• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# FieldInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中FieldInfo的典型用法代码示例。如果您正苦于以下问题:C# FieldInfo类的具体用法?C# FieldInfo怎么用?C# FieldInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FieldInfo类属于命名空间,在下文中一共展示了FieldInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:13,代码来源:BloomFilterFactory.cs


示例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.");
        }
开发者ID:giladbi,项目名称:Observer,代码行数:30,代码来源:SecurityDefinition.cs


示例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) });
		}
开发者ID:CountrysideGames,项目名称:Nostalgia,代码行数:27,代码来源:FGCodeWindow.cs


示例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());
 }
开发者ID:abakam,项目名称:WaleSuper,代码行数:7,代码来源:Deduction.cs


示例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;
        }
开发者ID:mparsin,项目名称:Elements,代码行数:13,代码来源:FieldInfoMemberDefinition.cs


示例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);
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:7,代码来源:DiskDocValuesProducer.cs


示例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);
                }
            }
        }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:27,代码来源:BlockTermsWriter.cs


示例8: DbField

 protected DbField(FieldInfo fieldInfo)
 {
   this.ID = fieldInfo.Id;
   this.Name = fieldInfo.Name;
   this.Shared = fieldInfo.Shared;
   this.Type = fieldInfo.Type;
 }
开发者ID:pveller,项目名称:Sitecore.FakeDb,代码行数:7,代码来源:DbField.cs


示例9: AddField

 public override TermsConsumer AddField(FieldInfo field)
 {
     Write(FIELD);
     Write(field.Name);
     Newline();
     return new SimpleTextTermsWriter(this, field);
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:7,代码来源:SimpleTextFieldsWriter.cs


示例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)};
        }
开发者ID:iSalva,项目名称:Cosmos,代码行数:27,代码来源:Ldflda.cs


示例11: FieldGetter

 public FieldGetter(FieldInfo fieldInfo)
 {
     _fieldInfo = fieldInfo;
     _name = fieldInfo.Name;
     _memberType = fieldInfo.FieldType;
     _lateBoundFieldGet = DelegateFactory.CreateGet(fieldInfo);
 }
开发者ID:BclEx,项目名称:AdamsyncEx,代码行数:7,代码来源:FieldGetter.cs


示例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);
 }
开发者ID:giladbi,项目名称:Observer,代码行数:10,代码来源:Logon.cs


示例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
 }
开发者ID:samskivert,项目名称:ikvm-monotouch,代码行数:27,代码来源:RuntimeHelperTypes.cs


示例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();
        }
开发者ID:uNormatov,项目名称:FreboCms,代码行数:35,代码来源:SqlHelper.cs


示例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);
 }
开发者ID:mortezabarzkar,项目名称:SharpNative,代码行数:7,代码来源:ReflectionTest6.cs


示例16: ReadField

    object ReadField(BinaryReader Reader, object Obj, FieldInfo Info)
    {
        //string name = Reader.ReadString();
        object value = null;

        if (Info.FieldType == typeof(System.String))
        {
            value = Reader.ReadString();
        }
        else if (Info.FieldType == typeof(System.Int16))
        {
            value = Reader.ReadInt16();
        }
        else if (Info.FieldType == typeof(System.Single))
        {
            value = Reader.ReadSingle();
        }
        else if (Info.FieldType == typeof(System.Int32))
        {
            value = Reader.ReadInt32();
        }
        else if(Info.FieldType == typeof(System.Enum) || Info.FieldType.BaseType == typeof(System.Enum))
        {
            value = Reader.ReadInt32();
        }

        return value;
    }
开发者ID:przemyslaw-szymanski,项目名称:dungeonworld,代码行数:28,代码来源:ItemSerializer.cs


示例17: GetOrdIndexInstance

 protected override MonotonicBlockPackedReader GetOrdIndexInstance(IndexInput data, FieldInfo field,
     NumericEntry entry)
 {
     data.Seek(entry.Offset);
     return new MonotonicBlockPackedReader((IndexInput)data.Clone(), entry.PackedIntsVersion, entry.BlockSize, entry.Count,
         true);
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:7,代码来源:DiskDocValuesProducer.cs


示例18: FieldDecorator

 public FieldDecorator(Type forType, FieldInfo field, IProtoSerializer tail) : base(tail)
 {
     Helpers.DebugAssert(forType != null);
     Helpers.DebugAssert(field != null);
     this.forType = forType;
     this.field = field;
 }
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:7,代码来源:FieldDecorator.cs


示例19: AMActionFieldSet

 public AMActionFieldSet(AMKey key, int frameRate, object target, FieldInfo f, object val)
     : base(key, frameRate)
 {
     mObj = target;
     mField = f;
     mVal = val;
 }
开发者ID:Ryrumeli,项目名称:MateAnimator,代码行数:7,代码来源:AMActionTween.cs


示例20: run

        public void run()
        {
            FieldInfo field = null;
            ClassInfo ownerClass = repository.GetClass(classInfo.Name);
            var fd = instruction.Operand as FieldDefinition;
            if(fd==null) return;

            var fieldName = fd.Name;
            var operand = instruction.Operand;

            try
            {
                field = ownerClass.GetField(fieldName);
            }
            catch (FieldNotFoundException e)
            {
                field =
                    //new FieldInfo(ownerClass, "FAKE:" + fieldName, ClrType
                    new FieldInfo(ownerClass, fieldName, ClrType.FromDescriptor(fd.FieldType.FullName), 
                        false, instruction.OpCode == OpCodes.Ldsfld || instruction.OpCode == OpCodes.Ldsflda, fd.IsPrivate);
            }

            var lineNumber = instruction.Offset;
            block.label(new Label(lineNumber));
            block.addOp(new GetField(instruction.Offset, field));
        }
开发者ID:dbremner,项目名称:dotnet-testability-explorer,代码行数:26,代码来源:GetFieldRunnable.cs



注:本文中的FieldInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# FieldList类代码示例发布时间:2022-05-24
下一篇:
C# FieldDescriptor类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap