コード例 #1
0
        private static Form GetMdiForm(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);
            XEditNetChildForm form = new XEditNetChildForm(userControl);

            return(form);
        }
コード例 #2
0
        private void ChildClosing(object sender, CancelEventArgs e)
        {
            XEditNetChildForm child = (XEditNetChildForm)sender;

            if (!ConfirmSave(child.Editor, (FileInfo)((Form)child).Tag))
            {
                e.Cancel = true;
            }
        }
コード例 #3
0
        private static Form GetMdiForm(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);
            XEditNetChildForm form=new XEditNetChildForm(userControl);

            return form;
        }