本文整理汇总了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;
}
示例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);
}
示例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);
}
}
示例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");
}
}
});
}
示例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;
}
示例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;
}
}
示例7: DidFinishDownloading
public override void DidFinishDownloading (NSUrlSession session, NSUrlSessionDownloadTask downloadTask,
NSUrl location)
{
_uploadCompleted (this, new NSUrlEventArgs (location.ToString ()));
}
示例8: DidFinishDownloading
public override void DidFinishDownloading(NSUrlSession session, NSUrlSessionDownloadTask downloadTask, NSUrl location)
{
OnDownloadCompleted(location.ToString(), downloadTask.TaskDescription ?? "");
}
示例9: ShouldPerformSelectorWithURL
public override void ShouldPerformSelectorWithURL(NotificarePushLib library, NSUrl url)
{
Console.WriteLine ("Should perform selector: " + url.ToString());
}
示例10: DidFinishDownloading
public virtual void DidFinishDownloading(NSUrlSessionDownloadTask downloadTask, NSUrl location)
{
Console.WriteLine ("DidFinishDownloading: {0}", location.ToString());
}