示例#1
0
        //FileTabPanel m_tabsPanel = new FileTabPanel();

        private IDockContent GetContentFromPersistString(string persistString)
        {
            if (persistString == typeof(ErrorPanel).ToString())
            {
                return(this.m_errorPanel);
            }
            if (persistString == typeof(ProjectPanel).ToString())
            {
                return(this.m_prjPanel);
            }
            if (persistString == typeof(PropertyPanel).ToString())
            {
                return(this.m_propertyPanel);
            }

            string[] strArray = persistString.Split(new char[] { ',' });
            if (strArray.Length != 3)
            {
                return(null);
            }
            if (strArray[0] != typeof(FileTabPanel).ToString())
            {
                return(null);
            }
            var doc = new FileTabPanel();

            if (strArray[1] != string.Empty)
            {
                doc.FileName = strArray[1];
            }
            if (strArray[2] != string.Empty)
            {
                doc.Text = strArray[2];
            }

            //DocumentViewManager.Instance().AddView(doc);

            this.receiver.LoadFile(doc.FileName);

            return(DocumentViewManager.Instance().GetView(doc.FileName));
            //var ctx = Assemble.CreateEditor(doc.FileName);

            //doc.Tag = ctx.Model.FileId;

            //return doc;
        }
示例#2
0
        //DocumentViewManager m_documentViewManager = null;

        public MainFrm()
        {
            InitializeComponent();
            //Workspace.ProjectView = this.splitContainer1.Panel1;
            GlobalService.ModelManager   = ModelManager.Instance();
            GlobalService.DepencyManager = DepencyManager.Instance();

            DocumentViewManager.Init(this.m_workspace);

            this.IsMdiContainer = true;

            this.m_deserializeDockContent = new DeserializeDockContent(this.GetContentFromPersistString);

            this.receiver.Listeners.Add(this.m_prjPanel.Receiver);
            this.receiver.Listeners.Add(this.m_propertyPanel.Receiver);
            this.receiver.Listeners.Add(DocumentViewManager.Instance().Receiver);
            this.receiver.Listeners.Add(GlobalService.ModelManager.Receiver);
            this.receiver.Listeners.Add(GlobalService.EditorContextManager.Receiver);

            this.Load        += new EventHandler(MainFrm_Load);
            this.FormClosing += new FormClosingEventHandler(MainFrm_FormClosing);

            this.receiver.OnOpenProjectCompleted += new ReceiverBase.OpenProjectCompletedHandler(receiver_OnOpenProjectCompleted);

            //this.treeView1.NodeMouseClick += new TreeNodeMouseClickEventHandler(treeView1_NodeMouseClick);
            //this.treeView1.NodeMouseDoubleClick += new TreeNodeMouseClickEventHandler(treeView1_NodeMouseDoubleClick);
            Application.Idle += new EventHandler(Application_Idle);

            this.InitIcon();

            //this.dgvError.RowPostPaint += new DataGridViewRowPostPaintEventHandler(dgvError_RowPostPaint);
            //this.dgvError.CellDoubleClick += new DataGridViewCellEventHandler(dgvError_CellDoubleClick);


            //GlobalService.ModelManager.ParseError += new OnParseError(GlobalService_ParseError);
            //StringTemplateGroup.RegisterGroupLoader(new PathGroupLoader(AppDomain.CurrentDomain.BaseDirectory, null));

            this.WindowState = FormWindowState.Maximized;

            //this.receiver.OnOpenNullProject += new ReceiverBase.OpenNullProjectHandler(receiver_OnOpenNullProject);
        }