本文整理匯總了C#中SourceGrid.Position.IsEmpty方法的典型用法代碼示例。如果您正苦於以下問題:C# Position.IsEmpty方法的具體用法?C# Position.IsEmpty怎麽用?C# Position.IsEmpty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SourceGrid.Position
的用法示例。
在下文中一共展示了Position.IsEmpty方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: PositionToCellRange
/// <summary>
/// This method converts a Position to the real range of the cell. This is usefull when RowSpan or ColumnSpan is greater than 1.
/// For example suppose to have at grid[0,0] a cell with ColumnSpan equal to 2. If you call this method with the position 0,0 returns 0,0-0,1 and if you call this method with 0,1 return again 0,0-0,1.
/// </summary>
/// <param name="pPosition"></param>
/// <returns></returns>
public virtual Range PositionToCellRange(Position pPosition)
{
if (pPosition.IsEmpty())
return Range.Empty;
ICellVirtual l_Cell = this.GetCell(pPosition.Row, pPosition.Column);
if (l_Cell == null)
return Range.Empty;
else
return new Range(pPosition);
//return new Range(pPosition);
}
示例2: PositionToCellRange
/// <summary>
/// This method converts a Position to the real range of the cell. This is usefull when RowSpan or ColumnSpan is greater than 1.
/// For example suppose to have at grid[0,0] a cell with ColumnSpan equal to 2. If you call this method with the position 0,0 returns 0,0-0,1 and if you call this method with 0,1 return again 0,0-0,1.
/// </summary>
/// <param name="pPosition"></param>
/// <returns></returns>
public override Range PositionToCellRange(Position pPosition)
{
if (pPosition.IsEmpty())
return Range.Empty;
Cells.ICell l_Cell = this[pPosition.Row, pPosition.Column];
if (l_Cell == null)
return Range.Empty;
else
return l_Cell.Range;
}
示例3: GetCell
/// <summary>
/// Return the Cell at the specified Row and Col position. This method is called for sort operations and for Move operations. If position is Empty return null. This method calls GetCell(int p_iRow, int p_iCol)
/// </summary>
/// <param name="p_Position"></param>
/// <returns></returns>
public Cells.ICellVirtual GetCell(Position p_Position)
{
if (p_Position.IsEmpty())
return null;
else
return GetCell(p_Position.Row, p_Position.Column);
}
示例4: GetPositionType
/// <summary>
/// Returns the type of a cell position
/// </summary>
/// <param name="position"></param>
/// <returns></returns>
public CellPositionType GetPositionType(Position position)
{
if (position.IsEmpty())
return CellPositionType.Empty;
else if (position.Row < FixedRows && position.Column < FixedColumns)
return CellPositionType.FixedTopLeft;
else if (position.Row < FixedRows)
return CellPositionType.FixedTop;
else if (position.Column < FixedColumns)
return CellPositionType.FixedLeft;
else
return CellPositionType.Scrollable;
}
示例5: OnKeyDown
protected override void OnKeyDown(KeyEventArgs e)
{
base.OnKeyDown(e);
m_keybordActivePosition = Selection.ActivePosition;
if (m_keybordActivePosition.IsEmpty() == false)
{
Cells.ICellVirtual focusCell = GetCell(m_keybordActivePosition);
if (focusCell != null)
Controller.OnKeyDown(new CellContext(this, m_keybordActivePosition, focusCell), e);
}
if (e.Handled == false)
ProcessSpecialGridKey(e);
}
示例6: HandleMouseDoubleClick
private void HandleMouseDoubleClick(Position clickPosition, EventArgs e)
{
if (clickPosition.IsEmpty() == true)
return;
Cells.ICellVirtual mouseDownCell = GetCell(clickPosition);
if (mouseDownCell != null)
Controller.OnDoubleClick(new CellContext(this, clickPosition, mouseDownCell), e);
}
示例7: ChangeMouseCell
/// <summary>
/// Fired when the cell under the mouse change. For internal use only.
/// </summary>
/// <param name="p_Cell"></param>
public virtual void ChangeMouseCell(Position p_Cell)
{
if (m_MouseCellPosition != p_Cell)
{
//se la cella che sta perdento il mouse è anche quella che ha ricevuto un eventuale evento di MouseDown non scateno il MouseLeave (che invece verrà scatenato dopo il MouseUp)
if (m_MouseCellPosition.IsEmpty() == false &&
m_MouseCellPosition != m_MouseDownPosition)
{
Controller.OnMouseLeave(new CellContext(this, m_MouseCellPosition), EventArgs.Empty);
}
m_MouseCellPosition = p_Cell;
if (m_MouseCellPosition.IsEmpty() == false)
{
Controller.OnMouseEnter(new CellContext(this, m_MouseCellPosition), EventArgs.Empty);
}
}
}
示例8: FindDestinationRange
/// <summary>
/// Calculate the destination range for the drop or paste operations.
/// </summary>
/// <param name="destinationGrid"></param>
/// <param name="dropDestination"></param>
/// <returns></returns>
public Range FindDestinationRange(GridVirtual destinationGrid, Position dropDestination)
{
if (dropDestination.IsEmpty())
return Range.Empty;
Position destinationStart = new Position(dropDestination.Row + (mSourceRange.Start.Row - mStartDragPosition.Row),
dropDestination.Column + (mSourceRange.Start.Column - mStartDragPosition.Column) );
destinationStart = Position.Max(destinationStart, new Position(0, 0));
Range destination = mSourceRange;
destination.MoveTo( destinationStart );
destination = destination.Intersect(destinationGrid.CompleteRange);
return destination;
}
示例9: Contains
/// <summary>
/// Indicates if the specified cell is selected
/// </summary>
/// <param name="p_Cell"></param>
/// <returns></returns>
public virtual bool Contains(Position p_Cell)
{
if (p_Cell.IsEmpty() || IsEmpty())
return false;
//Range
for (int i = 0; i < m_RangeCollection.Count; i++)
{
if (m_RangeCollection[i].Contains(p_Cell))
return true;
}
return false;
}