Exemplo n.º 1
0
		public override void Initialize()
		{
			MainMenu.All.First(x => x.Name == "View")
                .Add(new MenuItem("Workspace Explorer", OpenWorkspaceExplorer).WithIcon("Resources/Icons/FileBrowser.png"));

            var workspaceViewModel = IoC.Get<WorkspaceViewModel>();
		    //workspaceViewModel.IsVisible = false;
            Shell.ShowTool(workspaceViewModel);

		    var addNewFile = new MenuItem("Add New File...", AddNewFile)
		        .WithActivator(workspaceActivator);
            var addFolder = new MenuItem("Add New Folder...", AddNewFolder)
                .WithActivator(workspaceActivator);
            var addReference = new MenuItem("Add Reference from File...", AddReferenceFromFile)
                .WithActivator(workspaceActivator);
            var addReferenceGac = new MenuItem("Add Reference from GAC...", AddReferenceFromGac)
                .WithActivator(workspaceActivator);
            //populate the menu
            MainMenu.First(item => item.Name == "Workspace")
                .Add(
                    addNewFile,
                    MenuItemBase.Separator,
                    addFolder,
                    MenuItemBase.Separator,
                    addReference,
                    addReferenceGac
                );
		}
Exemplo n.º 2
0
		public override void Initialize()
		{
		    var newWorkspace = new MenuItem("New Workspace...", NewWorkspace);
            //var newFile = new MenuItem("_New File...", NewFile);
		    var openWorkspace = new MenuItem("Open Workspace...", OpenWorkspace);
            var openFile = new MenuItem("_Open File...", OpenFile)
                .WithIcon("/Resources/Icons/Open.png")
                .WithGlobalShortcut(ModifierKeys.Control, Key.O);
            var closeWorkspace = new MenuItem("Close Workspace", CloseWorkspace)
                .WithActivator(workspaceActivator);
            var closeFile = new MenuItem("_Close", CloseFile);
		    var save = new MenuItem("Save", Save)
		        .WithIcon("Resources/Icons/Icons.16x16.SaveIcon.png")
		        .WithGlobalShortcut(ModifierKeys.Control, Key.S);
		    var saveAs = new MenuItem("Save As...", SaveAs);
            var saveAll = new MenuItem("Save All", SaveAll)
                .WithIcon("Resources/Icons/Icons.16x16.SaveAllIcon.png")
                .WithGlobalShortcut(ModifierKeys.Control | ModifierKeys.Shift, Key.S);
		    var exit = new MenuItem("E_xit", Exit);
            
            //populate the menu
            MainMenu.First(item=>item.Name == "File")
                .Add(
                    newWorkspace,
                    //newFile,
                    MenuItemBase.Separator,
                    openWorkspace,
                    openFile,
                    MenuItemBase.Separator,
                    closeWorkspace,
                    closeFile,
                    MenuItemBase.Separator,
                    save,
                    saveAs,
                    saveAll,
                    MenuItemBase.Separator,
                    exit
                );

            //populate the toolbar
            ToolBar.Add(
                    openFile,
                    save,
                    saveAll
                );
		}
Exemplo n.º 3
0
        public override void Start()
        {
            //Edit
            var undo = new MenuItem("Undo", Undo).WithIcon("Resources/Icons/Icons.16x16.UndoIcon.png")
                .WithGlobalShortcut(ModifierKeys.Control, Key.Z);
            var redo = new MenuItem("Redo", Redo).WithIcon("Resources/Icons/Icons.16x16.RedoIcon.png")
                .WithGlobalShortcut(ModifierKeys.Control, Key.Y);
            var cut = new MenuItem("Cut", Cut).WithIcon("Resources/Icons/Icons.16x16.CutIcon.png")
                .WithGlobalShortcut(ModifierKeys.Control, Key.X);
            var copy = new MenuItem("Copy", Copy).WithIcon("Resources/Icons/Icons.16x16.CopyIcon.png")
                .WithGlobalShortcut(ModifierKeys.Control, Key.C);
            var paste = new MenuItem("Paste", Paste).WithIcon("Resources/Icons/Icons.16x16.PasteIcon.png")
                .WithGlobalShortcut(ModifierKeys.Control, Key.V);
            var selectAll = new MenuItem("Select All", SelectAll)
                .WithGlobalShortcut(ModifierKeys.Control, Key.A);
            var comment = new MenuItem("Comment Selection", Comment).WithIcon("Resources/Icons/Icons.16x16.CommentRegion.png")
                .WithGlobalShortcut(ModifierKeys.Control, Key.K);
            var uncomment = new MenuItem("Uncomment Selection", Uncomment).WithIcon("Resources/Icons/Icons.16x16.CommentRegion.png")
                .WithGlobalShortcut(ModifierKeys.Control, Key.U);
            //populate the menu
            MainMenu.First(item => item.Name == "Edit")
                .Add(
                    undo,
                    redo,
                    MenuItemBase.Separator,
                    cut,
                    copy,
                    paste,
                    MenuItemBase.Separator,
                    selectAll,
                    MenuItemBase.Separator,
                    comment,
                    uncomment
                );
            //populate the toolbar
            ToolBar.Add(
                    MenuItemBase.Separator,
                    cut,
                    copy,
                    paste,
                    MenuItemBase.Separator,
                    undo,
                    redo
                );

            //eval code
            var runFile = new MenuItem("Run", ExecuteFile)
                .WithIcon("Resources/Icons/Icons.16x16.RunAllIcon.png")
                .WithGlobalShortcut(ModifierKeys.Alt | ModifierKeys.Shift, Key.Enter);
            var runSelection = new MenuItem("Run Selection", ExecuteSelection)
                .WithIcon("Resources/Icons/Icons.16x16.RunProgramIcon.png")
                .WithGlobalShortcut(ModifierKeys.Alt, Key.Enter);
            //populate the menu
            MainMenu.First(item => item.Name == "Evaluate")
                .Add(
                    runFile,
                    runSelection
                );
            //populate the toolbar
            ToolBar.Add(
                    MenuItemBase.Separator,
                    runFile,
                    runSelection
                );
        }
Exemplo n.º 4
0
        public override void Initialize()
        {
            MainMenu.All.First(x => x.Name == "View")
                .Add(new MenuItem("Workspace Explorer", OpenWorkspaceExplorer).WithIcon("Resources/Icons/FileBrowser.png"));

            var workspaceViewModel = IoC.Get<WorkspaceViewModel>();
            //workspaceViewModel.IsVisible = false;
            Shell.ShowTool(workspaceViewModel);

            var addNewFile = new MenuItem("Add New File...", AddNewFile);
            var addFolder = new MenuItem("Add New Folder...", AddNewFolder);
            var addReference = new MenuItem("Add References from Files...", AddFileReferences);
            var addReferenceGac = new MenuItem("Add References from GAC...", AddGacReferences);
            var copyReference = new MenuItem("Copy References to Bin...", CopyReferences);
            var managePackages = new MenuItem("Manage NuGet Packages...", MangePackages);
            //populate the menu
            MainMenu.First(item => item.Name == "Workspace")
                .Add(
                    addNewFile,
                    MenuItemBase.Separator,
                    addFolder,
                    MenuItemBase.Separator,
                    addReference,
                    addReferenceGac,
                    MenuItemBase.Separator,
                    copyReference,
                    MenuItemBase.Separator,
                    managePackages
                );
        }