Beispiel #1
0
		/// <summary>
		/// Initializes a new instance of the SorterBase class with the specified 
		/// TableModel, Column index, IComparer and SortOrder
		/// </summary>
		/// <param name="tableModel">The TableModel that contains the data to be sorted</param>
		/// <param name="column">The index of the Column to be sorted</param>
		/// <param name="comparer">The IComparer used to sort the Column's Cells</param>
		/// <param name="sortOrder">Specifies how the Column is to be sorted</param>
		public SorterBase(TableModel tableModel, int column, IComparer comparer, SortOrder sortOrder)
		{
			this.tableModel = tableModel;
			this.column = column;
			this.comparer = comparer;
			this.sortOrder = sortOrder;
		}
		/// <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;
		}
		/// <summary>
		/// Initializes a new instance of the CheckBoxComparer class with the specified 
		/// TableModel, Column index and SortOrder
		/// </summary>
		/// <param name="tableModel">The TableModel that contains the data to be sorted</param>
		/// <param name="column">The index of the Column to be sorted</param>
		/// <param name="sortOrder">Specifies how the Column is to be sorted</param>
		public CheckBoxComparer(TableModel tableModel, int column, SortOrder sortOrder) : base(tableModel, column, sortOrder)
		{
			
		}
		/// <summary>
		/// Initializes a new instance of the ShellSorter class with the specified 
		/// TableModel, Column index, IComparer and SortOrder
		/// </summary>
		/// <param name="tableModel">The TableModel that contains the data to be sorted</param>
		/// <param name="column">The index of the Column to be sorted</param>
		/// <param name="comparer">The IComparer used to sort the Column's Cells</param>
		/// <param name="sortOrder">Specifies how the Column is to be sorted</param>
		public ShellSorter(TableModel tableModel, int column, IComparer comparer, SortOrder sortOrder) : base(tableModel, column, comparer, sortOrder)
		{
			
		}
		/// <summary>
		/// Initializes a new instance of the DateTimeComparer class with the specified 
		/// TableModel, Column index and SortOrder
		/// </summary>
		/// <param name="tableModel">The TableModel that contains the data to be sorted</param>
		/// <param name="column">The index of the Column to be sorted</param>
		/// <param name="sortOrder">Specifies how the Column is to be sorted</param>
		public DateTimeComparer(TableModel tableModel, int column, SortOrder sortOrder) : base(tableModel, column, sortOrder)
		{
			
		}
Beispiel #6
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 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 = Rectangle.Empty;
			this.newSelectionBounds = Rectangle.Empty;
			
			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 TextComparer class with the specified 
		/// TableModel, Column index and SortOrder
		/// </summary>
		/// <param name="tableModel">The TableModel that contains the data to be sorted</param>
		/// <param name="column">The index of the Column to be sorted</param>
		/// <param name="sortOrder">Specifies how the Column is to be sorted</param>
		public TextComparer(TableModel tableModel, int column, SortOrder sortOrder) : base(tableModel, column, sortOrder)
		{
			
		}
Beispiel #9
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;
			}
		}
Beispiel #10
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);
		}
		/// <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)
		{
			
		}
		/// <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;
		}