private void wakeUpSelectedMachine_Click(object sender, EventArgs e) { var objWakeU = new WakeUp(); var objMachine = ListOfMachines.Where(x => x.MachineName == SelectedMachineName).FirstOrDefault(); objWakeU.WakeFunction(objMachine.MachineMACAddress.Replace(":", "-").Replace("-", "")); }
public void SelectMachineFromList() { string[] tempMachineName = SelectedMachineName.Split(' '); string tempMachineNumber = tempMachineName[tempMachineName.Length - 1]; SelectedMachine = ListOfMachines.Where(m => m.SerialNumber == tempMachineNumber).FirstOrDefault(); //TODO Problem with selection list of printshops when machine selected before. Exception occure. }
private List <MachineEntity> SearchMachine(string searchString = null) { var listOfMachines = new List <MachineEntity>(); if (!string.IsNullOrEmpty(searchString)) { listOfMachines = ListOfMachines.Where(x => x.MachineName.Contains(searchString)).ToList(); } else { listOfMachines = ListOfMachines; } return(listOfMachines); }
private void chkOnline_CheckedChanged(object sender, EventArgs e) { if (ListOfMachines == null) { MessageBox.Show("Please scan network first"); chkOnline.Checked = false; return; } if (chkOnline.Checked) { var list = ListOfMachines.Where(x => x.MachineStatus == MachineStatus.Online).ToList(); PopulateListView(list); } else { PopulateListView(ListOfMachines); } }
private void FillStorage() { var objMachine = ListOfMachines.Where(x => x.MachineName == SelectedMachineName).ToList().FirstOrDefault(); objMachine = WindowsMachineProvider.GetInstance().GetStorageInfoOfMachine(SelectedMachineName, SelectedDomain, objMachine); lstStorage.Items.Clear(); lstStorage.FullRowSelect = true; ListViewItem lvi; foreach (var item in objMachine.ListOfStoragekDevices) { lvi = new ListViewItem(item.Name); lvi.SubItems.Add(item.SerialNumber); lvi.SubItems.Add(item.FreeSpace); lstStorage.Items.Add(lvi); } lblStorage.Text = string.Format("{0} Storage Devices found on machine {1} ", objMachine.ListOfStoragekDevices == null ? 0 : objMachine.ListOfStoragekDevices.Count, SelectedMachineName); }
private void PopulateNetworkDevices() { var machineName = lstView.SelectedItems[0].SubItems[1].Text; var machineDetails = ListOfMachines.Where(x => x.MachineName == machineName).ToList().FirstOrDefault(); machineDetails = MachineProvider.GetInstance().GetMachineAdditionalInformation(machineName, SelectedDomain, machineDetails); ListOfNetworkDevices = machineDetails.ListOfNetworkDevices; foreach (var item in machineDetails.ListOfNetworkDevices) { ListViewItem lvi = new ListViewItem(item.DeviceID); lvi.SubItems.Add(item.Adaptertype); lvi.SubItems.Add(item.Description); lvi.SubItems.Add(item.MACaddress); lvi.SubItems.Add(item.Manufacturer); lstNetworkDevices.Items.Add(lvi); } lblNetworkDevices.Text = string.Format("{0} NetworkDevices Installed on machine :{1}", machineDetails.ListOfNetworkDevices == null ? 0 : machineDetails.ListOfNetworkDevices.Count, lstView.SelectedItems[0].SubItems[1].Text); }