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


C# Foundation.NSError类代码示例

本文整理汇总了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);
        }
开发者ID:jorik041,项目名称:maccore,代码行数:7,代码来源:AVAudioRecorder.cs

示例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);
        }
开发者ID:jorik041,项目名称:maccore,代码行数:29,代码来源:NSUrlConnection.cs

示例3: FailedWithError

 public override void FailedWithError(NSUrlConnection connection, NSError error)
 {
     if (stream != null)
     {
         stream.Complete();
     }
     waitEvent.Set();
 }
开发者ID:Anomalous-Software,项目名称:MonoMac.HttpClient,代码行数:8,代码来源:NativeMessageConnectionDelegate.cs

示例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;
		}
开发者ID:polipo,项目名称:maccore,代码行数:11,代码来源:NSErrorException.cs

示例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;
		}
开发者ID:Anomalous-Software,项目名称:maccore,代码行数:12,代码来源:CTFontManager.cs

示例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);
        }
开发者ID:Cardanis,项目名称:MonoGame,代码行数:15,代码来源:Video.MacOS.cs

示例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;
            }
        }
开发者ID:kangaroo,项目名称:maccore,代码行数:15,代码来源:AVAudioPlayer.cs

示例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;
		}
开发者ID:baulig,项目名称:monomac,代码行数:15,代码来源:MyDocument.cs

示例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;
                }
            }
        }
开发者ID:roblillack,项目名称:maccore,代码行数:15,代码来源:AVAudioSession.cs

示例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;
            }
        }
开发者ID:kangaroo,项目名称:maccore,代码行数:15,代码来源:AVAudioRecorder.cs

示例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;
                }
            }
        }
开发者ID:roblillack,项目名称:maccore,代码行数:15,代码来源:AVAudioSession.cs

示例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;
		}
开发者ID:roblillack,项目名称:monomac,代码行数:18,代码来源:MyDocument.cs

示例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;
		}
开发者ID:Burkhardt,项目名称:mac-samples,代码行数:21,代码来源:MyDocument.cs

示例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);
        }
开发者ID:kangaroo,项目名称:maccore,代码行数:21,代码来源:NSUrlConnection.cs

示例15: CreateDirectory

 public bool CreateDirectory(string path, bool createIntermediates, NSFileAttributes attributes, out NSError error)
 {
     return CreateDirectory (path, createIntermediates, attributes.ToDictionary (), out error);
 }
开发者ID:roblillack,项目名称:maccore,代码行数:4,代码来源:NSFileManager.cs


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