/// <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) { I3Cell 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; } }
/// <summary> /// Initializes a new instance of the ColumnCollectionEditor class /// using the specified collection type /// </summary> /// <param name="type">The type of the collection for this editor to edit</param> public I3ColumnCollectionEditor(Type type) : base(type) { this.columns = null; this.previewColumnModel = new I3ColumnModel(); this.previewColumnModel.Columns.Add(new I3TextColumn("Column", 116)); this.previewTableModel = new I3TableModel(); this.previewTableModel.Rows.Add(new I3Row()); //I3Cell cell = new I3Cell(); //cell.Editable = false; //cell.ToolTipText = "This is a Cell ToolTip"; //this.previewTableModel.Rows[0].Cells.Add(cell); this.previewTableModel.DefaultRowHeight = 20; this.previewTable = new I3Table(); this.previewTable.EnableColumnHeaderContextMenu = false; this.previewTable.Preview = true; this.previewTable.Size = new Size(120, 274); this.previewTable.Location = new Point(0, 24); this.previewTable.GridLines = I3GridLines.Both; this.previewTable.TabStop = false; this.previewTable.EnableToolTips = true; this.previewTable.ColumnModel = this.previewColumnModel; this.previewTable.TableModel = this.previewTableModel; this.previewLabel = new Label(); this.previewLabel.Name = "previewLabel"; this.previewLabel.Text = "нц└└:"; this.previewLabel.Size = new Size(140, 16); this.previewLabel.Location = new Point(0, 8); }
/// <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 I3SorterBase(I3TableModel 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 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 I3TableModelEventArgs(I3TableModel source, I3Row row, int fromIndex, int toIndex) { this.source = source; this.row = row; this.fromIndex = fromIndex; this.toIndex = toIndex; }
/// <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 I3SelectionEventArgs(I3TableModel 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 RowCollection class /// that belongs to the specified TableModel /// </summary> /// <param name="owner">A TableModel representing the tableModel that owns /// the RowCollection</param> public I3RowCollection(I3TableModel owner) : base() { if (owner == null) { throw new ArgumentNullException("owner"); } this.owner = owner; }
/// <summary> /// Initialise default values /// </summary> private void Init() { this.cells = null; this.userData = null; this.tag = null; this.tableModel = null; this.index = -1; this.rowStyle = null; this.selectedCellCount = 0; this.rowState = I3RowState.Normal; this.state = (byte)(STATE_EDITABLE | STATE_ENABLED); }
/// <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 = (I3RowCollection)value; object returnObject = base.EditValue(context, isp, value); I3TableModel model = (I3TableModel)context.Instance; // make sure the TableModel's Table redraws any additions/deletions if (model.Table != null) { model.Table.PerformLayout(); model.Table.Refresh(); } return(returnObject); }
/// <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 I3TextComparer(I3TableModel tableModel, int column, SortOrder sortOrder) : base(tableModel, column, sortOrder) { }
/// <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 I3TableModelEventArgs(I3TableModel 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 I3TableModelEventArgs(I3TableModel source) : this(source, null, -1, -1) { }
/// <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 I3ShellSorter(I3TableModel tableModel, int column, IComparer comparer, SortOrder sortOrder) : base(tableModel, column, comparer, sortOrder) { }
private void InitializeComponent() { this.groupBox1 = new System.Windows.Forms.GroupBox(); this.okButton = new System.Windows.Forms.Button(); this.cancelButton = new System.Windows.Forms.Button(); this.columnTable = new IE310.Table.Models.I3Table(); this.columnModel1 = new IE310.Table.Column.I3ColumnModel(); this.cbc = new IE310.Table.Column.I3CheckBoxColumn(); this.tc = new IE310.Table.Column.I3TextColumn(); this.tableModel1 = new IE310.Table.Row.I3TableModel(); this.button3 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.columnTable)).BeginInit(); this.SuspendLayout(); // // groupBox1 // this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.groupBox1.Location = new System.Drawing.Point(8, 375); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(322, 8); this.groupBox1.TabIndex = 9; this.groupBox1.TabStop = false; // // okButton // this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.okButton.FlatStyle = System.Windows.Forms.FlatStyle.System; this.okButton.Location = new System.Drawing.Point(168, 395); this.okButton.Name = "okButton"; this.okButton.Size = new System.Drawing.Size(75, 23); this.okButton.TabIndex = 10; this.okButton.Text = "确定"; this.okButton.Click += new System.EventHandler(this.okButton_Click); // // cancelButton // this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.cancelButton.FlatStyle = System.Windows.Forms.FlatStyle.System; this.cancelButton.Location = new System.Drawing.Point(253, 395); this.cancelButton.Name = "cancelButton"; this.cancelButton.Size = new System.Drawing.Size(75, 23); this.cancelButton.TabIndex = 11; this.cancelButton.Text = "取消"; // // columnTable // this.columnTable.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.columnTable.ColumnHeaderDisplayMode = IE310.Table.Header.I3ColumnHeaderDisplayMode.Text; this.columnTable.ColumnModel = this.columnModel1; this.columnTable.EnableToolTips = true; this.columnTable.ExtendLastCol = true; this.columnTable.GridColor = System.Drawing.SystemColors.ActiveCaption; this.columnTable.HeaderFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold); this.columnTable.Location = new System.Drawing.Point(12, 46); this.columnTable.Name = "columnTable"; this.columnTable.RowHeaderDisplayMode = IE310.Table.Header.I3RowHeaderDisplayMode.Num; this.columnTable.Size = new System.Drawing.Size(316, 323); this.columnTable.TabIndex = 1; this.columnTable.TableModel = this.tableModel1; this.columnTable.ToolTipAutomaticDelay = 1000; this.columnTable.ToolTipAutoPopDelay = 10000; this.columnTable.UnfocusedSelectionBackColor = System.Drawing.SystemColors.Highlight; this.columnTable.UnfocusedSelectionForeColor = System.Drawing.SystemColors.HighlightText; // // columnModel1 // this.columnModel1.ColumnHeaderHeight = 20; this.columnModel1.Columns.AddRange(new IE310.Table.Column.I3Column[] { this.cbc, this.tc }); // // cbc // this.cbc.Caption = "选择"; this.cbc.CellAlignment = IE310.Table.Column.I3ColumnAlignment.Center; this.cbc.CheckBoxColumnStyle = IE310.Table.Column.I3CheckBoxColumnStyle.Image; this.cbc.CustomCheckImage = null; this.cbc.CustomCheckImageFillClient = false; this.cbc.CustomCheckImageSize = new System.Drawing.Size(24, 18); this.cbc.DataMember = ""; this.cbc.Dictionary = null; this.cbc.DrawText = false; this.cbc.IsSelected = false; this.cbc.Key = ""; this.cbc.NeedWidth = 34.76953F; this.cbc.Sortable = false; this.cbc.Tag = null; this.cbc.ToolTipText = "点击左键全选\r\n点击右键反选"; this.cbc.Width = 49; // // tc // this.tc.Caption = "列名"; this.tc.CellAlignment = IE310.Table.Column.I3ColumnAlignment.Center; this.tc.DataMember = ""; this.tc.Dictionary = null; this.tc.Editable = false; this.tc.IsSelected = false; this.tc.Key = ""; this.tc.NeedWidth = 34.76953F; this.tc.Sortable = false; this.tc.Tag = null; this.tc.Width = 225; // // tableModel1 // this.tableModel1.DataSource = null; this.tableModel1.DefaultRowHeight = 20; // // button3 // this.button3.Image = global::IE310.Table.Properties.Resources.backselect32; this.button3.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.button3.Location = new System.Drawing.Point(150, 12); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(58, 23); this.button3.TabIndex = 14; this.button3.Text = "反选"; this.button3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.button3.UseVisualStyleBackColor = true; this.button3.Click += new System.EventHandler(this.button3_Click); // // button2 // this.button2.Image = global::IE310.Table.Properties.Resources.unselect32; this.button2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.button2.Location = new System.Drawing.Point(76, 12); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(68, 23); this.button2.TabIndex = 13; this.button2.Text = "全不选"; this.button2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.button2_Click); // // button1 // this.button1.Image = global::IE310.Table.Properties.Resources.allselect32; this.button1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.button1.Location = new System.Drawing.Point(12, 12); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(58, 23); this.button1.TabIndex = 12; this.button1.Text = "全选"; this.button1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // I3ShowColumnsDialog // this.AcceptButton = this.okButton; this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); this.CancelButton = this.cancelButton; this.ClientSize = new System.Drawing.Size(339, 431); this.Controls.Add(this.button3); this.Controls.Add(this.button2); this.Controls.Add(this.button1); this.Controls.Add(this.cancelButton); this.Controls.Add(this.okButton); this.Controls.Add(this.groupBox1); this.Controls.Add(this.columnTable); this.Font = new System.Drawing.Font("Tahoma", 8.25F); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "I3ShowColumnsDialog"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "列设置"; ((System.ComponentModel.ISupportInitialize)(this.columnTable)).EndInit(); this.ResumeLayout(false); }