Exemple #1
0
        /// <summary>
        /// 列举当前系统的所有磁盘目录
        /// </summary>
        /// <returns></returns>
        public static FileSystemObjectViewModel GetSystemDrives()
        {
            var top = new FileSystemObjectViewModel();

            top._Children = new ObservableCollection <FileSystemObjectViewModel>();
            foreach (var drv in DriveInfo.GetDrives())
            {
                top._Children.Add(new FileSystemObjectViewModel(drv.RootDirectory.FullName, drv.ToString(), FileSystemObjectType.Folder, ""));
            }
            return(top);
        }
Exemple #2
0
        //查看是否是geodatabase类型
        public static bool check_gdb(string path)
        {
            if (FileSystemObjectViewModel.getextension(FileSystemObjectViewModel.GetFileName(path)) != "gdb")
            {
                return(false);
            }

            try
            {
                Geodatabase geo = Geodatabase.Open(@path);
                geo.Close();
                return(true);
            }
            catch
            {
                return(false);
            }
        }