예제 #1
0
 private Java.Io.File[] GetEntries(string path)
 {
     var dir = new Java.Io.File(path);
     if (dir.Exists() && dir.IsDirectory())
     {
         var entries = dir.ListFiles();
         if (entries != null)
         {
             var list = entries.OrderBy(x => x.Name).ToList();
             if (path != startPath)
             {
                 var parent = dir.ParentFile;
                 if (parent != null)
                 {
                     list.Insert(0, parent);
                 }
             }
             return list.ToArray();
         }
     }
     return new Java.Io.File[0];
 }
예제 #2
0
        private Java.Io.File[] GetEntries(string path)
        {
            var dir = new Java.Io.File(path);

            if (dir.Exists() && dir.IsDirectory())
            {
                var entries = dir.ListFiles();
                if (entries != null)
                {
                    var list = entries.OrderBy(x => x.Name).ToList();
                    if (path != startPath)
                    {
                        var parent = dir.ParentFile;
                        if (parent != null)
                        {
                            list.Insert(0, parent);
                        }
                    }
                    return(list.ToArray());
                }
            }
            return(new Java.Io.File[0]);
        }
예제 #3
0
파일: Directory.cs 프로젝트: slagusev/api
        /// <summary>
        /// Does a directory with given path exist on the filesystem?
        /// </summary>
        public static bool Exists(string path)
        {
            var file = new JFile(path);

            return(file.IsDirectory() && file.Exists());
        }
예제 #4
0
파일: Directory.cs 프로젝트: nguyenkien/api
 /// <summary>
 /// Does a directory with given path exist on the filesystem?
 /// </summary>
 public static bool Exists(string path)
 {
     var file = new JFile(path);
     return file.IsDirectory() && file.Exists();
 }