public string DropdownSearchOption(ColumnDef columnDef) { StringBuilder sb = new StringBuilder(); sb.AppendLine("<input type='hidden' id='P" + PageTemplateId + "_" + columnDef.ColumnName + "' name='P" + PageTemplateId + "_" + columnDef.ColumnName + "' readonly style='width:25px;' />"); sb.AppendLine("<input type='text' id='P" + PageTemplateId + "_" + columnDef.ColumnName + "_' name='P" + PageTemplateId + "_" + columnDef.ColumnName + "_' readonly style='width:" + columnDef.ElementWidth + "px;' />"); //OpenLookupWindow sb.AppendLine("<a href='javascript:OpenLookupWindow(" + columnDef.PageTemplateId + "," + columnDef.ColumnDefId + ")' style='position:relative;text-decoration:none;top:7px;'><img src='/Images/ToolBar/x24/find.png' /></a>"); sb.Append("<div id='LookupWindow_" + columnDef.ColumnDefId + "'></div>"); DocumentReady.AppendLine("$('#LookupWindow_" + columnDef.ColumnDefId + "').kendoWindow({"); DocumentReady.AppendLine(" height: '700px',"); DocumentReady.AppendLine(" width: '700px',"); DocumentReady.AppendLine(" modal: true,"); DocumentReady.AppendLine(" scrollable: true,"); DocumentReady.AppendLine(" title: '" + columnDef.DisplayName + "',"); DocumentReady.AppendLine(" animation: {"); DocumentReady.AppendLine(" open: {"); DocumentReady.AppendLine(" duration: 100"); DocumentReady.AppendLine(" }"); DocumentReady.AppendLine(" },"); DocumentReady.AppendLine(" visible: false,"); DocumentReady.AppendLine(" actions: ['Maximize', 'Close']"); DocumentReady.AppendLine(" "); DocumentReady.AppendLine("});"); return(sb.ToString()); }
public string CheckboxYesNo(ColumnDef columnDef) { StringBuilder sb = new StringBuilder(); sb.AppendLine("<div class='pretty p-default'><input type='checkbox' id='" + TableName + "_" + columnDef.ColumnName + "' name='" + TableName + "_" + columnDef.ColumnName + "' value='true'><div class='state p-primary'><label> </label></div></div>"); return(sb.ToString()); }
/** * Add a new column. The parameters are limits for each column * wall in the format of a sequence of points (x1,y1,x2,y2,...). * * @param left limits for left column * @param right limits for right column */ public void AddColumn(float[] left, float[] right) { ColumnDef nextDef = new ColumnDef(left, right, this); simple = nextDef.IsSimple(); columnDefs.Add(nextDef); }
public string GetAttachedFiles(int pageTemplateId, int columnDefId, int recordId) { using (SourceControlEntities Db = new SourceControlEntities()) { StringBuilder sb = new StringBuilder(); ColumnDef columnDef = SessionService.ColumnDef(columnDefId); sb.AppendLine(""); var files = Db.FileAttachments.Where(w => w.ColumnDefId == columnDefId && w.RecordId == recordId).OrderBy(o => o.UploadDate); if (files != null) { sb.AppendLine("<select class='site-select-element' id='download" + columnDefId + "_" + recordId + "' onchange='DownloadFile(" + columnDefId + "," + recordId + ")' style='width:" + columnDef.ElementWidth + "px;'>"); sb.AppendLine("<option value=''>Select file to download (" + files.Count() + " files)</option>"); foreach (var file in files) { sb.AppendLine("<option value='" + file.FileAttachmentId + "'>" + file.FileName + "</option>"); //sb.AppendLine("<a href='javascript:;' onclick='DownloadFile(" + file.FileAttachmentId + ")'>" + file.FileName + "</a><br>"); } sb.AppendLine("</select>"); } return(sb.ToString()); } }
public string ChangeHistory(ColumnDef columnDef) { StringBuilder sb = new StringBuilder(); string columnName = columnDef.ColumnName; sb.AppendLine("<a href='javascript:OpenChangeHistoryWindow( " + columnDef.PageTemplateId + ")'>View " + columnDef.DisplayName + "</a>"); sb.Append("<div id='ChangeHistoryWindow" + columnDef.PageTemplateId + "'></div>"); DocumentReady.AppendLine("$('#ChangeHistoryWindow" + columnDef.PageTemplateId + "').kendoWindow({"); DocumentReady.AppendLine(" height: '" + columnDef.ElementHeight + "px',"); DocumentReady.AppendLine(" width: '" + columnDef.ElementWidth + "px',"); DocumentReady.AppendLine(" modal: true,"); DocumentReady.AppendLine(" scrollable: true,"); DocumentReady.AppendLine(" title: '" + columnDef.DisplayName + "',"); DocumentReady.AppendLine(" animation: {"); DocumentReady.AppendLine(" open: {"); DocumentReady.AppendLine(" duration: 100"); DocumentReady.AppendLine(" }"); DocumentReady.AppendLine(" },"); DocumentReady.AppendLine(" visible: false,"); DocumentReady.AppendLine(" actions: ['Maximize', 'Close']"); DocumentReady.AppendLine(" "); DocumentReady.AppendLine("});"); return(sb.ToString()); }
/// <summary> /// 列名を取得します。 /// </summary> /// <param name="tableName">テーブル名を指定します。</param> /// <returns>列定義のリストを返却します。</returns> protected List <ColumnDef> GetColumnDefs(string tableName) { List <ColumnDef> columns = new List <ColumnDef>(); using (IDbConnection connection = this.CreateConnection()) { connection.Open(); using (IDbCommand command = connection.CreateCommand()) { command.CommandTimeout = this.CommandTimeout; command.CommandText = this.GetColumnListSql(tableName); ts.TraceInformation(command.CommandText); using (IDataReader columnReader = command.ExecuteReader(CommandBehavior.SingleResult)) { while (columnReader.Read()) { ColumnDef column = new ColumnDef(); column.Name = (string)Cast(columnReader["ColumnName"], typeof(string)); column.TypeName = (string)Cast(columnReader["TypeName"], typeof(string)); column.Length = (int)Cast(columnReader["Length"], typeof(int)); column.IsPrimaryKey = (bool)Cast(columnReader["IsPrimaryKey"], typeof(bool)); column.IsAutoNumber = (bool)Cast(columnReader["IsAutoNumber"], typeof(bool)); column.Nullable = (bool)Cast(columnReader["Nullable"], typeof(bool)); column.DecimalPlace = (int)Cast(columnReader["DecimalPlace"], typeof(int)); column.Remarks = (string)Cast(columnReader["Remarks"], typeof(string)); columns.Add(column); } } } } return(columns); }
private static string GetNonPkSetClause(IEnumerable <ColumnDef> columnDefs, CsvRecord headers) { var setClause = new StringBuilder(); List <ColumnDef> nonPrimaryKeyColumns = columnDefs .Where ( cd => !cd.IsInPrimaryKey && headers.Fields.Any ( f => f.Value.ToLower() == cd.ColumnName.ToLower() ) ) .ToList(); for (int index = 0; index < nonPrimaryKeyColumns.Count; index++) { ColumnDef columnDef = nonPrimaryKeyColumns[index]; setClause.Append(index == 0 ? "SET " : ", "); setClause.Append('['); setClause.Append(columnDef.ColumnName); setClause.Append("] = @"); setClause.Append(columnDef.ColumnName.ToLower()); } return(setClause.ToString()); }
public string Email(ColumnDef columnDef) { StringBuilder sb = new StringBuilder(); string columnName = columnDef.ColumnName; sb.Append("<input type='text' id='" + columnName + "' name='" + columnName + "' data-email-msg='Email is not valid' style = 'width:"); sb.Append((columnDef.ElementWidth > 0) ? columnDef.ElementWidth + "px;'" : "300px;'"); sb.Append(", maxlength='" + columnDef.DataLength + "'"); string validationMsg = ""; if (Convert.ToInt32(columnDef.IsRequired) == 1) { sb.Append(", required "); validationMsg = "Required"; } if (validationMsg.Length > 0) { sb.Append(", validationMessage='" + validationMsg + "'"); } sb.AppendLine(" />"); return(sb.ToString()); }
void controller_CellClick(T row, ColumnDef <T> col) { if (CellClick != null) { CellClick(row, col); } }
public string GetColumnDefById(int columnDefId) { if (columnDefId == 0) { ColumnDef columnDef = new ColumnDef(); columnDef.ColumnName = ""; columnDef.DisplayName = ""; columnDef.IsRequired = false; columnDef.ShowInGrid = true; columnDef.ElementType = "Textbox"; columnDef.DataLength = 50; columnDef.DataType = "TEXT"; columnDef.LookupTable = ""; string obj = JsonConvert.SerializeObject(columnDef); return(obj); } else { var columnDef = SessionService.ColumnDef(columnDefId); Session["sec.ColumnDefId" + columnDefId] = null; Session["sec.ColumnDefs" + columnDef.PageTemplateId] = null; columnDef = SessionService.ColumnDef(columnDefId); string obj = JsonConvert.SerializeObject(columnDef); return(obj); } }
public static PDynamicDeclaredColumnNode VisitDynamicColumn(ColumnDef node) { return(TreeHelper.Create <PDynamicDeclaredColumnNode>(n => { n.Name = IdentifierVisitor.Visit(node.ColumnDefName); PTree.RawNode[n] = node; })); }
private bool ProcessHeaderLine(/*OPTIONAL*/ string headerLine) { int index = 0; int strLen = headerLine.Length; // pid column is a fixed length column if (!SkipNonWhitespace(headerLine, ref index)) { return(false); } _pidCol = new ColumnDef(0, index); if (!SkipWhitespace(headerLine, ref index)) { return(false); } int colStart = index; if (!SkipNonWhitespace(headerLine, ref index)) { return(false); } _flagsCol = new ColumnDef(colStart, index); if (!SkipWhitespace(headerLine, ref index)) { return(false); } colStart = index; if (!SkipNonWhitespace(headerLine, ref index)) { return(false); } _ruserCol = new ColumnDef(colStart, index); if (!SkipWhitespace(headerLine, ref index)) { return(false); } // The rest of the line is the args column _argsCol = new ColumnDef(index, int.MaxValue); // comsume the rest of the header SkipNonWhitespace(headerLine, ref index); // make sure the line is now empty, aside from whitespace if (SkipWhitespace(headerLine, ref index)) { return(false); } return(true); }
private static SqlParameter MakeParameter(ColumnDef columnDef) { var toReturn = new SqlParameter { ParameterName = "@" + columnDef.ColumnName.ToLower() }; switch (columnDef.DataType) { case "nvarchar": toReturn.SqlDbType = SqlDbType.NVarChar; toReturn.Size = int.MaxValue; break; case "varchar": toReturn.SqlDbType = SqlDbType.VarChar; toReturn.Size = int.MaxValue; break; case "int": toReturn.SqlDbType = SqlDbType.Int; break; case "money": toReturn.SqlDbType = SqlDbType.Money; break; case "datetime": toReturn.SqlDbType = SqlDbType.DateTime; break; case "smalldatetime": toReturn.SqlDbType = SqlDbType.SmallDateTime; break; case "numeric": toReturn.SqlDbType = SqlDbType.Decimal; break; case "varbinary": toReturn.SqlDbType = SqlDbType.VarBinary; toReturn.Size = int.MaxValue; break; case "text": toReturn.SqlDbType = SqlDbType.Text; toReturn.Size = int.MaxValue; break; case "bit": toReturn.SqlDbType = SqlDbType.Bit; break; default: throw new NotSupportedException(columnDef.DataType + " not supported."); } return(toReturn); }
/// <summary> /// Overrides the AddColumn to change the way data is formatted. It is called to present a /// left padded column name and data, one per line. Used for the summary in the logger. /// </summary> /// <param name="columnDef"></param> protected override void AddColumn(ColumnDef columnDef) { if ((++count) > 1) { rowString.Append(info.OutputData.NewLineSequence); } this.rowString.Append(columnDef.Name.PadLeft(30)).Append(": "); this.BuildColumn(columnDef); }
public string Textarea(ColumnDef columnDef) { int columnWidth = (columnDef.ElementWidth < 30) ? 300 : columnDef.ElementWidth; int columnHeight = (columnDef.ElementHeight < 10) ? 200 : columnDef.ElementHeight; var response = "<textarea id='" + TableName + "_" + columnDef.ColumnName + "' name='" + TableName + "_" + columnDef.ColumnName + "' style='width:" + columnWidth + "px;height:" + columnHeight + "px;'></textarea>"; return(response); }
public WhereColumn(Join @join, ColumnDef columnDef, string statement, Operator @operator, string value1, string value2) { Join = @join; ColumnDef = columnDef; Statement = statement; Operator = @operator; Value1 = value1; Value2 = value2; }
public Join(Join parentJoin, ColumnDef parentColumnDef, ColumnDef columnDef, string alias, SelectStatement selectStatement) { ParentJoin = parentJoin; ParentColumnDef = parentColumnDef; ColumnDef = columnDef; ObjectDef = columnDef.ObjectDef; Alias = alias; SelectStatement = selectStatement; }
internal static string FormatColumn(string s, ColumnDef cd) { switch (cd.Format) { case FormatType.Date: return(FormatDate(s, cd.FormatParameter)); default: return(s); } }
protected void OnCellClick(T row, ColumnDef <T> colDef) { if (this.CellClick != null) { if (row != null) { this.CellClick(row, colDef); } } }
/** * Add a new column. The parameters are limits for each column * wall in the format of a sequence of points (x1,y1,x2,y2,...). * * @param left limits for left column * @param right limits for right column */ public void AddColumn(float[] left, float[] right) { ColumnDef nextDef = new ColumnDef(left, right, this); if (!nextDef.IsSimple()) { simple = false; } columnDefs.Add(nextDef); }
public static ColumnDef ColumnDef(int pageTemplateId, string columnName) { if (pageTemplateId == 0) { return(null); } ColumnDef columnDef = SessionService.ColumnDefs(pageTemplateId).Where(w => w.ColumnName == columnName).FirstOrDefault(); return(columnDef); }
public string DateChanged(ColumnDef columnDef) { StringBuilder sb = new StringBuilder(); var readOnly = "readonly"; sb.AppendLine("<input type='text' id='" + TableName + "_" + columnDef.ColumnName + "' name='" + TableName + "_" + columnDef.ColumnName + "' style='width:" + columnDef.ElementWidth + ";' " + readOnly + " />"); return(sb.ToString()); }
private ColumnDef getDef(string name) { var result = m_Columns[name]; if (result == null) { result = new ColumnDef(name); m_Columns.Register(result); } return(result); }
private CodeMemberProperty GenerateProperty(TableDef table, ColumnDef column) { var attribute = new CodeAttributeDeclaration("DbColumn"); attribute.Arguments.Add(new CodeAttributeArgument("Name", new CodePrimitiveExpression(column.Name))); attribute.Arguments.Add(new CodeAttributeArgument("TypeName", new CodePrimitiveExpression(column.TypeName))); if (column.IsPrimaryKey) { attribute.Arguments.Add(new CodeAttributeArgument("IsPrimaryKey", new CodePrimitiveExpression(true))); } if (column.Nullable) { attribute.Arguments.Add(new CodeAttributeArgument("Nullable", new CodePrimitiveExpression(true))); } if (column.IsAutoNumber) { attribute.Arguments.Add(new CodeAttributeArgument("IsAutoNumber", new CodePrimitiveExpression(true))); } if (column.DecimalPlace != 0) { attribute.Arguments.Add(new CodeAttributeArgument("DecimalPlace", new CodePrimitiveExpression(column.DecimalPlace))); } attribute.Arguments.Add(new CodeAttributeArgument("Length", new CodePrimitiveExpression(column.Length))); if (!string.IsNullOrEmpty(column.Remarks)) { attribute.Arguments.Add(new CodeAttributeArgument("Remarks", new CodePrimitiveExpression(column.Remarks))); } var property = new CodeMemberProperty(); if (this.UseWCF) { property.CustomAttributes.Add(new CodeAttributeDeclaration("DataMember")); } property.CustomAttributes.Add(attribute); property.Name = this.GetPropertyName(table.Name, column.Name); property.Type = new CodeTypeReference(this.db.GetProgramType(column)); property.Attributes = MemberAttributes.Public; property.GetStatements.Add(new CodeMethodReturnStatement(new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), this.GetFieldName(column)))); property.SetStatements.Add(new CodeAssignStatement(new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), this.GetFieldName(column)), new CodePropertySetValueReferenceExpression())); var parentForeignKeys = this.ForeignKeys.FindAll(f => f.TableName == table.Name && f.ColumnName == column.Name); foreach (var fk in parentForeignKeys) { var fkAttribute = new CodeAttributeDeclaration("ForeignKey"); fkAttribute.Arguments.Add(new CodeAttributeArgument("ReferencedTableName", new CodePrimitiveExpression(fk.ReferencedTableName))); fkAttribute.Arguments.Add(new CodeAttributeArgument("ReferencedColumnName", new CodePrimitiveExpression(fk.ReferencedColumnName))); property.CustomAttributes.Add(fkAttribute); } return(property); }
public string DatePicker(ColumnDef columnDef) { StringBuilder sb = new StringBuilder(); int columnWidth = (columnDef.ElementWidth < 10) ? 150 : columnDef.ElementWidth; sb.AppendLine("<input id='" + TableName + "_" + columnDef.ColumnName + "' name='" + TableName + "_" + columnDef.ColumnName + "' style='width:" + columnWidth + "px;' />"); //sb.AppendLine("<div class='form-group'>"); //sb.AppendLine(" <div class='input-group date' id='" + TableName + "_" + columnDef.ColumnName + "'>"); //sb.AppendLine(" <input type='text' class='form-control' />"); //sb.AppendLine(" <span class='input-group-addon'>"); //sb.AppendLine(" <span class='glyphicon glyphicon-calendar'></span>"); //sb.AppendLine(" </span>"); //sb.AppendLine(" </div>"); //sb.AppendLine("</div>"); //DocumentReady.AppendLine("$(function () {"); //DocumentReady.AppendLine("$('#" + TableName + "_" + columnDef.ColumnName + "').datetimepicker();"); //DocumentReady.AppendLine("});"); if (columnDef.DatePickerOption == "Date") { DocumentReady.AppendLine("$('#" + TableName + "_" + columnDef.ColumnName + "').kendoDatePicker({"); } else if (columnDef.DatePickerOption == "DateTime") { DocumentReady.AppendLine("$('#" + TableName + "_" + columnDef.ColumnName + "').kendoDateTimePicker({"); } else if (columnDef.DatePickerOption == "MonthYear") { DocumentReady.AppendLine("$('#" + TableName + "_" + columnDef.ColumnName + "').kendoDatePicker({"); DocumentReady.AppendLine("start: 'year',"); DocumentReady.AppendLine("depth: 'year',"); DocumentReady.AppendLine("format: 'MMMM yyyy'"); } else if (columnDef.DatePickerOption == "Year") { DocumentReady.AppendLine("$('#" + TableName + "_" + columnDef.ColumnName + "').kendoDatePicker({"); DocumentReady.AppendLine("start: 'year',"); DocumentReady.AppendLine("depth: 'year',"); DocumentReady.AppendLine("format: 'yyyy'"); } else { DocumentReady.AppendLine("$('#" + TableName + "_" + columnDef.ColumnName + "').kendoDatePicker({"); } DocumentReady.AppendLine("});"); return(sb.ToString()); }
private CodeMemberField GenerateField(ColumnDef column) { var field = new CodeMemberField(); field.Name = this.GetFieldName(column); field.Type = new CodeTypeReference(this.db.GetProgramType(column)); field.Attributes = MemberAttributes.Private; if (!string.IsNullOrEmpty(column.Remarks)) { field.Comments.Add(new CodeCommentStatement(column.Remarks)); } return(field); }
public string Textbox(string tableName, ColumnDef columnDef) { StringBuilder sb = new StringBuilder(); sb.Append("<input type='text' id='" + tableName + "_" + columnDef.ColumnName + "' name='" + tableName + "_" + columnDef.ColumnName + "' style='width:"); sb.Append((columnDef.ElementWidth > 0) ? columnDef.ElementWidth + "px;'" : "300px;'"); sb.Append(", maxlength='" + columnDef.DataLength + "'"); sb.AppendLine(" />"); return(sb.ToString()); }
private bool ProcessHeaderLine(/*OPTIONAL*/ string headerLine) { int index = 0; if (!SkipWhitespace(headerLine, ref index)) { return(false); } // pid column is right justified so the pid column stops at the 'A' index if (headerLine[index] != 'A') { return(false); } _pidCol = new ColumnDef(0, index); index++; if (!SkipWhitespace(headerLine, ref index)) { return(false); } if (headerLine[index] != 'B') { return(false); } // ruser and args columns are left justified int colStart = index++; if (!SkipWhitespace(headerLine, ref index)) { return(false); } if (headerLine[index] != 'C') { return(false); } _ruserCol = new ColumnDef(colStart, index - 1); // The rest of the line is the args column _argsCol = new ColumnDef(index, int.MaxValue); // make sure the line is now empty, aside from whitespace index++; if (SkipWhitespace(headerLine, ref index)) { return(false); } return(true); }
public string NumericTextbox(ColumnDef columnDef) { StringBuilder sb = new StringBuilder(); int columnWidth = (columnDef.ElementWidth < 30) ? 300 : columnDef.ElementWidth; sb.AppendLine("<input id='" + TableName + "_" + columnDef.ColumnName + "' name='" + TableName + "_" + columnDef.ColumnName + "'" + ((columnDef.NumberMin > 0) ? " min='" + columnDef.NumberMin + "'" : "") + " " + ((columnDef.NumberMax > 0) ? " max='" + columnDef.NumberMax + "'" : "") + " style='width:" + columnWidth + "px;' />"); DocumentReady.AppendLine("$('#" + columnDef.ColumnName + "').kendoNumericTextBox({"); DocumentReady.AppendLine(" format: '#',"); DocumentReady.AppendLine(" decimals: "+ columnDef.NumberOfDecimal); DocumentReady.AppendLine("});"); return(sb.ToString()); }
public override Type GetProgramType(ColumnDef column) { switch (column.TypeName) { case "bit": return(column.Nullable ? typeof(Nullable <bool>) : typeof(bool)); case "decimal": case "numeric": return(column.Nullable ? typeof(Nullable <decimal>) : typeof(decimal)); case "float": case "double": return(column.Nullable ? typeof(Nullable <double>) : typeof(double)); case "timestamp": case "datetime": case "date": return(column.Nullable ? typeof(Nullable <DateTime>) : typeof(DateTime)); case "integer": case "int": case "smallint": case "tinyint": case "mediumint": return(column.Nullable ? typeof(Nullable <int>) : typeof(int)); case "bigint": return(column.Nullable ? typeof(Nullable <Int64>) : typeof(Int64)); case "char": case "varchar": case "text": case "longtext": case "enum": case "set": return(typeof(string)); case "binary": case "varbinary": case "blob": case "longblob": return(typeof(byte[])); default: throw new Exception("対応外の型を使用しています。" + column.TypeName); } }
private static string GetPkWhereClause(IEnumerable <ColumnDef> columnDefs) { var pkWhereClause = new StringBuilder(); List <ColumnDef> pkColumns = columnDefs.Where(cd => cd.IsInPrimaryKey).ToList(); for (int index = 0; index < pkColumns.Count; index++) { ColumnDef columnDef = pkColumns[index]; pkWhereClause.Append(index == 0 ? "WHERE " : " AND "); pkWhereClause.Append('['); pkWhereClause.Append(columnDef.ColumnName); pkWhereClause.Append("] = @"); pkWhereClause.Append(columnDef.ColumnName.ToLower()); } return(pkWhereClause.ToString()); }
/** * Add a simple rectangular column with specified left * and right x position boundaries. * * @param left left boundary * @param right right boundary */ public void AddSimpleColumn(float left, float right) { ColumnDef newCol = new ColumnDef(left, right, this); columnDefs.Add(newCol); }
/** * Add a new column. The parameters are limits for each column * wall in the format of a sequence of points (x1,y1,x2,y2,...). * * @param left limits for left column * @param right limits for right column */ public void AddColumn(float[] left, float[] right) { ColumnDef nextDef = new ColumnDef(left, right, this); if (!nextDef.IsSimple()) simple = false; columnDefs.Add(nextDef); }
/// <summary>Adds only the column name.</summary> /// <see cref="RowBuilder.BuildColumn"/> protected override void BuildColumn(ColumnDef columnDef) { this.rowString.Append(columnDef.Name); }
private ColumnDef parseColumnDef() { ColumnDef col = new ColumnDef(); col.ColumnName = fCurrentToken.Value.TrimQuotation(); ReadNextToken(); col.ColumnType = fCurrentToken.Value; ReadNextToken(); if (fCurrentToken.Equals("(")) { ReadNextToken(); Expression exp = ParseIntegerConstant(); if (exp is IntegerConstant) col.Length = (exp as IntegerConstant).Value; if (fCurrentToken.Equals(",")) { ReadNextToken(); Expression exp2 = ParseIntegerConstant(); if (exp2 is IntegerConstant) col.Scale = (exp2 as IntegerConstant).Value; } SkipExpected(")"); } while (!AtEndOfSource && !(fCurrentToken.Equals(",") || fCurrentToken.Equals(")"))) col.Constraints.Add(parseColumnConstraint()); return col; }
private bool ProcessHeaderLine(/*OPTIONAL*/ string headerLine) { int index = 0; if (!SkipWhitespace(headerLine, ref index)) return false; // pid column is right justified so the pid column stops at the 'A' index if (headerLine[index] != 'A') return false; _pidCol = new ColumnDef(0, index); index++; if (!SkipWhitespace(headerLine, ref index)) return false; if (headerLine[index] != 'B') return false; // ruser and args columns are left justified int colStart = index++; if (!SkipWhitespace(headerLine, ref index)) return false; if (headerLine[index] != 'C') return false; _ruserCol = new ColumnDef(colStart, index - 1); // The rest of the line is the args column _argsCol = new ColumnDef(index, int.MaxValue); // make sure the line is now empty, aside from whitespace index++; if (SkipWhitespace(headerLine, ref index)) return false; return true; }
private ColumnDef getDef(string name) { var result = m_Columns[name]; if (result==null) { result = new ColumnDef(name); m_Columns.Register(result); } return result; }