本文整理汇总了C#中PathMaker.Table类的典型用法代码示例。如果您正苦于以下问题:C# Table类的具体用法?C# Table怎么用?C# Table使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Table类属于PathMaker命名空间,在下文中一共展示了Table类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadCommandTransitionDataGridView
public static void LoadCommandTransitionDataGridView(DataGridView gridView, Table table)
{
BindingList<CommandTransitionRow> ctList = CommandTransitionRow.GetRowsFromTable(table);
if (gridView.Columns.Count == 0) {
gridView.AutoGenerateColumns = false;
AddTextBoxColumn(gridView, CommandTransitionRow.OptionColumnName);
AddTextBoxColumn(gridView, CommandTransitionRow.VocabColumnName);
AddTextBoxColumn(gridView, CommandTransitionRow.DTMFColumnName);
AddTextBoxColumn(gridView, CommandTransitionRow.ConditionColumnName);
AddTextBoxColumn(gridView, CommandTransitionRow.ActionColumnName);
AddTextBoxColumn(gridView, CommandTransitionRow.GotoColumnName);
AddStringComboBoxColumn(gridView, CommandTransitionRow.ConfirmColumnName);
LoadComboBoxColumn(gridView, CommandTransitionRow.ConfirmColumnName, confirmValues);
AddTextBoxColumn(gridView, CommandTransitionRow.OptionDateStampColumnName);
AddTextBoxColumn(gridView, CommandTransitionRow.VocabDateStampColumnName);
AddTextBoxColumn(gridView, CommandTransitionRow.DTMFDateStampColumnName);
AddTextBoxColumn(gridView, CommandTransitionRow.ConditionDateStampColumnName);
AddTextBoxColumn(gridView, CommandTransitionRow.ActionDateStampColumnName);
AddTextBoxColumn(gridView, CommandTransitionRow.GotoDateStampColumnName);
AddTextBoxColumn(gridView, CommandTransitionRow.ConfirmDateStampColumnName);
gridView.DefaultValuesNeeded -= new DataGridViewRowEventHandler(OnCommandTransitionDefaultValuesNeeded);
gridView.DefaultValuesNeeded += new DataGridViewRowEventHandler(OnCommandTransitionDefaultValuesNeeded);
ApplyCommonDataGridViewSettings<CommandTransitionRow>(gridView, false);
HideDateStampColumns(gridView);
gridView.Columns[CommandTransitionRow.GotoColumnName].ReadOnly = true;
}
gridView.DataSource = ctList;
}
示例2: OnConnectAddOutput
public override void OnConnectAddOutput(Shadow shadow)
{
base.OnConnectAddOutput(shadow);
Table table = GetTransitions();
// make sure it's not already in there - this can happen with undo/redo
for (int r = 0; r < table.GetNumRows(); r++)
if (table.GetData(r, (int)TableColumns.Transitions.Goto).Equals(shadow.GetUniqueId()))
return;
if (table.IsEmpty())
table = new Table(1, Enum.GetNames(typeof(TableColumns.Transitions)).Length);
else
table.AddRow();
ConnectorShadow connector = shadow as ConnectorShadow;
if (connector != null) {
string label = connector.GetLabelName();
if (label.Length > 0) {
table.SetData(table.GetNumRows() - 1, (int)TableColumns.Transitions.Condition, CommonShadow.GetStringWithNewConnectorLabel("", label));
table.SetData(table.GetNumRows() - 1, (int)TableColumns.Transitions.ConditionDateStamp, DateTime.Today.ToString(Strings.DateColumnFormatString));
}
}
table.SetData(table.GetNumRows() - 1, (int)TableColumns.Transitions.Goto, shadow.GetUniqueId());
table.SetData(table.GetNumRows() - 1, (int)TableColumns.Transitions.GotoDateStamp, DateTime.Today.ToString(Strings.DateColumnFormatString));
SetTransitionsWithoutRemovingOutputsForDeletedTransitions(table);
}
示例3: RedoConfirmationPromptIds
public static int RedoConfirmationPromptIds(ref Table table, string stateId, int startNumber, string promptIdFormat)
{
if (promptIdFormat.Equals(Strings.PromptIdFormatFull) || promptIdFormat.Equals(Strings.PromptIdFormatPartial)) {
string statePrefix = "";
string stateNumber = "";
string stateName = "";
if (stateId != null)
StateShadow.DisectStateIdIntoParts(stateId, out statePrefix, out stateNumber, out stateName);
int nextNum = 1;
for (int row = 0; row < table.GetNumRows(); row++) {
string wording = table.GetData(row, (int)TableColumns.ConfirmationPrompts.Wording);
if (wording == null || wording.Length == 0 || wording.Trim().StartsWith(Strings.CalculatedPromptStartString) || wording.Trim().StartsWith(Strings.PromptTypeMacroStartString))
continue;
string newPromptId;
if (stateId != null) {
if (promptIdFormat.Equals(Strings.PromptIdFormatFull))
newPromptId = stateId + Strings.PromptIdSeparationChar + Strings.DefaultConfirmationPromptLetter + Strings.PromptIdSeparationChar + nextNum.ToString();
else
newPromptId = statePrefix + stateNumber + Strings.PromptIdSeparationChar + Strings.DefaultConfirmationPromptLetter + Strings.PromptIdSeparationChar + nextNum.ToString();
}
else
newPromptId = Strings.GlobalPromptPrefix.ToString () + Strings.PromptIdSeparationChar +
Strings.DefaultConfirmationPromptLetter.ToString() + Strings.PromptIdSeparationChar + nextNum;
if (!table.GetData(row, (int)TableColumns.ConfirmationPrompts.Id).Equals(newPromptId)) {
table.SetData(row, (int)TableColumns.ConfirmationPrompts.Id, newPromptId);
//table.SetData(row, (int)TableColumns.ConfirmationPrompts.IdDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString));
table.SetData(row, (int)TableColumns.ConfirmationPrompts.IdDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());//JDK added
}
nextNum++;
}
return nextNum - 1;
}
else if (promptIdFormat.Equals(Strings.PromptIdFormatNumeric)) {
int nextNum = startNumber;
for (int row = 0; row < table.GetNumRows(); row++) {
string wording = table.GetData(row, (int)TableColumns.ConfirmationPrompts.Wording);
if (wording == null || wording.Length == 0 || wording.Trim().StartsWith(Strings.CalculatedPromptStartString) || wording.Trim().StartsWith(Strings.PromptTypeMacroStartString))
continue;
table.SetData(row, (int)TableColumns.ConfirmationPrompts.Id, nextNum.ToString());
//table.SetData(row, (int)TableColumns.ConfirmationPrompts.IdDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString));
table.SetData(row, (int)TableColumns.ConfirmationPrompts.IdDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());//JDK added
nextNum++;
}
return nextNum - startNumber;
}
else
return 0;
}
示例4: GetRowsFromTable
public static BindingList<ChangeLogRow> GetRowsFromTable(Table table)
{
BindingList<ChangeLogRow> list = new BindingList<ChangeLogRow>();
for (int row = 0; row < table.GetNumRows(); row++) {
ChangeLogRow cl = new ChangeLogRow();
cl.Date = table.GetData(row, (int)TableColumns.ChangeLog.Date);
cl.Version = table.GetData(row, (int)TableColumns.ChangeLog.Version);
cl.Details = table.GetData(row, (int)TableColumns.ChangeLog.Details);
cl.Author = table.GetData(row, (int)TableColumns.ChangeLog.Author);
cl.Highlight = table.GetData(row, (int)TableColumns.ChangeLog.Highlight);
list.Add(cl);
}
return list;
}
示例5: GetTableFromRows
public static Table GetTableFromRows(BindingList<NameValuePairRow> rows)
{
Table table = new Table(rows.Count, Enum.GetNames(typeof(TableColumns.NameValuePairs)).Length);
int row = 0;
foreach (NameValuePairRow nv in rows) {
table.SetData(row, (int)TableColumns.NameValuePairs.Name, nv.Name);
table.SetData(row, (int)TableColumns.NameValuePairs.Value, nv.Value);
table.SetData(row, (int)TableColumns.NameValuePairs.NameDateStamp, nv.NameDateStamp);
table.SetData(row, (int)TableColumns.NameValuePairs.ValueDateStamp, nv.ValueDateStamp);
row++;
}
return table;
}
示例6: GetRowsFromTable
public static BindingList<NameValuePairRow> GetRowsFromTable(Table table)
{
BindingList<NameValuePairRow> list = new BindingList<NameValuePairRow>();
for (int r = 0; r < table.GetNumRows(); r++) {
NameValuePairRow nv = new NameValuePairRow();
nv.Name = table.GetData(r, (int)TableColumns.NameValuePairs.Name);
nv.Value = table.GetData(r, (int)TableColumns.NameValuePairs.Value);
nv.NameDateStamp = table.GetData(r, (int)TableColumns.NameValuePairs.NameDateStamp);
nv.ValueDateStamp = table.GetData(r, (int)TableColumns.NameValuePairs.ValueDateStamp);
list.Add(nv);
}
return list;
}
示例7: GetRowsFromTable
public static BindingList<PromptRow> GetRowsFromTable(Table table)
{
BindingList<PromptRow> list = new BindingList<PromptRow>();
for (int row = 0; row < table.GetNumRows(); row++) {
PromptRow pt = new PromptRow();
pt.Condition = table.GetData(row, (int)TableColumns.Prompts.Condition);
pt.Wording = table.GetData(row, (int)TableColumns.Prompts.Wording);
pt.Id = table.GetData(row, (int)TableColumns.Prompts.Id);
pt.ConditionDateStamp = table.GetData(row, (int)TableColumns.Prompts.ConditionDateStamp);
pt.WordingDateStamp = table.GetData(row, (int)TableColumns.Prompts.WordingDateStamp);
pt.IdDateStamp = table.GetData(row, (int)TableColumns.Prompts.IdDateStamp);
list.Add(pt);
}
return list;
}
示例8: GetRowsFromTable
public static BindingList<MaxHandlingRow> GetRowsFromTable(Table table)
{
BindingList<MaxHandlingRow> list = new BindingList<MaxHandlingRow>();
for (int row = 0; row < table.GetNumRows(); row++) {
MaxHandlingRow mh = new MaxHandlingRow();
mh.Condition = table.GetData(row, (int)TableColumns.MaxHandling.Condition);
mh.Count = table.GetData(row, (int)TableColumns.MaxHandling.Count);
mh.Action = table.GetData(row, (int)TableColumns.MaxHandling.Action);
mh.Goto = table.GetData(row, (int)TableColumns.MaxHandling.Goto);
mh.CountDateStamp = table.GetData(row, (int)TableColumns.MaxHandling.CountDateStamp);
mh.ActionDateStamp = table.GetData(row, (int)TableColumns.MaxHandling.ActionDateStamp);
mh.GotoDateStamp = table.GetData(row, (int)TableColumns.MaxHandling.GotoDateStamp);
list.Add(mh);
}
return list;
}
示例9: GetTableFromRows
public static Table GetTableFromRows(BindingList<ChangeLogRow> rows)
{
Table table = new Table(rows.Count, Enum.GetNames(typeof(TableColumns.ChangeLog)).Length);
int row = 0;
foreach (ChangeLogRow cl in rows) {
table.SetData(row, (int)TableColumns.ChangeLog.Date, cl.Date);
table.SetData(row, (int)TableColumns.ChangeLog.Version, cl.Version);
table.SetData(row, (int)TableColumns.ChangeLog.Details, cl.Details);
table.SetData(row, (int)TableColumns.ChangeLog.Author, cl.Author);
table.SetData(row, (int)TableColumns.ChangeLog.Highlight, cl.Highlight);
row++;
}
return table;
}
示例10: GetRowsFromTable
public static BindingList<ConfirmationPromptRow> GetRowsFromTable(Table table)
{
BindingList<ConfirmationPromptRow> list = new BindingList<ConfirmationPromptRow>();
for (int row = 0; row < table.GetNumRows(); row++) {
ConfirmationPromptRow cp = new ConfirmationPromptRow();
cp.Option = table.GetData(row, (int)TableColumns.ConfirmationPrompts.Option);
cp.Condition = table.GetData(row, (int)TableColumns.ConfirmationPrompts.Condition);
cp.Wording = table.GetData(row, (int)TableColumns.ConfirmationPrompts.Wording);
cp.Id = table.GetData(row, (int)TableColumns.ConfirmationPrompts.Id);
cp.OptionDateStamp = table.GetData(row, (int)TableColumns.ConfirmationPrompts.OptionDateStamp);
cp.ConditionDateStamp = table.GetData(row, (int)TableColumns.ConfirmationPrompts.ConditionDateStamp);
cp.WordingDateStamp = table.GetData(row, (int)TableColumns.ConfirmationPrompts.WordingDateStamp);
cp.IdDateStamp = table.GetData(row, (int)TableColumns.ConfirmationPrompts.IdDateStamp);
list.Add(cp);
}
return list;
}
示例11: GetRowsFromTable
public static BindingList<TransitionRow> GetRowsFromTable(Table table)
{
BindingList<TransitionRow> list = new BindingList<TransitionRow>();
for (int row = 0; row < table.GetNumRows(); row++) {
TransitionRow ct = new TransitionRow();
ct.Action = table.GetData(row, (int)TableColumns.Transitions.Action);
ct.Condition = table.GetData(row, (int)TableColumns.Transitions.Condition);
// stash the real goto data in a hidden column
ct.GotoData_TreatAsDateStamp = table.GetData(row, (int)TableColumns.Transitions.Goto);
Shadow targetShadow = Common.GetGotoTargetFromData(ct.GotoData_TreatAsDateStamp);
if (targetShadow == null)
ct.Goto = ct.GotoData_TreatAsDateStamp;
else
ct.Goto = targetShadow.GetGotoName();
ct.ActionDateStamp = table.GetData(row, (int)TableColumns.Transitions.ActionDateStamp);
ct.ConditionDateStamp = table.GetData(row, (int)TableColumns.Transitions.ConditionDateStamp);
ct.GotoDateStamp = table.GetData(row, (int)TableColumns.Transitions.GotoDateStamp);
list.Add(ct);
}
return list;
}
示例12: GetRowsFromTable
public static BindingList<NameValuePairRow> GetRowsFromTable(Table table)
{
BindingList<NameValuePairRow> list = new BindingList<NameValuePairRow>();
Boolean newStartStep = false;
//Version 1.6.1.13+ uses a new set of fields for init data NV pairs - Notes column was added JDK 08-25-2014
if (table.GetNumColumns() >= 5)
{
newStartStep = true;
}
if (newStartStep)
{
for (int r = 0; r < table.GetNumRows(); r++)
{
NameValuePairRow nv = new NameValuePairRow();
nv.Name = table.GetData(r, (int)TableColumns.NameValuePairs.Name);
nv.Value = table.GetData(r, (int)TableColumns.NameValuePairs.Value);
nv.Notes = table.GetData(r, (int)TableColumns.NameValuePairs.Notes);
nv.NameDateStamp = table.GetData(r, (int)TableColumns.NameValuePairs.NameDateStamp);
nv.ValueDateStamp = table.GetData(r, (int)TableColumns.NameValuePairs.ValueDateStamp);
nv.NotesDateStamp = table.GetData(r, (int)TableColumns.NameValuePairs.NotesDateStamp);
list.Add(nv);
}
} else {
for (int r = 0; r < table.GetNumRows(); r++)
{
NameValuePairRow nv = new NameValuePairRow();
nv.Name = table.GetData(r, (int)TableColumns.NameValuePairs.Name);
nv.Value = table.GetData(r, (int)TableColumns.NameValuePairs.Value);
nv.Notes = "";
nv.NameDateStamp = table.GetData(r, (int)TableColumns.NameValuePairs.NameDateStamp);
nv.ValueDateStamp = table.GetData(r, (int)TableColumns.NameValuePairs.ValueDateStamp);
nv.NotesDateStamp = "";
list.Add(nv);
}
}
return list;
}
示例13: LoadCommandTransitionDataGridView
public static void LoadCommandTransitionDataGridView(DataGridView gridView, Table table)
{
BindingList<CommandTransitionRow> ctList = CommandTransitionRow.GetRowsFromTable(table);
string myDefaultConfirmValue = PathMaker.LookupStartShadow().GetDefaultConfirmMode();
if (gridView.Columns.Count == 0) {
gridView.AutoGenerateColumns = false;
AddTextBoxColumn(gridView, CommandTransitionRow.OptionColumnName);
AddTextBoxColumn(gridView, CommandTransitionRow.VocabColumnName);
AddTextBoxColumn(gridView, CommandTransitionRow.DTMFColumnName);
AddTextBoxColumn(gridView, CommandTransitionRow.ConditionColumnName);
AddTextBoxColumn(gridView, CommandTransitionRow.ActionColumnName);
AddTextBoxColumn(gridView, CommandTransitionRow.GotoColumnName);
AddStringComboBoxColumn(gridView, CommandTransitionRow.ConfirmColumnName);
//LoadComboBoxColumn(gridView, CommandTransitionRow.ConfirmColumnName, confirmValues);
LoadComboBoxColumn(gridView, CommandTransitionRow.ConfirmColumnName, confirmValues, PathMaker.LookupStartShadow().GetDefaultConfirmMode());//JDK - need to find a way to set display default here - it DOES NOT work with Never as the default value
AddTextBoxColumn(gridView, CommandTransitionRow.OptionDateStampColumnName);
AddTextBoxColumn(gridView, CommandTransitionRow.VocabDateStampColumnName);
AddTextBoxColumn(gridView, CommandTransitionRow.DTMFDateStampColumnName);
AddTextBoxColumn(gridView, CommandTransitionRow.ConditionDateStampColumnName);
AddTextBoxColumn(gridView, CommandTransitionRow.ActionDateStampColumnName);
AddTextBoxColumn(gridView, CommandTransitionRow.GotoDateStampColumnName);
AddTextBoxColumn(gridView, CommandTransitionRow.ConfirmDateStampColumnName);
gridView.DefaultValuesNeeded -= new DataGridViewRowEventHandler(OnCommandTransitionDefaultValuesNeeded);
gridView.DefaultValuesNeeded += new DataGridViewRowEventHandler(OnCommandTransitionDefaultValuesNeeded);
//gridView.RowsAdded - new DataGridViewCellFormattingEventHandler(OnCellDropBoxCellSettingDefault);//JDK
//gridView.RowsAdded -= new DataGridViewRowsAddedEventHandler(OnCellDropBoxCellSettingDefault);//JDK
//gridView.DefaultValuesNeeded += new DataGridViewRowEventHandler(OnCellDropBoxCellSettingDefault);//JDK
ApplyCommonDataGridViewSettings<CommandTransitionRow>(gridView, false);
HideDateStampColumns(gridView);
gridView.Columns[CommandTransitionRow.GotoColumnName].ReadOnly = true;
}
gridView.DataSource = ctList;
}
示例14: SetTransitions
internal void SetTransitions(Table table)
{
SetTransitionsWithoutRemovingOutputsForDeletedTransitions(table);
RemoveOutputsIfNotInTableColumn(table, (int)TableColumns.Transitions.Goto);
}
示例15: SetTransitionsWithoutRemovingOutputsForDeletedTransitions
/**
* Because SetTransitions calls RemoveOutputsForDeletedTransitions, it can result in
* a shape delete. When it's being called because of a connector delete, we can end
* up with an error because we try to delete the same shape twice. This avoids that.
**/
private void SetTransitionsWithoutRemovingOutputsForDeletedTransitions(Table table)
{
List<Connect> connects = GetShapeOutputs();
for (int r = 0; r < table.GetNumRows(); r++) {
string uid = table.GetData(r, (int)TableColumns.Transitions.Goto);
ConnectorShadow shadow = PathMaker.LookupShadowByUID(uid) as ConnectorShadow;
if (shadow != null)
shadow.SetLabelName(table.GetData(r, (int)TableColumns.Transitions.Condition));
}
Common.SetCellTable(shape, ShapeProperties.Transitions, table);
}