本文整理汇总了C#中Template.CreateViewTemplate方法的典型用法代码示例。如果您正苦于以下问题:C# Template.CreateViewTemplate方法的具体用法?C# Template.CreateViewTemplate怎么用?C# Template.CreateViewTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Template
的用法示例。
在下文中一共展示了Template.CreateViewTemplate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: mnuSaveAsTemplate_Click
/// <summary>
/// Handles the Click event of the 'Save as Template' for a view
/// </summary>
/// <param name="sender">Object that fired the event</param>
/// <param name="e">.NET supplied event parameters</param>
void mnuSaveAsTemplate_Click(object sender, EventArgs e)
{
if (((System.Windows.Forms.ToolStripItem)(sender)).Text.Contains("Quick"))
{
Template template = new Template(this.mainForm.mediator);
template.CreateProjectTemplate
(
this.projectTree.TopNode.Text,
string.Format(@"Quick saved: {0}", DateTime.Now.ToString("dddd, MMMM dd, yyyy h:mm:ss tt")),
string.Format("{0} {1}", this.projectTree.TopNode.Text, DateTime.Now.ToString("yyyyMMddhmmsstt"))
);
this.mainForm.mediator.ProjectExplorer.UpdateTemplates();
}
else if (((System.Windows.Forms.ToolStripItem)(sender)).Tag is ProjectNode)
{
mainForm.TemplateNode = "Projects";
Dialogs.AddProjectTemplateDialog dialog = new Epi.Windows.MakeView.Dialogs.AddProjectTemplateDialog(mainForm);
dialog.ShowDialog();
if (dialog.DialogResult == DialogResult.OK)
{
Template template = new Template(this.mainForm.mediator);
template.CreateProjectTemplate(dialog.TemplateName.ToString(), dialog.TemplateDescription.ToString());
this.mainForm.mediator.ProjectExplorer.UpdateTemplates();
}
}
else if (((System.Windows.Forms.ToolStripItem)(sender)).Tag is ViewNode)
{
mainForm.TemplateNode = "Forms";
Dialogs.AddTemplateDialog dialog = new Epi.Windows.MakeView.Dialogs.AddTemplateDialog(mainForm);
dialog.ShowDialog();
if (dialog.DialogResult == DialogResult.OK)
{
Template template = new Template(this.mainForm.mediator);
template.CreateViewTemplate(dialog.TemplateName, ((Epi.Windows.Controls.ViewNode)(rightClickedNode)).View);
this.mainForm.mediator.ProjectExplorer.UpdateTemplates();
}
}
else if (((System.Windows.Forms.ToolStripItem)(sender)).Tag is PageNode)
{
mainForm.TemplateNode = "Pages";
Dialogs.AddTemplateDialog dialog = new Epi.Windows.MakeView.Dialogs.AddTemplateDialog(mainForm);
dialog.ShowDialog();
if (dialog.DialogResult == DialogResult.OK)
{
Template template = new Template(this.mainForm.mediator);
template.CreatePageTemplate(dialog.TemplateName.ToString());
this.mainForm.mediator.ProjectExplorer.UpdateTemplates();
}
}
}