本文整理汇总了C#中ColumnValue类的典型用法代码示例。如果您正苦于以下问题:C# ColumnValue类的具体用法?C# ColumnValue怎么用?C# ColumnValue使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ColumnValue类属于命名空间,在下文中一共展示了ColumnValue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public override CommandResultCode Execute(IExecutionContext context, CommandArguments args)
{
ISettingsHandler handler = Application as ISettingsHandler;
if (handler == null) {
Error.WriteLine("The application doesn't support settings.");
return CommandResultCode.ExecutionFailed;
}
if (args.MoveNext())
return CommandResultCode.SyntaxError;
VarColumns[0].ResetWidth();
VarColumns[1].ResetWidth();
TableRenderer table = new TableRenderer(VarColumns, Out);
table.EnableHeader = true;
table.EnableFooter = true;
foreach(KeyValuePair<string, string> setting in handler.Settings) {
if (setting.Key == ApplicationSettings.SpecialLastCommand)
continue;
ColumnValue[] row = new ColumnValue[4];
row[0] = new ColumnValue(setting.Key);
row[1] = new ColumnValue(setting.Value);
table.AddRow(row);
}
table.CloseTable();
Error.WriteLine();
return CommandResultCode.Success;
}
示例2: Execute
public override CommandResultCode Execute(IExecutionContext context, CommandArguments args)
{
PropertyRegistry properties = Properties;
if (properties == null) {
Application.Error.WriteLine("the current context does not support properties.");
return CommandResultCode.ExecutionFailed;
}
if (args.MoveNext()) {
string name = args.Current;
PropertyHolder holder = properties.GetProperty(name);
if (holder == null)
return CommandResultCode.ExecutionFailed;
PrintDescription(name, holder, Application.Error);
return CommandResultCode.Success;
}
ProperiesColumns[0].ResetWidth();
ProperiesColumns[1].ResetWidth();
TableRenderer table = new TableRenderer(ProperiesColumns, Application.Out);
foreach(KeyValuePair<string, PropertyHolder> entry in properties) {
ColumnValue[] row = new ColumnValue[3];
PropertyHolder holder = entry.Value;
row[0] = new ColumnValue(entry.Key);
row[1] = new ColumnValue(holder.Value);
row[2] = new ColumnValue(holder.ShortDescription);
table.AddRow(row);
}
table.CloseTable();
return CommandResultCode.Success;
}
示例3: SetColumns
/// <summary>
/// Recursive SetColumns method for data pinning. This populates the buffer and
/// calls the inherited SetColumns method.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">
/// The table to set the columns in. An update should be prepared.
/// </param>
/// <param name="columnValues">
/// Column values to set.
/// </param>
/// <param name="nativeColumns">
/// Structures to put the pinned data in.
/// </param>
/// <param name="i">Offset of this object in the array.</param>
/// <returns>An error code.</returns>
internal override unsafe int SetColumns(JET_SESID sesid, JET_TABLEID tableid, ColumnValue[] columnValues, NATIVE_SETCOLUMN* nativeColumns, int i)
{
if (null != this.Value)
{
fixed (void* buffer = this.Value)
{
return this.SetColumns(
sesid, tableid, columnValues, nativeColumns, i, buffer, checked(this.Value.Length * sizeof(char)), true);
}
}
return this.SetColumns(sesid, tableid, columnValues, nativeColumns, i, null, 0, false);
}
示例4: Execute
public override CommandResultCode Execute(IExecutionContext context, CommandArguments args)
{
Columns[0].ResetWidth();
Columns[1].ResetWidth();
TableRenderer table = new TableRenderer(Columns, Out);
foreach(KeyValuePair<string, string> alias in Application.Commands.Aliases) {
ColumnValue[] row = new ColumnValue[2];
row[0] = new ColumnValue(alias.Key);
row[1] = new ColumnValue(alias.Value);
table.AddRow(row);
}
table.CloseTable();
return CommandResultCode.Success;
}
示例5: Add
public void Add(GeneralItem generalItem)
{
try {
ColumnValue id = new ColumnValue () { Item1 = "id", Item2 = generalItem.Id.ToString() };
ColumnValue name = new ColumnValue () { Item1 = "name", Item2 = generalItem.Name };
ColumnValue iconId = new ColumnValue () { Item1 = "iconId", Item2 = generalItem.IconId.ToString() };
List<ColumnValue> columns = new List<ColumnValue> ();
columns.Add (id);
columns.Add (name);
columns.Add (iconId);
this.Insert (columns);
} catch (MySqlException ex) {
switch (ex.Number) {
case 0:
throw new DatabaseException ("Cannot connect to server. Contact administrator", ex);
case 1045:
throw new DatabaseException ("Invalid username/password, please try again", ex);
default:
throw new DatabaseException (ex.Message, ex);
}
}
}
示例6: SetStatusFieldValue
/// <summary>
/// This is a convenience method that allows direct modification of the value of the record's Scope_.Status field.
/// </summary>
public void SetStatusFieldValue(ColumnValue val)
{
this.SetValue(val, TableUtils.StatusColumn);
}
示例7: SetSiteZipFieldValue
/// <summary>
/// This is a convenience method that allows direct modification of the value of the record's VwSite_.SiteZip field.
/// </summary>
public void SetSiteZipFieldValue(string val)
{
ColumnValue cv = new ColumnValue(val);
this.SetValue(cv, TableUtils.SiteZipColumn);
}
示例8: SetCreatedByFieldValue
/// <summary>
/// This is a convenience method that allows direct modification of the value of the record's Scope_.CreatedBy field.
/// </summary>
public void SetCreatedByFieldValue(string val)
{
ColumnValue cv = new ColumnValue(val);
this.SetValue(cv, TableUtils.CreatedByColumn);
}
示例9: SetTotalFieldValue
/// <summary>
/// This is a convenience method that allows direct modification of the value of the record's VwPropSBondBudgetDetail_.Total field.
/// </summary>
public void SetTotalFieldValue(long val)
{
ColumnValue cv = new ColumnValue(val);
this.SetValue(cv, TableUtils.TotalColumn);
}
示例10: Setsub_categoryFieldValue
/// <summary>
/// This is a convenience method that allows direct modification of the value of the record's VwPropSBondBudgetDetail_.sub_category field.
/// </summary>
public void Setsub_categoryFieldValue(string val)
{
ColumnValue cv = new ColumnValue(val);
this.SetValue(cv, TableUtils.sub_categoryColumn);
}
示例11: SetParentIDFieldValue
/// <summary>
/// This is a convenience method that allows direct modification of the value of the record's VwPropSBondBudgetDetail_.ParentID field.
/// </summary>
public void SetParentIDFieldValue(long val)
{
ColumnValue cv = new ColumnValue(val);
this.SetValue(cv, TableUtils.ParentIDColumn);
}
示例12: SetID0FieldValue
/// <summary>
/// This is a convenience method that allows direct modification of the value of the record's VwPropSBondBudgetDetail_.ID field.
/// </summary>
public void SetID0FieldValue(long val)
{
ColumnValue cv = new ColumnValue(val);
this.SetValue(cv, TableUtils.ID0Column);
}
示例13: SetScopeDescriptionFieldValue
/// <summary>
/// This is a convenience method that allows direct modification of the value of the record's Scope_.ScopeDescription field.
/// </summary>
public void SetScopeDescriptionFieldValue(ColumnValue val)
{
this.SetValue(val, TableUtils.ScopeDescriptionColumn);
}
示例14: SetLastEditDateFieldValue
/// <summary>
/// This is a convenience method that allows direct modification of the value of the record's Scope_.LastEditDate field.
/// </summary>
public void SetLastEditDateFieldValue(DateTime val)
{
ColumnValue cv = new ColumnValue(val);
this.SetValue(cv, TableUtils.LastEditDateColumn);
}
示例15: SetLastEditByIDFieldValue
/// <summary>
/// This is a convenience method that allows direct modification of the value of the record's Scope_.LastEditByID field.
/// </summary>
public void SetLastEditByIDFieldValue(System.Guid val)
{
ColumnValue cv = new ColumnValue(val, System.TypeCode.Object);
this.SetValue(cv, TableUtils.LastEditByIDColumn);
}