Inheritance: NSObject
Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
 public override void FailedWithError(NSUrlConnection connection, NSError error)
 {
     if (stream != null)
     {
         stream.Complete();
     }
     waitEvent.Set();
 }
Exemple #4
0
		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;
		}
		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;
		}
Exemple #6
0
        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;
            }
        }
Exemple #7
0
		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;
		}
Exemple #8
0
        public bool SetActive(bool beActive, out NSError outError)
        {
            unsafe {
                IntPtr errhandle;
                IntPtr ptrtohandle = (IntPtr) (&errhandle);

                if (SetActive (beActive, ptrtohandle)){
                    outError = null;
                    return true;
                } else {
                    outError = (NSError) Runtime.GetNSObject (errhandle);
                    return false;
                }
            }
        }
Exemple #9
0
        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;
                }
            }
        }
Exemple #10
0
        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;
            }
        }
Exemple #11
0
        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;
                }
            }
        }
Exemple #12
0
        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);
        }
Exemple #13
0
		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;
		}
Exemple #14
0
        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);
        }
Exemple #15
0
		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;
		}
Exemple #16
0
		public bool SetResource (string key, NSObject value, out NSError error)
		{
			return SetResourceValue (value, key, out error);
		}
Exemple #17
0
		public bool TryGetResource (string key, out NSObject value, out NSError error)
		{
			return GetResourceValue (out value, key, out error);
		}
Exemple #18
0
		public override bool ReadFromUrl (NSUrl absoluteUrl, string typeName, out NSError outError)
		{
			var loaded = QTMovie.FromUrl (absoluteUrl, out outError);
			if (loaded != null){
				loaded.SetAttribute (NSNumber.FromBoolean (true), QTMovie.EditableAttribute);
				
				if (movie != null)
					movie.Dispose ();
				movie = loaded;
			}
			return loaded != null;
		}
Exemple #19
0
		public override bool WriteToUrl (NSUrl absoluteUrl, string typeName, NSSaveOperationType saveOperation, NSUrl absoluteOriginalContentsUrl, out NSError outError)
		{
			var saveOptions = new QTMovieSaveOptions () {
				Flatten = true
			};
			return movie.SaveTo (absoluteUrl.Path, new QTMovieSaveOptions () { Flatten = true }, out outError);
		}
Exemple #20
0
        public bool CreateDirectory(string path, bool createIntermediates, NSFileAttributes attributes, out NSError error)
        {
            var dict = attributes == null ? null : attributes.ToDictionary();

            return(CreateDirectory(path, createIntermediates, dict, out error));
        }
Exemple #21
0
 public NSFileSystemAttributes GetFileSystemAttributes(string path, out NSError error)
 {
     return NSFileSystemAttributes.FromDict (_GetFileSystemAttributes (path, out error));
 }
Exemple #22
0
 public override void EncoderError(AVAudioRecorder recorder, NSError error)
 {
     if (cbEncoderError != null)
         cbEncoderError (recorder, new AVErrorEventArgs (error));
 }
Exemple #23
0
 public AVErrorEventArgs(NSError error)
 {
     Error = error;
 }
//		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;
		}
 public bool SetAttributes(NSFileAttributes attributes, string path, out NSError error)
 {
     return(SetAttributes(attributes.ToDictionary(), path, out error));
 }
 public NSFileSystemAttributes GetFileSystemAttributes(string path, out NSError error)
 {
     return(NSFileSystemAttributes.FromDict(_GetFileSystemAttributes(path, out error)));
 }
 public bool CreateDirectory(string path, bool createIntermediates, NSFileAttributes attributes, out NSError error)
 {
     return(CreateDirectory(path, createIntermediates, attributes.ToDictionary(), out error));
 }
		//
		// 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;
		}
Exemple #29
0
 public bool SetResource(string key, NSObject value, out NSError error)
 {
     return(SetResourceValue(value, key, out error));
 }
Exemple #30
0
 public override void DecoderError(AVAudioPlayer player, NSError  error)
 {
     if (cbDecoderError != null)
         cbDecoderError (player, new AVErrorEventArgs (error));
 }
		public bool SetPreferredHardwareSampleRate (double sampleRate, NSError outError)
		{
			// Effectively discarded due to original binding error
			return SetPreferredHardwareSampleRate (sampleRate, out outError);
		}
Exemple #32
0
 public bool CreateDirectory(string path, bool createIntermediates, NSFileAttributes attributes, out NSError error)
 {
     return CreateDirectory (path, createIntermediates, attributes.ToDictionary (), out error);
 }
		public bool SetPreferredIOBufferDuration (double duration, NSError outError)
		{
			// Effectively discarded due to original binding error
			return SetPreferredIOBufferDuration (duration, out outError);
		}
Exemple #34
0
 public bool SetAttributes(NSFileAttributes attributes, string path, out NSError error)
 {
     return SetAttributes (attributes.ToDictionary (), path, out error);
 }
Exemple #35
0
 public NSErrorEventArgs(NSError error)
 {
     Error = error;
 }
Exemple #36
0
		public override NSPrintOperation PrintOperation (NSDictionary printSettings, out NSError outError)
		{
			outError = null;
			return webView.MainFrame.FrameView.GetPrintOperation (new NSPrintInfo (printSettings));
		}
Exemple #37
0
 public bool TryGetResource(string key, out NSObject value, out NSError error)
 {
     return(GetResourceValue(out value, key, out error));
 }