本文整理汇总了C#中System.Windows.Input.QueryCursorEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# QueryCursorEventArgs类的具体用法?C# QueryCursorEventArgs怎么用?C# QueryCursorEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
QueryCursorEventArgs类属于System.Windows.Input命名空间,在下文中一共展示了QueryCursorEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnQueryCursor
/// <inheritdoc/>
protected internal override void OnQueryCursor(QueryCursorEventArgs e)
{
if (LinkIsClickable()) {
e.Handled = true;
e.Cursor = Cursors.Hand;
}
}
示例2: OnQueryCursor
//-------------------------------------------------------------------
//
// Private Methods
//
//----------------------------------------------------------------------
#region Private Methods
// QueryCursorEvent callback.
// If this Hyperlink is editable, use the editor cursor unless
// the control key is down.
private static void OnQueryCursor(object sender, QueryCursorEventArgs e)
{
Hyperlink link = (Hyperlink)sender;
if (link.IsEnabled && link.IsEditable)
{
if ((Keyboard.Modifiers & ModifierKeys.Control) == 0)
{
e.Cursor = link.TextContainer.TextSelection.TextEditor._cursor;
e.Handled = true;
}
}
}
示例3: OnQueryCursor
protected override void OnQueryCursor(QueryCursorEventArgs e)
{
base.OnQueryCursor(e);
if (_context != null) {
Cursor cursor = _context.Services.Tool.CurrentTool.Cursor;
if (cursor != null) {
e.Cursor = cursor;
e.Handled = true;
}
}
}
示例4: OnQueryCursorThunk
private static void OnQueryCursorThunk(object sender, QueryCursorEventArgs e)
{
Invariant.Assert(!e.Handled, "Unexpected: Event has already been handled.");
UIElement uie = sender as UIElement;
if (uie != null)
{
uie.OnQueryCursor(e);
}
else
{
ContentElement ce = sender as ContentElement;
if (ce != null)
{
ce.OnQueryCursor(e);
}
else
{
((UIElement3D)sender).OnQueryCursor(e);
}
}
}
示例5: textArea_QueryCursor
void textArea_QueryCursor(object sender, QueryCursorEventArgs e)
{
throw new NotImplementedException();
}
示例6: OnQueryCursor
protected override void OnQueryCursor(QueryCursorEventArgs e)
{
if (FindNextInsertionPoint(e.GetPosition(this)) >= 0)
e.Cursor = Cursors.UpArrow;
else
e.Cursor = Cursors.Arrow;
e.Handled = true;
}
示例7: OnQueryCursor
// QueryCursorEvent handler
internal static void OnQueryCursor(object sender, QueryCursorEventArgs e)
{
TextEditor This = TextEditor._GetTextEditor(sender);
if (This == null)
{
return;
}
if (This.TextView == null)
{
return;
}
// Determine whether the cursor is over our render scope. In particular, we want to distinguish between
// being directly over our RenderScope (including content of that scope), and being over visual chrome
// between our UiScope and our RenderScope (such as scroll bars)
if (IsPointWithinInteractiveArea(This, Mouse.GetPosition(This.UiScope)))
{
// Mouse is moving over our render scope, so we apply one of
// editing cursors - IBeam when outside of selection, Arrow when within selection,
// Resize - when over table borders, etc.
// Otherwise (when we are not over the render scope) we do not
// respond to QueryCursor request, thus leaving it for other
// elements to decide.
e.Cursor = This._cursor;
e.Handled = true;
}
}
示例8: NotifyDragOutsideQueryCursor
protected virtual void NotifyDragOutsideQueryCursor( object sender, QueryCursorEventArgs e )
{
e.Cursor = ( this.DropOutsideCursor != null )
? this.DropOutsideCursor
: Cursors.No;
if( this.DragOutsideQueryCursor != null )
{
this.DragOutsideQueryCursor( sender, e );
}
e.Handled = true;
}
示例9: OnDraggedElement_QueryCursor
private void OnDraggedElement_QueryCursor( object sender, QueryCursorEventArgs e )
{
if( this.IsDragging )
{
if( ( this.CurrentDropTarget == null ) || ( !this.CurrentDropTarget.CanDropElement( this.DraggedElement ) ) )
{
this.NotifyDragOutsideQueryCursor( sender, e );
}
}
}
示例10: OnQueryCursor
/// <inheritdoc/>
protected override void OnQueryCursor(QueryCursorEventArgs e) {
if (!CanClick)
return;
e.Handled = true;
e.Cursor = referenceSegment.IsLocal ? Cursors.Arrow : Cursors.Hand;
}
示例11: UpdateCursorPrivate
private bool UpdateCursorPrivate()
{
int timeStamp = Environment.TickCount;
QueryCursorEventArgs queryCursor = new QueryCursorEventArgs(this, timeStamp);
queryCursor.Cursor = Cursors.Arrow;
queryCursor.RoutedEvent=Mouse.QueryCursorEvent;
//ProcessInput has a linkdemand
_inputManager.Value.ProcessInput(queryCursor);
return queryCursor.Handled;
}
示例12: m_rowResizerThumb_QueryCursor
private void m_rowResizerThumb_QueryCursor( object sender, QueryCursorEventArgs e )
{
FrameworkElement rowItem = ( FrameworkElement )this.DataContext;
if( rowItem == null )
return;
if( this.CanBeResized( this.Orientation ) )
{
DataGridContext dataGridContext = DataGridControl.GetDataGridContext( this );
if( dataGridContext != null )
{
TableView tableView = dataGridContext.DataGridControl.GetView() as TableView;
e.Cursor = ( ( tableView != null ) && ( this.Orientation == Orientation.Vertical ) )
? tableView.RowSelectorResizeNorthSouthCursor
: tableView.RowSelectorResizeWestEastCursor;
}
if( e.Cursor == null )
{
e.Cursor = ( this.Orientation == Orientation.Vertical )
? TableView.DefaultRowSelectorResizeNorthSouthCursor
: TableView.DefaultRowSelectorResizeWestEastCursor;
}
}
e.Handled = true;
}
示例13: OnQueryCursor
protected override void OnQueryCursor(QueryCursorEventArgs e)
{
e.Handled = true;
e.Cursor = Cursors.Hand;
}
示例14: ColumnResizerThumb_QueryCursor
private void ColumnResizerThumb_QueryCursor( object sender, QueryCursorEventArgs e )
{
ColumnBase parentColumn = this.ParentColumn;
if( parentColumn == null )
return;
DataGridContext dataGridContext = this.DataGridContext;
bool showResizeCursor = !parentColumn.HasFixedWidth;
if( !showResizeCursor )
{
// Don't disable resizing if ColumnStretching can be disabled by an end-user resize.
showResizeCursor = ( dataGridContext != null ) && ( TableView.GetRemoveColumnStretchingOnResize( dataGridContext ) );
}
if( showResizeCursor )
{
if( dataGridContext != null )
{
UIViewBase uiViewBase = dataGridContext.DataGridControl.GetView() as UIViewBase;
e.Cursor = ( uiViewBase != null )
? uiViewBase.ColumnResizeWestEastCursor
: UIViewBase.DefaultColumnResizeWestEastCursor;
}
else
{
e.Cursor = UIViewBase.DefaultColumnResizeWestEastCursor;
}
e.Handled = true;
}
}
示例15: OnQueryCursor
protected virtual void OnQueryCursor(QueryCursorEventArgs e);