Represents a collection of Row objects
Inheritance: System.Collections.CollectionBase
示例#1
0
        /// <summary>
        /// Edits the value of the specified object using the specified 
        /// service provider and context
        /// </summary>
        /// <param name="context">An ITypeDescriptorContext that can be 
        /// used to gain additional context information</param>
        /// <param name="isp">A service provider object through which 
        /// editing services can be obtained</param>
        /// <param name="value">The object to edit the value of</param>
        /// <returns>The new value of the object. If the value of the 
        /// object has not changed, this should return the same object 
        /// it was passed</returns>
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider isp, object value)
        {
            this.rows = (RowCollection) value;

            object returnObject = base.EditValue(context, isp, value);

            TableModel model;
            try
            {
                model = (TableModel) context.Instance;
            }
            catch
            {
                // This must be a sub row
                model = ((Row)context.Instance).TableModel;
            }

            // make sure the TableModel's Table redraws any additions/deletions
            if (model.Table != null)
            {
                model.Table.PerformLayout();
                model.Table.Refresh();
            }

            return returnObject;
        }
示例#2
0
        /// <summary>
        /// Initialise default settings
        /// </summary>
        private void Init()
        {
            this.rows = null;

            this.selection = new Selection(this);
            this.table = null;
            this.rowHeight = TableModel.DefaultRowHeight;
        }
		/// <summary>
		/// Initializes a new instance of the RowCollectionEditor class 
		/// using the specified collection type
		/// </summary>
		/// <param name="type">The type of the collection for this editor to edit</param>
		public RowCollectionEditor(Type type) : base(type)
		{
			this.rows = null;
		}