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; }
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; }
/// <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); }
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; }
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); } } }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Events_.GID field. /// </summary> public void SetGIDFieldValue(ColumnValue val) { this.SetValue(val, TableUtils.GIDColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Scope_.UOMID field. /// </summary> public void SetUOMIDFieldValue(ColumnValue val) { this.SetValue(val, TableUtils.UOMIDColumn); }
/// <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); }
/// <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); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Scope_.ScopeGlobal field. /// </summary> public void SetScopeGlobalFieldValue(ColumnValue val) { this.SetValue(val, TableUtils.ScopeGlobalColumn); }
/// <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); }
public void WriteCellValue(ColumnValue value) { WriteTag(PlainBufferConsts.TAG_CELL_VALUE); if (value.IsInfMin()) { output.WriteRawLittleEndian32(1); output.WriteRawByte(PlainBufferConsts.VT_INF_MIN); return; } if (value.IsInfMax()) { output.WriteRawLittleEndian32(1); output.WriteRawByte(PlainBufferConsts.VT_INF_MAX); return; } if (value.IsPlaceHolderForAutoIncr()) { output.WriteRawLittleEndian32(1); output.WriteRawByte(PlainBufferConsts.VT_AUTO_INCREMENT); return; } byte[] rawData; int prefixLength; switch (value.Type) { case ColumnValueType.String: rawData = value.AsStringInBytes(); prefixLength = PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE + 1; // length + type + length output.WriteRawLittleEndian32(prefixLength + rawData.Length); // length + type + value output.WriteRawByte(PlainBufferConsts.VT_STRING); output.WriteRawLittleEndian32(rawData.Length); output.WriteBytes(rawData); break; case ColumnValueType.Integer: output.WriteRawLittleEndian32(1 + PlainBufferOutputStream.LITTLE_ENDIAN_64_SIZE); output.WriteRawByte(PlainBufferConsts.VT_INTEGER); output.WriteRawLittleEndian64(value.IntegerValue); break; case ColumnValueType.Binary: rawData = value.BinaryValue; prefixLength = PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE + 1; // length + type + length output.WriteRawLittleEndian32(prefixLength + rawData.Length); // length + type + value output.WriteRawByte(PlainBufferConsts.VT_BLOB); output.WriteRawLittleEndian32(rawData.Length); output.WriteBytes(rawData); break; case ColumnValueType.Boolean: output.WriteRawLittleEndian32(2); output.WriteRawByte(PlainBufferConsts.VT_BOOLEAN); output.WriteBool(value.BooleanValue); break; case ColumnValueType.Double: output.WriteRawLittleEndian32(1 + PlainBufferOutputStream.LITTLE_ENDIAN_64_SIZE); output.WriteRawByte(PlainBufferConsts.VT_DOUBLE); output.WriteDouble(value.DoubleValue); break; default: throw new IOException("Bug: unsupported column type: " + value.Type); } }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Scope_.LastEditDate field. /// </summary> public void SetLastEditDateFieldValue(ColumnValue val) { this.SetValue(val, TableUtils.LastEditDateColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Events_.AccountNumber field. /// </summary> public void SetAccountNumberFieldValue(string val) { ColumnValue cv = new ColumnValue(val); this.SetValue(cv, TableUtils.AccountNumberColumn); }
public TermQuery(string fieldName, ColumnValue term) { this.FieldName = fieldName; this.Term = term; }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Events_.AccountNumber field. /// </summary> public void SetAccountNumberFieldValue(ColumnValue val) { this.SetValue(val, TableUtils.AccountNumberColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Events_.ContactEmail field. /// </summary> public void SetContactEmailFieldValue(ColumnValue val) { this.SetValue(val, TableUtils.ContactEmailColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Events_.GID field. /// </summary> public void SetGIDFieldValue(System.Guid val) { ColumnValue cv = new ColumnValue(val, System.TypeCode.Object); this.SetValue(cv, TableUtils.GIDColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Scope_.CreatedDate field. /// </summary> public void SetCreatedDateFieldValue(ColumnValue val) { this.SetValue(val, TableUtils.CreatedDateColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Users_.UserName field. /// </summary> public void SetUserName0FieldValue(ColumnValue val) { this.SetValue(val, TableUtils.UserName0Column); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Scope_.LastEditBy field. /// </summary> public void SetLastEditByFieldValue(string val) { ColumnValue cv = new ColumnValue(val); this.SetValue(cv, TableUtils.LastEditByColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Users_.UserName field. /// </summary> public void SetUserName0FieldValue(string val) { ColumnValue cv = new ColumnValue(val); this.SetValue(cv, TableUtils.UserName0Column); }
/// <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); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Users_.Password field. /// </summary> public void SetPasswordFieldValue(ColumnValue val) { this.SetValue(val, TableUtils.PasswordColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's VwSite_.SiteID field. /// </summary> public void SetSiteIDFieldValue(decimal val) { ColumnValue cv = new ColumnValue(val); this.SetValue(cv, TableUtils.SiteIDColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Users_.Password field. /// </summary> public void SetPasswordFieldValue(string val) { ColumnValue cv = new ColumnValue(val); this.SetValue(cv, TableUtils.PasswordColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's VwPropSBondBudgetDetail_.DeptID field. /// </summary> public void SetDeptIDFieldValue(string val) { ColumnValue cv = new ColumnValue(val); this.SetValue(cv, TableUtils.DeptIDColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Users_.eMail field. /// </summary> public void SeteMailFieldValue(ColumnValue val) { this.SetValue(val, TableUtils.eMailColumn); }
/// <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); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Users_.eMail field. /// </summary> public void SeteMailFieldValue(string val) { ColumnValue cv = new ColumnValue(val); this.SetValue(cv, TableUtils.eMailColumn); }
/// <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); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Users_.Active field. /// </summary> public void SetActiveFieldValue(ColumnValue val) { this.SetValue(val, TableUtils.ActiveColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Scope_.Status field. /// </summary> public void SetStatusFieldValue(bool val) { ColumnValue cv = new ColumnValue(val); this.SetValue(cv, TableUtils.StatusColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Users_.Active field. /// </summary> public void SetActiveFieldValue(bool val) { ColumnValue cv = new ColumnValue(val); this.SetValue(cv, TableUtils.ActiveColumn); }
/// <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); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Users_.LastLoginDate field. /// </summary> public void SetLastLoginDateFieldValue(ColumnValue val) { this.SetValue(val, TableUtils.LastLoginDateColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Scope_.CreatedDate field. /// </summary> public void SetCreatedDateFieldValue(DateTime val) { ColumnValue cv = new ColumnValue(val); this.SetValue(cv, TableUtils.CreatedDateColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Users_.LastLoginDate field. /// </summary> public void SetLastLoginDateFieldValue(DateTime val) { ColumnValue cv = new ColumnValue(val); this.SetValue(cv, TableUtils.LastLoginDateColumn); }
/// <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); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Users_.RoleId field. /// </summary> public void SetRoleIdFieldValue(ColumnValue val) { this.SetValue(val, TableUtils.RoleIdColumn); }
/// <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); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Users_.RoleId field. /// </summary> public void SetRoleIdFieldValue(long val) { ColumnValue cv = new ColumnValue(val); this.SetValue(cv, TableUtils.RoleIdColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Scope_.ScopeDescription field. /// </summary> public void SetScopeDescriptionFieldValue(string val) { ColumnValue cv = new ColumnValue(val); this.SetValue(cv, TableUtils.ScopeDescriptionColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Users_.CreatedBy field. /// </summary> public void SetCreatedByFieldValue(ColumnValue val) { this.SetValue(val, TableUtils.CreatedByColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's FieldTrips_.DisplaySequence field. /// </summary> public void SetDisplaySequenceFieldValue(long val) { ColumnValue cv = new ColumnValue(val); this.SetValue(cv, TableUtils.DisplaySequenceColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Users_.CreatedBy field. /// </summary> public void SetCreatedByFieldValue(decimal val) { ColumnValue cv = new ColumnValue(val); this.SetValue(cv, TableUtils.CreatedByColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's VwSite_.SiteZip field. /// </summary> public void SetSiteZipFieldValue(ColumnValue val) { this.SetValue(val, TableUtils.SiteZipColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Users_.UpdatedBy field. /// </summary> public void SetUpdatedByFieldValue(long val) { ColumnValue cv = new ColumnValue(val); this.SetValue(cv, TableUtils.UpdatedByColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's FieldTrips_.DisplaySequence field. /// </summary> public void SetDisplaySequenceFieldValue(ColumnValue val) { this.SetValue(val, TableUtils.DisplaySequenceColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Users_.CreatedOn field. /// </summary> public void SetCreatedOnFieldValue(DateTime val) { ColumnValue cv = new ColumnValue(val); this.SetValue(cv, TableUtils.CreatedOnColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's VwPropSBondBudgetDetail_.ID field. /// </summary> public void SetID0FieldValue(ColumnValue val) { this.SetValue(val, TableUtils.ID0Column); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Users_.UpdatedOn field. /// </summary> public void SetUpdatedOnFieldValue(ColumnValue val) { this.SetValue(val, TableUtils.UpdatedOnColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's VwPropSBondBudgetDetail_.ParentID field. /// </summary> public void SetParentIDFieldValue(ColumnValue val) { this.SetValue(val, TableUtils.ParentIDColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's FieldTrips_.EventId field. /// </summary> public void SetEventIdFieldValue(decimal val) { ColumnValue cv = new ColumnValue(val); this.SetValue(cv, TableUtils.EventIdColumn); }
/// <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(ColumnValue val) { this.SetValue(val, TableUtils.sub_categoryColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Events_.EventName field. /// </summary> public void SetEventNameFieldValue(ColumnValue val) { this.SetValue(val, TableUtils.EventNameColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's VwPropSBondBudgetDetail_.Total field. /// </summary> public void SetTotalFieldValue(ColumnValue val) { this.SetValue(val, TableUtils.TotalColumn); }
/// <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); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's FieldTrips_.Time field. /// </summary> public void SetTimeFieldValue(DateTime val) { ColumnValue cv = new ColumnValue(val); this.SetValue(cv, TableUtils.TimeColumn); }
/// <summary> /// This is a convenience method that allows direct modification of the value of the record's Events_.EventName field. /// </summary> public void SetEventNameFieldValue(string val) { ColumnValue cv = new ColumnValue(val); this.SetValue(cv, TableUtils.EventNameColumn); }