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


C# NSUrl.ToString方法代码示例

本文整理汇总了C#中NSUrl.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# NSUrl.ToString方法的具体用法?C# NSUrl.ToString怎么用?C# NSUrl.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NSUrl的用法示例。


在下文中一共展示了NSUrl.ToString方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HandleOpenURL

		public override bool HandleOpenURL(UIApplication application, NSUrl url)
		{
			if (url == null)
				return false;
			var uri = new System.Uri(url.ToString());

//			if (Slideout != null)
//			{
//				if (!string.IsNullOrEmpty(uri.Host))
//				{
//					string username = uri.Host;
//					string repo = null;
//
//					if (uri.Segments.Length > 1)
//						repo = uri.Segments[1].Replace("/", "");
//
//					if (repo == null)
//						Slideout.SelectView(new CodeBucket.ViewControllers.ProfileViewController(username));
//					else
//						Slideout.SelectView(new CodeBucket.ViewControllers.RepositoryInfoViewController(username, repo, repo));
//				}
//			}

			return true;
		}
开发者ID:jsuo,项目名称:CodeBucket,代码行数:25,代码来源:AppDelegate.cs

示例2: PdfViewController

		public PdfViewController (NSUrl url) : base()
		{
			Url = url;
			View = new UIView ();
			View.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleTopMargin | UIViewAutoresizing.FlexibleBottomMargin | UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin;
			View.AutosizesSubviews = true;
			
			PdfDocument = CGPDFDocument.FromUrl (Url.ToString ());
			
			// For demo purposes, show first page only.
			PdfPage = PdfDocument.GetPage (1);
			PdfPageRect = PdfPage.GetBoxRect (CGPDFBox.Crop);
			
			// Setup tiled layer.
			TiledLayer = new CATiledLayer ();
			TiledLayer.Delegate = new TiledLayerDelegate (this);
			TiledLayer.TileSize = new SizeF (1024f, 1024f);
			TiledLayer.LevelsOfDetail = 5;
			TiledLayer.LevelsOfDetailBias = 5;
			TiledLayer.Frame = PdfPageRect;
			
			ContentView = new UIView (PdfPageRect);
			ContentView.Layer.AddSublayer (TiledLayer);
			
			// Prepare scroll view.
			ScrollView = new UIScrollView (View.Frame);
			ScrollView.AutoresizingMask = View.AutoresizingMask;
			ScrollView.Delegate = new ScrollViewDelegate (this);
			ScrollView.ContentSize = PdfPageRect.Size;
			ScrollView.MaximumZoomScale = 10f;
			ScrollView.MinimumZoomScale = 1f;
			ScrollView.ScrollEnabled = true;
			ScrollView.AddSubview (ContentView);
			View.AddSubview (ScrollView);
		}
开发者ID:21Off,项目名称:21Off,代码行数:35,代码来源:PdfViewController.cs

示例3: DidSelectLinkWithURL

 public override void DidSelectLinkWithURL (MonoTouch.TTTAttributedLabel.TTTAttributedLabel label, NSUrl url)
 {
     try
     {
         if (url.ToString().StartsWith("http", StringComparison.Ordinal))
         {
             if (_webLinkClicked != null)
                 _webLinkClicked(url);
         }
         else
         {
             var i = Int32.Parse(url.ToString());
             _links[i].Callback();
         }
     }
     catch (Exception e)
     {
         Console.WriteLine("Unable to callback on TTTAttributedLabel: {0}", e.Message);
     }
 }
开发者ID:GitWatcher,项目名称:CodeHub,代码行数:20,代码来源:NewsCellView.cs

示例4: InitiateCall

 private void InitiateCall(object textURI)
 {
     UIApplication.SharedApplication.InvokeOnMainThread (delegate {
         NSUrl urlParam = new NSUrl ((string)textURI);
         SystemLogger.Log(SystemLogger.Module.PLATFORM,"Make CALL using URL :"+urlParam.ToString());
         if (UIApplication.SharedApplication.CanOpenUrl (urlParam)) {
             UIApplication.SharedApplication.OpenUrl (urlParam);
         } else {
             INotification notificationService = (INotification)IPhoneServiceLocator.GetInstance ().GetService ("notify");
             if (notificationService != null) {
                 notificationService.StartNotifyAlert ("Phone Alert", "Establishing voice calls is not enabled or supported on this device.", "OK");
             }
         }
     });
 }
开发者ID:lsp1357,项目名称:appverse-mobile,代码行数:15,代码来源:IPhoneTelephony.cs

示例5: OpenDeepLink

        private bool OpenDeepLink(NSUrl url)
        {
            //var svgurl = url.LastPathComponent; //fails to correctly decode path
            var uri = url.ToString();
            var pathIndex = uri.LastIndexOf('/');
            var svgurl = Uri.UnescapeDataString(uri.Substring(pathIndex + 1));

            if (!String.IsNullOrWhiteSpace(svgurl))
            {
                var dontWait = MyViewController.TheViewController.LoadSvg(svgurl);
                return true;
            }

            return false;
        }
开发者ID:softlion,项目名称:XamSvg-Samples,代码行数:15,代码来源:AppDelegate.cs

示例6: OpenUrl

        public override bool OpenUrl(UIApplication app, NSUrl url, string sourceApp, NSObject annotation)
        {
            var rurl = new Rivets.AppLinkUrl (url.ToString ());

            var id = string.Empty;

            if (rurl.InputQueryParameters.ContainsKey("id"))
                id = rurl.InputQueryParameters ["id"];

            if (rurl.InputUrl.Host.Equals ("products") && !string.IsNullOrEmpty (id)) {
                var c = new ProductViewController (id);
                navController.PushViewController (c, true);
                return true;
            } else {
                navController.PopToRootViewController (true);
                return true;
            }
        }
开发者ID:yofanana,项目名称:recipes,代码行数:18,代码来源:AppDelegate.cs

示例7: DidFinishDownloading

		public override void DidFinishDownloading (NSUrlSession session, NSUrlSessionDownloadTask downloadTask, 
		                                           NSUrl location)
		{
			_uploadCompleted (this, new NSUrlEventArgs (location.ToString ()));
		}
开发者ID:Fedorm,项目名称:core-master,代码行数:5,代码来源:NSUrlUploadDelegate.cs

示例8: DidFinishDownloading

 public override void DidFinishDownloading(NSUrlSession session, NSUrlSessionDownloadTask downloadTask, NSUrl location)
 {
     OnDownloadCompleted(location.ToString(), downloadTask.TaskDescription ?? "");
 }
开发者ID:StorozhenkoDmitry,项目名称:SimpleHttp,代码行数:4,代码来源:DownloadDelegate.cs

示例9: ShouldPerformSelectorWithURL

 public override void ShouldPerformSelectorWithURL(NotificarePushLib library, NSUrl url)
 {
     Console.WriteLine ("Should perform selector: " + url.ToString());
 }
开发者ID:Notificare,项目名称:notificare-push-lib-xamarin,代码行数:4,代码来源:AppDelegate.cs

示例10: DidFinishDownloading

 public virtual void DidFinishDownloading(NSUrlSessionDownloadTask downloadTask, NSUrl location)
 {
     Console.WriteLine ("DidFinishDownloading: {0}", location.ToString());
 }
开发者ID:ruiamorimwDev,项目名称:skobbler-mono-bindings,代码行数:4,代码来源:NetworkUrlSession.cs


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