public override bool Exec(object context)
 {
     dnlib.DotNet.TypeDef type = (dnlib.DotNet.TypeDef)context;
     if (type.IsRuntimeSpecialName)
     {
         return(false);
     }
     if (type.IsGlobalModuleType)
     {
         return(false);
     }
     return(true);
 }
Пример #2
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="resolver">Type resolver instance</param>
        /// <param name="source">Type source</param>
        /// <param name="parent">Nested type parent</param>
        internal EnumDef(Resolver resolver, dnlib.DotNet.TypeDef source, dnlib.DotNet.TypeDef?parent, DotNetType type)
            : base(resolver, source, parent, type)
        {
            // If the source is null..
            if (source is null)
            {
                // throw an exception
                throw new ArgumentNullException(nameof(source));
            }

            // Initialize the enum fields
            Fields = source.Fields
                     // Select valid enum fields
                     .Where(x => x.ElementType != dnlib.DotNet.ElementType.End)
                     // Initialize the enum fields
                     .Select(x => new EnumFieldDef(x, Accessor))
                     // Materialize the collection
                     .ToReadOnlyCollection();
        }
Пример #3
0
 /// <inheritdoc />
 internal RecordDef(Resolver resolver, dnlib.DotNet.TypeDef source, dnlib.DotNet.TypeDef?parent, DotNetType type)
     : base(resolver, source, parent, type)
 {
 }