public override void BeginLoad(IDesignerLoaderHost host)
		{
			// Check dialog id.
			if (designer.DialogId == null) {
				throw new FormsDesignerLoadException(StringParser.Parse("${res:ICSharpCode.WixBinding.WixDialogDesigner.NoDialogSelectedInDocumentMessage}"));
			}
			
			// Get dialog element.
			WixDocument document = CreateWixDocument();
			document.LoadXml(designer.GetDocumentXml());
			wixDialog = document.GetDialog(designer.DialogId, new WorkbenchTextFileReader());
			if (wixDialog == null) {
				throw new FormsDesignerLoadException(String.Format(StringParser.Parse("${res:ICSharpCode.WixBinding.DialogDesignerGenerator.DialogIdNotFoundMessage}"), designer.DialogId));
			}
			
			host.AddService(typeof(ComponentSerializationService), new CodeDomComponentSerializationService((IServiceProvider)host));
			host.AddService(typeof(INameCreationService), new XmlDesignerLoader.NameCreationService(host));
			host.AddService(typeof(IDesignerSerializationService), new DesignerSerializationService(host));

			base.BeginLoad(host);
		}
예제 #2
0
        public override void BeginLoad(IDesignerLoaderHost host)
        {
            // Check dialog id.
            if (designer.DialogId == null)
            {
                throw new FormsDesignerLoadException(StringParser.Parse("${res:ICSharpCode.WixBinding.WixDialogDesigner.NoDialogSelectedInDocumentMessage}"));
            }

            // Get dialog element.
            WixDocument document = CreateWixDocument();

            document.LoadXml(designer.GetDocumentXml());
            wixDialog = document.GetDialog(designer.DialogId, new WorkbenchTextFileReader());
            if (wixDialog == null)
            {
                throw new FormsDesignerLoadException(String.Format(StringParser.Parse("${res:ICSharpCode.WixBinding.DialogDesignerGenerator.DialogIdNotFoundMessage}"), designer.DialogId));
            }

            host.AddService(typeof(ComponentSerializationService), new CodeDomComponentSerializationService((IServiceProvider)host));
            host.AddService(typeof(INameCreationService), new XmlDesignerLoader.NameCreationService(host));
            host.AddService(typeof(IDesignerSerializationService), new DesignerSerializationService(host));

            base.BeginLoad(host);
        }
예제 #3
0
		void GetDialogElement()
		{
			WixDocument document = CreateWixDocument();
			document.LoadXml(designer.GetDocumentXml());
			wixDialog = document.CreateWixDialog(designer.DialogId, new WorkbenchTextFileReader());
		}
		public void SetUpFixture()
		{
			doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			dialog = doc.CreateWixDialog("MissingDialog", new MockTextFileReader());
		}
		public void SetUpFixture()
		{
			doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			dialog = doc.GetDialog("MissingDialog");
		}