public void WixDesignerAttached()
		{
			MockTextEditorViewContent view = new MockTextEditorViewContent();
			using (WixDialogDesigner designerAdded = new WixDialogDesigner(view)) {
				view.SecondaryViewContents.Add(designerAdded);
				Assert.IsNotNull(WixDialogDesigner.GetDesigner(view));
			}
		}
 /// <summary>
 /// Gets the WixDialogDesigner from the primary view.
 /// </summary>
 /// <returns>The wix dialog designer view that is attached as a
 /// secondary view; <see langword="null"/> if the primary view
 /// has no such designer attached.</returns>
 public static WixDialogDesigner GetDesigner(IViewContent view)
 {
     foreach (IViewContent secondaryView in view.SecondaryViewContents)
     {
         WixDialogDesigner designer = secondaryView as WixDialogDesigner;
         if (designer != null)
         {
             return(designer);
         }
     }
     return(null);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Opens the specified dialog id into the designer.
        /// </summary>
        static void OpenDialog(string fileName, string dialogId)
        {
            // Open the Wix file.
            IViewContent viewContent = FileService.OpenFile(fileName);

            // Show the designer.
            WixDialogDesigner designer = WixDialogDesigner.GetDesigner(viewContent);

            if (designer != null)
            {
                designer.OpenDialog(dialogId);
            }
            else
            {
                LoggingService.Debug("Could not open Wix dialog designer for: " + fileName);
            }
        }