当前位置: 首页>>代码示例>>C#>>正文


C# CellContext类代码示例

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


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


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