예제 #1
0
 /// <summary>
 /// 清理所有正在使用的资源。
 /// </summary>
 /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
     }
     if (Id != null)
     {
         Id.Dispose();
         Id = null;
     }
     if (gridview1 != null)
     {
         gridview1.Dispose();
         gridview1 = null;
     }
     if (pager1 != null)
     {
         pager1.Dispose();
         pager1 = null;
     }
     base.Dispose(disposing);
 }
예제 #2
0
 /// <summary>
 /// 仅更新描述、引发统计事件
 /// </summary>
 internal void RefreshDesc()
 {
     if (dataSource == null)
     {
         return;
     }
     if (dataSource is DataTable)
     {
         var dt = dataSource as DataTable;
         PagerInfo.RecordCount = dt.Rows.Count;
         TPager.UpdateDesc(TotalEvent?.Invoke(dataSource));
     }
     else if (dataSource is IList list)
     {
         PagerInfo.RecordCount = list.Count;
         TPager.UpdateDesc(TotalEvent?.Invoke(dataSource));
     }
     else
     {
         PagerInfo.RecordCount = 1;
         TPager.UpdateDesc(null);
     }
 }
예제 #3
0
 /// <summary>
 /// 设计器支持所需的方法 - 不要
 /// 使用代码编辑器修改此方法的内容。
 /// </summary>
 private void InitializeComponent()
 {
     this.lbBottom  = new System.Windows.Forms.Label();
     this.pager1    = new Paway.Forms.TPager();
     this.lbTop     = new System.Windows.Forms.Label();
     this.gridview1 = new Paway.Forms.TDataGridView();
     this.Id        = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.lbLeft    = new System.Windows.Forms.Label();
     this.lbRight   = new System.Windows.Forms.Label();
     ((System.ComponentModel.ISupportInitialize)(this.gridview1)).BeginInit();
     this.SuspendLayout();
     //
     // lbBottom
     //
     this.lbBottom.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(149)))), ((int)(((byte)(204)))), ((int)(((byte)(223)))));
     this.lbBottom.Dock      = System.Windows.Forms.DockStyle.Bottom;
     this.lbBottom.Location  = new System.Drawing.Point(0, 202);
     this.lbBottom.Name      = "lbBottom";
     this.lbBottom.Size      = new System.Drawing.Size(576, 1);
     this.lbBottom.TabIndex  = 103;
     //
     // pager1
     //
     this.pager1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(207)))), ((int)(((byte)(221)))), ((int)(((byte)(238)))));
     this.pager1.Dock      = System.Windows.Forms.DockStyle.Bottom;
     this.pager1.Font      = new System.Drawing.Font("微软雅黑", 11F);
     this.pager1.Location  = new System.Drawing.Point(0, 172);
     this.pager1.Name      = "pager1";
     this.pager1.Size      = new System.Drawing.Size(576, 30);
     this.pager1.TabIndex  = 104;
     //
     // lbTop
     //
     this.lbTop.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(149)))), ((int)(((byte)(204)))), ((int)(((byte)(223)))));
     this.lbTop.Dock      = System.Windows.Forms.DockStyle.Top;
     this.lbTop.Location  = new System.Drawing.Point(0, 0);
     this.lbTop.Name      = "lbTop";
     this.lbTop.Size      = new System.Drawing.Size(576, 0);
     this.lbTop.TabIndex  = 108;
     //
     // gridview1
     //
     this.gridview1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
         this.Id
     });
     this.gridview1.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.gridview1.Location = new System.Drawing.Point(0, 0);
     this.gridview1.Name     = "gridview1";
     this.gridview1.RowTemplate.DefaultCellStyle.Font               = new System.Drawing.Font("微软雅黑", 9F);
     this.gridview1.RowTemplate.DefaultCellStyle.ForeColor          = System.Drawing.Color.Black;
     this.gridview1.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.LightBlue;
     this.gridview1.RowTemplate.DefaultCellStyle.SelectionForeColor = System.Drawing.Color.Black;
     this.gridview1.RowTemplate.Height    = 32;
     this.gridview1.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.False;
     this.gridview1.Size     = new System.Drawing.Size(576, 172);
     this.gridview1.TabIndex = 109;
     //
     // Id
     //
     this.Id.DataPropertyName = "Id";
     this.Id.HeaderText       = "Id";
     this.Id.Name             = "Id";
     this.Id.ReadOnly         = true;
     //
     // lbLeft
     //
     this.lbLeft.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(149)))), ((int)(((byte)(204)))), ((int)(((byte)(223)))));
     this.lbLeft.Dock      = System.Windows.Forms.DockStyle.Left;
     this.lbLeft.Location  = new System.Drawing.Point(0, 0);
     this.lbLeft.Name      = "lbLeft";
     this.lbLeft.Size      = new System.Drawing.Size(1, 172);
     this.lbLeft.TabIndex  = 110;
     //
     // lbRight
     //
     this.lbRight.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(149)))), ((int)(((byte)(204)))), ((int)(((byte)(223)))));
     this.lbRight.Dock      = System.Windows.Forms.DockStyle.Right;
     this.lbRight.Location  = new System.Drawing.Point(575, 0);
     this.lbRight.Name      = "lbRight";
     this.lbRight.Size      = new System.Drawing.Size(1, 172);
     this.lbRight.TabIndex  = 111;
     //
     // TDataGridViewPager
     //
     this.Controls.Add(this.lbRight);
     this.Controls.Add(this.lbLeft);
     this.Controls.Add(this.gridview1);
     this.Controls.Add(this.lbTop);
     this.Controls.Add(this.pager1);
     this.Controls.Add(this.lbBottom);
     this.Name = "TDataGridViewPager";
     this.Size = new System.Drawing.Size(576, 203);
     ((System.ComponentModel.ISupportInitialize)(this.gridview1)).EndInit();
     this.ResumeLayout(false);
 }