本文整理汇总了C#中ColumnType类的典型用法代码示例。如果您正苦于以下问题:C# ColumnType类的具体用法?C# ColumnType怎么用?C# ColumnType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ColumnType类属于命名空间,在下文中一共展示了ColumnType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetNativeSqlType
public override string GetNativeSqlType(ColumnType type)
{
switch (type)
{
case ColumnType.ID:
return "integer primary key autoincrement";
case ColumnType.ForeignKey:
case ColumnType.Integer:
return "integer";
case ColumnType.String:
return "text";
case ColumnType.Bool:
return "bool";
case ColumnType.Timestamp:
return "timestamp";
case ColumnType.Date:
return "date";
case ColumnType.Double:
return "double";
default:
return null;
}
}
示例2: Format_DBNullValue_NullDisplay
public void Format_DBNullValue_NullDisplay(ColumnType columnType)
{
var factory = new CellFormatterFactory();
var formatter = factory.GetObject(columnType);
var text = formatter.Format(DBNull.Value);
Assert.That(text, Is.EqualTo("(null)"));
}
示例3: ColumnSchema
/// <summary>
/// Explicit constructor for a foreign key
/// </summary>
/// <param name="name">Name of the column</param>
/// <param name="type">Type of the column</param>
public ColumnSchema(string name, ColumnType type, string tableName, string columnName, string comment)
{
Name = name;
Type = type;
Reference = string.Format("{0}.{1}", tableName, columnName);
Comment = comment;
}
示例4: Column
/// <summary>
/// Initializes a new instance of the <see cref="Column" /> class.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="title">The title.</param>
/// <param name="type">The type.</param>
/// <param name="pk">if set to <c>true</c> the column is a primary key.</param>
public Column(string name, string title = null, ColumnType type = ColumnType.Text, bool pk = false)
{
this.Name = name;
this.Title = (title == null) ? name : title;
this.Type = type;
this.PrimaryKey = pk;
}
示例5: ColumnTypeToString
public static string ColumnTypeToString(ColumnType ct)
{
switch (ct){
case ColumnType.Boolean:
return "C";
case ColumnType.Categorical:
return "C";
case ColumnType.Color:
return "C";
case ColumnType.DateTime:
return "T";
case ColumnType.DashStyle:
return "C";
case ColumnType.Integer:
return "N";
case ColumnType.MultiInteger:
return "M";
case ColumnType.MultiNumeric:
return "M";
case ColumnType.Numeric:
return "N";
case ColumnType.Text:
return "T";
default:
return "T";
}
}
示例6: ColumnMappingField
public ColumnMappingField(FieldInfo field, ColumnAttribute attribute)
{
this._Field = field;
this._ColumnName = string.IsNullOrEmpty(attribute.ColumnName) ? field.Name : attribute.ColumnName;
this._ColumnType = attribute.ColumnType;
this._ColumnId = attribute.ColumnId;
}
示例7: FilterIncrementallyWith
/// <summary>
/// Filter items in ImageListView incrementally.
/// This method optimizes on-the-fly filtering as user types in a search box.
/// </summary>
/// <param name="key">An item is visible only if it contains this string</param>
private void FilterIncrementallyWith(string key, ColumnType attrType)
{
if (key.Length == mLastSearch.Length) return;
if (mVisibleItems == null)
{
mVisibleItems = new LinkedList<ImageListViewItem>(mItems);
mInvisibleItems = new LinkedList<ImageListViewItem>();
}
if (key.Length > mLastSearch.Length)
{
ToggleMatchedItems(mVisibleItems, mInvisibleItems, false, key, attrType);
}
else if (key.Length < mLastSearch.Length)
{
ToggleMatchedItems(mInvisibleItems, mVisibleItems, true, key, attrType);
}
mImageListView.Items.Clear(false);
mImageListView.SuspendLayout();
foreach (ImageListViewItem item in mVisibleItems)
{
mImageListView.Items.Add(item, mAdaptor);
}
mImageListView.ResumeLayout();
mLastSearch = key;
}
示例8: TableInfo
public TableInfo(string name, string primaryKeyName, ColumnType? primaryKeyType, short? primaryKeySize)
{
Name = name;
PrimaryKeyName = primaryKeyName;
PrimaryKeyType = primaryKeyType;
PrimaryKeySize = primaryKeySize;
}
示例9: Create
public static ColumnParser Create(ColumnType type, string format)
{
switch (type)
{
case ColumnType.Logger:
return new LoggerParser();
case ColumnType.Level:
return new LevelParser();
case ColumnType.Timestamp:
return new TimestampParser(format);
case ColumnType.Thread:
return new ThreadParser();
case ColumnType.Line:
return new LineParser();
case ColumnType.Newline:
return new NewlineParser();
case ColumnType.Message:
return new MessageParser();
case ColumnType.Date:
return new DateParser(format, DateTimeKind.Local);
case ColumnType.UtcDate:
return new DateParser(format, DateTimeKind.Utc);
default:
throw new KeyNotFoundException(string.Format("Unable to find a parser for '{0}'", type));
}
}
示例10: ColumnData
public ColumnData(String name, ColumnType type, String comparison, String method)
{
Name = name;
Type = type;
Comparison = comparison;
TimingMethod = method;
}
示例11: AddColumn
public void AddColumn(string colName, int width, ColumnType columnType, string description, bool persistent)
{
AddColumn(colName, width, columnType, description);
if (persistent){
AddPersistentColumn(colName, width, columnType, description, null);
}
}
示例12: ValuedExpression
public ValuedExpression(string expression, object value, ColumnType type, string tolerance)
: base(expression)
{
Value = value;
Type = type;
Tolerance = tolerance;
}
示例13: FilterWith
/// <summary>
/// Filter out items in ImageListView according to given criterion.
/// </summary>
/// <param name="key">An item is visible only if it contains this string</param>
internal void FilterWith(string key, ColumnType attrType)
{
if (mItems == null)
{
throw new InvalidOperationException("Method Snapshot() should be called before the first search.");
}
mImageListView.Items.Clear(false);
if (key.Length == 0) // reset items
{
mImageListView.Items.AddRange(mItems, mAdaptor);
}
else
{
string uKey = key.ToUpperInvariant();
mImageListView.SuspendLayout();
foreach (ImageListViewItem item in mItems)
{
Boolean isMatched = false;
switch (attrType)
{
case ColumnType.Name:
isMatched = item.Text.Contains(uKey); break;
default:
throw new NotImplementedException();
}
if (isMatched) mImageListView.Items.Add(item, mAdaptor);
}
mImageListView.ResumeLayout();
}
mLastSearch = key;
}
示例14: ColumnDefinition
/// <summary>
/// The column definition.
/// </summary>
/// <param name="theName">The name of the column.</param>
/// <param name="theDataType">The type of the column.</param>
public ColumnDefinition(String theName, ColumnType theDataType)
{
Name = theName;
DataType = theDataType;
Count = -1;
Low = High = Mean = Sd = Double.NaN;
}
示例15: ColumnMappingProperty
public ColumnMappingProperty(PropertyInfo Property, ColumnAttribute attribute)
{
this._Property = Property;
this._ColumnName = string.IsNullOrEmpty(attribute.ColumnName) ? Property.Name : attribute.ColumnName;
this._ColumnType = attribute.ColumnType;
this._ColumnId = attribute.ColumnId;
}