本文整理汇总了C#中FieldInfo类的典型用法代码示例。如果您正苦于以下问题:C# FieldInfo类的具体用法?C# FieldInfo怎么用?C# FieldInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FieldInfo类属于命名空间,在下文中一共展示了FieldInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Downsize
/// <summary>
/// Called when downsizing bitsets for serialization
/// </summary>
/// <param name="fieldInfo">The field with sparse set bits</param>
/// <param name="initialSet">The bits accumulated</param>
/// <returns> null or a hopefully more densely packed, smaller bitset</returns>
public FuzzySet Downsize(FieldInfo fieldInfo, FuzzySet initialSet)
{
// Aim for a bitset size that would have 10% of bits set (so 90% of searches
// would fail-fast)
const float targetMaxSaturation = 0.1f;
return initialSet.Downsize(targetMaxSaturation);
}
示例2: SecurityDefinition
/// <summary>
/// Provides properties for storing and retrieving CME FIX security definition fields.
/// </summary>
public SecurityDefinition(FieldInfo<byte> tagInfo, FieldInfo<byte> valueInfo, Trailer trailer)
: base(tagInfo, valueInfo, trailer)
{
SecurityGroup = new FieldInfo<char>(SECURITY_GROUP_FIELD_LENGTH);
Symbol = new FieldInfo<char>(SYMBOL_FIELD_LENGTH);
SecurityDesc = new FieldInfo<char>(SECURITY_DESC_FIELD_LENGTH);
SecurityID = new FieldInfo<char>(SECURITY_ID_FIELD_LENGTH);
CFICode = new FieldInfo<char>(CFI_CODE_FIELD_LENGTH);
SecurityExchange = new FieldInfo<char>(SECURITY_EXCHANGE_FIELD_LENGTH);
StrikeCurrency = new FieldInfo<char>(STRIKE_CURRENCY_FIELD_LENGTH);
Currency = new FieldInfo<char>(CURRENCY_FIELD_LENGTH);
SettlCurrency = new FieldInfo<char>(SETTL_CURRENCY_FIELD_LENGTH);
DataBlockEvent = new RepeatingGroupEvent[REPEATING_GROUP_ARRAY_LENGTH];
for (int i = 0; i < REPEATING_GROUP_ARRAY_LENGTH; i++)
{
DataBlockEvent[i] = new RepeatingGroupEvent();
}
DataBlockMDFeedType = new RepeatingGroupMDFeedType[REPEATING_GROUP_ARRAY_LENGTH];
for (int i = 0; i < REPEATING_GROUP_ARRAY_LENGTH; i++)
{
DataBlockMDFeedType[i] = new RepeatingGroupMDFeedType();
}
//throw new NotImplementedException("SecurityDefinition class not yet implemented.");
}
示例3: API
static API()
{
var editorAssembly = typeof(EditorWindow).Assembly;
containerWindowType = editorAssembly.GetType("UnityEditor.ContainerWindow");
viewType = editorAssembly.GetType("UnityEditor.View");
dockAreaType = editorAssembly.GetType("UnityEditor.DockArea");
parentField = typeof(EditorWindow).GetField("m_Parent", BindingFlags.Instance | BindingFlags.GetField | BindingFlags.Public | BindingFlags.NonPublic);
if (dockAreaType != null)
{
panesField = dockAreaType.GetField("m_Panes", BindingFlags.Instance | BindingFlags.GetField | BindingFlags.Public | BindingFlags.NonPublic);
addTabMethod = dockAreaType.GetMethod("AddTab", new System.Type[] { typeof(EditorWindow) });
}
if (containerWindowType != null)
{
windowsField = containerWindowType.GetProperty("windows", BindingFlags.Static | BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.NonPublic);
mainViewField = containerWindowType.GetProperty("mainView", BindingFlags.Instance | BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.NonPublic);
}
if (viewType != null)
allChildrenField = viewType.GetProperty("allChildren", BindingFlags.Instance | BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.NonPublic);
FieldInfo windowsReorderedField = typeof(EditorApplication).GetField("windowsReordered", BindingFlags.Static | BindingFlags.GetField | BindingFlags.Public | BindingFlags.NonPublic);
windowsReordered = windowsReorderedField.GetValue(null) as EditorApplication.CallbackFunction;
System.Type projectWindowUtilType = editorAssembly.GetType("UnityEditor.ProjectWindowUtil");
if (projectWindowUtilType != null)
createAssetMethod = projectWindowUtilType.GetMethod("CreateAsset", new System.Type[] { typeof(Object), typeof(string) });
}
示例4: setupEntityInfo
protected override void setupEntityInfo()
{
FieldInfoList["DeductionID"] = new FieldInfo(false, false, true, new DeductionEDT());
FieldInfoList["Description"] = new FieldInfo(true, true, true, new ShortDescriptionEDT());
FieldInfoList["DeductionType"] = new FieldInfo(true, true, true, new DeductionTypeEDT());
FieldInfoList["Value"] = new FieldInfo(true, true, true, "Value", new AmountEDT());
}
示例5: FieldInfoMemberDefinition
/// <summary>
/// Initializes a new instance of the <see cref="FieldInfoMemberDefinition"/> class.
/// </summary>
/// <param name="field">
/// The field.
/// </param>
public FieldInfoMemberDefinition(FieldInfo field)
{
if (field == null)
throw new ArgumentNullException("field");
_field = field;
}
示例6: GetAddressInstance
protected override MonotonicBlockPackedReader GetAddressInstance(IndexInput data, FieldInfo field,
BinaryEntry bytes)
{
data.Seek(bytes.AddressesOffset);
return new MonotonicBlockPackedReader((IndexInput)data.Clone(), bytes.PackedIntsVersion, bytes.BlockSize, bytes.Count,
true);
}
示例7: BlockTermsWriter
public BlockTermsWriter(TermsIndexWriterBase termsIndexWriter,
SegmentWriteState state, PostingsWriterBase postingsWriter)
{
var termsFileName = IndexFileNames.SegmentFileName(state.SegmentInfo.Name, state.SegmentSuffix,
TERMS_EXTENSION);
_termsIndexWriter = termsIndexWriter;
_output = state.Directory.CreateOutput(termsFileName, state.Context);
var success = false;
try
{
FieldInfos = state.FieldInfos;
WriteHeader(_output);
CurrentField = null;
PostingsWriter = postingsWriter;
postingsWriter.Init(_output); // have consumer write its format/header
success = true;
}
finally
{
if (!success)
{
IOUtils.CloseWhileHandlingException(_output);
}
}
}
示例8: DbField
protected DbField(FieldInfo fieldInfo)
{
this.ID = fieldInfo.Id;
this.Name = fieldInfo.Name;
this.Shared = fieldInfo.Shared;
this.Type = fieldInfo.Type;
}
示例9: AddField
public override TermsConsumer AddField(FieldInfo field)
{
Write(FIELD);
Write(field.Name);
Newline();
return new SimpleTextTermsWriter(this, field);
}
示例10: DoExecute
public static void DoExecute(Cosmos.Assembler.Assembler Assembler, MethodInfo aMethod, Type aDeclaringType, FieldInfo aField, bool aDerefValue, bool aDebugEnabled)
{
int xExtraOffset = 0;
var xType = aMethod.MethodBase.DeclaringType;
bool xNeedsGC = aDeclaringType.IsClass && !aDeclaringType.IsValueType;
if (xNeedsGC)
{
xExtraOffset = 12;
}
var xActualOffset = aField.Offset + xExtraOffset;
var xSize = aField.Size;
DoNullReferenceCheck(Assembler, aDebugEnabled, 0);
if (aDerefValue && aField.IsExternalValue)
{
new CPUx86.Mov
{
DestinationReg = CPUx86.Registers.EAX,
SourceReg = CPUx86.Registers.ESP, SourceIsIndirect = true, SourceDisplacement = (int) xActualOffset
};
new CPUx86.Mov {DestinationReg = CPUx86.Registers.ESP, DestinationIsIndirect = true, SourceReg = CPUx86.Registers.EAX};
}
else
new CPUx86.Add {DestinationReg = CPUx86.Registers.ESP, DestinationIsIndirect = true, SourceValue = (uint) (xActualOffset)};
}
示例11: FieldGetter
public FieldGetter(FieldInfo fieldInfo)
{
_fieldInfo = fieldInfo;
_name = fieldInfo.Name;
_memberType = fieldInfo.FieldType;
_lateBoundFieldGet = DelegateFactory.CreateGet(fieldInfo);
}
示例12: Logon
/// <summary>
/// Provides properties for storing and retrieving CME FIX logon fields.
/// </summary>
public Logon(FieldInfo<byte> tagInfo, FieldInfo<byte> valueInfo, Trailer trailer)
: base(tagInfo, valueInfo, trailer)
{
Username = new FieldInfo<char>(USERNAME_FIELD_LENGTH);
Password = new FieldInfo<char>(PASSWORD_FIELD_LENGTH);
ApplID = new FieldInfo<char>(APPL_ID_FIELD_LENGTH);
}
示例13: GetClassLiteralField
internal static FieldInfo GetClassLiteralField(Type type)
{
Debug.Assert(type != Types.Void);
if (classLiteralType == null)
{
#if STATIC_COMPILER
classLiteralType = JVM.CoreAssembly.GetType("ikvm.internal.ClassLiteral`1");
#elif !FIRST_PASS
classLiteralType = typeof([email protected]<>);
#endif
}
#if !STATIC_COMPILER
if (!IsTypeBuilder(type))
{
return classLiteralType.MakeGenericType(type).GetField("Value", BindingFlags.Public | BindingFlags.Static);
}
#endif
if (classLiteralField == null)
{
classLiteralField = classLiteralType.GetField("Value", BindingFlags.Public | BindingFlags.Static);
}
#if !NOEMIT
return TypeBuilder.GetField(classLiteralType.MakeGenericType(type), classLiteralField);
#else
return null;
#endif
}
示例14: GenerateInsertScript
/// <summary>
/// Create Insert statements dynamically
/// </summary>
/// <param name="tablename"></param>
/// <param name="fieldinfos"></param>
/// <returns></returns>
public static string GenerateInsertScript(string tablename, FieldInfo[] fieldinfos)
{
StringBuilder parametrs = new StringBuilder();
StringBuilder columns = new StringBuilder();
foreach (FieldInfo info in fieldinfos)
{
if (FormHelper.IsComponent(info))
continue;
if (info.IsPrimaryKey)
continue;
if (parametrs.Length > 0)
parametrs.Append(",");
if (columns.Length > 0)
columns.Append(",");
columns.AppendFormat("[{0}]", info.Name);
parametrs.AppendFormat("@{0}", info.Name);
}
StringBuilder insertscript = new StringBuilder();
insertscript.AppendFormat(" INSERT INTO {0}({1}) ", tablename, columns);
insertscript.AppendFormat("VALUES ( {0} );", parametrs);
insertscript.Append("SELECT @@IDENTITY; ");
return insertscript.ToString();
}
示例15: DisplayField
static void DisplayField(Object obj, FieldInfo f)
{
// Display the field name, value, and attributes.
//
Console.WriteLine("{0} = \"{1}\"; attributes: {2}",
f.Name, f.GetValue(obj), f.Attributes);
}