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); }
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); }
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); }