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

C# CellContext类代码示例

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

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



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

示例1: OnFocusLeft

		public override void OnFocusLeft(CellContext sender, EventArgs e)
		{
			base.OnFocusLeft (sender, e);

			if (sender.Grid!=null)
				sender.Grid.InvalidateCell(sender.Position);
		}
开发者ID:wsrf2009,项目名称:KnxUiEditor,代码行数:7,代码来源:StandardBehavior.cs


示例2: OnFocusLeft

		/// <summary>
		/// 
		/// </summary>
		/// <param name="e"></param>
		public override void OnFocusLeft(CellContext sender, EventArgs e)
		{
			base.OnFocusLeft (sender, e);

			if (sender.Cell != null && sender.Cell.Controller != null)
				sender.Cell.Controller.OnFocusLeft(sender, e);
		}
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:11,代码来源:CellEventDispatcher.cs


示例3: OnClick

        public override void OnClick(CellContext sender, EventArgs e)
        {
            base.OnClick(sender, e);

            if (mLastButton == MouseButtons.Left)
                OnExecuted(sender, e);
        }
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:7,代码来源:Button.cs


示例4: OnMouseMove

        public override void OnMouseMove(CellContext sender, MouseEventArgs e)
        {
            base.OnMouseMove(sender, e);

            //Mouse multi selection

            //First check if the multi selection is enabled and the active position is valid
            if (sender.Grid.Selection.EnableMultiSelection == false ||
                sender.Grid.MouseDownPosition.IsEmpty() ||
                sender.Grid.MouseDownPosition != sender.Grid.Selection.ActivePosition)
                return;

            //Check if the mouse position is valid
            Position mousePosition = sender.Grid.PositionAtPoint(new Point(e.X, e.Y));
            if (mousePosition.IsEmpty())
                return;

            //If the position type is different I don't continue
            // bacause this can cause problem for example when selection the fixed rows when the scroll is on a position > 0
            // that cause all the rows to be selected
            if (sender.Grid.GetPositionType(mousePosition) !=
                sender.Grid.GetPositionType(sender.Grid.Selection.ActivePosition))
                return;

            sender.Grid.ChangeMouseSelectionCorner(mousePosition);
        }
开发者ID:zhuangyy,项目名称:Motion,代码行数:26,代码来源:MouseSelection.cs


示例5: OnEditEnded

        /// <summary>
        /// Fired when editing is ended
        /// </summary>
        /// <param name="e"></param>
        public override void OnEditEnded(CellContext sender, EventArgs e)
        {
            base.OnEditEnded (sender, e);

            //Invalidate the selection to redraw the selection border
            sender.Grid.Selection.Invalidate();
        }
开发者ID:zhuangyy,项目名称:Motion,代码行数:11,代码来源:StandardBehavior.cs


示例6: OnMouseDown

        public override void OnMouseDown(CellContext sender, System.Windows.Forms.MouseEventArgs e)
        {
            base.OnMouseDown(sender, e);

            if (e.Button != MouseButtons.Left)
                return;

            GridVirtual grid = sender.Grid;

            //Check the control and shift key status
            bool controlPress = ((Control.ModifierKeys & Keys.Control) == Keys.Control &&
                (grid.SpecialKeys & GridSpecialKeys.Control) == GridSpecialKeys.Control);

            bool shiftPress = ((Control.ModifierKeys & Keys.Shift) == Keys.Shift &&
                (grid.SpecialKeys & GridSpecialKeys.Shift) == GridSpecialKeys.Shift);

            if (shiftPress == false ||
                grid.Selection.EnableMultiSelection == false)
            {
                //Handle Control key
                bool mantainSelection = grid.Selection.EnableMultiSelection && controlPress;

                grid.Selection.Focus(sender.Position, !mantainSelection);
            }
            else //handle shift key
            {
                grid.Selection.ResetSelection(true);

                Range rangeToSelect = new Range(grid.Selection.ActivePosition, sender.Position);
                grid.Selection.SelectRange(rangeToSelect, true);
            }
        }
开发者ID:zhuangyy,项目名称:Motion,代码行数:32,代码来源:MouseSelection.cs


示例7: OnDoubleClick

		/// <summary>
		/// 
		/// </summary>
		/// <param name="e"></param>
		public override void OnDoubleClick (CellContext sender, EventArgs e)
		{
			base.OnDoubleClick(sender, e);

			if (sender.Cell != null && sender.Cell.Controller != null)
				sender.Cell.Controller.OnDoubleClick(sender, e);
		}
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:11,代码来源:CellEventDispatcher.cs


