本文整理汇总了C#中Template.GetProjectTable方法的典型用法代码示例。如果您正苦于以下问题:C# Template.GetProjectTable方法的具体用法?C# Template.GetProjectTable怎么用?C# Template.GetProjectTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Template
的用法示例。
在下文中一共展示了Template.GetProjectTable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProjectFromTemplateDialog
public ProjectFromTemplateDialog(string selectedTemplatePath)
{
SelectedTemplatePath = selectedTemplatePath;
InitializeComponent();
project = new Project();
metaDbInfo = new DbDriverInfo();
collectedDataDBInfo = new DbDriverInfo();
projectTemplateListView.Dock = DockStyle.None;
projectTemplateListView.View = System.Windows.Forms.View.Details;
projectTemplateListView.Sorting = System.Windows.Forms.SortOrder.Ascending;
projectTemplateListView.GridLines = false;
projectTemplateListView.Scrollable = true;
projectTemplateListView.FullRowSelect = true;
projectTemplateListView.AllowColumnReorder = true;
projectTemplateListView.HideSelection = false;
ColumnHeader templateName = new ColumnHeader();
templateName.Text = "Template Name";
templateName.Width = -1;
ColumnHeader creationDate = new ColumnHeader();
creationDate.Text = "Creation Date";
creationDate.Width = -1;
ColumnHeader description = new ColumnHeader();
description.Text = "Description";
description.Width = -1;
ColumnHeader path = new ColumnHeader();
path.Text = "Path";
path.Width = -1;
projectTemplateListView.Columns.AddRange(
new ColumnHeader[]
{
templateName,
creationDate,
description,
path
});
lvwColumnSorter = new ListViewColumnSorter();
projectTemplateListView.ListViewItemSorter = lvwColumnSorter;
Epi.Template template = new Template();
projectTable = template.GetProjectTable("Projects");
foreach (DataRow row in template.GetProjectTable("Forms").Rows)
{
projectTable.Rows.Add(row.ItemArray);
}
foreach (DataRow row in projectTable.Rows)
{
string itemText = row["TemplateName"].ToString();
if(string.IsNullOrEmpty(itemText) == false)
{
ListViewItem item = new ListViewItem(itemText, 0);
string subItemText = row["TemplateCreateDate"].ToString();
ListViewItem.ListViewSubItem subItem = new ListViewItem.ListViewSubItem();
subItem.Text = subItemText;
subItem.Tag = System.DateTime.Now;
item.SubItems.Add(subItem);
item.SubItems.Add("");
item.SubItems.Add(row["TemplatePath"].ToString());
item.Tag = row["TemplatePath"].ToString();
projectTemplateListView.Items.Add(item);
}
}
}