• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Models.Cell类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中XPTable.Models.Cell的典型用法代码示例。如果您正苦于以下问题:C# Cell类的具体用法?C# Cell怎么用?C# Cell使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Cell类属于XPTable.Models命名空间,在下文中一共展示了Cell类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CellToolTipEventArgs

 /// <summary>
 /// Creates a CellToolTipEventArgs using the values from args.
 /// </summary>
 /// <param name="cell"></param>
 /// <param name="location"></param>
 public CellToolTipEventArgs(Cell cell, Point location)
     : base(false)
 {
     this.Cell = cell;
     this.Location = location;
     this.ToolTipText = cell.ToolTipText;
 }
开发者ID:antiduh,项目名称:XPTable,代码行数:12,代码来源:ToolTipEventArgs.cs


示例2: CompareCells

        /// <summary>
        /// Compares two cells and returns a value indicating whether one is less 
        /// than, equal to or greater than the other.
        /// </summary>
        /// <param name="cell1"></param>
        /// <param name="cell2"></param>
        /// <returns></returns>
        protected override int CompareCells(Cell cell1, Cell cell2)
        {
            int retVal = 0;

            if (cell1.Checked && !cell2.Checked)
            {
                retVal = -1;
            }
            else if (!cell1.Checked && cell2.Checked)
            {
                retVal = 1;
            }

            // if the cells have the same checked value and the CheckBoxColumn
            // they belong to allows text drawing, compare the text properties
            // to determine order
            if (retVal == 0 && ((CheckBoxColumn)this.TableModel.Table.ColumnModel.Columns[this.SortColumn]).DrawText)
            {
                // check for null data
                if (cell1.Text == null && cell2.Text == null)
                {
                    return 0;
                }
                else if (cell1.Text == null)
                {
                    return -1;
                }

                retVal = cell1.Text.CompareTo(cell2.Text);
            }

            return retVal;
        }
开发者ID:antiduh,项目名称:XPTable,代码行数:40,代码来源:CheckBoxComparer.cs


示例3: UpdateControl

        public override Control UpdateControl(Cell cell, Control control)
        {
            // We either show a loading circle with the given colour, or just load an image.
            Control newControl = null;
            if (cell.Data is Color)
            {
                Color color = (Color)cell.Data;
                if (control is LoadingCircle)
                {
                    LoadingCircle lc = (LoadingCircle)control;
                    lc.Color = color;
                }
            }
            else
            {
                // We are getting rid of the control now - so remove event handlers
                if (control is LoadingCircle && this.ClickEventHandler != null)
                    ((LoadingCircle)control).Click -= ClickEventHandler;

                PictureBox pic = new PictureBox();
                pic.Image = new Bitmap(AppDomain.CurrentDomain.BaseDirectory + @"..\..\Resources\EmailRead.bmp");
                newControl = pic;
            }
            return newControl;
        }
开发者ID:adarmus,项目名称:XPTable,代码行数:25,代码来源:SpinnerFactory.cs


