protected override void LoadFromDocument(HtmlDocument document) { WebFormsEditor editor = base.Editor as WebFormsEditor; IDocumentDesignerHost service = (IDocumentDesignerHost) base.ServiceProvider.GetService(typeof(IDocumentDesignerHost)); foreach (RegisterDirective directive in ((WebFormsDocument) service.Document).RegisterDirectives) { string tagPrefix = directive.TagPrefix; if (tagPrefix.Length > 0) { editor.RegisterNamespace(tagPrefix); } } string html = ((WebFormsDocument) document).Html; if (html != null) { base.Editor.LoadHtml(html, document.ProjectItem.Url); } }
void IDocumentView.LoadFromDocument(Document document) { this._document = (Microsoft.Matrix.Packages.Web.Documents.HtmlDocument) document; this.EnsureEditor(); ((IDocumentDesignerHost) this._serviceProvider.GetService(typeof(IDocumentDesignerHost))).BeginLoad(); this.OnBeforeLoadFromDocument(this._document); this.LoadFromDocument(this._document); this._commandManager.UpdateCommands(false); this._isDirty = true; this.OnDocumentChanged(EventArgs.Empty); }
public HtmlDocumentStorage(HtmlDocument owner) : base(owner) { }
Document IDocumentFactory.CreateDocument(DocumentProjectItem projectItem, bool readOnly, DocumentMode mode, DocumentViewType initialView, out DocumentWindow documentWindow, out DesignerHost designerHost) { if (projectItem == null) { throw new ArgumentNullException("projectItem"); } Document document = new HtmlDocument(projectItem); designerHost = new DesignerHost(document); document.Load(readOnly); if (initialView == DocumentViewType.Default) { initialView = WebPackage.Instance.WebDefaultView; } documentWindow = new HtmlDocumentWindow(designerHost, document, initialView); return document; }