object IList.this[int index] { get { return((ColumnPrompt)arrList[index]); } set { if (value != null) { ColumnPrompt p = value as ColumnPrompt; if (p == null) { throw new ArgumentException("Collection member must be of type ColumnPrompt", "value"); } else { arrList[index] = p; } } else { throw new ArgumentNullException("value", "Collection does not accept null members"); } } }
public void Remove(ColumnPrompt value) { if (value == null) { throw new ArgumentNullException("value", "You cannot remove collection member using null reference"); } arrList.Remove(value); }
public int Add(ColumnPrompt value) { if (value == null) { throw new ArgumentNullException("value", "You cannot add an object with null reference to the collection"); } return(arrList.Add(value)); }
public int IndexOf(ColumnPrompt value) { if (value == null) { return(-1); } return(arrList.IndexOf(value)); }
public bool Contains(ColumnPrompt value) { if (value == null) { return(false); } return(arrList.Contains(value)); }
public void Insert(int index, ColumnPrompt value) { if (value == null) { throw new ArgumentNullException("value", "Collection does not accept null members"); } arrList.Insert(index, value); }
// get ColumnPrompt of this column. // ( either default or the entry from mColumns collection ) private ColumnPrompt FindColumnPrompt(string InColumnName) { ColumnPrompt cp = null; foreach (ColumnPrompt column in Columns) { if (column.ColumnName == InColumnName) { cp = column; break; } } return(cp); }
int IList.Add(object value) { if (value == null) { throw new ArgumentNullException("value", "You cannot add an object with null reference to the collection"); } ColumnPrompt p = value as ColumnPrompt; if (p == null) { throw new ArgumentException("value", "You can add only objects of type ColumnPrompt"); } return(Add(p)); }
int IList.IndexOf(object value) { if (value == null) { return(-1); } ColumnPrompt p = value as ColumnPrompt; if (p == null) { return(-1); } return(IndexOf(p)); }
bool IList.Contains(object value) { if (value == null) { return(false); } ColumnPrompt p = value as ColumnPrompt; if (p == null) { return(false); } return(Contains(p)); }
void IList.Remove(object value) { if (value == null) { throw new ArgumentNullException("value", "You cannot remove collection member using null reference"); } ColumnPrompt p = value as ColumnPrompt; if (p == null) { throw new ArgumentNullException("value", "You can remove only an object of type ColumnPrompt"); } Remove(p); }
void IList.Insert(int index, object value) { if (value == null) { throw new ArgumentNullException("value", "Collection does not accept null members"); } ColumnPrompt p = value as ColumnPrompt; if (p == null) { throw new ArgumentException("Collection member must be of type ColumnPrompt", "value"); } Insert(index, p); }
// create the property panel as a table. The panel contains each column // being prompted. private void CreatePropertyPanel(AcTable InPanel) { AcTableRow row; AcTableCell cell; // create the property panel as a table. InPanel.AddStyle("background-color", "lightgrey") .AddStyle("font-family", "Verdana, Arial") .AddStyle("border-color", "white"); // first row holds the property panel title InPanel.AddNewRow( ).AddNewCell( ) .AddAttribute("ColSpan", "2") .AddStyle("text-align", "center") .SetText(Title); // build a dataset holding the single row to be prompted. DataSet rowds = TableRowToDataSet( ); DataTable rowtbl = rowds.Tables[0]; // add a row to the panel grid for each column in the table row being prompted. DataRow rowrow = rowtbl.Rows[0]; foreach (DataColumn column in rowtbl.Columns) { string ColumnName = column.ColumnName; ColumnPrompt cp = null; // get ColumnPrompt of this column. // ( either default or the entry from mColumns collection ) if (Columns.Count == 0) { cp = new ColumnPrompt(ColumnName); } else { cp = FindColumnPrompt(ColumnName); } if (cp == null) { continue; } // add an AcTableRow to the panel AcTable row = InPanel.AddNewRow( ); // first column is the column prompt text row.AddNewCell( ) .AddStyle("padding-right", "2%") .SetText(ColumnName); // second column is the column value cell = row.AddNewCell( ); string ColumnValue = rowrow[ColumnName].ToString( ); if (AlwChg == true) { TextBox tb = new TextBox( ); tb.Text = ColumnValue; cell.Controls.Add(tb); } else { cell.AddStyle("padding-right", "1%") .SetText(ColumnValue); } } }