• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# NSSet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中NSSet的典型用法代码示例。如果您正苦于以下问题:C# NSSet类的具体用法?C# NSSet怎么用?C# NSSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NSSet类属于命名空间,在下文中一共展示了NSSet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: TouchesBegan

 public override void TouchesBegan(NSSet touches, UIEvent evt)
 {
     base.TouchesBegan (touches, evt);
     //get the touch event
     UITouch touch = touches.AnyObject as UITouch;
     if (touch != null) {
         if (imgCub.Frame.Contains (touch.LocationInView (View)))
         {
             touchStartedInside = true;
             playSound("CubScouts");
         }
         if (imgTiger.Frame.Contains (touch.LocationInView (View)))
         {
             touchStartedInside = true;
             playSound("Tiger");
         }
         if (imgWolf.Frame.Contains (touch.LocationInView (View)))
         {
             touchStartedInside = true;
             playSound("Wolf");
         }
         if (imgBear.Frame.Contains (touch.LocationInView (View)))
         {
             touchStartedInside = true;
             playSound("Bear");
         }
         if (imgWeblo.Frame.Contains (touch.LocationInView (View)))
         {
             touchStartedInside = true;
             playSound("Weblo");
         }
     }
 }
开发者ID:Clancey,项目名称:Pack957,代码行数:33,代码来源:MoveLogos.cs


示例17: TouchesBegan

		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 = "Number of fingers: " + touches.Count.ToString();

			// get the touch
			UITouch touch = touches.AnyObject as UITouch;
			if (touch != null) {

				Console.WriteLine("screen touched");

				//==== IMAGE TOUCH
				if (imgTouchMe.Frame.Contains (touch.LocationInView (View)))
					lblTouchStatus.Text = "TouchesBegan";

				//==== IMAGE DOUBLE TAP
				if(touch.TapCount == 2 && imgTapMe.Frame.Contains (touch.LocationInView (View))) {
					if (imageHighlighted)
						imgTapMe.Image = UIImage.FromBundle ("Images/DoubleTapMe.png");
					else
						imgTapMe.Image = UIImage.FromBundle ("Images/DoubleTapMe_Highlighted.png");
					imageHighlighted = !imageHighlighted;
				}

				//==== IMAGE DRAG
				// check to see if the touch started in the dragme image
				if (imgDragMe.Frame.Contains (touch.LocationInView (View)))
					touchStartedInside = true;
			}
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:32,代码来源:Touches_iPhone.xib.cs


示例18: TouchesEnded

		public override void TouchesEnded(NSSet touches, UIEvent evt)
		{
			base.TouchesEnded(touches, evt);
			
			//TODO : check this to make sure Control is ok or do we need another on like InputControl
			var source = Controller.TableView.Source as BaseDialogViewSource;
			if (source != null)
			{
				foreach (var section in source.Sections.Values)
				{
					foreach (var viewList in section.Views.Values)
					{
						foreach(var view in viewList)
						{
							var focusable = view as IFocusable;
							if (focusable != null && focusable.Control != null && focusable.Control.IsFirstResponder)
							{
								focusable.Control.ResignFirstResponder();
								break;
							}
						}
					}
				}
			}
			
			ResetTextShadow(true, touches);
		}
开发者ID:drony,项目名称:MonoMobile.Views,代码行数:27,代码来源:DialogViewTable.cs


示例19: TouchesCancelled

        public override void TouchesCancelled(NSSet touches, UIEvent evt)
        {
            base.TouchesCancelled(touches, evt);

            // reset our tracking flags
            touchStartedInside = false;
        }
开发者ID:flolovebit,项目名称:xamarin-evolve-2014,代码行数:7,代码来源:SimpleTouch.cs


示例20: TouchesBegan

        public override void TouchesBegan(NSSet touches, UIEvent evt)
        {
            base.TouchesMoved (touches, evt);

            actions [(int)PlayerActions.Action] = false;
            actions [(int)PlayerActions.Left] = false;
            actions [(int)PlayerActions.Right] = false;
            actions [(int)PlayerActions.Forward] = false;
            actions [(int)PlayerActions.Back] = false;

            UITouch touch = (UITouch)touches.AnyObject;
            var location = touch.LocationInView (View);

            var deltaX = location.X - controlledShip.Position.X;
            var deltaY = (480 - location.Y) - controlledShip.Position.Y;

            if (Math.Abs (deltaX) < 30 && Math.Abs (deltaY) < 30)
                actions [(int)PlayerActions.Action] = true;
            else if (Math.Abs (deltaX) > Math.Abs (deltaY)) {
                if (deltaX < 0)
                    actions [(int)PlayerActions.Left] = true;
                else
                    actions [(int)PlayerActions.Right] = true;
            } else {
                if (deltaY < 0)
                    actions [(int)PlayerActions.Forward] = true;
                else
                    actions [(int)PlayerActions.Back] = true;
            }
        }
开发者ID:BoogieMAN2K,项目名称:monotouch-samples,代码行数:30,代码来源:SpaceScene.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# NSString类代码示例发布时间:2022-05-24
下一篇:
C# NSRange类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap