예제 #1
0
		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;
		}
예제 #2
0
		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");
		}
예제 #3
0
//		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 ();
		}
예제 #4
0
		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 ();
		}
예제 #5
0
		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");
		}
예제 #6
0
		public DesignerSerializer (DesignerHost hst)
		{
			host = hst;
			document = host.RootDocument;
		}