void InjectDialogs(string name, ManagedDialogs dialogs) { if (dialogs.Any()) { var dialogsInfo = new StringBuilder(); foreach (var item in dialogs) { if (!this.DefaultRefAssemblies.Contains(item.Assembly.Location)) { this.DefaultRefAssemblies.Add(item.Assembly.Location); } var info = GetDialogInfo(item); ValidateDialogInfo(info); dialogsInfo.Append(info + "\n"); } this.AddProperty(new Property(name, dialogsInfo.ToString().Trim())); } }
void DemoPlay(ManagedDialogs dialogs, string demoProperties = "") { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); IsDemoMode = true; var resourcesMsi = BuildUiPlayerResources(); var dummySession = Installer.OpenPackage(resourcesMsi, true); foreach (var pair in demoProperties.ToDictionary()) { dummySession[pair.Key] = pair.Value; } Runtime = new MsiRuntime(dummySession); Dialogs = dialogs; shellView = new ShellView(); GoNext(); shellView.ShowDialog(); }
/// <summary> /// Plays the specified dialogs in demo mode. /// </summary> /// <param name="dialogs">The dialogs.</param> public static void Play(ManagedDialogs dialogs) { new UIShell().DemoPlay(dialogs); }
/// <summary> /// Initializes a new instance of the <see cref="ManagedUI"/> class. /// </summary> public ManagedUI() { InstallDialogs = new ManagedDialogs(); ModifyDialogs = new ManagedDialogs(); }