public AssemblyOptionsVM(AssemblyOptions options, ModuleDef ownerModule, Language language) { this.ownerModule = ownerModule; this.origOptions = options; this.hashAlgorithmVM = new EnumListVM(hashAlgorithmList, (a, b) => OnPropertyChanged("AssemblyFullName")); this.contentTypeVM = new EnumListVM(contentTypeList, (a, b) => OnPropertyChanged("AssemblyFullName")); this.versionMajor = new UInt16VM(a => { HasErrorUpdated(); OnPropertyChanged("AssemblyFullName"); }) { UseDecimal = true }; this.versionMinor = new UInt16VM(a => { HasErrorUpdated(); OnPropertyChanged("AssemblyFullName"); }) { UseDecimal = true }; this.versionBuild = new UInt16VM(a => { HasErrorUpdated(); OnPropertyChanged("AssemblyFullName"); }) { UseDecimal = true }; this.versionRevision = new UInt16VM(a => { HasErrorUpdated(); OnPropertyChanged("AssemblyFullName"); }) { UseDecimal = true }; this.publicKey = new HexStringVM(a => { HasErrorUpdated(); OnPropertyChanged("AssemblyFullName"); UpdatePublicKeyFlag(); }) { UpperCaseHex = false }; this.customAttributesVM = new CustomAttributesVM(ownerModule, language); this.declSecuritiesVM = new DeclSecuritiesVM(ownerModule, language, null, null); Reinitialize(); }
public ResourceVM(ResourceOptions options, ModuleDef ownerModule) { this.origOptions = options; this.ownerModule = ownerModule; this.fileHashValue = new HexStringVM(a => HasErrorUpdated()); Reinitialize(); }
public CustomAttributeVM(CustomAttributeOptions options, ModuleDef ownerModule, Language language, TypeDef ownerType, MethodDef ownerMethod) { this.origOptions = options; this.ownerModule = ownerModule; this.language = language; this.ownerType = ownerType; this.ownerMethod = ownerMethod; this.rawData = new HexStringVM(a => HasErrorUpdated()); this.caNamedArgumentsVM = new CANamedArgumentsVM(ownerModule, language, ownerType, ownerMethod, a => !IsRawData && a.Collection.Count < ushort.MaxValue); ConstructorArguments.CollectionChanged += Args_CollectionChanged; CANamedArgumentsVM.Collection.CollectionChanged += Args_CollectionChanged; Reinitialize(); }
public CustomAttributeVM(CustomAttributeOptions options, ModuleDef ownerModule, IDecompilerService decompilerService, TypeDef ownerType, MethodDef ownerMethod) { origOptions = options; this.ownerModule = ownerModule; this.decompilerService = decompilerService; this.ownerType = ownerType; this.ownerMethod = ownerMethod; RawData = new HexStringVM(a => HasErrorUpdated()); CANamedArgumentsVM = new CANamedArgumentsVM(ownerModule, decompilerService, ownerType, ownerMethod, a => !IsRawData && a.Collection.Count < ushort.MaxValue); ConstructorArguments.CollectionChanged += Args_CollectionChanged; CANamedArgumentsVM.Collection.CollectionChanged += Args_CollectionChanged; Reinitialize(); }
public AssemblyOptionsVM(AssemblyOptions options, ModuleDef ownerModule, IDecompilerService decompilerService) { this.ownerModule = ownerModule; origOptions = options; hashAlgorithmVM = new EnumListVM(hashAlgorithmList, (a, b) => OnPropertyChanged(nameof(AssemblyFullName))); contentTypeVM = new EnumListVM(contentTypeList, (a, b) => OnPropertyChanged(nameof(AssemblyFullName))); VersionMajor = new UInt16VM(a => { HasErrorUpdated(); OnPropertyChanged(nameof(AssemblyFullName)); }, true); VersionMinor = new UInt16VM(a => { HasErrorUpdated(); OnPropertyChanged(nameof(AssemblyFullName)); }, true); VersionBuild = new UInt16VM(a => { HasErrorUpdated(); OnPropertyChanged(nameof(AssemblyFullName)); }, true); VersionRevision = new UInt16VM(a => { HasErrorUpdated(); OnPropertyChanged(nameof(AssemblyFullName)); }, true); PublicKey = new HexStringVM(a => { HasErrorUpdated(); OnPropertyChanged(nameof(AssemblyFullName)); UpdatePublicKeyFlag(); }) { UpperCaseHex = false }; CustomAttributesVM = new CustomAttributesVM(ownerModule, decompilerService); DeclSecuritiesVM = new DeclSecuritiesVM(ownerModule, decompilerService, null, null); Reinitialize(); }
public MarshalTypeVM(ModuleDef ownerModule, Language language, TypeDef ownerType, MethodDef ownerMethod) { this.nativeTypeVM = new EnumListVM(nativeTypeList, (a, b) => { OnNativeTypeChanged(); TypeStringUpdated(); }); FixNativeTypeEnum(this.NativeType, false); this.rawMarshalType_data = new HexStringVM(a => { HasErrorUpdated(); TypeStringUpdated(); }); this.fixedSysStringMarshalType_size = new NullableCompressedUInt32(a => { HasErrorUpdated(); TypeStringUpdated(); }); this.safeArrayMarshalType_variantTypeVM = new EnumListVM(variantTypeList, (a, b) => { OnSafeArrayMarshalTypeIsEnabledChanged(); TypeStringUpdated(); }); this.safeArrayMarshalType_userDefinedSubType_typeSigCreator = CreateTypeSigCreatorVM(ownerModule, language, ownerType, ownerMethod, true, safeArrayMarshalType_userDefinedSubType_typeSigCreator_PropertyChanged); this.fixedArrayMarshalType_size = new NullableCompressedUInt32(a => { OnFixedArrayMarshalTypeIsEnabledChanged(); TypeStringUpdated(); }); this.fixedArrayMarshalType_nativeTypeVM = new EnumListVM(nativeTypeList, (a, b) => { OnFixedArrayMarshalTypeIsEnabledChanged(); TypeStringUpdated(); }); FixNativeTypeEnum(FixedArrayMarshalType_NativeType, true); this.arrayMarshalType_nativeTypeVM = new EnumListVM(nativeTypeList, (a, b) => { OnArrayMarshalTypeIsEnabledChanged(); TypeStringUpdated(); }); FixNativeTypeEnum(ArrayMarshalType_NativeType, true); this.arrayMarshalType_paramNum = new NullableCompressedUInt32(a => { OnArrayMarshalTypeIsEnabledChanged(); TypeStringUpdated(); }); this.arrayMarshalType_numElems = new NullableCompressedUInt32(a => { OnArrayMarshalTypeIsEnabledChanged(); TypeStringUpdated(); }); this.arrayMarshalType_flags = new NullableCompressedUInt32(a => { OnArrayMarshalTypeIsEnabledChanged(); TypeStringUpdated(); }); this.customMarshalType_custMarshaler_typeSigCreator = CreateTypeSigCreatorVM(ownerModule, language, ownerType, ownerMethod, true, customMarshalType_custMarshaler_typeSigCreator_PropertyChanged); this.interfaceMarshalType_iidParamIndex = new NullableCompressedUInt32(a => { HasErrorUpdated(); TypeStringUpdated(); }); }
public MarshalTypeVM(ModuleDef ownerModule, IDecompilerService decompilerService, TypeDef ownerType, MethodDef ownerMethod) { NativeType = new EnumListVM(nativeTypeList, (a, b) => { OnNativeTypeChanged(); TypeStringUpdated(); }); FixNativeTypeEnum(NativeType, false); RawMarshalType_Data = new HexStringVM(a => { HasErrorUpdated(); TypeStringUpdated(); }); FixedSysStringMarshalType_Size = new NullableCompressedUInt32(a => { HasErrorUpdated(); TypeStringUpdated(); }); SafeArrayMarshalType_VariantType = new EnumListVM(variantTypeList, (a, b) => { OnSafeArrayMarshalTypeIsEnabledChanged(); TypeStringUpdated(); }); SafeArrayMarshalType_UserDefinedSubType_TypeSigCreator = CreateTypeSigCreatorVM(ownerModule, decompilerService, ownerType, ownerMethod, true, safeArrayMarshalType_userDefinedSubType_typeSigCreator_PropertyChanged); FixedArrayMarshalType_Size = new NullableCompressedUInt32(a => { OnFixedArrayMarshalTypeIsEnabledChanged(); TypeStringUpdated(); }); FixedArrayMarshalType_NativeType = new EnumListVM(nativeTypeList, (a, b) => { OnFixedArrayMarshalTypeIsEnabledChanged(); TypeStringUpdated(); }); FixNativeTypeEnum(FixedArrayMarshalType_NativeType, true); ArrayMarshalType_NativeType = new EnumListVM(nativeTypeList, (a, b) => { OnArrayMarshalTypeIsEnabledChanged(); TypeStringUpdated(); }); FixNativeTypeEnum(ArrayMarshalType_NativeType, true); ArrayMarshalType_ParamNum = new NullableCompressedUInt32(a => { OnArrayMarshalTypeIsEnabledChanged(); TypeStringUpdated(); }); ArrayMarshalType_NumElems = new NullableCompressedUInt32(a => { OnArrayMarshalTypeIsEnabledChanged(); TypeStringUpdated(); }); ArrayMarshalType_Flags = new NullableCompressedUInt32(a => { OnArrayMarshalTypeIsEnabledChanged(); TypeStringUpdated(); }); CustomMarshalType_CustMarshaler_TypeSigCreator = CreateTypeSigCreatorVM(ownerModule, decompilerService, ownerType, ownerMethod, true, customMarshalType_custMarshaler_typeSigCreator_PropertyChanged); InterfaceMarshalType_IidParamIndex = new NullableCompressedUInt32(a => { HasErrorUpdated(); TypeStringUpdated(); }); }
public FieldOptionsVM(FieldDefOptions options, ModuleDef ownerModule, IDecompilerService decompilerService, TypeDef ownerType) { this.ownerModule = ownerModule; var typeSigCreatorOptions = new TypeSigCreatorOptions(ownerModule, decompilerService) { IsLocal = false, CanAddGenericTypeVar = true, CanAddGenericMethodVar = false, OwnerType = ownerType, }; if (ownerType != null && ownerType.GenericParameters.Count == 0) { typeSigCreatorOptions.CanAddGenericTypeVar = false; } TypeSigCreator = new TypeSigCreatorVM(typeSigCreatorOptions); TypeSigCreator.PropertyChanged += typeSigCreator_PropertyChanged; CustomAttributesVM = new CustomAttributesVM(ownerModule, decompilerService); origOptions = options; ConstantVM = new ConstantVM(ownerModule, options.Constant?.Value, dnSpy_AsmEditor_Resources.Field_DefaultValueInfo); ConstantVM.PropertyChanged += constantVM_PropertyChanged; MarshalTypeVM = new MarshalTypeVM(ownerModule, decompilerService, ownerType, null); MarshalTypeVM.PropertyChanged += marshalTypeVM_PropertyChanged; FieldOffset = new NullableUInt32VM(a => HasErrorUpdated()); InitialValue = new HexStringVM(a => HasErrorUpdated()); RVA = new UInt32VM(a => HasErrorUpdated()); ImplMapVM = new ImplMapVM(ownerModule); ImplMapVM.PropertyChanged += implMapVM_PropertyChanged; TypeSigCreator.CanAddFnPtr = false; ConstantVM.IsEnabled = HasDefault; MarshalTypeVM.IsEnabled = HasFieldMarshal; ImplMapVM.IsEnabled = PinvokeImpl; Reinitialize(); }
public FieldOptionsVM(FieldDefOptions options, ModuleDef ownerModule, Language language, TypeDef ownerType) { this.ownerModule = ownerModule; var typeSigCreatorOptions = new TypeSigCreatorOptions(ownerModule, language) { IsLocal = false, CanAddGenericTypeVar = true, CanAddGenericMethodVar = false, OwnerType = ownerType, }; if (ownerType != null && ownerType.GenericParameters.Count == 0) { typeSigCreatorOptions.CanAddGenericTypeVar = false; } this.typeSigCreator = new TypeSigCreatorVM(typeSigCreatorOptions); TypeSigCreator.PropertyChanged += typeSigCreator_PropertyChanged; this.customAttributesVM = new CustomAttributesVM(ownerModule, language); this.origOptions = options; this.constantVM = new ConstantVM(ownerModule, options.Constant == null ? null : options.Constant.Value, "Default value for this field"); ConstantVM.PropertyChanged += constantVM_PropertyChanged; this.marshalTypeVM = new MarshalTypeVM(ownerModule, language, ownerType, null); MarshalTypeVM.PropertyChanged += marshalTypeVM_PropertyChanged; this.fieldOffset = new NullableUInt32VM(a => HasErrorUpdated()); this.initialValue = new HexStringVM(a => HasErrorUpdated()); this.rva = new UInt32VM(a => HasErrorUpdated()); this.implMapVM = new ImplMapVM(ownerModule); ImplMapVM.PropertyChanged += implMapVM_PropertyChanged; this.typeSigCreator.CanAddFnPtr = false; ConstantVM.IsEnabled = HasDefault; MarshalTypeVM.IsEnabled = HasFieldMarshal; ImplMapVM.IsEnabled = PinvokeImpl; Reinitialize(); }
public FieldOptionsVM(FieldDefOptions options, ModuleDef ownerModule, IDecompilerService decompilerService, TypeDef ownerType) { this.ownerModule = ownerModule; var typeSigCreatorOptions = new TypeSigCreatorOptions(ownerModule, decompilerService) { IsLocal = false, CanAddGenericTypeVar = true, CanAddGenericMethodVar = false, OwnerType = ownerType, }; if (ownerType != null && ownerType.GenericParameters.Count == 0) typeSigCreatorOptions.CanAddGenericTypeVar = false; TypeSigCreator = new TypeSigCreatorVM(typeSigCreatorOptions); TypeSigCreator.PropertyChanged += typeSigCreator_PropertyChanged; CustomAttributesVM = new CustomAttributesVM(ownerModule, decompilerService); origOptions = options; ConstantVM = new ConstantVM(ownerModule, options.Constant?.Value, dnSpy_AsmEditor_Resources.Field_DefaultValueInfo); ConstantVM.PropertyChanged += constantVM_PropertyChanged; MarshalTypeVM = new MarshalTypeVM(ownerModule, decompilerService, ownerType, null); MarshalTypeVM.PropertyChanged += marshalTypeVM_PropertyChanged; FieldOffset = new NullableUInt32VM(a => HasErrorUpdated()); InitialValue = new HexStringVM(a => HasErrorUpdated()); RVA = new UInt32VM(a => HasErrorUpdated()); ImplMapVM = new ImplMapVM(ownerModule); ImplMapVM.PropertyChanged += implMapVM_PropertyChanged; TypeSigCreator.CanAddFnPtr = false; ConstantVM.IsEnabled = HasDefault; MarshalTypeVM.IsEnabled = HasFieldMarshal; ImplMapVM.IsEnabled = PinvokeImpl; Reinitialize(); }
public FieldOptionsVM(FieldDefOptions options, ModuleDef ownerModule, Language language, TypeDef ownerType) { this.ownerModule = ownerModule; var typeSigCreatorOptions = new TypeSigCreatorOptions(ownerModule, language) { IsLocal = false, CanAddGenericTypeVar = true, CanAddGenericMethodVar = false, OwnerType = ownerType, }; if (ownerType != null && ownerType.GenericParameters.Count == 0) typeSigCreatorOptions.CanAddGenericTypeVar = false; this.typeSigCreator = new TypeSigCreatorVM(typeSigCreatorOptions); TypeSigCreator.PropertyChanged += typeSigCreator_PropertyChanged; this.customAttributesVM = new CustomAttributesVM(ownerModule, language); this.origOptions = options; this.constantVM = new ConstantVM(ownerModule, options.Constant == null ? null : options.Constant.Value, "Default value for this field"); ConstantVM.PropertyChanged += constantVM_PropertyChanged; this.marshalTypeVM = new MarshalTypeVM(ownerModule, language, ownerType, null); MarshalTypeVM.PropertyChanged += marshalTypeVM_PropertyChanged; this.fieldOffset = new NullableUInt32VM(a => HasErrorUpdated()); this.initialValue = new HexStringVM(a => HasErrorUpdated()); this.rva = new UInt32VM(a => HasErrorUpdated()); this.implMapVM = new ImplMapVM(ownerModule); ImplMapVM.PropertyChanged += implMapVM_PropertyChanged; this.typeSigCreator.CanAddFnPtr = false; ConstantVM.IsEnabled = HasDefault; MarshalTypeVM.IsEnabled = HasFieldMarshal; ImplMapVM.IsEnabled = PinvokeImpl; Reinitialize(); }
public MarshalTypeVM(ModuleDef ownerModule, ILanguageManager languageManager, TypeDef ownerType, MethodDef ownerMethod) { this.nativeTypeVM = new EnumListVM(nativeTypeList, (a, b) => { OnNativeTypeChanged(); TypeStringUpdated(); }); FixNativeTypeEnum(this.NativeType, false); this.rawMarshalType_data = new HexStringVM(a => { HasErrorUpdated(); TypeStringUpdated(); }); this.fixedSysStringMarshalType_size = new NullableCompressedUInt32(a => { HasErrorUpdated(); TypeStringUpdated(); }); this.safeArrayMarshalType_variantTypeVM = new EnumListVM(variantTypeList, (a, b) => { OnSafeArrayMarshalTypeIsEnabledChanged(); TypeStringUpdated(); }); this.safeArrayMarshalType_userDefinedSubType_typeSigCreator = CreateTypeSigCreatorVM(ownerModule, languageManager, ownerType, ownerMethod, true, safeArrayMarshalType_userDefinedSubType_typeSigCreator_PropertyChanged); this.fixedArrayMarshalType_size = new NullableCompressedUInt32(a => { OnFixedArrayMarshalTypeIsEnabledChanged(); TypeStringUpdated(); }); this.fixedArrayMarshalType_nativeTypeVM = new EnumListVM(nativeTypeList, (a, b) => { OnFixedArrayMarshalTypeIsEnabledChanged(); TypeStringUpdated(); }); FixNativeTypeEnum(FixedArrayMarshalType_NativeType, true); this.arrayMarshalType_nativeTypeVM = new EnumListVM(nativeTypeList, (a, b) => { OnArrayMarshalTypeIsEnabledChanged(); TypeStringUpdated(); }); FixNativeTypeEnum(ArrayMarshalType_NativeType, true); this.arrayMarshalType_paramNum = new NullableCompressedUInt32(a => { OnArrayMarshalTypeIsEnabledChanged(); TypeStringUpdated(); }); this.arrayMarshalType_numElems = new NullableCompressedUInt32(a => { OnArrayMarshalTypeIsEnabledChanged(); TypeStringUpdated(); }); this.arrayMarshalType_flags = new NullableCompressedUInt32(a => { OnArrayMarshalTypeIsEnabledChanged(); TypeStringUpdated(); }); this.customMarshalType_custMarshaler_typeSigCreator = CreateTypeSigCreatorVM(ownerModule, languageManager, ownerType, ownerMethod, true, customMarshalType_custMarshaler_typeSigCreator_PropertyChanged); this.interfaceMarshalType_iidParamIndex = new NullableCompressedUInt32(a => { HasErrorUpdated(); TypeStringUpdated(); }); }