Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        string VerifyInstruction(ListVM<InstructionVM> list)
        {
            var item = list.SelectedItem;
            var instr = item as InstructionVM;
            if (item != null && instr == null)
                return "Only instructions can be selected";

            if (instr != null && instr.Index == -1)
                return "Instruction has been removed";

            return string.Empty;
        }
Ejemplo n.º 3
0
 bool HasListError(ListVM<InstructionVM> list)
 {
     return !string.IsNullOrEmpty(VerifyInstruction(list))  ;
 }