/// <summary>
        /// Initializes a new instance of the SelectionEventArgs class with 
        /// the specified TableModel source, old selected indicies and new 
        /// selected indicies
        /// </summary>
        /// <param name="source">The TableModel that originated the event</param>
        /// <param name="oldSelectedIndicies">An array of the previously selected Rows</param>
        /// <param name="newSelectedIndicies">An array of the newly selected Rows</param>
        public SelectionEventArgs(TableModel source, int[] oldSelectedIndicies, int[] newSelectedIndicies)
            : base()
        {
            if (source == null)
            {
                throw new ArgumentNullException("source", "TableModel cannot be null");
            }

            this.source = source;
            this.oldSelectedIndicies = oldSelectedIndicies;
            this.newSelectedIndicies = newSelectedIndicies;

            this.oldSelectionBounds = new Gdk.Rectangle();
            this.newSelectionBounds = new Gdk.Rectangle();

            if (oldSelectedIndicies.Length > 0)
            {
                this.oldSelectionBounds = source.Selections.CalcSelectionBounds(oldSelectedIndicies[0],
                                                                                oldSelectedIndicies[oldSelectedIndicies.Length-1]);
            }

            if (newSelectedIndicies.Length > 0)
            {
                this.newSelectionBounds = source.Selections.CalcSelectionBounds(newSelectedIndicies[0],
                                                                                newSelectedIndicies[newSelectedIndicies.Length-1]);
            }
        }
 /// <summary>
 /// Initializes a new instance of the TableModelEventArgs class with 
 /// the specified TableModel source, start index, end index and affected Column
 /// </summary>
 /// <param name="source">The TableModel that originated the event</param>
 /// <param name="row">The affected Row</param>
 /// <param name="fromIndex">The start index of the affected Row(s)</param>
 /// <param name="toIndex">The end index of the affected Row(s)</param>
 public TableModelEventArgs(TableModel source, Row row, int fromIndex, int toIndex)
 {
     this.source = source;
     this.row = row;
     this.fromIndex = fromIndex;
     this.toIndex = toIndex;
 }
        /// <summary>
        /// Initializes a new instance of the RowCollection class 
        /// that belongs to the specified TableModel
        /// </summary>
        /// <param name="owner">A TableModel representing the tableModel that owns 
        /// the RowCollection</param>
        public RowCollection(TableModel owner)
            : base()
        {
            if (owner == null)
            {
                throw new ArgumentNullException("owner");
            }

            this.owner = owner;
        }
Ejemplo n.º 4
0
            /// <summary>
            /// Initializes a new instance of the TableModel.Selection class 
            /// that belongs to the specified TableModel
            /// </summary>
            /// <param name="owner">A TableModel representing the tableModel that owns 
            /// the Selection</param>
            public Selection(TableModel owner)
            {
                if (owner == null)
                {
                    throw new ArgumentNullException("owner", "owner cannot be null");
                }

                this.owner = owner;
                this.rows = new ArrayList();

                this.shiftSelectStart = CellPos.Empty;
                this.shiftSelectEnd = CellPos.Empty;
            }
 /// <summary>
 /// Initializes a new instance of the TableModelEventArgs class with 
 /// the specified TableModel source, start index, end index and affected Column
 /// </summary>
 /// <param name="source">The TableModel that originated the event</param>
 /// <param name="fromIndex">The start index of the affected Row(s)</param>
 /// <param name="toIndex">The end index of the affected Row(s)</param>
 public TableModelEventArgs(TableModel source, int fromIndex, int toIndex)
     : this(source, null, fromIndex, toIndex)
 {
 }
 /// <summary>
 /// Initializes a new instance of the TableModelEventArgs class with 
 /// the specified TableModel source, start index, end index and affected Column
 /// </summary>
 /// <param name="source">The TableModel that originated the event</param>
 public TableModelEventArgs(TableModel source)
     : this(source, null, -1, -1)
 {
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Initialise default values
        /// </summary>
        private void Init()
        {
            this.cells = null;

            this.tag = null;
            this.tableModel = null;
            this.index = -1;
            this.rowStyle = null;
            this.selectedCellCount = 0;

            this.state = (byte) (STATE_EDITABLE | STATE_ENABLED);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Releases all resources used by the Row
        /// </summary>
        public void Dispose()
        {
            if (!this.disposed)
            {
                this.tag = null;

                if (this.tableModel != null)
                {
                    this.tableModel.Rows.Remove(this);
                }

                this.tableModel = null;
                this.index = -1;

                if (this.cells != null)
                {
                    Cell cell;

                    for (int i=0; i<this.cells.Count; i++)
                    {
                        cell = this.cells[i];

                        cell.InternalRow = null;
                        cell.Dispose();
                    }

                    this.cells = null;
                }

                this.rowStyle = null;
                this.state = (byte) 0;

                this.disposed = true;
            }
        }