本文整理汇总了C#中NSUrl.?.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# NSUrl.?.ToString方法的具体用法?C# NSUrl.?.ToString怎么用?C# NSUrl.?.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NSUrl
的用法示例。
在下文中一共展示了NSUrl.?.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveExportedData
async Task SaveExportedData (NSWindow window, nint panelResult, NSUrl url)
{
if (panelResult != 1 || syncController?.SyncState != SyncState.Finished)
return;
string error = null;
try {
if (url == null || url.FilePathUrl == null) {
error = url?.ToString () ?? "Invalid file URL";
return;
}
statusTextField.StringValue = "saving with sadness…";
saveButton.Enabled = false;
actionButton.Enabled = false;
indeterminateProgressIndicator.Hidden = false;
await syncController.CreateExporter ().ExportAsync (url.FilePathUrl.Path);
statusTextField.StringValue = "saved your tedious music curation work!";
actionButton.Enabled = true;
indeterminateProgressIndicator.Hidden = true;
savedExportedDataUrl = url;
saveButton.Enabled = true;
saveButton.Title = "Reveal in Finder…";
} catch (Exception e) {
Console.Error.WriteLine (e);
error = e.Message;
} finally {
if (error != null)
new NSAlert {
AlertStyle = NSAlertStyle.Critical,
MessageText = "Unable to save exported data to file",
InformativeText = error
}.RunSheetModal (window, NSApplication.SharedApplication);
}
}