コード例 #1
0
        public IDEWindow()
        {
            InitializeComponent();

            // Регистрируем комманды
            CommandBindings.Add(new CommandBinding(ApplicationCommands.New, ExecutedNew, CanExecuteNew));
            CommandBindings.Add(new CommandBinding(ApplicationCommands.Open, ExecutedOpen, CanExecuteOpen));
            CommandBindings.Add(new CommandBinding(SaveAll, ExecutedSaveAll, CanExecuteSaveAll));

            Common.FileCommands.OpenFile.CanExecuteTargets += new Func <bool>(OpenFile_CanExecuteTargets);
            Common.FileCommands.OpenFile.ExecuteTargets    += new Action <object>(OpenFile_ExecuteTargets);

            // Регистрируем расширения
            EditorManager.Instance.RegisterExtension <TextEditorWindow>(".txt");
            EditorManager.Instance.RegisterExtension <ScriptEditorWindow>(".lua");
            EditorManager.Instance.RegisterExtension <QuestEditorWindow>(".story");
            EditorManager.Instance.RegisterExtension <LevelEditor.View.ConversationEditorWindow>(".conv");

            EditorManager.Instance.RegisterEditorForTag(new LevelEditorAssociation(), "Levels");
            EditorManager.Instance.RegisterEditorForTag <QuestEditorWindow>("Story");
            EditorManager.Instance.RegisterEditorForTag <ScriptEditorWindow>("Scripts");
            EditorManager.Instance.RegisterEditorForTag <LevelEditor.View.ConversationEditorWindow>("Conversations");
            //  ExtensionManager.RegisterExtension<LevelEditorWindow>(".lvl");

            mToolWindowsMenu.DataContext = mTools;
            mWindowMenu.DataContext      = mOpendDocuments;

            // Регистрируем панели инструментов
            AddToolWindow(mPropertiesWindow);
            AddToolWindow(mModuleManager);
            AddToolWindow(LevelEditor.View.ObjectManager.Instance);
            AddToolWindow(LevelEditor.View.EntityPaletteTool.Instance);

            AddEditorWindow(LevelEditor.View.LevelEditorWindow.Instance);
            //      AddEditorWindow(new LevelEditorWindow() { FileName = "../Data/Levels/Level1.xml" });
            ToolBar tb;// = LuaEditor.Resources.getToolbar();

            //if (tb != null)
            //    mToolbarTray.ToolBars.Add(tb);

            // Stream s = typeof(QuestEditor.Views.QuestEditorWindow).Assembly.GetManifestResourceStream("QuestEditor.Views.QuestToolbar.xaml");

            tb = LevelEditor.View.QuestEditorToolBar.Instance;
            mToolbarTray.ToolBars.Add(tb);

            tb = new LevelEditor.View.LevelEditorToolBar();
            mToolbarTray.ToolBars.Add(tb);

            tb = LevelEditor.View.ConversationEditorToolBar.Instance;
            mToolbarTray.ToolBars.Add(tb);

            tb = LevelEditor.View.ScriptToolBar.Instance;
            mToolbarTray.ToolBars.Add(tb);
        }
コード例 #2
0
ファイル: IDEWindow.xaml.cs プロジェクト: weimingtom/isilme
        public IDEWindow()
        {
            InitializeComponent();

            // Регистрируем комманды
            CommandBindings.Add(new CommandBinding(ApplicationCommands.New, ExecutedNew, CanExecuteNew));
            CommandBindings.Add(new CommandBinding(ApplicationCommands.Open, ExecutedOpen, CanExecuteOpen));
            CommandBindings.Add(new CommandBinding(SaveAll, ExecutedSaveAll, CanExecuteSaveAll));

            Common.FileCommands.OpenFile.CanExecuteTargets += new Func<bool>(OpenFile_CanExecuteTargets);
            Common.FileCommands.OpenFile.ExecuteTargets += new Action<object>(OpenFile_ExecuteTargets);

            // Регистрируем расширения
            EditorManager.Instance.RegisterExtension<TextEditorWindow>(".txt");
            EditorManager.Instance.RegisterExtension<ScriptEditorWindow>(".lua");
            EditorManager.Instance.RegisterExtension<QuestEditorWindow>(".story");
            EditorManager.Instance.RegisterExtension<LevelEditor.View.ConversationEditorWindow>(".conv");

            EditorManager.Instance.RegisterEditorForTag(new LevelEditorAssociation(), "Levels");
            EditorManager.Instance.RegisterEditorForTag<QuestEditorWindow>("Story");
            EditorManager.Instance.RegisterEditorForTag<ScriptEditorWindow>("Scripts");
            EditorManager.Instance.RegisterEditorForTag<LevelEditor.View.ConversationEditorWindow>("Conversations");
            EditorManager.Instance.RegisterExtension<AIPackagesEditor.AIPackagesEditorWindow>(".aip");
              //  ExtensionManager.RegisterExtension<LevelEditorWindow>(".lvl");

            mToolWindowsMenu.DataContext = mTools;
            mWindowMenu.DataContext = mOpendDocuments;

            // Регистрируем панели инструментов
            AddToolWindow(mPropertiesWindow);
            AddToolWindow(mModuleManager);
            AddToolWindow(LevelEditor.View.ObjectManager.Instance);
            AddToolWindow(LevelEditor.View.EntityPaletteTool.Instance);

            AddEditorWindow(LevelEditor.View.LevelEditorWindow.Instance);
              //      AddEditorWindow(new LevelEditorWindow() { FileName = "../Data/Levels/Level1.xml" });
            ToolBar tb;// = LuaEditor.Resources.getToolbar();
            //if (tb != null)
            //    mToolbarTray.ToolBars.Add(tb);

               // Stream s = typeof(QuestEditor.Views.QuestEditorWindow).Assembly.GetManifestResourceStream("QuestEditor.Views.QuestToolbar.xaml");

            tb = LevelEditor.View.QuestEditorToolBar.Instance;
            mToolbarTray.ToolBars.Add(tb);

            tb = new LevelEditor.View.LevelEditorToolBar();
            mToolbarTray.ToolBars.Add(tb);

            tb =LevelEditor.View.ConversationEditorToolBar.Instance;
            mToolbarTray.ToolBars.Add(tb);

            tb = LevelEditor.View.ScriptToolBar.Instance;
            mToolbarTray.ToolBars.Add(tb);
        }