/// <param name="observer">To be added.</param> /// <param name="startPage">To be added.</param> /// <summary>To be added.</summary> /// <remarks>To be added.</remarks> public void EnumerateItems(INSFileProviderEnumerationObserver observer, NSData startPage) { try { var metadata = storageManager.GetFileMetadata(this.EnumeratedItemIdentifier); if (!metadata.IsExists) { observer.FinishEnumerating(NSFileProviderErrorFactory.CreateNonExistentItemError(EnumeratedItemIdentifier)); return; } INSFileProviderItem item = ProviderItem.CreateFromMetadata(metadata); observer.DidEnumerateItems(new[] { item }); observer.FinishEnumerating((NSData)null); } catch (UnauthorizedException) { observer.FinishEnumerating(NSFileProviderErrorFactory.CreateNonExistentItemError(this.EnumeratedItemIdentifier)); } catch (WebDavHttpException) { observer.FinishEnumerating(NSErrorFactory.CreateUnspecifiedNetworkError()); } catch (Exception) { observer.FinishEnumerating(NSErrorFactory.CreateUnspecifiedError()); } }
/// <param name="url">The shared document's URL.</param> /// <param name="completionHandler"> /// <para>An action the system calls subsequent to the creation of a placeholder.</para> /// <para tool="nullallowed">This parameter can be <see langword="null" />.</para> /// </param> /// <summary>When implemented by the developer, creates a specified placeholder for a previously defined URL.</summary> /// <remarks> /// <para>The developer must override this method. This method is called to provide a placeholder for documents that are returned by the Document Picker but that are not locally stored.</para> /// <para tool="threads">This can be used from a background thread.</para> /// </remarks> public override void ProvidePlaceholderAtUrl(NSUrl url, Action <NSError> completionHandler) { try { string identifier = this.GetPersistentIdentifier(url); ItemMetadata itemMetadata = this.StorageManager.GetItemMetadata(identifier); if (!itemMetadata.IsExists) { completionHandler?.Invoke(NSFileProviderErrorFactory.CreateNonExistentItemError(identifier)); return; } NSUrl placeholderUrl = NSFileProviderManager.GetPlaceholderUrl(url); NSError error; NSFileManager.DefaultManager.CreateDirectory(placeholderUrl.RemoveLastPathComponent(), true, null, out error); if (error != null) { completionHandler?.Invoke(error); return; } INSFileProviderItem providerItem = ProviderItem.CreateFromMetadata(itemMetadata); NSFileProviderManager.WritePlaceholder(placeholderUrl, providerItem, out error); completionHandler?.Invoke(error); } catch (Exception ex) { NSError error = this.MapError(ex); completionHandler?.Invoke(error); } }
public static Foundation.NSNumber GetFavoriteRank(this INSFileProviderItem This) { throw new NotSupportedException(); }