本文整理汇总了C#中FieldType类的典型用法代码示例。如果您正苦于以下问题:C# FieldType类的具体用法?C# FieldType怎么用?C# FieldType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FieldType类属于命名空间,在下文中一共展示了FieldType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetDataName
public void SetDataName(string DataName, FieldType type)
{
if (this.Type == type)
{
this.Dataname = DataName;
}
}
示例2: FieldBase
public FieldBase(FieldType Type, FieldBase Base)
{
this.Type = Type;
this.Name = Type.Name;
this.TenantID = Configure.GetTenantResolutionProvider().GetTenantID();
LoadUpValues(Base);
}
示例3: OGRTypeToBufferType
public DataType OGRTypeToBufferType(FieldType OGRFieldType)
{
DataType BufferDataType;
switch (OGRFieldType)
{
//case FieldType.OFTBinary:
// BufferDataType = DataType.DT_IMAGE;
// break;
case FieldType.OFTDate:
BufferDataType = DataType.DT_DBDATE;
break;
case FieldType.OFTDateTime:
BufferDataType = DataType.DT_DBTIMESTAMP;
break;
case FieldType.OFTInteger:
BufferDataType = DataType.DT_I4;
break;
case FieldType.OFTReal:
BufferDataType = DataType.DT_R8;
break;
case FieldType.OFTString:
BufferDataType = DataType.DT_WSTR;
break;
case FieldType.OFTTime:
BufferDataType = DataType.DT_DBTIME;
break;
default:
BufferDataType = DataType.DT_NTEXT;
break;
}
return BufferDataType;
}
示例4: BondFieldMappingAttribute
public BondFieldMappingAttribute(BondField field_, Focus focus_=Focus.None, FieldType fieldType_=FieldType.None, CellColourScheme colourScheme_=CellColourScheme.None)
{
Field = field_;
Focus = focus_;
FieldType = fieldType_;
ColourScheme = colourScheme_;
}
示例5: Read
public static object Read(this BinaryReader reader, FieldType fieldType)
{
if (reader == null) throw new ArgumentNullException("reader");
switch (fieldType)
{
case FieldType.UInt8:
return reader.ReadByte();
case FieldType.UInt16:
return reader.ReadUInt16();
case FieldType.UInt32:
return reader.ReadUInt32();
case FieldType.UInt64:
return reader.ReadUInt64();
case FieldType.Int8:
return reader.ReadSByte();
case FieldType.Int16:
return reader.ReadInt16();
case FieldType.Int32:
return reader.ReadInt32();
case FieldType.Int64:
return reader.ReadInt64();
case FieldType.Float:
return reader.ReadSingle();
case FieldType.Double:
return reader.ReadDouble();
case FieldType.NetDecimal:
return reader.ReadDecimal();
default:
throw new ArgumentOutOfRangeException("Reading FieldType '{0}' from the stream failed, the type is not supported.".Formatted(fieldType));
}
}
示例6: Type
public AddFieldDialog Type(FieldType type)
{
var element = FindElement("field-type");
var select = new SelectElement(element);
select.SelectByValue(type.ToText());
return this;
}
示例7: StructField
public StructField(string name, FieldType type)
{
VarLength = -1;
VarArrayLength = 0;
Name = name;
_type = type;
}
示例8: QField
// Constructors
internal QField(int fieldId, string value, FieldType type, IQRecord record)
{
FieldId = fieldId;
Type = type;
Record = record; // needs to be before Value.
Value = value;
}
示例9: AppendFormat
private void AppendFormat(StringBuilder sb, string tableName, string elementName, string fieldName, FieldType fieldType, ScriptItem item)
{
switch (fieldType) {
case FieldType.Boolean:
sb.AppendFormat("{0}[\"{1}\"].{2} = {3}",
tableName,
DialogueLua.StringToTableIndex(elementName),
DialogueLua.StringToTableIndex(fieldName),
(item.booleanValue == BooleanType.True) ? "true" : "false");
break;
case FieldType.Number:
if (item.valueSetMode == ValueSetMode.To) {
sb.AppendFormat("{0}[\"{1}\"].{2} = {3}",
tableName,
DialogueLua.StringToTableIndex(elementName),
DialogueLua.StringToTableIndex(fieldName),
item.floatValue);
} else {
sb.AppendFormat("{0}[\"{1}\"].{2} = {0}[\"{1}\"].{2} + {3}",
tableName,
DialogueLua.StringToTableIndex(elementName),
DialogueLua.StringToTableIndex(fieldName),
item.floatValue);
}
break;
default:
sb.AppendFormat("{0}[\"{1}\"].{2} = \"{3}\"",
tableName,
DialogueLua.StringToTableIndex(elementName),
DialogueLua.StringToTableIndex(fieldName),
item.stringValue);
break;
}
}
示例10: TextFieldParser
public TextFieldParser(Stream stream)
{
this.m_CommentTokens = new string[0];
this.m_LineNumber = 1L;
this.m_EndOfData = false;
this.m_ErrorLine = "";
this.m_ErrorLineNumber = -1L;
this.m_TextFieldType = FieldType.Delimited;
this.m_WhitespaceCodes = new int[] {
9, 11, 12, 0x20, 0x85, 160, 0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008,
0x2009, 0x200a, 0x200b, 0x2028, 0x2029, 0x3000, 0xfeff
};
this.m_WhiteSpaceRegEx = new Regex(@"\s", RegexOptions.CultureInvariant);
this.m_TrimWhiteSpace = true;
this.m_Position = 0;
this.m_PeekPosition = 0;
this.m_CharsRead = 0;
this.m_NeedPropertyCheck = true;
this.m_Buffer = new char[0x1000];
this.m_HasFieldsEnclosedInQuotes = true;
this.m_MaxLineSize = 0x989680;
this.m_MaxBufferSize = 0x989680;
this.m_LeaveOpen = false;
this.InitializeFromStream(stream, Encoding.UTF8, true);
}
示例11: IndexField
public IndexField(string fieldName, object value, FieldType type, IndexFieldValueType valueType)
{
this.fieldName = fieldName;
this.value = value;
this.type = type;
this.valueType = valueType;
}
示例12: GetFieldList
public static List<string> GetFieldList(FieldType fieldType, object obj)
{
var list = new List<string>();
Type type = obj.GetType();
PropertyInfo[] properties = type.GetProperties();
foreach (PropertyInfo property in properties)
{
var attribute = (ValidateFieldAttribute)property.GetCustomAttributes(typeof(ValidateFieldAttribute), true)
.FirstOrDefault(r => ((ValidateFieldAttribute)r).Type == fieldType);
if (attribute == null)
continue;
object value = property.GetValue(obj, null);
if (value is string)
{
if (string.IsNullOrEmpty((string)value))
list.Add(attribute.Name);
}
}
return list;
}
示例13: Field
public Field(string var, string label, FieldType type)
: this()
{
this.Type = type;
this.Var = var;
this.Label = label;
}
示例14: Field
public Field(string name, FieldType type)
{
if (name == null) throw new ArgumentNullException(nameof(name));
this.Name = name;
this.Type = type;
}
示例15: GetName
public static string GetName(FieldType type)
{
string result = String.Empty;
switch (type)
{
case FieldType.Auto:
result = "auto";
break;
case FieldType.String:
result = "string";
break;
case FieldType.Int:
result = "int";
break;
case FieldType.Float:
result = "float";
break;
case FieldType.Boolean:
result = "boolean";
break;
case FieldType.Date:
result = "date";
break;
}
return result;
}