예제 #1
0
 public CWNetwork[] ScanForNetworksWithName(string networkName, out NSError error)
 {
     NSSet networks = _ScanForNetworksWithName (networkName, out error);
     if (networks != null)
         return networks.ToArray<CWNetwork> ();
     return null;
 }
예제 #2
0
        public static bool GetSkipBackupAttribute(string filename, out NSError error)
        {
            if (filename == null)
                throw new ArgumentNullException ("filename");

            #if IOS
            if (xattr_compatibility) {
                byte attrValue = 0;
                unsafe {
                    byte *p = &attrValue;

                    int code = getxattr (filename, key, (IntPtr) p, 1, 0, 0);
                    if (code == -1) {
                        error = new NSError (NSError.PosixErrorDomain, Marshal.GetLastWin32Error ());
                        return false;
                    }
                    error = null;
                    return attrValue != 0;
                }
            } else {
            #endif // IOS
                using (NSUrl url = NSUrl.FromFilename (filename)) {
                    NSObject value;
                    url.TryGetResource (NSUrl.IsExcludedFromBackupKey, out value, out error);
                    return (error == null) && ((long) ((NSNumber) value) == 1);
                }
            #if IOS
            }
            #endif // IOS
        }
예제 #3
0
 public CWNetwork[] ScanForNetworksWithSsid(NSData ssid, out NSError error)
 {
     NSSet networks = _ScanForNetworksWithSsid (ssid, out error);
     if (networks != null)
         return networks.ToArray<CWNetwork> ();
     return null;
 }
예제 #4
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,
                Selector.GetHandle (selSendSynchronousRequestReturningResponseError),
                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);
        }
예제 #5
0
        public static GLKMesh[] FromAsset(MDLAsset asset, out MDLMesh [] sourceMeshes, out NSError error)
        {
            NSArray aret;

            var ret = FromAsset (asset, out aret, out error);
            sourceMeshes = NSArray.FromArray<MDLMesh> (aret);
            return ret;
        }
예제 #6
0
        // use the best selector based on the OS version
        public NSAttributedString(NSUrl url, NSDictionary options, out NSDictionary resultDocumentAttributes, ref NSError error)
        {
            if (UIDevice.CurrentDevice.CheckSystemVersion (9,0))
                Handle = InitWithURL (url, options, out resultDocumentAttributes, ref error);
            else
                Handle = InitWithFileURL (url, options, out resultDocumentAttributes, ref error);

            if (Handle == IntPtr.Zero)
                throw new ArgumentException ();
        }
예제 #7
0
 public bool RegisterNamespace(NSString xmlns, NSString prefix, out NSError error)
 {
     if (xmlns == null)
         throw new ArgumentNullException ("xmlns");
     if (prefix == null)
         throw new ArgumentNullException ("prefix");
     IntPtr err;
     bool result = CGImageMetadataRegisterNamespaceForPrefix (Handle, xmlns.Handle, prefix.Handle, out err);
     error = err == IntPtr.Zero ? null : new NSError (err);
     return result;
 }
예제 #8
0
        public bool SendDataToAllPeers(NSData data, GKSendDataMode mode, out NSError error)
        {
            unsafe {
                IntPtr errhandle;
                IntPtr ptrtohandle = (IntPtr) (&errhandle);

                var ret = SendDataToAllPeers (data, mode, ptrtohandle);
                if (errhandle != IntPtr.Zero)
                    error = (NSError) Runtime.GetNSObject (errhandle);
                else
                    error = null;
                return ret;
            }
        }
예제 #9
0
 public NSObject DecodeTopLevelObject(Type[] types, string key, out NSError error)
 {
     #if XAMCORE_2_0
     NSSet<Class> typeSet = null;
     #else
     NSSet typeSet = null;
     #endif
     if (types != null) {
         var classes = new Class [types.Length];
         for (int i = 0; i < types.Length; i++)
             classes [i] =  new Class (types [i]);
     #if XAMCORE_2_0
         typeSet = new NSSet<Class> (classes);
     #else
         typeSet = new NSSet (classes);
     #endif
     }
     return DecodeTopLevelObject (typeSet, key, out error);
 }
예제 #10
0
 public NSAttributedString(NSUrl url, NSAttributedStringDocumentAttributes documentAttributes, ref NSError error)
     : this(url, documentAttributes, out ignore, ref error)
 {
 }
예제 #11
0
 public void Callback(string str, NSError err, IntPtr ctx)
 {
     status (str, err);
     DangerousRelease ();
 }
예제 #12
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));
        }
예제 #13
0
 public NSAttributedString(NSData data, ref NSError error)
     : this(data, (NSDictionary) null, out ignore, ref error)
 {
 }
예제 #14
0
 public NSAttributedString(NSData data, NSAttributedStringDocumentAttributes documentAttributes, ref NSError error)
     : this(data, documentAttributes, out ignore, ref error)
 {
 }
예제 #15
0
		public override void DecoderError (AVAudioPlayer player, NSError  error)
		{
			if (cbDecoderError != null)
				cbDecoderError (player, new AVErrorEventArgs (error));
		}