示例8: OnClick

		public override void OnClick(CellContext sender, EventArgs e)
		{
			base.OnClick(sender, e);

            if (mLastButton == MouseButtons.Left)
    			UIChangeChecked(sender, e);
		}
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:7,代码来源:CheckBox.cs


示例9: OnMouseUp

		public override void OnMouseUp(CellContext sender, MouseEventArgs e)
		{
			base.OnMouseUp (sender, e);

			//Note: I can't use the click event because I don't have Button information (Control.MouseButtons returns always None inside the Click event)

			Point currentPoint = sender.Grid.PointToClient(System.Windows.Forms.Control.MousePosition);
			Rectangle cellRect = sender.Grid.PositionToRectangle(sender.Position);
			float distance;
			DevAge.Drawing.RectanglePartType partType = LogicalBorder.GetPointPartType(cellRect, currentPoint, out distance);

			//eseguo il sort solo se non sono attualmente in resize
			if ( IsSortEnable(sender) &&
			    partType == DevAge.Drawing.RectanglePartType.ContentArea &&
			    e.Button == System.Windows.Forms.MouseButtons.Left )
			{
                // AlanP: Dec 2013.  Do not do a sort if the MouseUp is after a coulmnWidthResize
                Resizable resizableHeader = (Resizable)sender.Cell.Controller.FindController(typeof(Resizable));
                if (resizableHeader != null)
                {
                    // If the mouse down initiated a resize of the header on this cell we don't want to do a sort
                    if (resizableHeader.MouseDownStartedWidthResize)
                    {
                        return;
                    }
                }

				Models.ISortableHeader sortHeader = (Models.ISortableHeader)sender.Cell.Model.FindModel(typeof(Models.ISortableHeader));
				Models.SortStatus l_Status = sortHeader.GetSortStatus(sender);
				if (l_Status.Style == DevAge.Drawing.HeaderSortStyle.Ascending)
					SortColumn(sender, false, l_Status.Comparer);
				else
					SortColumn(sender, true, l_Status.Comparer);
			}
		}
开发者ID:Davincier,项目名称:openpetra,代码行数:35,代码来源:SortableHeader.cs


示例10: OnKeyPress

		/// <summary>
		/// 
		/// </summary>
		/// <param name="e"></param>
		public override void OnKeyPress (CellContext sender, KeyPressEventArgs e)
		{
			base.OnKeyPress(sender, e);

			if (sender.Cell != null && sender.Cell.Controller != null && e.Handled == false)
				sender.Cell.Controller.OnKeyPress(sender, e);
		}
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:11,代码来源:CellEventDispatcher.cs


示例11: InternalStartEdit

		/// <summary>
		/// Start editing the cell passed. Do not call this method for start editing a cell, you must use CellContext.StartEdit.
		/// </summary>
		/// <param name="cellContext">Cell to start edit</param>
		internal override void InternalStartEdit(CellContext cellContext)
		{
			base.InternalStartEdit(cellContext);

			if (Control == null)
				throw new SourceGridException("Control cannot be null");

			if (IsEditing == false && EnableEdit)
			{
				//verifico di non avere ancora una cella associata
				if (EditCell!=null)
					throw new SourceGridException("There is already a Cell in edit state");

				if (IsControlAttached() == false)
					AttachControl(cellContext.Grid);

				mLinkedControl.Position = cellContext.Position;

				//aggiorno la posizione
				cellContext.Grid.ArrangeLinkedControls();

				OnStartingEdit(cellContext, Control);

				//With this method the edit start
				SetEditCell(cellContext);

				//Set the control value
				SafeSetEditValue(cellContext.Cell.Model.ValueModel.GetValue(cellContext));

				//Show the control
				ShowControl(Control);
			}
		}
开发者ID:wsrf2009,项目名称:KnxUiEditor,代码行数:37,代码来源:EditorControlBase.cs


示例12: OnEditEnded

		/// <summary>
		/// Fired when editing is ended
		/// </summary>
		public override void OnEditEnded(CellContext sender, EventArgs e)
		{
			base.OnEditEnded (sender, e);

			if (sender.Cell != null && sender.Cell.Controller != null)
				sender.Cell.Controller.OnEditEnded(sender, e);
		}
