Exemplo 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);
        }
Exemplo n.º 2
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;
        }