public void RunStarted(object automationObject, Dictionary <string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams) { ProjectMetadata model = new ProjectMetadata(); wizardPage = new WizardWindow(model); Nullable <bool> dialogCompleted = wizardPage.ShowDialog(); if (dialogCompleted == true) { replacementsDictionary.Add("$generateExampleImplementation$", model.GenerateExample ? "true" : "false"); if (model.UseLogging == Logging.None) { replacementsDictionary.Add("$logging$", "none"); } else if (model.UseLogging == Logging.TraceListener) { replacementsDictionary.Add("$logging$", "tracelistener"); } else if (model.UseLogging == Logging.Slab) { replacementsDictionary.Add("$logging$", "slab"); } if (model.Protocol == Protocol.UDP) { replacementsDictionary.Add("$protocol$", "UDP"); replacementsDictionary.Add("$protocolCamelCase$", "Udp"); } else if (model.Protocol == Protocol.TCP) { replacementsDictionary.Add("$protocol$", "TCP"); replacementsDictionary.Add("$protocolCamelCase$", "Tcp"); } } else { throw new WizardCancelledException(); } }
public WizardWindow(ProjectMetadata model) { InitializeComponent(); this.DataContext = model; this.Owner = Application.Current.MainWindow; }