本文整理汇总了C#中TouchEventArgs.StopPropagation方法的典型用法代码示例。如果您正苦于以下问题:C# TouchEventArgs.StopPropagation方法的具体用法?C# TouchEventArgs.StopPropagation怎么用?C# TouchEventArgs.StopPropagation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TouchEventArgs
的用法示例。
在下文中一共展示了TouchEventArgs.StopPropagation方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnTouchDown
/// <summary>
/// Handles the touch down event.
/// </summary>
/// <param name="e">Touch event arguments.</param>
/// <returns>Touch event arguments.</returns>
public override TouchEventArgs OnTouchDown(TouchEventArgs e)
{
if (Rect.Contains(e.Point))
{
_pressed = true;
Invalidate();
TriggerPressEvent(this);
e.StopPropagation();
}
return e;
}
示例2: OnTouchUp
/// <summary>
/// Handles the touch up event.
/// </summary>
/// <param name="e">Touch event arguments.</param>
/// <returns>Touch event arguments.</returns>
public override TouchEventArgs OnTouchUp(TouchEventArgs e)
{
if (Rect.Contains(e.Point))
{
if (_pressed)
{
_pressed = false;
Invalidate();
TriggerReleaseEvent(this);
TriggerTapEvent(this);
e.StopPropagation();
}
}
else
{
if (_pressed)
{
_pressed = false;
TriggerReleaseEvent(this);
Invalidate();
}
}
return e;
}
示例3: OnTouchDown
/// <summary>
/// Handles the touch down event.
/// </summary>
/// <param name="e">Touch event arguments.</param>
/// <returns>Touch event arguments.</returns>
public override TouchEventArgs OnTouchDown(TouchEventArgs e)
{
// Global coordinates to local coordinates
Point localPoint = new Point(e.Point.X - Rect.X, e.Point.Y - Rect.Y);
if (_knob.Contains(localPoint))
{
_dragging = true;
Invalidate();
if (_touchThread == null || (_touchThread != null && !_touchThread.IsAlive))
{
GlideTouch.IgnoreAllEvents = true;
_touchThread = new Thread(TouchThread);
_touchThread.Priority = ThreadPriority.Highest;
_touchThread.Start();
}
e.StopPropagation();
return e;
}
if (Rect.Contains(e.Point))
{
RenderKnob(e.Point);
e.StopPropagation();
}
return e;
}
示例4: OnTouchUp
/// <summary>
/// Handles the touch up event.
/// </summary>
/// <param name="e">Touch event arguments.</param>
/// <returns>Touch event arguments.</returns>
public override TouchEventArgs OnTouchUp(TouchEventArgs e)
{
Point localPoint = new Point(e.Point.X - Rect.X, e.Point.Y - Rect.Y);
if (_knob.Contains(localPoint))
{
if (_dragging)
{
_dragging = false;
Invalidate();
e.StopPropagation();
}
}
else
{
if (_dragging)
{
_dragging = false;
Invalidate();
}
}
return e;
}
示例5: OnTouchDown
/// <summary>
/// Handles the touch down event.
/// </summary>
/// <param name="e">Touch event arguments.</param>
/// <returns>Touch event arguments.</returns>
public override TouchEventArgs OnTouchDown(TouchEventArgs e)
{
if (Rect.Contains(e.Point) && _rows.Count > 0)
{
_pressed = true;
_lastTouchY = e.Point.Y;
_lastListY = _listY;
e.StopPropagation();
}
return e;
}
示例6: OnTouchMove
/// <summary>
/// Handles the touch move event.
/// </summary>
/// <param name="e">Touch event arguments.</param>
/// <returns>Touch event arguments.</returns>
public override TouchEventArgs OnTouchMove(TouchEventArgs e)
{
if (!Draggable || !_pressed || _rows.Count <= RowCount)
return e;
if (!_moving)
{
if (_ignoredTouchMoves < _maxIgnoredTouchMoves)
_ignoredTouchMoves++;
else
{
_ignoredTouchMoves = 0;
_moving = true;
}
}
else
{
_listY = _lastListY - (e.Point.Y - _lastTouchY);
_listY = GlideUtils.Math.MinMax(_listY, 0, _listMaxY);
_scrollIndex = (int)System.Math.Ceiling((double)_listY / RowHeight);
Invalidate();
e.StopPropagation();
}
return e;
}
示例7: OnTouchUp
/// <summary>
/// Handles the touch up event.
/// </summary>
/// <param name="e">Touch event arguments.</param>
/// <returns>Touch event arguments.</returns>
public override TouchEventArgs OnTouchUp(TouchEventArgs e)
{
if (Rect.Contains(e.Point) && _pressed)
{
_pressed = false;
Checked = !Checked;
TriggerTapEvent(this);
e.StopPropagation();
}
return e;
}
示例8: OnTouchDown
/// <summary>
/// Handles the touch down event.
/// </summary>
/// <param name="e">Touch event arguments.</param>
/// <returns>Touch event arguments.</returns>
public override TouchEventArgs OnTouchDown(TouchEventArgs e)
{
if (Rect.Contains(e.Point))
{
_pressed = true;
e.StopPropagation();
}
return e;
}
示例9: OnTouchUp
/// <summary>
/// Handles the touch up event.
/// </summary>
/// <param name="e">Touch event arguments.</param>
/// <returns>Touch event arguments.</returns>
public override TouchEventArgs OnTouchUp(TouchEventArgs e)
{
if (Rect.Contains(e.Point) && _pressed)
{
Toggle();
e.StopPropagation();
}
return e;
}
示例10: OnTouchUp
/// <summary>
/// Handles the touch up event.
/// </summary>
/// <param name="e">Touch event arguments.</param>
/// <returns>Touch event arguments.</returns>
public override TouchEventArgs OnTouchUp(TouchEventArgs e)
{
if (_pressed && Rect.Contains(e.Point))
{
_pressed = false;
if (For != null)
{
if (For is CheckBox)
{
CheckBox checkBox = (CheckBox)For;
checkBox.Checked = !checkBox.Checked;
checkBox.TriggerTapEvent(checkBox);
}
else if (For is RadioButton)
{
// Radio buttons have rules for changing their selected
// value so we must call a toggle function.
((RadioButton)For).Toggle();
}
}
else
{
TriggerTapEvent(this);
}
e.StopPropagation();
}
return e;
}
示例11: OnTouchDown
/// <summary>
/// Handles the touch down event.
/// </summary>
/// <param name="e">Touch event arguments.</param>
/// <returns>Touch event arguments.</returns>
public override TouchEventArgs OnTouchDown(TouchEventArgs e)
{
// Only register a press if our tap event has listeners.
if (!TapEventIsNull() && Rect.Contains(e.Point))
{
_pressed = true;
e.StopPropagation();
}
return e;
}
示例12: OnTouchUp
/// <summary>
/// Handles the touch up event.
/// </summary>
/// <param name="e">Touch event arguments.</param>
/// <returns>Touch event arguments.</returns>
public override TouchEventArgs OnTouchUp(TouchEventArgs e)
{
// A key must be down
if (_downIndex == -1)
return e;
_touchEventArgs = null;
// If we just finished holding backspace down
// avoid doing more logic than needed.
if (_tapHold)
{
_tapHold = false;
_downIndex = -1;
Invalidate();
e.StopPropagation();
return e;
}
Rectangle keyCoord;
for (int i = 0; i < _keyCoords.Length; i++)
{
keyCoord = _keyCoords[i];
if (keyCoord.Contains(e.Point) && _downIndex == i)
{
switch (_keyValues[i])
{
case ActionKey.ToggleCase:
Uppercase = !Uppercase;
if (Uppercase)
_bitmapIndex = 0;
else
_bitmapIndex = 1;
_downIndex = -1;
Invalidate();
e.StopPropagation();
return e;
case ActionKey.ToSymbols:
_view = View.Symbols;
CalculateKeys();
_bitmapIndex = 3;
_downIndex = -1;
Invalidate();
e.StopPropagation();
return e;
case ActionKey.ToNumbers:
_view = View.Numbers;
CalculateKeys();
_bitmapIndex = 2;
_downIndex = -1;
Invalidate();
e.StopPropagation();
return e;
case ActionKey.ToLetters:
_view = View.Letters;
CalculateKeys();
Uppercase = true;
_bitmapIndex = 0;
_downIndex = -1;
Invalidate();
e.StopPropagation();
return e;
default:
if (_keyValues[i] != ActionKey.Return)
{
_downIndex = -1;
Invalidate();
}
// Triggering a TapKeyEvent will reset the keyboard and make the current index (i) out of range.
// Switching to numbers makes keyValues 34 length
// Tapping done is index 33 causing the keyboard to close and reset.
// When reset, we switch back to letters and keyValues becomes 33 length
// Now our index (33) is out of range.
TriggerTapKeyEvent(this, new TapKeyEventArgs((Uppercase) ? _keyValues[i].ToUpper() : _keyValues[i], i));
e.StopPropagation();
return e;
}
}
}
// Released outside of keyboard
_downIndex = -1;
Invalidate();
//.........这里部分代码省略.........
示例13: OnTouchDown
/// <summary>
/// Handles the touch down event.
/// </summary>
/// <param name="e">Touch event arguments.</param>
/// <returns>Touch event arguments.</returns>
public override TouchEventArgs OnTouchDown(TouchEventArgs e)
{
Rectangle keyCoord;
for (int i = 0; i < _keyCoords.Length; i++)
{
keyCoord = _keyCoords[i];
if (keyCoord.Contains(e.Point) && _keyActive[i] && (_keyValues[i] != null && _keyValues[i] != ""))
{
_downIndex = i;
DrawKeyDown(i);
if (_keyValues[i] == ActionKey.Backspace)
_touchEventArgs = e;
e.StopPropagation();
break;
}
}
return e;
}