Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        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);
            }
        }