示例4: DoColspan

        private void DoColspan()
        {
            Table table = this.table;       // The Table control on a form - already initialised
            table.SelectionStyle = SelectionStyle.Grid;
            table.BeginUpdate();
            table.EnableWordWrap = true;    // If false, then Cell.WordWrap is ignored

            table.GridLines = GridLines.Rows;

            TextColumn col1 = new TextColumn("col A", 100);
            TextColumn col2 = new TextColumn("col B", 100);
            TextColumn col3 = new TextColumn("col C", 100);
            table.ColumnModel = new ColumnModel(new Column[] { col1, col2, col3 });

            TableModel model = new TableModel();

            Row row;
            Cell cell;

            // Add all 3 cells for row 1
            row = new Row();
            row.Cells.Add(new Cell("Short 1a"));
            //row1.Cells.Add(new Cell("Short 1"));
            cell = new Cell("This is long text that will just be truncated");
            row.Cells.Add(cell);
            row.Cells.Add(new Cell("Short 1c"));
            model.Rows.Add(row);

            // Add only 2 cells for row 2
            row = new Row();
            row.Cells.Add(new Cell("Short 2a"));
            cell = new Cell("This is text that will go over to the next column");
            cell.ColSpan = 2;          // The row height will be increased so we can see all the text
            row.Cells.Add(cell);
            // We don't add the next cell
            model.Rows.Add(row);

            // Add all 3 cells for row 3
            row = new Row();
            row.Cells.Add(new Cell("Short 3"));
            //row1.Cells.Add(new Cell("Short 1"));
            cell = new Cell("This is a cell with some really long text that wraps more than the other text");
            cell.WordWrap = true;          // The row height will be increased so we can see all the text
            row.Cells.Add(cell);
            row.Cells.Add(new Cell("Short 3c"));
            model.Rows.Add(row);

            // Add only 2 cells for row 4
            row = new Row();
            row.Cells.Add(new Cell("Short 4"));
            cell = new Cell("This is a cell with some really long text that wraps more than the other text");
            cell.WordWrap = true;         // Colspan and Wordwrap!!
            cell.ColSpan = 2;
            row.Cells.Add(cell);
            model.Rows.Add(row);

            this.table.TableModel = model;

            this.table.EndUpdate();
        }
开发者ID:antiduh,项目名称:XPTable,代码行数:60,代码来源:Demo.cs


示例5: CellEventArgsBase

 /// <summary>
 /// Initializes a new instance of the CellEventArgs class with 
 /// the specified Cell source, column index and row index
 /// </summary>
 /// <param name="source">The Cell that Raised the event</param>
 /// <param name="column">The Column index of the Cell</param>
 /// <param name="row">The Row index of the Cell</param>
 public CellEventArgsBase(Cell source, int column, int row)
     : base()
 {
     this.source = source;
     this.column = column;
     this.row = row;
 }
开发者ID:antiduh,项目名称:XPTable,代码行数:14,代码来源:CellEventArgsBase.cs


示例6: AddEmailRows

        private void AddEmailRows(TableModel table, bool read, string from, string sent, string subject, string preview)
        {
            Row row = new Row();
            row.Cells.Add(new Cell());       // always starts off showing all subrows
            row.Cells.Add(new Cell("", read ? _read : _unread));
            row.Cells.Add(new Cell(from));
            row.Cells.Add(new Cell(DateTime.Parse(sent)));
            row.Cells.Add(new Cell("hi"));
            table.Rows.Add(row);

            // Add a sub-row that shows just the email subject in grey (single line only)
            Row subrow = new Row();
            subrow.Cells.Add(new Cell());   // Extra column for +/-
            subrow.Cells.Add(new Cell());
            Cell cell = new Cell(subject);
            cell.ForeColor = Color.Gray;
            cell.ColSpan = 3;
            subrow.Cells.Add(cell);
            row.SubRows.Add(subrow);

            // Add a sub-row that shows just a preview of the email body in blue, and wraps too
            subrow = new Row();
            subrow.Cells.Add(new Cell());   // Extra column for +/-
            subrow.Cells.Add(new Cell());
            cell = new Cell(preview);
            cell.ForeColor = Color.Blue;
            cell.ColSpan = 3;
            cell.WordWrap = true;
            subrow.Cells.Add(cell);
            row.SubRows.Add(subrow);
        }
开发者ID:antiduh,项目名称:XPTable,代码行数:31,代码来源:Demo.cs


示例7: CanShow

        /// <summary>
        /// Called to determine whether this cell can be shown by this filter
        /// </summary>
        /// <param name="cell"></param>
        /// <returns></returns>
        public bool CanShow(Cell cell)
        {
            if (_allowedItems == null)
                return true;

            if (cell == null)
                return true;

            return _allowedItems.Contains(cell.Text);
        }
