private static void Share(UIViewController presentingViewController, string toShare) { var item = new NSString (toShare); var activityItems = new NSObject[] { item }; var activityViewController = new UIActivityViewController (activityItems, null); var excludedActivityTypes = new [] { UIActivityType.CopyToPasteboard, UIActivityType.Mail, UIActivityType.PostToWeibo }; if (!MFMessageComposeViewController.CanSendText) { excludedActivityTypes = new [] { UIActivityType.CopyToPasteboard, UIActivityType.Mail, UIActivityType.Message, UIActivityType.PostToWeibo }; } activityViewController.ExcludedActivityTypes = excludedActivityTypes; presentingViewController.PresentViewController (activityViewController, true, null); }
public override void TouchesMoved(Foundation.NSSet touches, UIEvent evt) { UITouch touch = touches.AnyObject as UITouch; //Obtain the location of the touch and add it to the current path and current_points array. CGPoint touchLocation = touch.LocationInView (this); currentPath.AddLineTo (touchLocation); currentPoints.Add (touchLocation); updateBounds (touchLocation); SetNeedsDisplayInRect (new CGRect (minX, minY, (nfloat)Math.Abs (maxX - minX), (nfloat)Math.Abs (maxY - minY))); }
public override void TouchesBegan(Foundation.NSSet touches, UIEvent evt) { //Create a new path and set the options. currentPath = UIBezierPath.Create (); currentPath.LineWidth = StrokeWidth; currentPath.LineJoinStyle = CGLineJoin.Round; currentPoints.Clear (); UITouch touch = touches.AnyObject as UITouch; //Obtain the location of the touch, move the path to that position and add it to the //current_points array. CGPoint touchLocation = touch.LocationInView (this); currentPath.MoveTo (touchLocation); currentPoints.Add (touchLocation); resetBounds (touchLocation); btnClear.Hidden = false; }