开发者ID:wsrf2009,项目名称:KnxUiEditor,代码行数:10,代码来源:CellEventDispatcher.cs


示例13: OnMouseUp

        public override void OnMouseUp(CellContext sender, MouseEventArgs e)
        {
            base.OnMouseUp(sender, e);

            m_IsWidthResize = false;
            m_IsHeightResize = false;
        }
开发者ID:wsrf2009,项目名称:KnxUiEditor,代码行数:7,代码来源:Resizable.cs


示例14: OnStartingEdit

		/// <summary>
		/// This method is called just before the edit start. You can use this method to customize the editor with the cell informations.
		/// </summary>
		/// <param name="cellContext"></param>
		/// <param name="editorControl"></param>
		protected override void OnStartingEdit(CellContext cellContext, Control editorControl)
		{
			base.OnStartingEdit(cellContext, editorControl);

			System.Windows.Forms.DateTimePicker dtPicker = (System.Windows.Forms.DateTimePicker)editorControl;
			dtPicker.Font = cellContext.Cell.View.Font;
		}
开发者ID:wsrf2009,项目名称:KnxUiEditor,代码行数:12,代码来源:DateTimePicker.cs


示例15: OnMouseLeave

        public override void OnMouseLeave(CellContext sender, EventArgs e)
        {
            base.OnMouseLeave(sender, e);

            if (mApplyOnMouseEnter)
                ResetCursor(sender, e);
        }
开发者ID:zhuangyy,项目名称:Motion,代码行数:7,代码来源:MouseCursor.cs


示例16: grid_MouseDown

		protected virtual void grid_MouseDown(GridVirtual sender, System.Windows.Forms.MouseEventArgs e)
		{
			//verifico che l'eventuale edit sia terminato altrimenti esco
			if (sender.Selection.ActivePosition.IsEmpty() == false)
			{
				CellContext focusCell = new CellContext(sender, sender.Selection.ActivePosition);
				if (focusCell.Cell != null && focusCell.IsEditing())
				{
					if (focusCell.EndEdit(false) == false)
						return;
				}
			}

			//scateno eventi di MouseDown
			Position position = sender.PositionAtPoint( new Point(e.X, e.Y) );
			if (position.IsEmpty() == false)
			{
				Cells.ICellVirtual cellMouseDown = sender.GetCell(position);
				if (cellMouseDown != null)
				{
					sender.ChangeMouseDownCell(position, position);

					//Cell.OnMouseDown
					CellContext cellContext = new CellContext(sender, position, cellMouseDown);
					sender.Controller.OnMouseDown(cellContext, e);
				}
			}
			else
				sender.ChangeMouseDownCell(Position.Empty, Position.Empty);
		}
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:30,代码来源:Grid.cs


示例17: OnEditStarting

        public override void OnEditStarting(CellContext sender, System.ComponentModel.CancelEventArgs e)
        {
            base.OnEditStarting (sender, e);

            //Invalidate the selection to redraw the selection border
            sender.Grid.Selection.Invalidate();
        }
开发者ID:zhuangyy,项目名称:Motion,代码行数:7,代码来源:StandardBehavior.cs


示例18: PrepareView

        protected override void PrepareView(CellContext context)
        {
            // Do not start base prepare view, as it will render the text as normal TextGDI.
            // base.PrepareView(context);

            PrepareVisualElementRichTextBox(context);
        }
开发者ID:wsrf2009,项目名称:KnxUiEditor,代码行数:7,代码来源:RichTextBox.cs


示例19: OnDragEnter

        /// <summary>
        /// 
        /// </summary>
        /// <param name="e"></param>
        public override void OnDragEnter(CellContext sender, DragEventArgs e)
        {
            base.OnDragEnter (sender, e);

            if (sender.Cell != null && sender.Cell.Controller != null)
                sender.Cell.Controller.OnDragEnter(sender, e);
        }
开发者ID:zhuangyy,项目名称:Motion,代码行数:11,代码来源:CellEventDispatcher.cs


示例20: OnKeyPress

		public override void OnKeyPress(CellContext sender, KeyPressEventArgs e)
		{
			base.OnKeyPress(sender, e);

			if (e.KeyChar == ' ')
				UIChangeChecked(sender, e);
		}
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:7,代码来源:CheckBox.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# CellEventArgs类代码示例发布时间:2022-05-24
下一篇:
C# Cell类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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