开发者ID:adarmus,项目名称:XPTable,代码行数:15,代码来源:TextColumnFilter.cs


示例8: GetCellHeight

 /// <summary>
 /// Returns the height that is required to render this cell. If zero is returned then the default row height is used.
 /// </summary>
 /// <param name="graphics"></param>
 /// <param name="cell"></param>
 /// <returns></returns>
 public override int GetCellHeight(Graphics graphics, Cell cell)
 {
     if (cell != null)
     {
         this.Font = cell.Font;
         // Need to set this.Bounds before we access Client rectangle
         SizeF size = graphics.MeasureString(cell.Text, this.Font, this.ClientRectangle.Width, this.StringFormat);
         return (int)Math.Ceiling(size.Height);
     }
     else
         return 0;
 }
开发者ID:samuraitruong,项目名称:comitdownloader,代码行数:18,代码来源:TextCellRenderer.cs


示例9: CompareCells

        /// <summary>
        /// Compares two cells and returns a value indicating whether one is less 
        /// than, equal to or greater than the other.
        /// </summary>
        /// <param name="cell1"></param>
        /// <param name="cell2"></param>
        /// <returns></returns>
        protected override int CompareCells(Cell cell1, Cell cell2)
        {
            // check for null data
            if (cell1.Data == null && cell2.Data == null)
            {
                return 0;
            }
            else if (cell1.Data == null)
            {
                return -1;
            }
            else if (cell2.Data == null)
            {
                return 1;
            }

            Color color1 = (Color) cell1.Data;
            Color color2 = (Color) cell2.Data;

            if (color1.GetHue() < color2.GetHue())
            {
                return -1;
            }
            else if (color1.GetHue() > color2.GetHue())
            {
                return 1;
            }
            else
            {
                if (color1.GetSaturation() < color2.GetSaturation())
                {
                    return -1;
                }
                else if (color1.GetSaturation() > color2.GetSaturation())
                {
                    return 1;
                }
                else
                {
                    if (color1.GetBrightness() < color2.GetBrightness())
                    {
                        return -1;
                    }
                    else if (color1.GetBrightness() > color2.GetBrightness())
                    {
                        return 1;
                    }

                    return 0;
                }
            }
        }
开发者ID:antiduh,项目名称:XPTable,代码行数:59,代码来源:ColorComparer.cs


示例10: DoWrap

        private void DoWrap()
        {
            Table table = this.table;       // The Table control on a form - already initialised

            table.BeginUpdate();
            table.EnableWordWrap = true;    // If false, then Cell.WordWrap is ignored
            table.SelectionStyle = SelectionStyle.Grid;
            table.GridLines = GridLines.Rows;

            TextColumn col1 = new TextColumn("col A", 100);
            TextColumn col2 = new TextColumn("col B", 100);
            table.ColumnModel = new ColumnModel(new Column[] { col1, col2 });

            TableModel model = new TableModel();

            Row row;
            Cell cell;

            row = new Row();
            row.Cells.Add(new Cell("Short 1"));
            //row1.Cells.Add(new Cell("Short 1"));
            cell = new Cell("This is a cell with quite long text");
            cell.WordWrap = true;          // The row height will be increased so we can see all the text
            row.Cells.Add(cell);
            model.Rows.Add(row);

            row = new Row();
            row.Cells.Add(new Cell("Short 2"));
            cell = new Cell("This is long text that will just be truncated");
            cell.WordWrap = false;         // Not needed - it is false by default
            row.Cells.Add(cell);
            model.Rows.Add(row);

            row = new Row();
            row.Cells.Add(new Cell("Short 3"));
            //row1.Cells.Add(new Cell("Short 1"));
            cell = new Cell("This is a cell with some really long text that wraps more than the other text");
            cell.WordWrap = true;          // The row height will be increased so we can see all the text
            row.Cells.Add(cell);
            model.Rows.Add(row);

            row = new Row();
            row.Cells.Add(new Cell("Short "));
            cell = new Cell("This is long text that will just be truncated");
            cell.WordWrap = false;         // Not needed - it is false by default
            row.Cells.Add(cell);
            model.Rows.Add(row);

            this.table.TableModel = model;

            this.table.EndUpdate();
        }
开发者ID:antiduh,项目名称:XPTable,代码行数:52,代码来源:Demo.cs


示例11: GetButtonRendererData

		/// <summary>
		/// Gets the ButtonCellRenderer specific data used by the Renderer from 
		/// the specified Cell
		/// </summary>
		/// <param name="cell">The Cell to get the ButtonCellRenderer data for</param>
		/// <returns>The ButtonCellRenderer data for the specified Cell</returns>
		protected ButtonRendererData GetButtonRendererData(Cell cell)
		{
			object rendererData = this.GetRendererData(cell);

			if (rendererData == null || !(rendererData is ButtonRendererData))
			{
				rendererData = new ButtonRendererData();

				this.SetRendererData(cell, rendererData);
			}

			return (ButtonRendererData) rendererData;
		}
开发者ID:nithinphilips,项目名称:SMOz,代码行数:19,代码来源:ButtonCellRenderer.cs


示例12: Add

		/// <summary>
		/// Adds the specified Cell to the end of the collection
		/// </summary>
		/// <param name="cell">The Cell to add</param>
		public int Add(Cell cell)
		{
			if (cell == null) 
			{
				throw new System.ArgumentNullException("Cell is null");
			}

			int index = this.List.Add(cell);

			this.OnCellAdded(new RowEventArgs(this.owner, cell, index, index));

			return index;
		}
开发者ID:nithinphilips,项目名称:SMOz,代码行数:17,代码来源:CellCollection.cs


示例13: AddEmailRows

        private void AddEmailRows(TableModel table, bool read, string from, string sent, string subject, string preview)
        {
            Row row = new Row();
            //row.Alignment = RowAlignment.Top;
            row.Cells.Add(new Cell());       // always starts off showing all subrows
            row.Cells.Add(new Cell("", read ? _read : _unread));
            Cell fro = new Cell(null); //from);
            fro.WordWrap = true;
            row.Cells.Add(fro);
            Cell cellSent = new Cell(DateTime.Parse(sent));
            if (sent == "5/4/2007 9:13")
            {
                cellSent.CellStyle = new CellStyle(ColumnAlignment.Left);
                cellSent.CellStyle.LineAlignment = RowAlignment.Top;
            }
            row.Cells.Add(cellSent);
            row.Cells.Add(new Cell("hi"));
            row.RowStyle = new XPTable.Models.RowStyle();
            row.RowStyle.Alignment = RowAlignment.Top;
            table.Rows.Add(row);

            // Add a sub-row that shows just the email subject in grey (single line only)
            Row subrow = new Row();
            subrow.Cells.Add(new Cell());   // Extra column for +/-
            subrow.Cells.Add(new Cell());
            subrow.RowStyle = new XPTable.Models.RowStyle();
            subrow.RowStyle.Alignment = RowAlignment.Bottom;
            Cell cell = new Cell(subject);
            cell.ForeColor = Color.Gray;
            cell.ColSpan = 3;

            subrow.Cells.Add(cell);
            row.SubRows.Add(subrow);

            // Add a sub-row that shows just a preview of the email body in blue, and wraps too
            subrow = new Row();
            subrow.Cells.Add(new Cell());   // Extra column for +/-
            subrow.Cells.Add(new Cell());
            cell = new Cell(preview);
            cell.ForeColor = Color.Blue;
            cell.ColSpan = 3;
            cell.WordWrap = true;
            subrow.RowStyle = new XPTable.Models.RowStyle();
            subrow.RowStyle.Alignment = RowAlignment.Bottom;
            subrow.Cells.Add(cell);
            row.SubRows.Add(subrow);
        }
