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); }
public void Dissconect(USBModel Model) { if (uSBModel != null && uSBModel.SerialNumber == Model.SerialNumber) { uSBModel = null; } uSBModelsWork.Remove(Model); }
public void Start(USBModel Model) { uSBModelsWork.Add(Model); if (!IsFlashWork) { StartMAN(); IsFlashWork = true; } }
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); }
private void Initializer(USBModel Model) { uSBModel = Model; PatchUSB = Model.VolumeLabel + uSBModel.PathImage; PatchTo = Explorer.FilePath; }
public FileManager(USBModel Model) { Initializer(Model); }
public FileManager(USBModel Model, string PatchTo) { uSBModel = Model; PatchUSB = uSBModel.PathImage; this.PatchTo = PatchTo; }
private void UsbManager_DisconnectUSB(USBModel model) { // Отключино зарегестрированное устройство fileManager.Dissconect(model); }
private void UsbManager_ConnectUSB(USBModel model) { fileManager.Start(model); //ImageList = new ObservableCollection<ImageModel>(); //new LoadImage(ImageList); }