public LocalVM(TypeSigCreatorOptions typeSigCreatorOptions, LocalOptions options) { this.typeSigCreatorOptions = typeSigCreatorOptions.Clone("Create a Local Type"); this.typeSigCreatorOptions.IsLocal = true; this.typeSigCreatorOptions.NullTypeSigAllowed = false; this.origOptions = options; Reinitialize(); }
protected TypeVMBase(T value, Action <DataFieldVM> onUpdated, TypeSigCreatorOptions options) : base(onUpdated) { if (options != null) { this.options = options.Clone("Create a Type"); this.options.NullTypeSigAllowed = true; } SetValue(value); }
public ObjectListDataFieldVM(ModuleDef ownerModule, IList <object> value, Action <DataFieldVM> onUpdated, TypeSigCreatorOptions options) : base(onUpdated) { this.ownerModule = ownerModule; if (options != null) { this.options = options.Clone("Create a Type"); this.options.NullTypeSigAllowed = true; } SetValue(value); }
void PickTypeSpec() { if (typeSigCreator == null) { throw new InvalidOperationException(); } bool canceled; var newType = typeSigCreator.Create(typeSigCreatorOptions.Clone("Create TypeSpec"), (Class as ITypeDefOrRef).ToTypeSig(), out canceled); if (!canceled) { Class = newType.ToTypeDefOrRef(); } }
void AddFnPtrSig() { if (createMethodPropertySig == null) { throw new InvalidOperationException(); } var createOptions = new MethodSigCreatorOptions(options.Clone("Create FnPtr Method Signature")); createOptions.IsPropertySig = false; createOptions.CanHaveSentinel = true; var fnPtrSig = TypeSig as FnPtrSig; var msig = fnPtrSig == null ? null : fnPtrSig.MethodSig; var sig = createMethodPropertySig.Create(createOptions, msig); if (sig == null) { return; } TypeSig = new FnPtrSig(sig); }
public ExceptionHandlerVM(TypeSigCreatorOptions typeSigCreatorOptions, ExceptionHandlerOptions options) { this.typeSigCreatorOptions = typeSigCreatorOptions.Clone("Create an Exception Catch Type"); this.typeSigCreatorOptions.IsLocal = false; this.typeSigCreatorOptions.NullTypeSigAllowed = true; this.origOptions = options; this.handlerTypeVM = new EnumListVM(exceptionHandlerTypeList); this.tryStartVM = new ListVM<InstructionVM>((a, b) => OnSelectionChanged()) { DataErrorInfoDelegate = VerifyInstruction }; this.tryEndVM = new ListVM<InstructionVM>((a, b) => OnSelectionChanged()) { DataErrorInfoDelegate = VerifyInstruction }; this.filterStartVM = new ListVM<InstructionVM>((a, b) => OnSelectionChanged()) { DataErrorInfoDelegate = VerifyInstruction }; this.handlerStartVM = new ListVM<InstructionVM>((a, b) => OnSelectionChanged()) { DataErrorInfoDelegate = VerifyInstruction }; this.handlerEndVM = new ListVM<InstructionVM>((a, b) => OnSelectionChanged()) { DataErrorInfoDelegate = VerifyInstruction }; Reinitialize(); }
public TypeSigCreatorVM(TypeSigCreatorOptions options, TypeSig defaultTypeSig = null) { this.options = options.Clone(); this.defaultTypeSig = defaultTypeSig; this.arrayRank = new UInt32VM(2, a => { }); this.arraySizes = new UInt32ListDataFieldVM(a => { }) { Min = ModelUtils.COMPRESSED_UINT32_MIN, Max = ModelUtils.COMPRESSED_UINT32_MAX, }; this.arrayLowerBounds = new Int32ListDataFieldVM(a => { }) { Min = ModelUtils.COMPRESSED_INT32_MIN, Max = ModelUtils.COMPRESSED_INT32_MAX, }; this.genericVariableNumber = new UInt32VM(0, a => { }); Reinitialize(); }
public TypeSigCreatorVM(TypeSigCreatorOptions options, TypeSig defaultTypeSig = null) { this.options = options.Clone(); this.defaultTypeSig = defaultTypeSig; this.arrayRank = new UInt32VM(2, a => { }); this.arraySizes = new UInt32ListDataFieldVM(a => { }) { Min = ModelUtils.COMPRESSED_UINT32_MIN, Max = ModelUtils.COMPRESSED_UINT32_MAX, }; this.arrayLowerBounds = new Int32ListDataFieldVM(a => { }) { Min = ModelUtils.COMPRESSED_INT32_MIN, Max = ModelUtils.COMPRESSED_INT32_MAX, }; this.genericVariableNumber = new UInt32VM(0, a => { }); Reinitialize(); }
public MemberRefVM(MemberRefOptions options, TypeSigCreatorOptions typeSigCreatorOptions, bool isField) { this.isField = isField; this.typeSigCreatorOptions = typeSigCreatorOptions.Clone(); this.origOptions = options; this.customAttributesVM = new CustomAttributesVM(typeSigCreatorOptions.OwnerModule, typeSigCreatorOptions.Language); this.typeSigCreatorOptions.CanAddGenericMethodVar = true; this.typeSigCreatorOptions.CanAddGenericTypeVar = true; this.typeSigCreatorOptions.IsLocal = false; this.typeSigCreatorOptions.NullTypeSigAllowed = false; this.typeSigCreatorVM = new TypeSigCreatorVM(this.typeSigCreatorOptions.Clone("Create Field TypeSig")); TypeSigCreatorVM.PropertyChanged += (s, e) => HasErrorUpdated(); var mopts = new MethodSigCreatorOptions(this.typeSigCreatorOptions.Clone()); mopts.CanHaveSentinel = true; this.methodSigCreatorVM = new MethodSigCreatorVM(mopts); MethodSigCreatorVM.PropertyChanged += (s, e) => HasErrorUpdated(); Reinitialize(); }
public MemberRefVM(MemberRefOptions options, TypeSigCreatorOptions typeSigCreatorOptions, bool isField) { this.isField = isField; this.typeSigCreatorOptions = typeSigCreatorOptions.Clone(); this.origOptions = options; this.customAttributesVM = new CustomAttributesVM(typeSigCreatorOptions.OwnerModule, typeSigCreatorOptions.Language); this.typeSigCreatorOptions.CanAddGenericMethodVar = true; this.typeSigCreatorOptions.CanAddGenericTypeVar = true; this.typeSigCreatorOptions.IsLocal = false; this.typeSigCreatorOptions.NullTypeSigAllowed = false; this.typeSigCreatorVM = new TypeSigCreatorVM(this.typeSigCreatorOptions.Clone("Create Field TypeSig")); TypeSigCreatorVM.PropertyChanged += (s, e) => HasErrorUpdated(); var mopts = new MethodSigCreatorOptions(this.typeSigCreatorOptions.Clone()); mopts.CanHaveSentinel = true; this.methodSigCreatorVM = new MethodSigCreatorVM(mopts); MethodSigCreatorVM.PropertyChanged += (s, e) => HasErrorUpdated(); Reinitialize(); }