• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Foundation.NSError类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MonoMac.Foundation.NSError的典型用法代码示例。如果您正苦于以下问题:C# NSError类的具体用法?C# NSError怎么用?C# NSError使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NSError类属于MonoMac.Foundation命名空间,在下文中一共展示了NSError类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: EncoderError

 public override void EncoderError(AVAudioRecorder recorder, NSError error)
 {
     if (cbEncoderError != null)
         cbEncoderError (recorder, new AVErrorEventArgs (error));
 }
开发者ID:kangaroo,项目名称:maccore,代码行数:5,代码来源:Events.cs


示例17: DecoderError

 public override void DecoderError(AVAudioPlayer player, NSError  error)
 {
     if (cbDecoderError != null)
         cbDecoderError (player, new AVErrorEventArgs (error));
 }
开发者ID:kangaroo,项目名称:maccore,代码行数:5,代码来源:Events.cs


示例18: AVErrorEventArgs

 public AVErrorEventArgs(NSError error)
 {
     Error = error;
 }
开发者ID:kangaroo,项目名称:maccore,代码行数:4,代码来源:Events.cs


示例19: ReadFromData

		//
		// Load support:
		//    Override one of ReadFromData, ReadFromFileWrapper or ReadFromUrl
		//
		public override bool ReadFromData (NSData data, string typeName, out NSError outError)
		{
			outError = NSError.FromDomain (NSError.OsStatusErrorDomain, -4);
			return false;
		}
开发者ID:mortezabarzkar,项目名称:SharpNative,代码行数:9,代码来源:MyDocument.cs


示例20: GetAsData

//		public NSTextView CSharpTextBox;
//		public NSTextView ConsoleTextBox;
//		public NSTextView IntermediateTextBox;
//		public NSTextView CPPTextBox;




		
		//
		// Save support:
		//    Override one of GetAsData, GetAsFileWrapper, or WriteToUrl.
		//
		
		// This method should store the contents of the document using the given typeName
		// on the return NSData value.
		public override NSData GetAsData (string documentType, out NSError outError)
		{
			outError = NSError.FromDomain (NSError.OsStatusErrorDomain, -4);
			return null;
		}
开发者ID:mortezabarzkar,项目名称:SharpNative,代码行数:21,代码来源:MyDocument.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Foundation.NSObject类代码示例发布时间:2022-05-26
下一篇:
C# Foundation.NSCoder类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap