string CreateAppDirectory(NSSearchPathDirectory targetDir, string subDir = "Data") { NSError err; var fm = new NSFileManager(); var url = fm.GetUrl(targetDir, NSSearchPathDomain.All, null, true, out err); var ret = Path.Combine(url.RelativePath, NSBundle.MainBundle.BundleIdentifier, subDir); if (!Directory.Exists(ret)) Directory.CreateDirectory(ret); return ret; }
string CreateAppDirectory(NSSearchPathDirectory targetDir, string subDir = "BlobCache") { NSError err; var fm = new NSFileManager(); var url = fm.GetUrl(targetDir, NSSearchPathDomain.All, null, true, out err); var ret = Path.Combine(url.RelativePath, BlobCache.ApplicationName, subDir); if (!Directory.Exists(ret)) _inner.CreateRecursive(ret).Wait(); return ret; }
static string GetDirectory(NSSearchPathDirectory directory) { var dirs = NSSearchPath.GetDirectories(directory, NSSearchPathDomain.User); if (dirs == null || dirs.Length == 0) { // this should never happen... return(null); } return(dirs[0]); }
static string GetDirectory(NSSearchPathDirectory directory) { var dirs = NSSearchPath.GetDirectories(directory, NSSearchPathDomain.User); if (dirs == null || dirs.Length == 0) { // this should never happen... throw new NotSupportedException("this should never happen..."); //return null; } return(dirs[0]); }
private string CreateAppDirectory(NSSearchPathDirectory targetDir, string subDir = "BlobCache") { using (var fm = new NSFileManager()) { var url = fm.GetUrl(targetDir, NSSearchPathDomain.All, null, true, out _); var ret = Path.Combine(url.RelativePath, BlobCache.ApplicationName, subDir); if (!Directory.Exists(ret)) { _inner.CreateRecursive(ret).Wait(); } return(ret); } }
private static string IosFolderPathDocuments(NSSearchPathDirectory nsSearchpath, Environment.SpecialFolder path) { string folderPath; if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0)) { folderPath = NSFileManager.DefaultManager.GetUrls(nsSearchpath, NSSearchPathDomain.User)[0].Path; } else { folderPath = Environment.GetFolderPath(path); } return(folderPath); }
void Convert (EtoSpecialFolder folder, out NSSearchPathDirectory dir, out NSSearchPathDomain domain) { switch (folder) { case EtoSpecialFolder.ApplicationSettings: dir = NSSearchPathDirectory.ApplicationSupportDirectory; domain = NSSearchPathDomain.User; break; case EtoSpecialFolder.Documents: dir = NSSearchPathDirectory.DocumentDirectory; domain = NSSearchPathDomain.User; break; default: throw new NotSupportedException (); } }
string CreateAppDirectory(NSSearchPathDirectory targetDir, string subDir = "Data") { NSError err; var fm = new NSFileManager(); var url = fm.GetUrl(targetDir, NSSearchPathDomain.All, null, true, out err); var ret = Path.Combine(url.RelativePath, NSBundle.MainBundle.BundleIdentifier, subDir); if (!Directory.Exists(ret)) { Directory.CreateDirectory(ret); } return(ret); }
void Convert(EtoSpecialFolder folder, out NSSearchPathDirectory dir, out NSSearchPathDomain domain) { switch (folder) { case EtoSpecialFolder.ApplicationSettings: dir = NSSearchPathDirectory.ApplicationSupportDirectory; domain = NSSearchPathDomain.User; break; case EtoSpecialFolder.Documents: dir = NSSearchPathDirectory.DocumentDirectory; domain = NSSearchPathDomain.User; break; default: throw new NotSupportedException(); } }
public static string[] GetDirectories(NSSearchPathDirectory directory, NSSearchPathDomain domainMask, bool expandTilde = true) { return(NSArray.StringArrayFromHandle(NSSearchPathForDirectoriesInDomains((nuint)(ulong)directory, (nuint)(ulong)domainMask, expandTilde))); }
public static string[] SearchPathForDirectoriesInDomains(NSSearchPathDirectory directory, NSSearchPathDomainMask domainMask, bool expandTilde) { var handle = NSSearchPathForDirectoriesInDomains(directory, domainMask, expandTilde); return(NSArray.StringArrayFromHandle(handle)); }
internal static string FirstSearchPathFor(NSSearchPathDirectory directory, NSSearchPathDomainMask domainMask = NSSearchPathDomainMask.NSUserDomainMask, bool expandTilde = true) { var paths = SearchPathForDirectoriesInDomains(directory, domainMask, expandTilde); return(paths.Length > 0 ? paths[0] : null); }
internal extern static IntPtr NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory directory, NSSearchPathDomainMask domainMask, [MarshalAs(UnmanagedType.U1)] bool expandTilde);
private static NSArray NSSearchPathForDirectoriesInDomains( NSSearchPathDirectory directory, NSSearchPathDomainMask domainMask, bool expandTilde) { return (NSArray)NSArray.Alloc().Init(); }
static DirectoryInfo ToDirectory(NSSearchPathDirectory dir) => new DirectoryInfo(NSSearchPath.GetDirectories(dir, NSSearchPathDomain.User).First());
extern static IntPtr NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory directory, NSSearchPathDomain domainMask, bool expandTilde);
public static NSArray NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory directory, NSSearchPathDomainMask domainMask, bool expandTilde) { return NativeMethods.NSSearchPathForDirectoriesInDomains(directory, domainMask, expandTilde).To<NSArray>(); }
public static extern IntPtr NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory directory, NSSearchPathDomainMask domainMask, [MarshalAs(UnmanagedType.U1)] bool expandTilde);
static extern IntPtr NSSearchPathForDirectoriesInDomains (NSSearchPathDirectory directory, NSSearchPathDomain domainMask, bool expandTilde);
public static string[] GetDirectories (NSSearchPathDirectory directory, NSSearchPathDomain domainMask, bool expandTilde) { IntPtr values = NSSearchPathForDirectoriesInDomains(directory, domainMask, expandTilde); return NSArray.StringArrayFromHandle (values); }
internal static extern string?SearchPath(NSSearchPathDirectory folderId);
private string GetPath(NSSearchPathDirectory directory) { return(NSSearchPath.GetDirectories(directory, NSSearchPathDomain.User).FirstOrDefault()); }
public virtual AnyObject[] URLsForDirectory(NSSearchPathDirectory directory, NSSearchPathDomainMask inDomains) { return(default(AnyObject[])); }
public static string[] GetDirectories(NSSearchPathDirectory directory, NSSearchPathDomain domainMask, bool expandTilde = true) { return NSArray.StringArrayFromHandle (NSSearchPathForDirectoriesInDomains ((nuint)(ulong)directory, (nuint)(ulong)domainMask, expandTilde)); }
public virtual NSURL URLForDirectory(NSSearchPathDirectory directory, NSSearchPathDomainMask inDomain, [Optional] NSURL appropriateForURL, bool create, NSErrorPointer error) { return(default(NSURL)); }
public virtual bool GetRelationship(UnsafeMutablePointer <NSURLRelationship> outRelationship, NSSearchPathDirectory ofDirectory, NSSearchPathDomainMask inDomain, NSURL toItemAtURL, NSErrorPointer error) { return(default(bool)); }
public static string[] GetDirectories(NSSearchPathDirectory directory, NSSearchPathDomain domainMask, bool expandTilde) { IntPtr values = NSSearchPathForDirectoriesInDomains(directory, domainMask, expandTilde); return(NSArray.StringArrayFromHandle(values)); }
public static string SearchPathForDirectoriesInDomains(NSSearchPathDirectory directory, NSSearchPathDomainMask domainMask, bool expandTilde) { return(NSString.FromHandle(NSSearchPathForDirectoriesInDomains(directory, domainMask, expandTilde))); }
internal static partial string?SearchPath(NSSearchPathDirectory folderId);
private string GetPath(NSSearchPathDirectory directory) { //We should only have one.... return(NSSearchPath.GetDirectories(directory, NSSearchPathDomain.User)[0]); }