Beispiel #1
0
        public CWorkspace()
        {
            CKlaxScriptRegistry registry = CKlaxScriptRegistry.Instance;

            Instance      = this;
            UndoRedoModel = new CUndoRedoModel();

            Tools.Add(new CViewportViewModel());
            Tools.Add(new CConsoleViewModel());
            Tools.Add(new CWorldOutlinerViewModel());
            Tools.Add(new CInspectorViewModel());
            Tools.Add(new MaterialEditorViewModel());
            Tools.Add(new CAssetPreviewerViewModel());
            Tools.Add(new CAssetBrowserViewModel());
            Tools.Add(new CEntityBuilderViewModel());
            Tools.Add(new CEntityBuilderInspectorViewModel());
            Tools.Add(new CNodeGraphViewModel());
            Tools.Add(new CInterfaceEditorViewmodel());

            foreach (var tool in Tools)
            {
                tool.PostToolInit();
            }

            InitCommands();
            InitUndoRedo();
        }
        public CLayoutManagerViewModel(DockingManager manager, CWorkspace workspace)
        {
            m_dockingManager = manager;
            m_workspace      = workspace;

            m_userLayoutFileFolder    = Paths.UserDirectory + "\\Layouts\\";
            m_layoutFilePath          = m_userLayoutFileFolder + "layout.cfg";
            m_builtinLayoutFileFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\Resources\\Layouts\\";
            Directory.CreateDirectory(m_userLayoutFileFolder);

            LoadLayoutCommand        = new CRelayCommand(OnLoadLayout, (arg) => m_dockingManager != null);
            LoadLayoutAtIndexCommand = new CRelayCommand(OnLoadAtIndexLayout, (arg) => m_dockingManager != null);
            SaveLayoutCommand        = new CRelayCommand(OnSaveLayout, (arg) => m_dockingManager != null);
            SaveLayoutAsCommand      = new CRelayCommand(OnSaveLayoutAs, (arg) => m_dockingManager != null);

            InitLayouts();
        }