public LayoutPartPropertyVerificationPageViewModel(LayoutPartVerificationViewModel layoutPartFilterViewModel)
		{
			_layoutPartVerificationViewModel = layoutPartFilterViewModel;

			Devices = new ObservableCollection<DeviceViewModel>();
			foreach (var device in GKManager.Devices)
			{
				if (device.Driver.IsCardReaderOrCodeReader)
				{
					var deviceViewModel = new DeviceViewModel(device);
					Devices.Add(deviceViewModel);
				}
			}
		}
Ejemplo n.º 2
0
		protected override bool Save()
		{
			var device = new SKDDevice()
			{
				Address = Address,
				Driver = SelectedDriver,
				DriverUID = SelectedDriver.UID
			};
			SKDManager.Devices.Add(device);
			AddedDevice = new DeviceViewModel(device);
			ParentDeviceViewModel.Device.Children.Add(device);
			ParentDeviceViewModel.AddChild(AddedDevice);
			ParentDeviceViewModel.Update();
			XManager.DeviceConfiguration.Update();
			return true;
		}
Ejemplo n.º 3
0
		public NewDeviceViewModel(DeviceViewModel deviceViewModel)
		{
			Title = "Новое устройство";
			ParentDeviceViewModel = deviceViewModel;
			ParentDevice = ParentDeviceViewModel.Device;
			Drivers = new ObservableCollection<SKDDriver>();
			AvailableShleifs = new ObservableCollection<byte>();

			foreach (var driver in SKDManager.Drivers)
			{
				if (ParentDevice.Driver.Children.Contains(driver.DriverType))
					Drivers.Add(driver);
			}

			var driverType = deviceViewModel.Driver.DriverType;
			var parentShleif = ParentDevice;

			SelectedDriver = Drivers.FirstOrDefault();
		}
		public LayoutPartVerificationViewModel(LayoutPartReferenceProperties properties)
		{
			Title = "Верификация";
			IconSource = LayoutPartDescription.IconPath + "BLevels.png";
			_properties = properties ?? new LayoutPartReferenceProperties();
			DeviceViewModel deviceViewModel = null;
			var gkDevice = GKManager.Devices.FirstOrDefault(x => x.UID == _properties.ReferenceUID);
			if (gkDevice != null)
			{
				deviceViewModel = new DeviceViewModel(gkDevice);
			}

			if (deviceViewModel != null)
			{
				UpdateLayoutPart(deviceViewModel.NameAndAddress);
			}
			else
			{
				UpdateLayoutPart("Устройство не указано");
			}
		}