Пример #1
0
 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");
         }
     }
 }
Пример #2
0
 public void Remove(ColumnPrompt value)
 {
     if (value == null)
     {
         throw new ArgumentNullException("value", "You cannot remove collection member using null reference");
     }
     arrList.Remove(value);
 }
Пример #3
0
        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));
        }
Пример #4
0
        public int IndexOf(ColumnPrompt value)
        {
            if (value == null)
            {
                return(-1);
            }

            return(arrList.IndexOf(value));
        }
Пример #5
0
        public bool Contains(ColumnPrompt value)
        {
            if (value == null)
            {
                return(false);
            }

            return(arrList.Contains(value));
        }
Пример #6
0
        public void Insert(int index, ColumnPrompt value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value", "Collection does not accept null members");
            }

            arrList.Insert(index, value);
        }
Пример #7
0
        // 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);
        }
Пример #8
0
        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));
        }
Пример #9
0
        int IList.IndexOf(object value)
        {
            if (value == null)
            {
                return(-1);
            }

            ColumnPrompt p = value as ColumnPrompt;

            if (p == null)
            {
                return(-1);
            }

            return(IndexOf(p));
        }
Пример #10
0
        bool IList.Contains(object value)
        {
            if (value == null)
            {
                return(false);
            }

            ColumnPrompt p = value as ColumnPrompt;

            if (p == null)
            {
                return(false);
            }

            return(Contains(p));
        }
Пример #11
0
        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);
        }
Пример #12
0
        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);
        }
Пример #13
0
        // 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);
                }
            }
        }