开发者ID:adarmus,项目名称:XPTable,代码行数:47,代码来源:Demo.cs


示例14: CompareCells

        /// <summary>
        /// Compares two cells and returns a value indicating whether one is less 
        /// than, equal to or greater than the other.
        /// </summary>
        /// <param name="cell1"></param>
        /// <param name="cell2"></param>
        /// <returns></returns>
        protected override int CompareCells(Cell cell1, Cell cell2)
        {
            // check for null data
			if (cell1.Data == null && cell2.Data == null)
			{
				return 0;
			}
			else if (cell1.Data == null)
			{
				return -1;
			}
			else if (cell2.Data == null)
			{
				return 1;
			}

			return Convert.ToDateTime(cell1.Data).CompareTo(Convert.ToDateTime(cell2.Data));
		}
开发者ID:samuraitruong,项目名称:comitdownloader,代码行数:25,代码来源:DateTimeComparer.cs


示例15: Add

		/// <summary>
		/// Adds the specified Cell to the end of the collection
		/// </summary>
		/// <param name="cell">The Cell to add</param>
		public int Add(Cell cell)
		{
			if (cell == null) 
			{
				throw new System.ArgumentNullException("Cell is null");
			}

			int index = this.List.Add(cell);

			this.OnCellAdded(new RowEventArgs(this.owner, cell, index, index));

            for (int i = 1; i < cell.ColSpan; i++)
            {
                this.Add(new Cell(string.Empty));
            }

			return index;
		}
开发者ID:samuraitruong,项目名称:comitdownloader,代码行数:22,代码来源:CellCollection.cs


示例16: AddColumns

        /// <summary>
        /// 
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public void AddColumns(ColumnModel model)
        {
            this.model = model;

            CellStyle cellStyle = new CellStyle();
            cellStyle.Padding = new CellPadding(6, 0, 0, 0);

            this.columnTable.BeginUpdate();

            for (int i=0; i<model.Columns.Count; i++)
            {
                Row row = new Row();

                Cell cell = new Cell(model.Columns[i].Text, model.Columns[i].Visible);
                cell.Tag = model.Columns[i].Width;
                cell.CellStyle = cellStyle;

                row.Cells.Add(cell);

                this.columnTable.TableModel.Rows.Add(row);
            }

            this.columnTable.SelectionChanged += new Events.SelectionEventHandler(OnSelectionChanged);
            this.columnTable.CellCheckChanged += new Events.CellCheckBoxEventHandler(OnCellCheckChanged);

            if (this.columnTable.VScroll)
            {
                this.columnTable.ColumnModel.Columns[0].Width -= SystemInformation.VerticalScrollBarWidth;
            }

            if (this.columnTable.TableModel.Rows.Count > 0)
            {
                this.columnTable.TableModel.Selections.SelectCell(0, 0);

                this.showButton.Enabled = !this.model.Columns[0].Visible;
                this.hideButton.Enabled = this.model.Columns[0].Visible;

                this.widthTextBox.Text = this.model.Columns[0].Width.ToString();
            }

            this.columnTable.EndUpdate();
        }
开发者ID:adarmus,项目名称:XPTable,代码行数:47,代码来源:ShowColumnsDialog.cs


示例17: CompareCells

        /// <summary>
        /// Compares two cells and returns a value indicating whether one is less 
        /// than, equal to or greater than the other.
        /// </summary>
        /// <param name="cell1"></param>
        /// <param name="cell2"></param>
        /// <returns></returns>
        protected override int CompareCells(Cell cell1, Cell cell2)
        {
            string cell1Text = "";
            string cell2Text = "";

            if (cell1.Text != null)
            {
                cell1Text = cell1.Text;
            }

            if (cell2.Text != null)
            {
                cell2Text = cell2.Text;
            }

            // check for null data and empty text.
            if (cell1.Data == null && cell2.Data == null && cell1Text.Length == 0 && cell2Text.Length == 0)
            {
                return 0;
            }
            else if (cell1.Data == null && cell1Text.Length == 0)
            {
                return -1;
            }
            else if (cell2.Data == null && cell2Text.Length == 0)
            {
                return 1;
            }

            if (cell1.Data != null && cell2.Data != null)
            {
                // Compare using cell data.
                return Convert.ToDateTime(cell1.Data).CompareTo(Convert.ToDateTime(cell2.Data));
            }
            else
            {
                // Compare using cell text.
                return Convert.ToDateTime(cell1Text).CompareTo(Convert.ToDateTime(cell2Text));
            }
        }