예제 #16
0
		public override void EncoderError (AVAudioRecorder recorder, NSError error)
		{
			if (cbEncoderError != null)
				cbEncoderError (recorder, new AVErrorEventArgs (error));
		}
예제 #17
0
 public NSAttributedString(NSData data, NSAttributedStringDocumentAttributes documentAttributes, ref NSError error)
     : this(data, documentAttributes, out ignore, ref error)
 {
 }
예제 #18
0
 public NSAttributedString(NSUrl url, ref NSError error)
     : this(url, (NSDictionary)null, out ignore, ref error)
 {
 }
예제 #19
0
 public NSAttributedString(NSData data, ref NSError error)
     : this(data, (NSDictionary)null, out ignore, ref error)
 {
 }
예제 #20
0
 public NSFileSystemAttributes GetFileSystemAttributes(string path, out NSError error)
 {
     return(NSFileSystemAttributes.FromDictionary(_GetFileSystemAttributes(path, out error)));
 }
예제 #21
0
 public NSErrorException(NSError error)
 {
     this.error = error;
 }
예제 #22
0
 public NSFileSystemAttributes GetFileSystemAttributes(string path, out NSError error)
 {
     return NSFileSystemAttributes.FromDictionary (_GetFileSystemAttributes (path, out error));
 }
예제 #23
0
		public AVErrorEventArgs (NSError error)
		{
			Error = error;
		}
예제 #24
0
 public bool SetAttributes(NSFileAttributes attributes, string path, out NSError error)
 {
     if (attributes == null)
         throw new ArgumentNullException ("attributes");
     return SetAttributes (attributes.ToDictionary (), path, out error);
 }
예제 #25
0
 public NSAttributedString(NSUrl url, NSAttributedStringDocumentAttributes documentAttributes, ref NSError error)
     : this(url, documentAttributes, out ignore, ref error)
 {
 }
예제 #26
0
		AVAudioRecorder (NSUrl url, AudioSettings settings, out NSError error) {
			// We use this method because it allows us to out NSError but, as a side effect, it is possible for the handle to be null and we will need to check this manually (on the Create method).
			Handle = InitWithUrl (url, settings.Dictionary, out error);
		}	
예제 #27
0
 public NSAttributedString(NSUrl url, ref NSError error)
     : this(url, (NSDictionary) null, out ignore, ref error)
 {
 }
예제 #28
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);
		}
예제 #29
0
		public AVAudioRecorder (NSUrl url, NSDictionary settings, NSError outError)
		{
			throw new Exception ("This constructor is no longer supported, use the AVAudioRecorder.ToUrl factory method instead");
		}
예제 #30
0
        // use the best selector based on the OS version
        public NSAttributedString(NSUrl url, NSDictionary options, out NSDictionary resultDocumentAttributes, ref NSError error)
        {
            if (UIDevice.CurrentDevice.CheckSystemVersion(9, 0))
            {
                Handle = InitWithURL(url, options, out resultDocumentAttributes, ref error);
            }
            else
            {
                Handle = InitWithFileURL(url, options, out resultDocumentAttributes, ref error);
            }

            if (Handle == IntPtr.Zero)
            {
                throw new ArgumentException();
            }
        }
예제 #31
0
		public static AVAudioRecorder Create (NSUrl url, AudioSettings settings, out NSError error)
		{
			if (settings == null)
				throw new ArgumentNullException ("settings");
			error = null;
			try {
				AVAudioRecorder r = new AVAudioRecorder (url, settings, out error);
				if (r.Handle == IntPtr.Zero) 
					return null;

				return r;
			} catch { 
				return null;
			}
		}
예제 #32
0
 public bool RemoveCalendarc(EKCalendar calendar, bool commit, out NSError error)
 {
     return RemoveCalendar (calendar, commit, out error);
 }
예제 #33
0
		static AVAudioRecorder ToUrl (NSUrl url, NSDictionary settings, out NSError error)
		{
			return Create (url, new AudioSettings (settings), out error);
		}
예제 #34
0
 public bool SaveTo(string fileName, QTMovieSaveOptions options, out NSError error)
 {
     return SaveTo (fileName, options == null ? null : options.ToDictionary (), out error);
 }
예제 #35
0
 public override void Finished(MFMailComposeViewController controller, MFMailComposeResult result, NSError error)
 {
     if (cbFinished != null)
         cbFinished (controller, new MFComposeResultEventArgs (controller, result, error));
 }
예제 #36
0
 public MFComposeResultEventArgs(MFMailComposeViewController controller, MFMailComposeResult result, NSError error)
 {
     Result = result;
     Error = error;
     Controller = controller;
 }
예제 #37
0
 public virtual bool InsertTimeRanges(NSValue cmTimeRanges, AVAssetTrack[] tracks, CMTime startTime, out NSError error)
 {
     return InsertTimeRanges (new NSValue [] { cmTimeRanges }, tracks, startTime, out error);
 }
예제 #38
0
        public unsafe static 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,
                Selector.GetHandle(selSendSynchronousRequestReturningResponseError),
                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));
        }