本文整理汇总了C#中WizardRunKind类的典型用法代码示例。如果您正苦于以下问题:C# WizardRunKind类的具体用法?C# WizardRunKind怎么用?C# WizardRunKind使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WizardRunKind类属于命名空间,在下文中一共展示了WizardRunKind类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RunStarted
public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
{
try
{
OpenxliveComfirmForm form = new OpenxliveComfirmForm();
form.ShowDialog();
if (form.DialogResult == System.Windows.Forms.DialogResult.OK)
{
CreateWithOpenxlive = form.CreateWithOpenxlive;
SolutionName = replacementsDictionary["$projectname$"];
if (CreateWithOpenxlive)
replacementsDictionary.Add("$CreateWithOpenxlive$", "True");
else
replacementsDictionary.Add("$CreateWithOpenxlive$", "False");
}
else
{
throw new WizardCancelledException();
}
}
catch
{
}
}
示例2: RunStarted
public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
{
try
{
// Display a form to the user. The form collects
// input for the custom message.
inputForm = new SolutionSetupForm();
inputForm.ShowDialog();
ProxyName = inputForm.ProxyProjectName;
ServerName = inputForm.ServerProjectName;
ClientName = inputForm.ClientProjectName;
OutputDirectory = string.Format("{0}\\Debug\\", replacementsDictionary["$solutiondirectory$"]);
if (!Directory.Exists(OutputDirectory))
Directory.CreateDirectory(OutputDirectory);
// Add custom parameters.
replacementsDictionary.Add("$proxyname$", ProxyName);
replacementsDictionary.Add("$servername$", ServerName);
replacementsDictionary.Add("$clientname$", ClientName);
replacementsDictionary.Add("$outputdirectory$", OutputDirectory);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
示例3: RunStarted
public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
{
string runSilent;
if (replacementsDictionary.TryGetValue("$runsilent$", out runSilent) && bool.TrueString.Equals(runSilent, StringComparison.OrdinalIgnoreCase))
return;
string wizardData;
if (!replacementsDictionary.TryGetValue("$wizarddata$", out wizardData))
return;
if (string.IsNullOrWhiteSpace(wizardData))
return;
string message;
try
{
XDocument document = XDocument.Parse(wizardData);
message = document.Root.Value;
}
catch (XmlException ex)
{
StringBuilder error = new StringBuilder();
error.AppendLine("Could not parse WizardData element.");
error.AppendLine();
error.Append(ex);
message = error.ToString();
}
MessageBox.Show(message);
}
示例4: RunStarted
public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
{
try
{
_dte = automationObject as EnvDTE.DTE;
_projectName = replacementsDictionary["$safeprojectname$"];
_container = replacementsDictionary["$container$"];
_solutionDir = System.IO.Path.GetDirectoryName(replacementsDictionary["$destinationdirectory$"]);
_templateDir = System.IO.Path.GetDirectoryName(customParams[0] as string);
XamarinFormsNewProjectDialog dialog = new XamarinFormsNewProjectDialog();
dialog.ShowDialog();
_dialogResult = dialog.Result;
if (_dialogResult.Cancelled)
throw new WizardBackoutException();
}
catch (Exception ex)
{
if (Directory.Exists(_solutionDir))
Directory.Delete(_solutionDir, true);
throw;
}
}
示例5: RunStarted
public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
{
DTE dte = automationObject as DTE;
//Get a reference to the Item currently selected in the Solution Explorer
SelectedItem item = dte.SelectedItems.Item(1);
//Check if the $edmxInputFile$ token is already in the replacementDictionnary.
//If it is, it means the file was added through the "Add Code Generation Item..." menu,
//and we don't need to set it here. The token was actually set by the
//Microsoft.Data.Entity.Design.VisualStudio.ModelWizard.AddArtifactGeneratorWizard WizardExtension
//(see the file StarterKitExtension.ItemTemplate.vstemplate in the StarterKitExtension.ItemTemplate project)
if (!replacementsDictionary.ContainsKey("$edmxInputFile$"))
{
ModelChoser frm = new ModelChoser(dte, item);
if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
//Substitute the EDMX filename within the template
replacementsDictionary.Add("$edmxInputFile$", frm.ModelFile);
}
else
{
throw new WizardCancelledException("Action cancelled by user");
}
}
}
示例6: RunStarted
public override void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
{
base.RunStarted(automationObject, replacementsDictionary, runKind, customParams);
var vs = (automationObject as DTE);
this.serviceProvider = new ServiceProvider((Ole.IServiceProvider)vs);
}
示例7: RunStarted
public void RunStarted(object automationObject,
Dictionary<string, string> replacementsDictionary,
WizardRunKind runKind, object[] customParams)
{
string safeprojectname = RootWizardImpl.GlobalParameters.Where(p => p.Key == "$safeprojectname$").First().Value;
replacementsDictionary["$safeprojectname$"] = safeprojectname;
}
示例8: RunStarted
public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
{
_dte = (DTE)automationObject;
_wrongProjectFolder = replacementsDictionary["$destinationdirectory$"];
_solutionFolder = Path.GetDirectoryName(_wrongProjectFolder);
_templatePath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName((string)customParams[0]), ".."));
_solutionName = replacementsDictionary["$safeprojectname$"];
replacementsDictionary.Add("$safesolutionname$", _solutionName);
var dlg = new WizardForm(_solutionName);
if (dlg.ShowDialog() == DialogResult.OK)
{
replacementsDictionary.Add("$connectionstring$", dlg.ConnectinString);
replacementsDictionary.Add("$databasename$", dlg.DatabaseName);
replacementsDictionary.Add("$databaseuser$", dlg.DatabaseUser);
replacementsDictionary.Add("$ormapperclassname$", dlg.ORMapperClassName);
replacementsDictionary.Add("$ormappermodule$", dlg.ORMapperModule);
replacementsDictionary.Add("$schema$", dlg.Schema);
replacementsDictionary.Add("$provider$", dlg.Provider);
}
else
{
throw new WizardCancelledException("Aborted by user");
}
_replacementsDictionary = replacementsDictionary;
}
示例9: RunStarted
public override void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
{
var doc = Helpers.LoadWizardXml(replacementsDictionary);
var ns = Helpers.WizardNamespace;
var model = new OptionsPageModel(doc.Root.Elements(ns + "Options").FirstOrDefault());
var view = new OptionsPageView(model);
var dialog = new BaseDialog { Content = view, Title = model.Title };
if (dialog.ShowModal(Helpers.MainWindow))
{
foreach (var option in model.Options)
{
var selected = option.Selected;
if (selected != null)
{
foreach (var replacement in selected.Replacements)
{
if (replacementsDictionary.MatchesCondition(replacement.Condition))
{
replacementsDictionary[replacement.Name] = replacement.Content;
}
}
}
}
}
else
throw new WizardBackoutException();
}
示例10: RunStarted
public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
{
_dte = automationObject as EnvDTE.DTE;
_viewName = replacementsDictionary["$safeitemname$"];
_viewModelName = $"{_viewName}ViewModel";
_templatesDirectory = Path.GetDirectoryName(customParams[0] as string);
}
示例11: RunStarted
public override void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
{
// This is done to trick NuPattern into using the v4 template when unfolding the v5 template.
// The template is used by NuPattern to identify the toolkit and product elements associated to the template,
// and there can only one template associated to the application
base.RunStarted(automationObject, replacementsDictionary, runKind, ApplicationTemplateWorkaroundHelper.ReplaceCustomParameters(customParams));
}
示例12: RunStarted
public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams) {
DTE2 dte = automationObject as DTE2;
// here we need to show the UI for which file to download
var form = new DownloadZipWindow();
var result = form.ShowDialog();
if (result.HasValue && result.Value) {
// download the file
string file = form.DownloadedFile;
TempDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
if (!Directory.Exists(TempDir)) {
Directory.CreateDirectory(TempDir);
}
// unpack the file in temp
ZipFile.ExtractToDirectory(file, TempDir);
// copy the files to the project directory
var foo = "bar";
}
}
示例13: RunStarted
// Retrieve global replacement parameters
public void RunStarted(object automationObject,
Dictionary<string, string> replacementsDictionary,
WizardRunKind runKind, object[] customParams)
{
// Add custom parameters.
replacementsDictionary.Add("$saferootprojectname$", RootWizard.GlobalDictionary["$saferootprojectname$"]);
}
示例14: RunStarted
public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
{
var timestamp = DateTime.Now.ToString("yyyyMMddHHmmss");
replacementsDictionary["$migrationtimestamp$"] = timestamp;
replacementsDictionary["$migrationclassname$"] = replacementsDictionary["$safeitemname$"];
replacementsDictionary["$migrationfilename$"] = String.Format("{0}_{1}.cs", timestamp, replacementsDictionary["$safeitemname$"]);
}
示例15: RunStarted
public void RunStarted(object automationObject,
Dictionary<string, string> replacementsDictionary,
WizardRunKind runKind, object[] customParams)
{
_dte = automationObject as EnvDTE80.DTE2;
_runKind = runKind;
if(runKind.HasFlag(WizardRunKind.AsNewProject))
{
_solutionDir = replacementsDictionary["$solutiondirectory$"];
_destinationDirectory = replacementsDictionary["$destinationdirectory$"];
}
try
{
// Display a form to the user. The form collects
// input for the custom message.
//inputForm = new UserInputForm();
//inputForm.ShowDialog();
//customMessage = inputForm.get_CustomMessage();
//// Add custom parameters.
//replacementsDictionary.Add("$custommessage$",
// customMessage);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
//Console.Write("Wizard!!!");
}