本文整理汇总了C#中NSSet类的典型用法代码示例。如果您正苦于以下问题:C# NSSet类的具体用法?C# NSSet怎么用?C# NSSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NSSet类属于命名空间,在下文中一共展示了NSSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TouchesBegan
public override void TouchesBegan(NSSet touchesSet, UIEvent evt)
{
var touches = touchesSet.ToArray<UITouch> ();
touchPhaseLabel.Text = "Phase:Touches began";
touchInfoLabel.Text = "";
var numTaps = touches.Sum (t => t.TapCount);
if (numTaps >= 2){
touchInfoLabel.Text = string.Format ("{0} taps", numTaps);
if (numTaps == 2 && piecesOnTop) {
// recieved double tap -> align the three pieces diagonal.
firstImage.Center = new PointF (padding + firstImage.Frame.Width / 2f,
touchInfoLabel.Frame.Bottom + padding + firstImage.Frame.Height / 2f);
secondImage.Center = new PointF (View.Bounds.Width / 2f, View.Bounds.Height / 2f);
thirdImage.Center = new PointF (View.Bounds.Width - thirdImage.Frame.Width / 2f - padding,
touchInstructionLabel.Frame.Top - thirdImage.Frame.Height);
touchInstructionLabel.Text = "";
}
} else {
touchTrackingLabel.Text = "";
}
foreach (var touch in touches) {
// Send to the dispatch method, which will make sure the appropriate subview is acted upon
DispatchTouchAtPoint (touch.LocationInView (View));
}
}
示例2: TouchesBegan
public override void TouchesBegan(NSSet touches, UIEvent evt)
{
var touch = (UITouch) touches.AnyObject;
if (touch.Phase == UITouchPhase.Began){
Console.WriteLine ("Overlay view touched");
}
}
示例3: TouchesEnded
public override void TouchesEnded( NSSet touches, UIEvent evt )
{
if( Interceptor != null )
{
Interceptor.TouchesEnded( touches, evt );
}
}
示例4: TouchesBegan
public override void TouchesBegan (NSSet touchesSet, UIEvent evt)
{
var touches = touchesSet.ToArray<UITouch> ();
touchPhaseLabel.Text = "Phase:Touches began";
touchInfoLabel.Text = "";
var numTaps = touches.Sum (t => t.TapCount);
if (numTaps >= 2){
touchInfoLabel.Text = string.Format ("{0} taps", numTaps);
if (numTaps == 2 && piecesOnTop) {
// recieved double tap -> align the three pieces diagonal.
if (firstImage.Center.X == secondImage.Center.X)
secondImage.Center = new PointF (firstImage.Center.X - 50, firstImage.Center.Y - 50);
if (firstImage.Center.X == thirdImage.Center.X)
thirdImage.Center = new PointF (firstImage.Center.X + 50, firstImage.Center.Y + 50);
if (secondImage.Center.X == thirdImage.Center.X)
thirdImage.Center = new PointF (secondImage.Center.X + 50, secondImage.Center.Y + 50);
touchInstructionLabel.Text = "";
}
} else {
touchTrackingLabel.Text = "";
}
foreach (var touch in touches) {
// Send to the dispatch method, which will make sure the appropriate subview is acted upon
DispatchTouchAtPoint (touch.LocationInView (window));
}
}
示例5: TouchesBegan
// void TouchesBeganWithEvent (NSSet touches, UIEvent theEvent)
// {
// _ctr = 0;
// UITouch touch = touches.AnyObject ();
// Pts [0] = touch.LocationInView (this);
// }
public override void TouchesBegan (NSSet touches, UIEvent evt)
{
base.TouchesBegan (touches, evt);
_ctr = 0;
UITouch touch = touches.AnyObject as UITouch;
Pts [0] = touch.LocationInView (this);
}
示例6: TouchesBegan
public override void TouchesBegan(NSSet touches, UIEvent evt)
{
base.TouchesBegan(touches, evt);
UITouch touch = touches.AnyObject as UITouch;
var el = this.Element as BoxViewEx;
el.OnManipulationStarted(el, new ManipulationStartedRoutedEventArgs());
}
示例7: TouchesBegan
public override void TouchesBegan (NSSet touches, UIEvent evt)
{
// hide keyboard
name.ResignFirstResponder();
email.ResignFirstResponder();
comments.ResignFirstResponder();
}
示例8: TouchesMoved
/// <summary>
/// Called when the fingers move
/// </summary>
public override void TouchesMoved (NSSet touches, UIEvent evt)
{
base.TouchesMoved (touches, evt);
// if we haven't already failed
if (base.State != UIGestureRecognizerState.Failed) {
// get the current and previous touch point
CGPoint newPoint = (touches.AnyObject as UITouch).LocationInView (View);
CGPoint previousPoint = (touches.AnyObject as UITouch).PreviousLocationInView (View);
// if we're not already on the upstroke
if (!strokeUp) {
// if we're moving down, just continue to set the midpoint at
// whatever point we're at. when we start to stroke up, it'll stick
// as the last point before we upticked
if (newPoint.X >= previousPoint.X && newPoint.Y >= previousPoint.Y) {
midpoint = newPoint;
}
// if we're stroking up (moving right x and up y [y axis is flipped])
else if (newPoint.X >= previousPoint.X && newPoint.Y <= previousPoint.Y) {
strokeUp = true;
}
// otherwise, we fail the recognizer
else {
base.State = UIGestureRecognizerState.Failed;
}
}
}
Console.WriteLine (base.State.ToString ());
}
示例9: TouchesEnded
public override void TouchesEnded(TaskUIViewController taskUIViewController, NSSet touches, UIEvent evt)
{
base.TouchesEnded(taskUIViewController, touches, evt);
// if they touched a dead area, reveal the nav toolbar again.
//NavToolbar.RevealForTime( 3.0f );
}
示例10: TouchesBegan
//TODO: Step 2 - Subscribe to touches began events
public override void TouchesBegan(NSSet touches, UIEvent evt)
{
base.TouchesBegan(touches, evt);
// we can get the number of fingers from the touch count, but Multitouch must be enabled
lblNumberOfFingers.Text = string.Format("Number of Fingers: {0}", touches.Count);
// get the touch
var touch = touches.AnyObject as UITouch;
if (touch == null) return;
Console.WriteLine("screen touched");
//TODO: Step 3 - Check if touch was on a particular view
if (imgTouchMe.Frame.Contains(touch.LocationInView(View)))
lblTouchStatus.Text = "Touch Status: Touches Began";
//TODO: Step 4 - Detect multiple taps
if (touch.TapCount == 2 && imgTapMe.Frame.Contains(touch.LocationInView(View)))
{
imgTapMe.Image = UIImage.FromBundle(
imageHighlighted
? "Images/DoubleTapMe.png"
: "Images/DoubleTapMe_Highlighted.png");
imageHighlighted = !imageHighlighted;
}
//TODO: Step 5 - Start recording a drag event
if (imgDragMe.Frame.Contains(touch.LocationInView(View)))
touchStartedInside = true;
}
示例11: TouchesCancelled
/// <summary>
/// Called when the touches are cancelled due to a phone call, etc.
/// </summary>
public override void TouchesCancelled (NSSet touches, UIEvent evt)
{
base.TouchesCancelled (touches, evt);
// we fail the recognizer so that there isn't unexpected behavior
// if the application comes back into view
base.State = UIGestureRecognizerState.Failed;
}
示例12: TouchesBegan
public override void TouchesBegan(NSSet touches, UIEvent evt)
{
if (!Dragging)
NextResponder.TouchesBegan(touches, evt);
else
base.TouchesBegan(touches, evt);
}
示例13: TouchesBegan
public override void TouchesBegan (NSSet touches, UIEvent evt)
{
this.ExclusiveTouch = true;
IndexCount++;
var path = new UIBezierPath
{
LineWidth = PenWidth
} ;
var touch = (UITouch)touches.AnyObject;
PreviousPoint = (PointF)touch.PreviousLocationInView (this);
var newPoint = touch.LocationInView (this);
path.MoveTo (newPoint);
InvokeOnMainThread (SetNeedsDisplay);
CurrentPath = path;
var line = new VESLine
{
Path = CurrentPath,
Color = UIColor.Black,
Index = IndexCount
} ;
Lines.Add (line);
}
示例14: TouchesEnded
public override void TouchesEnded (NSSet touches, UIEvent evt)
{
CanvasView.DrawTouches (touches, evt);
CanvasView.EndTouches (touches, false);
ReticleView.Hidden = true;
}
示例15: TouchesBegan
public override void TouchesBegan(NSSet touches, UIEvent evt)
{
foreach (UITouch touch in touches.ToArray<UITouch>())
{
Console.WriteLine(touch);
}
}