public static GCDeviceCollection LoadDeviceDirectory(string devicePath) { if (!IsDevicePath(devicePath)) { return(null); } try { GCError.ClearLastError(); GCDeviceCollection dlist = new GCDeviceCollection(); string[] subFolders = Directory.GetDirectories(devicePath); foreach (string sf in subFolders) { string folder = devicePath + "\\" + sf; GCDevice device = LoadDevice(folder); dlist.Add(device); } return(dlist); } catch (Exception e) { GCError.SetLastError(e); return(null); } }
public static bool SaveDevice(IDevice device) { if (device == null) { return(false); } try { GCError.ClearLastError(); return(_SaveDeviceDir(device)); } catch (Exception e) { GCError.SetLastError(e); return(false); } }
public static GCDevice LoadDevice(string devicePath) { if (!IsDevicePath(devicePath)) { return(null); } try { GCError.ClearLastError(); DeviceDir dir = _LoadDeviceDir(devicePath); return(new GCDevice(dir, devicePath)); } catch (Exception e) { GCError.SetLastError(e); return(null); } }