本文整理汇总了C#中MonoMac.Foundation.NSError类的典型用法代码示例。如果您正苦于以下问题:C# NSError类的具体用法?C# NSError怎么用?C# NSError使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NSError类属于MonoMac.Foundation命名空间,在下文中一共展示了NSError类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToUrl
public static AVAudioRecorder ToUrl(NSUrl url, AVAudioRecorderSettings settings, out NSError error)
{
if (settings == null)
throw new ArgumentNullException ("settings");
return ToUrl (url, settings.ToDictionary (), out error);
}
示例2: SendSynchronousRequest
public static unsafe NSData SendSynchronousRequest(NSUrlRequest request, out NSUrlResponse response, out NSError error)
{
IntPtr responseStorage = IntPtr.Zero;
IntPtr errorStorage = IntPtr.Zero;
void *resp = &responseStorage;
void *errp = &errorStorage;
IntPtr rhandle = (IntPtr) resp;
IntPtr ehandle = (IntPtr) errp;
var res = Messaging.IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr (
class_ptr,
selSendSynchronousRequestReturningResponseError.Handle,
request.Handle,
rhandle,
ehandle);
if (responseStorage != IntPtr.Zero)
response = (NSUrlResponse) Runtime.GetNSObject (responseStorage);
else
response = null;
if (errorStorage != IntPtr.Zero)
error = (NSError) Runtime.GetNSObject (errorStorage);
else
error = null;
return (NSData) Runtime.GetNSObject (res);
}
示例3: FailedWithError
public override void FailedWithError(NSUrlConnection connection, NSError error)
{
if (stream != null)
{
stream.Complete();
}
waitEvent.Set();
}
示例4: NSErrorException
public NSErrorException (NSError error)
: base (error.LocalizedDescription,
error.UserInfo == null
? null
: error.UserInfo.ContainsKey (NSError.UnderlyingErrorKey)
? new NSErrorException ((NSError)error.UserInfo[NSError.UnderlyingErrorKey])
: null)
{
this.error = error;
HResult = error.Code;
}
示例5: RegisterFontsForUrl
public static NSError RegisterFontsForUrl (NSUrl fontUrl, CTFontManagerScope scope)
{
if (fontUrl == null)
throw new ArgumentNullException ("fontUrl");
NSError e = new NSError (ErrorDomain, 0);
if (CTFontManagerRegisterFontsForURL (fontUrl.Handle, scope, e.Handle))
return null;
else
return e;
}
示例6: PlatformInitialize
private void PlatformInitialize()
{
var err = new NSError();
_mMovie = new QTMovie(FileName, out err);
if (_mMovie != null)
{
MovieView = new QTMovieView();
MovieView.Movie = _mMovie;
MovieView.IsControllerVisible = false;
}
else
Console.WriteLine(err);
}
示例7: FromUrl
public static AVAudioPlayer FromUrl(NSUrl url, out NSError error)
{
unsafe {
IntPtr errhandle;
IntPtr ptrtohandle = (IntPtr) (&errhandle);
var ap = new AVAudioPlayer (url, ptrtohandle);
if (ap.Handle == IntPtr.Zero){
error = (NSError) Runtime.GetNSObject (errhandle);
return null;
} else
error = null;
return ap;
}
}
示例8: ReadFromUrl
public override bool ReadFromUrl (NSUrl url, string typeName, out NSError outError)
{
Console.WriteLine ("ReadFromUrl : {0}", url.ToString ());
outError = null;
// if scheme is not right, we ignore the url
if (url.Scheme != "monodoc" && url.Scheme != "mdoc")
return true;
// ResourceSpecifier is e.g. "//T:System.String"
initialLoadFromUrl = Uri.UnescapeDataString (url.ResourceSpecifier.Substring (2));
this.FileUrl = url;
return true;
}
示例9: SetActive
public bool SetActive(bool beActive, AVAudioSessionFlags flags, out NSError outError)
{
unsafe {
IntPtr errhandle;
IntPtr ptrtohandle = (IntPtr) (&errhandle);
if (_SetActive (beActive, (int) flags, ptrtohandle)){
outError = null;
return true;
} else {
outError = (NSError) Runtime.GetNSObject (errhandle);
return false;
}
}
}
示例10: ToUrl
public static AVAudioRecorder ToUrl(NSUrl url, NSDictionary settings, out NSError error)
{
unsafe {
IntPtr errhandle;
IntPtr ptrtohandle = (IntPtr) (&errhandle);
var ap = new AVAudioRecorder (url, settings, ptrtohandle);
if (ap.Handle == IntPtr.Zero){
error = (NSError) Runtime.GetNSObject (errhandle);
return null;
} else
error = null;
return ap;
}
}
示例11: SetCategory
public bool SetCategory(NSString theCategory, out NSError outError)
{
unsafe {
IntPtr errhandle;
IntPtr ptrtohandle = (IntPtr) (&errhandle);
if (SetCategory (theCategory, ptrtohandle)){
outError = null;
return true;
} else {
outError = (NSError) Runtime.GetNSObject (errhandle);
return false;
}
}
}
示例12: ReadFromUrl
public override bool ReadFromUrl (NSUrl url, string typeName, out NSError outError)
{
Console.WriteLine ("ReadFromUrl : {0}", url.ToString ());
outError = null;
const int NSServiceMiscellaneousError = 66800;
if (url.Scheme != "monodoc" && url.Scheme != "mdoc") {
outError = new NSError (NSError.CocoaErrorDomain,
NSServiceMiscellaneousError,
NSDictionary.FromObjectAndKey (NSError.LocalizedFailureReasonErrorKey, new NSString (string.Format ("Scheme {0} isn't supported", url.Scheme))));
return false;
}
// ResourceSpecifier is e.g. "//T:System.String"
initialLoadFromUrl = Uri.UnescapeDataString (url.ResourceSpecifier.Substring (2));
this.FileUrl = url;
return true;
}
示例13: ReadFromUrl
public override bool ReadFromUrl (NSUrl url, string typeName, out NSError outError)
{
fsEvents = new FSEventStream (new [] { Path.GetDirectoryName (url.Path) },
TimeSpan.FromSeconds (0), FSEventStreamCreateFlags.FileEvents);
fsEvents.Events += (sender, e) => {
foreach (var evnt in e.Events) {
if (evnt.Path == url.Path && (evnt.Flags & FSEventStreamEventFlags.ItemModified) != 0) {
ReloadDocument ();
break;
}
}
};
fsEvents.ScheduleWithRunLoop (NSRunLoop.Current);
fsEvents.Start ();
documentUrl = url;
outError = null;
return true;
}
示例14: SendSynchronousRequest
static unsafe NSData SendSynchronousRequest(NSUrlRequest request, out NSUrlResponse response, NSError error)
{
IntPtr storage = IntPtr.Zero;
void *p = &storage;
IntPtr handle = (IntPtr) p;
var res = Messaging.IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr (
class_ptr,
selSendSynchronousRequestReturningResponseError.Handle,
request.Handle,
handle,
error != null ? error.Handle : IntPtr.Zero);
if (storage != IntPtr.Zero)
response = (NSUrlResponse) Runtime.GetNSObject (storage);
else
response = null;
return (NSData) Runtime.GetNSObject (res);
}
示例15: CreateDirectory
public bool CreateDirectory(string path, bool createIntermediates, NSFileAttributes attributes, out NSError error)
{
return CreateDirectory (path, createIntermediates, attributes.ToDictionary (), out error);
}