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);
        }
        public UserControl GetEditorRegion(XmlDocument doc)
        {
            if (profile == null)
            {
                return(null);
            }

            return(profile.GetEditorRegion(doc));
        }