Ejemplo n.º 1
0
        private List <USBModel> CheckListUSB(List <USBModel> Register, List <USBModel> list)
        {
            List <USBModel> rtn = new List <USBModel>();

            if (Register.Count >= list.Count)
            {
                foreach (var item in Register)
                {
                    USBModel elm = list.FirstOrDefault(c => c.SerialNumber == item.SerialNumber);
                    if (elm != null)
                    {
                        elm.PathImage = item.PathImage;
                        rtn.Add(elm);
                    }
                }
            }
            else
            {
                foreach (var item in list)
                {
                    USBModel elm = Register.FirstOrDefault(c => c.SerialNumber == item.SerialNumber);
                    if (elm != null)
                    {
                        item.PathImage = elm.PathImage;
                        rtn.Add(item);
                    }
                }
            }

            return(rtn);
        }
Ejemplo n.º 2
0
        public void Dissconect(USBModel Model)
        {
            if (uSBModel != null && uSBModel.SerialNumber == Model.SerialNumber)
            {
                uSBModel = null;
            }

            uSBModelsWork.Remove(Model);
        }
Ejemplo n.º 3
0
        public void Start(USBModel Model)
        {
            uSBModelsWork.Add(Model);

            if (!IsFlashWork)
            {
                StartMAN();
                IsFlashWork = true;
            }
        }
Ejemplo n.º 4
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                return(null);
            }

            if (value is USBModel)
            {
                USBModel model = (USBModel)value;
                return(string.Format("{0} {1} {2} Gb", model.VolumeLabel.Replace(@"\", ""), model.Name, Math.Round(model.Size / Math.Pow(1024d, 3d)), 2));
            }

            return(null);
        }
Ejemplo n.º 5
0
 private void Initializer(USBModel Model)
 {
     uSBModel = Model;
     PatchUSB = Model.VolumeLabel + uSBModel.PathImage;
     PatchTo  = Explorer.FilePath;
 }
Ejemplo n.º 6
0
 public FileManager(USBModel Model)
 {
     Initializer(Model);
 }
Ejemplo n.º 7
0
 public FileManager(USBModel Model, string PatchTo)
 {
     uSBModel     = Model;
     PatchUSB     = uSBModel.PathImage;
     this.PatchTo = PatchTo;
 }
Ejemplo n.º 8
0
 private void UsbManager_DisconnectUSB(USBModel model)
 {
     // Отключино зарегестрированное устройство
     fileManager.Dissconect(model);
 }
Ejemplo n.º 9
0
 private void UsbManager_ConnectUSB(USBModel model)
 {
     fileManager.Start(model);
     //ImageList = new ObservableCollection<ImageModel>();
     //new LoadImage(ImageList);
 }