Пример #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));
        }