Ejemplo n.º 1
0
        private IDockContent GetContentFromPersistString(string persistString)
        {
            string[] items = persistString.Split(',');

            persistString = items[0];

            if (persistString == typeof(TerminalForm).ToString())
            {
                if (this.TerminalForm != null)
                {
                    return(this.TerminalForm);
                }
                this.TerminalForm          = new TerminalForm();
                this.TerminalForm.IsHidden = false;
                if (this.TerminalForm.DockState == DockState.Document)
                {
                    this.TerminalForm.DockState = DockState.DockRight;
                }
                return(this.TerminalForm);
            }

            //else if (persistString == typeof(ErrorListForm).ToString())
            //{
            //    if (this.ErrorListForm != null)
            //        return this.ErrorListForm;
            //    this.ErrorListForm = new ErrorListForm();
            //    this.ErrorListForm.IsHidden = false;
            //    return this.ErrorListForm;
            //}

            else if (persistString == typeof(EditorForm).ToString())
            {
                if (items.Length == 3 && File.Exists(items[1]))
                {
                    if (this.FindDocument(items[1]) == null)
                    {
                        EditorForm editor = new EditorForm(this);
                        editor.LoadFromFile(items[1]);
                        editor.scintilla.GotoPosition(int.Parse(items[2]));
                        editor.scintilla.SetSavePoint();
                        editor.IsHidden = false;
                        editor.Focus();
                        return(editor);
                    }
                    return(null);
                }
                else
                {
                    return(null);
                }
            }
            return(null);
        }