public ExceptionHandlerVM(TypeSigCreatorOptions typeSigCreatorOptions, ExceptionHandlerOptions options) { this.typeSigCreatorOptions = typeSigCreatorOptions.Clone(dnSpy_AsmEditor_Resources.CreateAnExceptionCatchType); this.typeSigCreatorOptions.IsLocal = false; this.typeSigCreatorOptions.NullTypeSigAllowed = true; origOptions = options; HandlerTypeVM = new EnumListVM(exceptionHandlerTypeList); TryStartVM = new ListVM<InstructionVM>((a, b) => OnSelectionChanged()) { DataErrorInfoDelegate = VerifyInstruction }; TryEndVM = new ListVM<InstructionVM>((a, b) => OnSelectionChanged()) { DataErrorInfoDelegate = VerifyInstruction }; FilterStartVM = new ListVM<InstructionVM>((a, b) => OnSelectionChanged()) { DataErrorInfoDelegate = VerifyInstruction }; HandlerStartVM = new ListVM<InstructionVM>((a, b) => OnSelectionChanged()) { DataErrorInfoDelegate = VerifyInstruction }; HandlerEndVM = new ListVM<InstructionVM>((a, b) => OnSelectionChanged()) { DataErrorInfoDelegate = VerifyInstruction }; Reinitialize(); }
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 void InitializeFrom(ExceptionHandlerOptions options) { this.TryStartVM.SelectedItem = options.TryStart ?? InstructionVM.Null; this.TryEndVM.SelectedItem = options.TryEnd ?? InstructionVM.Null; this.FilterStartVM.SelectedItem = options.FilterStart ?? InstructionVM.Null; this.HandlerStartVM.SelectedItem = options.HandlerStart ?? InstructionVM.Null; this.HandlerEndVM.SelectedItem = options.HandlerEnd ?? InstructionVM.Null; this.CatchType = options.CatchType; this.HandlerTypeVM.SelectedItem = options.HandlerType; }
public ExceptionHandlerOptions CopyTo(ExceptionHandlerOptions options) { options.TryStart = RemoveNullInstance(this.TryStartVM.SelectedItem); options.TryEnd = RemoveNullInstance(this.TryEndVM.SelectedItem); options.FilterStart = RemoveNullInstance(this.FilterStartVM.SelectedItem); options.HandlerStart = RemoveNullInstance(this.HandlerStartVM.SelectedItem); options.HandlerEnd = RemoveNullInstance(this.HandlerEndVM.SelectedItem); options.CatchType = this.CatchType; options.HandlerType = (ExceptionHandlerType)this.HandlerTypeVM.SelectedItem; return options; }