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


C# NSSet类代码示例

本文整理汇总了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));
            }
        }
开发者ID:BoogieMAN2K,项目名称:monotouch-samples,代码行数:27,代码来源:Touches_ClassicViewController.cs

示例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");
     }
 }
开发者ID:CVertex,项目名称:monotouch-samples,代码行数:7,代码来源:MyOverlayView.cs

示例3: TouchesEnded

 public override void TouchesEnded( NSSet touches, UIEvent evt )
 {
     if( Interceptor != null )
     {
         Interceptor.TouchesEnded( touches, evt );
     }
 }
开发者ID:Higherbound,项目名称:HBMobileApp,代码行数:7,代码来源:NotesViewController.cs

示例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));
			}
		}
开发者ID:rojepp,项目名称:monotouch-samples,代码行数:28,代码来源:Touches_ClassicViewController.cs

示例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);
		}
开发者ID:ClusterReplyBUS,项目名称:MonoTouch.Dialog,代码行数:13,代码来源:SmoothedBIView.cs

示例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());
 }
开发者ID:moonmile,项目名称:PazzleDrag,代码行数:7,代码来源:BoxExRenderer.cs

示例7: TouchesBegan

		public override void TouchesBegan (NSSet touches, UIEvent evt)
		{
			 // hide keyboard
			name.ResignFirstResponder();
			email.ResignFirstResponder();
			comments.ResignFirstResponder();
		}
开发者ID:hawkstalion,项目名称:Tog-Mobile,代码行数:7,代码来源:ContactView.cs

示例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 ());
		}
开发者ID:ARMoir,项目名称:mobile-samples,代码行数:34,代码来源:CheckmarkGestureRecognizer.cs

示例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 );
        }
开发者ID:Higherbound,项目名称:HBMobileApp,代码行数:7,代码来源:GiveTask.cs

示例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;

        }
开发者ID:flolovebit,项目名称:xamarin-evolve-2014,代码行数:35,代码来源:SimpleTouch.cs

示例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;
		}
开发者ID:ARMoir,项目名称:mobile-samples,代码行数:10,代码来源:CheckmarkGestureRecognizer.cs

示例12: TouchesBegan

 public override void TouchesBegan(NSSet touches, UIEvent evt)
 {
     if (!Dragging)
         NextResponder.TouchesBegan(touches, evt);
     else
         base.TouchesBegan(touches, evt);
 }
开发者ID:trongtran,项目名称:HMSegmentedControl,代码行数:7,代码来源:HMSegmentedControl.cs

示例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);

		}
开发者ID:kimuraeiji214,项目名称:Keys,代码行数:31,代码来源:WritingView.cs

示例14: TouchesEnded

		public override void TouchesEnded (NSSet touches, UIEvent evt)
		{
			CanvasView.DrawTouches (touches, evt);
			CanvasView.EndTouches (touches, false);

			ReticleView.Hidden = true;
		}
开发者ID:russellharvey,项目名称:monotouch-samples,代码行数:7,代码来源:MainViewController.cs

示例15: TouchesBegan

 public override void TouchesBegan(NSSet touches, UIEvent evt)
 {
     foreach (UITouch touch in touches.ToArray<UITouch>())
     {
         Console.WriteLine(touch);
     }
 }
开发者ID:pedroccrl,项目名称:Xamarin.Plugins-1,代码行数:7,代码来源:GestureMonitor.cs


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