Пример #1
0
        void InitializeFrom(ModuleOptions options)
        {
            Mvid.Value                      = options.Mvid;
            EncId.Value                     = options.EncId;
            EncBaseId.Value                 = options.EncBaseId;
            Name                            = options.Name;
            ModuleKind.SelectedItem         = options.Kind;
            DllCharacteristics              = options.DllCharacteristics;
            RuntimeVersion                  = options.RuntimeVersion;
            Machine.SelectedItem            = options.Machine;
            Cor20HeaderFlags                = options.Cor20HeaderFlags;
            Cor20HeaderRuntimeVersion.Value = options.Cor20HeaderRuntimeVersion;
            TablesHeaderVersion.Value       = options.TablesHeaderVersion;

            ManagedEntryPoint         = options.ManagedEntryPoint;
            NativeEntryPointRva.Value = (uint)options.NativeEntryPoint;
            if (options.ManagedEntryPoint != null)
            {
                EntryPointEnum = EntryPointType.Managed;
            }
            else if (options.NativeEntryPoint != 0)
            {
                EntryPointEnum = EntryPointType.Native;
            }
            else
            {
                EntryPointEnum = EntryPointType.None;
            }

            // Writing to Machine and ModuleKind triggers code that updates Characteristics so write
            // this property last.
            Characteristics = options.Characteristics;

            CustomAttributesVM.InitializeFrom(options.CustomAttributes);
        }
Пример #2
0
 void InitializeFrom(EventDefOptions options)
 {
     Attributes   = options.Attributes;
     Name         = options.Name;
     EventTypeSig = options.EventType.ToTypeSig();
     AddMethod    = options.AddMethod;
     InvokeMethod = options.InvokeMethod;
     RemoveMethod = options.RemoveMethod;
     OtherMethodsVM.InitializeFrom(options.OtherMethods);
     CustomAttributesVM.InitializeFrom(options.CustomAttributes);
 }
Пример #3
0
 void InitializeFrom(MethodDefOptions options)
 {
     ImplAttributes            = options.ImplAttributes;
     Attributes                = options.Attributes;
     Name                      = options.Name;
     MethodSig                 = options.MethodSig;
     ImplMap                   = options.ImplMap;
     CodeType.SelectedItem     = (Method.CodeType)((int)(options.ImplAttributes & MethodImplAttributes.CodeTypeMask) >> 0);
     ManagedType.SelectedItem  = (Method.ManagedType)((int)(options.ImplAttributes & MethodImplAttributes.ManagedMask) >> 2);
     MethodAccess.SelectedItem = (Method.MethodAccess)((int)(options.Attributes & MethodAttributes.MemberAccessMask) >> 0);
     VtableLayout.SelectedItem = (Method.VtableLayout)((int)(options.Attributes & MethodAttributes.VtableLayoutMask) >> 8);
     CustomAttributesVM.InitializeFrom(options.CustomAttributes);
     DeclSecuritiesVM.InitializeFrom(options.DeclSecurities);
     ParamDefsVM.InitializeFrom(options.ParamDefs);
     GenericParamsVM.InitializeFrom(options.GenericParameters);
     MethodOverridesVM.InitializeFrom(options.Overrides);
 }
Пример #4
0
 void InitializeFrom(AssemblyOptions options)
 {
     PublicKey.Value            = options.PublicKey.Data;
     HashAlgorithm.SelectedItem = options.HashAlgorithm;
     VersionMajor.Value         = checked ((ushort)options.Version.Major);
     VersionMinor.Value         = checked ((ushort)options.Version.Minor);
     VersionBuild.Value         = checked ((ushort)options.Version.Build);
     VersionRevision.Value      = checked ((ushort)options.Version.Revision);
     Flags = options.Attributes;
     ProcessArchitecture.SelectedItem = (AsmProcArch)((uint)(options.Attributes & AssemblyAttributes.PA_Mask) >> (int)AssemblyAttributes.PA_Shift);
     ContentType.SelectedItem         = (AsmContType)((uint)(options.Attributes & AssemblyAttributes.ContentType_Mask) >> 9);
     Name    = options.Name;
     Culture = options.Culture;
     ClrVersion.SelectedItem = options.ClrVersion;
     CustomAttributesVM.InitializeFrom(options.CustomAttributes);
     DeclSecuritiesVM.InitializeFrom(options.DeclSecurities);
 }
Пример #5
0
 void InitializeFrom(TypeDefOptions options)
 {
     Attributes                    = options.Attributes;
     Namespace                     = options.Namespace;
     Name                          = options.Name;
     PackingSize.Value             = options.PackingSize;
     ClassSize.Value               = options.ClassSize;
     BaseTypeSig                   = options.BaseType.ToTypeSig();
     TypeVisibility.SelectedItem   = (Types.TypeVisibility)((int)(options.Attributes & TypeAttributes.VisibilityMask) >> 0);
     TypeLayout.SelectedItem       = (Types.TypeLayout)(((int)options.Attributes >> 3) & 3);
     TypeSemantics.SelectedItem    = (Types.TypeSemantics)(((int)options.Attributes >> 5) & 1);
     TypeStringFormat.SelectedItem = (Types.TypeStringFormat)(((int)options.Attributes >> 16) & 3);
     TypeCustomFormat.SelectedItem = (Types.TypeCustomFormat)(((int)options.Attributes >> 22) & 3);
     CustomAttributesVM.InitializeFrom(options.CustomAttributes);
     DeclSecuritiesVM.InitializeFrom(options.DeclSecurities);
     GenericParamsVM.InitializeFrom(options.GenericParameters);
     InterfaceImplsVM.InitializeFrom(options.Interfaces);
 }
Пример #6
0
 void InitializeFrom(PropertyDefOptions options)
 {
     Attributes  = options.Attributes;
     Name        = options.Name;
     PropertySig = options.PropertySig;
     if (options.Constant != null)
     {
         HasDefault       = true;
         ConstantVM.Value = options.Constant.Value;
     }
     else
     {
         HasDefault       = false;
         ConstantVM.Value = null;
     }
     GetMethodsVM.InitializeFrom(options.GetMethods);
     SetMethodsVM.InitializeFrom(options.SetMethods);
     OtherMethodsVM.InitializeFrom(options.OtherMethods);
     CustomAttributesVM.InitializeFrom(options.CustomAttributes);
 }
Пример #7
0
 void InitializeFrom(FieldDefOptions options)
 {
     Attributes         = options.Attributes;
     Name               = options.Name;
     FieldTypeSig       = options.FieldSig?.Type;
     FieldOffset.Value  = options.FieldOffset;
     MarshalTypeVM.Type = options.MarshalType;
     RVA.Value          = (uint)options.RVA;
     InitialValue.Value = options.InitialValue;
     ImplMap            = options.ImplMap;
     if (options.Constant != null)
     {
         HasDefault       = true;
         ConstantVM.Value = options.Constant.Value;
     }
     else
     {
         HasDefault       = false;
         ConstantVM.Value = null;
     }
     FieldAccess.SelectedItem = (Field.FieldAccess)((int)(options.Attributes & FieldAttributes.FieldAccessMask) >> 0);
     CustomAttributesVM.InitializeFrom(options.CustomAttributes);
 }