Esempio n. 1
0
        /// <summary>
        /// Sets a FATX Drive from an index
        /// </summary>
        /// <param name="DeviceIn"></param>
        public FATXDrive(DeviceReturn DeviceIn)
        {
            Drive xdrive = new Drive(DeviceIn.index, DeviceIn.type);

            if (!xdrive.Accessed)
            {
                throw new Exception("Invalid input");
            }
            //if (!FATXManagement.IsFATX(ref xdrive, out xType))
            //   throw new Exception("Drive is not FATX");
            xType   = DriveTypes.USBFlashDrive;
            xactive = true;
            xDrive  = xdrive;
            LoadPartitions();
        }
        public USBDrive(DeviceReturn device)
        {
            this.device = device;

            if (Open())
            {
                try
                {
                    this.name = Drive.DriveName;

                    RefreshPartitions();
                }
                catch { }
                finally { this.Close(); }
            }
        }
 /// <summary>
 /// Sets a FATX Drive from an index
 /// </summary>
 /// <param name="DeviceIn"></param>
 public FATXDrive(DeviceReturn DeviceIn)
 {
     Drive xdrive = new Drive(DeviceIn.index, DeviceIn.type);
     if (!xdrive.Accessed)
         throw new Exception("Invalid input");
     //if (!FATXManagement.IsFATX(ref xdrive, out xType))
     //   throw new Exception("Drive is not FATX");
     xType = DriveTypes.USBFlashDrive;
     xactive = true;
     xDrive = xdrive;
     LoadPartitions();
 }
 /// <summary>
 /// Determins if this Index is a FATX drive pointed index
 /// </summary>
 /// <param name="Device">Device to check</param>
 /// <param name="xType">Grabs the FATX type</param>
 /// <returns></returns>
 public static bool IsFATX(DeviceReturn Device, out DriveTypes xType)
 {
     Drive xDrive = new Drive(Device.index, Device.type);
     return IsFATX(ref xDrive, out xType);
 }
 /// <summary>
 /// Gets a result of available set of FATX Drives from a set of Indexes
 /// </summary>
 /// <param name="Drives">General drive list</param>
 /// <returns></returns>
 public static DeviceReturn[] GetFATXDrives(DeviceReturn[] Drives)
 {
     List<DeviceReturn> xReturn = new List<DeviceReturn>();
     for (int i = 0; i < Drives.Length; i++)
     {
         Drive xDrive = new Drive(Drives[i].index, Drives[i].type);
         DriveTypes xType = DriveTypes.Unknown;
         if (IsFATX(ref xDrive, out xType))
             xReturn.Add(Drives[i]);
     }
     return xReturn.ToArray();
 }
Esempio n. 6
0
        /// <summary>
        /// Determins if this Index is a FATX drive pointed index
        /// </summary>
        /// <param name="Device">Device to check</param>
        /// <param name="xType">Grabs the FATX type</param>
        /// <returns></returns>
        public static bool IsFATX(DeviceReturn Device, out DriveTypes xType)
        {
            Drive xDrive = new Drive(Device.index, Device.type);

            return(IsFATX(ref xDrive, out xType));
        }