Esempio n. 1
0
        private static DockContent GetMdiForm(System.Xml.XmlDocument doc, bool valid)
        {
            IXEditNetProfile prof = ProfileProvider.GetProfile(doc);

            UserControl userControl = null;

            if (prof != null)
            {
                userControl = prof.GetEditorRegion(doc);
            }

            if (userControl == null)
            {
                userControl = new XEditNetDefaultEditorRegion();
            }

            IXEditNetEditorRegion r = userControl as IXEditNetEditorRegion;

            if (r == null)
            {
                throw new InvalidOperationException("User control returned by profile does not implement " + typeof(IXEditNetEditorRegion));
            }

            if (prof != null && prof.Info.Stylesheet != null && prof.Info.Stylesheet.Length > 0)
            {
                r.Editor.SetStylesheet(prof.Info.Stylesheet);
            }

            r.Editor.Attach(doc, valid);
            XEditNetChildForm2 form = new XEditNetChildForm2(userControl);

            return(form);
        }
Esempio n. 2
0
        private void UpdateSelectionStatus()
        {
            IXEditNetEditorRegion child = (IXEditNetEditorRegion)this.ActiveMdiChild;
            Selection             sel   = child.Editor.Selection;

            this.statusBar.Text = sel == null ? "" : sel.ToString();
        }
Esempio n. 3
0
        private IXEditNetEditorRegion FindExistingForm(FileInfo fi)
        {
            foreach (Form child in this.MdiChildren)
            {
                IXEditNetEditorRegion f = child as IXEditNetEditorRegion;
                if (f == null)
                {
                    continue;
                }

                if (child.Text.Equals(fi.Name))
                {
                    return(f);
                }
            }
            return(null);
        }
Esempio n. 4
0
        private void XEditNetMainForm_MdiChildActivate(object sender, EventArgs e)
        {
            if (activeChild != null)
            {
                activeChild.Editor.SelectionChanged -= new SelectionChangedEventHandler(SelectionChanged);
            }

            IXEditNetEditorRegion child = this.ActiveMdiChild as IXEditNetEditorRegion;

            if (child == null)
            {
                return;
            }

            activeChild = child;
            activeChild.Editor.SelectionChanged += new SelectionChangedEventHandler(SelectionChanged);

            UpdateSelectionStatus();
        }
Esempio n. 5
0
        public void childForm_Activated(object sender, EventArgs e)
        {
            XEditNetChildForm2 form = sender as XEditNetChildForm2;

            if (sender != null)
            {
                IXEditNetEditorRegion r = form.EditorRegion;
                if (currentRegion != null)
                {
                    currentRegion.Editor.InsertElementActivated -= new XEditNet.InterfaceActivationEventHandler(InsertElementActivated);
                    currentRegion.Editor.ChangeElementActivated -= new XEditNet.InterfaceActivationEventHandler(ChangeElementActivated);
                }

                r.Editor.InsertElementActivated += new XEditNet.InterfaceActivationEventHandler(InsertElementActivated);
                r.Editor.ChangeElementActivated += new XEditNet.InterfaceActivationEventHandler(ChangeElementActivated);

                foreach (WidgetPanel p in panels.Values)
                {
                    p.Nested.Editor = r.Editor;
                }

                currentRegion = r;
            }
        }
Esempio n. 6
0
        private void XEditNetMainForm_MdiChildActivate(object sender, EventArgs e)
        {
            if ( activeChild != null )
                activeChild.Editor.SelectionChanged-=new SelectionChangedEventHandler(SelectionChanged);

            IXEditNetEditorRegion child=this.ActiveMdiChild as IXEditNetEditorRegion;
            if ( child == null )
                return;

            activeChild=child;
            activeChild.Editor.SelectionChanged+=new SelectionChangedEventHandler(SelectionChanged);

            UpdateSelectionStatus();
        }
Esempio n. 7
0
        public void childForm_Activated(object sender, EventArgs e)
        {
            XEditNetChildForm2 form = sender as XEditNetChildForm2;
            if (sender != null)
            {
                IXEditNetEditorRegion r = form.EditorRegion;
                if (currentRegion != null)
                {
                    currentRegion.Editor.InsertElementActivated -= new XEditNet.InterfaceActivationEventHandler(InsertElementActivated);
                    currentRegion.Editor.ChangeElementActivated -= new XEditNet.InterfaceActivationEventHandler(ChangeElementActivated);
                }

                r.Editor.InsertElementActivated += new XEditNet.InterfaceActivationEventHandler(InsertElementActivated);
                r.Editor.ChangeElementActivated += new XEditNet.InterfaceActivationEventHandler(ChangeElementActivated);

                foreach (WidgetPanel p in panels.Values)
                {
                    p.Nested.Editor = r.Editor;
                }

                currentRegion = r;
            }
        }