public void LoadFromFile(string fileName)
        {
            _ScriptEditor?.LoadFromFile(fileName);

            var fluent = mvvmContext.OfType <ConsoleDocumentViewModel>();

            fluent.ViewModel.FileLoaded(fileName);
            Messenger.Default.Send(new ControlModifiedMessage()
            {
                Control = this, Modified = false
            });
        }
        private void ViewEditors_QueryControl(object sender, DevExpress.XtraBars.Docking2010.Views.QueryControlEventArgs e)
        {
            switch (e.Document.ControlName)
            {
            case "docScript":
                if (_ScriptEditor == null)
                {
                    _ScriptEditor = new ScriptEditorControl();

                    var model = mvvmContext.GetViewModel <ConsoleDocumentViewModel>();
                    _ScriptEditor.LoadSyntax(model.Engine.SyntaxFile);
                    _ScriptEditor.DefaultExt             = model.Engine.DefaultExt;
                    _ScriptEditor.FileFilter             = model.Engine.FileFilter;
                    _ScriptEditor.ModifiedChanged       += ScriptEditor_ModifiedChanged;
                    _ScriptEditor.ListIntellisenseItems += ScriptEditor_ListIntellisenseItems;
                    _ScriptEditor.ScriptChanged         += ScriptEditor_ScriptChanged;

                    if (!string.IsNullOrWhiteSpace(model.FileName))
                    {
                        var scriptFileName = model.GetScriptFileName(model.FileName);
                        if (scriptFileName != null && File.Exists(scriptFileName))
                        {
                            _ScriptEditor.LoadFromFile(scriptFileName);
                        }
                    }
                }
                e.Control = _ScriptEditor;
                break;

            case "docConsole":
                if (_ConsoleOutputControl == null)
                {
                    var model = mvvmContext.GetViewModel <ConsoleDocumentViewModel>();
                    _ConsoleOutputControl   = new ConsoleOutputControl(model);
                    model.SynchronizeInvoke = _ConsoleOutputControl;

                    _ConsoleOutputControl.RibbonUpdateRequest += ConsoleOutputControl_RibbonUpdateRequest;
                    _ConsoleOutputControl.ConsoleLoaded       += ConsoleOutputControl_ConsoleLoaded;
                }
                e.Control = _ConsoleOutputControl;
                break;

            case "docCommandLine":
                if (_ConsoleInputControl == null)
                {
                    _ConsoleInputControl = new ConsoleInputControl()
                    {
                        MessagesVisible = false
                    };

                    var model = mvvmContext.GetViewModel <ConsoleDocumentViewModel>();

                    _ConsoleInputControl.LoadSyntax(model.Engine?.SyntaxFile);
                    _ConsoleInputControl.ExecuteCommand        += ExecuteCommandHandler;
                    _ConsoleInputControl.ListIntellisenseItems += ScriptEditor_ListIntellisenseItems;
                    _ConsoleInputControl.ShowParseError        += ScriptEditor_ShowParseError;
                }
                e.Control = _ConsoleInputControl;
                break;
            }
        }