public DocumentSerializer (DesignerHost hst) { host = hst; document = host.RootDocument; designerContext = String.Empty; //designerContext = ((host.GetDesigner (host.RootComponent) as RootDesigner).GetView (ViewTechnology.Default) as RootDesignerView).DesignerContext; }
public DesignTimeParser (DesignerHost host, Document document) { this.host = host; this.document = document; refMan = host.GetService(typeof(IWebFormReferenceManager)) as IWebFormReferenceManager; if (refMan == null) throw new Exception ("Could not get IWebFormReferenceManager from host"); }
// public void Load (Stream file, string fileName) // { // using (TextReader reader = new StreamReader (file)) // { // Load (reader.ReadToEnd (), fileName); // } // } public void LoadDocument () { if (activated || RootComponent != null) throw new InvalidOperationException ("You must reset the host before loading another file."); loading = true; this.Container.Add (new WebFormPage()); this.rootDocument = new Document ((Control)rootComponent, this); //rootDocument.Changed += new EventHandler (Document_OnChanged); serializer = new DocumentSerializer (this); designerSerializer = new DesignerSerializer (this); loading = false; OnLoadComplete (); }
public void NewFile () { if (activated || RootComponent != null) throw new InvalidOperationException ("You must reset the host before loading another file."); loading = true; this.Container.Add (new WebFormPage ()); this.rootDocument = new Document ((Control)rootComponent, this, "New Document"); loading = false; OnLoadComplete (); }
internal void SetRootComponent (IComponent rootComponent) { this.rootComponent = rootComponent; if (rootComponent == null) { rootDocument = null; return; } if (!(rootComponent is Control)) throw new InvalidOperationException ("The root component must be a Control"); }
public DesignerSerializer (DesignerHost hst) { host = hst; document = host.RootDocument; }