开发者ID:adarmus,项目名称:XPTable,代码行数:47,代码来源:DateTimeComparer.cs


示例18: GetControl

        public override Control GetControl(Cell cell)
        {
            LoadingCircle circle = null;
            if (cell.Data != null && cell.Data is Color)
            {
                // Yes - we do want to show a control
                circle = new LoadingCircle();

                // We assign the event handler in this way so that when it is clicked, the event is handled
                // *directly* by the form - it doesnt get processed at all by this object (the Spinner Factory)
                if (this.ClickEventHandler != null)
                    circle.Click += ClickEventHandler;

                circle.SetCircleAppearance(12, 2, 5, 11);
                circle.Active = true;
                circle.Height = 12;
                circle.Width = 12;
                circle.Color = ((Color)cell.Data);  // We've already checked the type of cell.Data above
            }

            return circle;
        }
开发者ID:adarmus,项目名称:XPTable,代码行数:22,代码来源:SpinnerFactory.cs


示例19: CompareCells

        /// <summary>
        /// Compares two cells and returns a value indicating whether one is less 
        /// than, equal to or greater than the other.
        /// </summary>
        /// <param name="cell1"></param>
        /// <param name="cell2"></param>
        /// <returns></returns>
        protected override int CompareCells(Cell cell1, Cell cell2)
        {
            int retVal = 0;

			// check for null data
			if (cell1.Data == null && cell2.Data == null)
			{
				retVal = 0;
			}
			else if (cell1.Data == null)
			{
				retVal = -1;
			}
			else if (cell2.Data == null)
			{
				retVal = 1;
			}

			// since images aren't comparable, if retVal = 0 and the ImageColumn 
			// they belong to allows text drawing, compare the text properties 
			// to determine order
			if (retVal == 0 && ((ImageColumn) this.TableModel.Table.ColumnModel.Columns[this.SortColumn]).DrawText)
			{
				// check for null data
				if (cell1.Text == null && cell2.Text == null)
				{
					return 0;
				}
				else if (cell1.Text == null)
				{
					return -1;
				}
			
				retVal = cell1.Text.CompareTo(cell2.Text);
			}

			return retVal;
		}
开发者ID:samuraitruong,项目名称:comitdownloader,代码行数:45,代码来源:ImageComparer.cs


示例20: CompareCells

        /// <summary>
        /// Compares two cells and returns a value indicating whether one is less 
        /// than, equal to or greater than the other.
        /// </summary>
        /// <param name="cell1"></param>
        /// <param name="cell2"></param>
        /// <returns></returns>
        protected override int CompareCells(Cell cell1, Cell cell2)
        {
            string s1 = cell1.Text;
            string s2 = cell2.Text;

            // check for null cells
            if (s1 == null && s2 == null)
            {
                return 0;
            }
            else if (s1 == null)
            {
                return -1;
            }
            else if (s2 == null)
            {
                return 1;
            }
            else
            {
                return s1.CompareTo(s2);
            }
        }
开发者ID:samuraitruong,项目名称:comitdownloader,代码行数:30,代码来源:TextComparer.cs



注:本文中的XPTable.Models.Cell类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Models.CellPos类代码示例发布时间:2022-05-26
下一篇:
C# Events.PaintCellEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap