Beispiel #1
0
        void initCommands()
        {
            CMDNew = new Command(new Action(newFile))
            {
                Caption = "New", Icon = IcoNew, CanExecute = true
            };
            CMDOpen = new Command(new Action(openFileDialog))
            {
                Caption = "Open...", Icon = IcoOpen
            };
            CMDSave = new Command(new Action(saveFileDialog))
            {
                Caption = "Save", Icon = IcoSave, CanExecute = false
            };
            CMDSaveAs = new Command(new Action(saveFileDialog))
            {
                Caption = "Save As...", Icon = IcoSaveAs, CanExecute = false
            };
            CMDQuit = new Command(new Action(Quit))
            {
                Caption = "Quit", Icon = IcoQuit
            };
            CMDUndo = new Command(new Action(undo))
            {
                Caption = "Undo", Icon = IcoUndo, CanExecute = false
            };
            CMDRedo = new Command(new Action(redo))
            {
                Caption = "Redo", Icon = IcoRedo, CanExecute = false
            };
            CMDCut = new Command(new Action(cut))
            {
                Caption = "Cut", Icon = IcoCut, CanExecute = false
            };
            CMDCopy = new Command(new Action(copy))
            {
                Caption = "Copy", Icon = IcoCopy, CanExecute = false
            };
            CMDPaste = new Command(new Action(paste))
            {
                Caption = "Paste", Icon = IcoPaste, CanExecute = false
            };
            CMDHelp = new Command(new Action(() => System.Diagnostics.Debug.WriteLine("help")))
            {
                Caption = "Help", Icon = IcoHelp
            };
            CMDOptions = new Command(new Action(() => loadWindow("#ui.Options.crow", this)))
            {
                Caption = "Editor Options", Icon = new SvgPicture("#Icons.tools.svg")
            };

            cmdCloseSolution = new Command(new Action(closeSolution))
            {
                Caption = "Close Solution", Icon = new SvgPicture("#Icons.paste-on-document.svg"), CanExecute = false
            };

            CMDViewErrors = new Command(new Action(() => loadWindow("#ui.winErrors.crow", this)))
            {
                Caption = "Errors pane"
            };
            CMDViewLog = new Command(new Action(() => loadWindow("#ui.winLog.crow", this)))
            {
                Caption = "Log View"
            };
            CMDViewSolution = new Command(new Action(() => loadWindow("#ui.winSolution.crow", this)))
            {
                Caption = "Solution Tree", CanExecute = false
            };
            CMDViewEditor = new Command(new Action(() => loadWindow("#ui.winEditor.crow", this)))
            {
                Caption = "Editor Pane"
            };
            CMDViewProperties = new Command(new Action(() => loadWindow("#ui.winProperties.crow", this)))
            {
                Caption = "Properties"
            };
            CMDViewDesign = new Command(new Action(() => loadWindow("#ui.winDesign.crow", this)))
            {
                Caption = "Quick Design", CanExecute = true
            };
            CMDViewToolbox = new Command(new Action(() => loadWindow("#ui.winToolbox.crow", this)))
            {
                Caption = "Toolbox", CanExecute = false
            };
            CMDViewSchema = new Command(new Action(() => loadWindow("#ui.winSchema.crow", this)))
            {
                Caption = "IML Shematic View", CanExecute = true
            };
            CMDViewStyling = new Command(new Action(() => loadWindow("#ui.winStyleView.crow", this)))
            {
                Caption = "Styling Explorer", CanExecute = true
            };
            CMDViewGTExp = new Command(new Action(() => loadWindow("#ui.winGTExplorer.crow", this)))
            {
                Caption = "Graphic Tree Explorer", CanExecute = true
            };
            CMDViewSyntaxTree = new Command(new Action(() => loadWindow("#ui.winSyntaxTree.crow", currentSolution)))
            {
                Caption = "Syntax Tree", CanExecute = true
            };

            CMDBuild = new Command(new Action(() => CurrentSolution?.Build("Build")))
            {
                Caption = "Compile Solution", CanExecute = false
            };
            CMDClean = new Command(new Action(() => CurrentSolution?.Build("Clean")))
            {
                Caption = "Clean Solution", CanExecute = false
            };
            CMDRestore = new Command(new Action(() => CurrentSolution?.Build("Restore")))
            {
                Caption = "Restore packages", CanExecute = false
            };
            CMDViewProjProps = new Command(new Action(() => loadWindow("#ui.ProjectProperties.crow")))
            {
                Caption = "Project Properties", CanExecute = false
            };
        }