当前位置: 首页>>代码示例>>C#>>正文


C# GKDevice.OnChanged方法代码示例

本文整理汇总了C#中RubezhAPI.GK.GKDevice.OnChanged方法的典型用法代码示例。如果您正苦于以下问题:C# GKDevice.OnChanged方法的具体用法?C# GKDevice.OnChanged怎么用?C# GKDevice.OnChanged使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RubezhAPI.GK.GKDevice的用法示例。


在下文中一共展示了GKDevice.OnChanged方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddDeviceToZone

		public static void AddDeviceToZone(GKDevice device, GKZone zone)
		{
			if (!device.Zones.Contains(zone))
			{
				device.Zones.Add(zone);
			}
			if (!device.ZoneUIDs.Contains(zone.UID))
				device.ZoneUIDs.Add(zone.UID);
			if (!device.InputDependentElements.Contains(zone))
				device.InputDependentElements.Add(zone);
			if (!zone.OutputDependentElements.Contains(device))
				zone.OutputDependentElements.Add(device);
			zone.Devices.Add(device);
			zone.OnChanged();
			device.OnChanged();
		}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:16,代码来源:GKManager.Actions.cs

示例2: ChangeDeviceZones

		public static void ChangeDeviceZones(GKDevice device, List<GKZone> zones)
		{
			foreach (var zone in device.Zones)
			{
				zone.Devices.Remove(device);
				zone.OnChanged();
			}
			device.Zones.Clear();
			device.ZoneUIDs.Clear();
			foreach (var zone in zones)
			{
				device.Zones.Add(zone);
				device.ZoneUIDs.Add(zone.UID);
				zone.Devices.Add(device);
				zone.OnChanged();
			}
			device.OnChanged();
		}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:18,代码来源:GKManager.Actions.cs

示例3: ChangeDeviceGuardZones

		public static void ChangeDeviceGuardZones(GKDevice device, List<GKDeviceGuardZone> deviceGuardZones)
		{
			foreach (var guardZone in device.GuardZones)
			{
				guardZone.GuardZoneDevices.RemoveAll(x => x.Device == device);
				guardZone.OnChanged();
			}
			device.GuardZones.Clear();
			foreach (var deviceGuardZone in deviceGuardZones)
			{
				device.GuardZones.Add(deviceGuardZone.GuardZone);

				var gkGuardZoneDevice = new GKGuardZoneDevice();
				gkGuardZoneDevice.Device = device;
				gkGuardZoneDevice.DeviceUID = device.UID;
				if (deviceGuardZone.ActionType != null)
					gkGuardZoneDevice.ActionType = deviceGuardZone.ActionType.Value;
				gkGuardZoneDevice.CodeReaderSettings = deviceGuardZone.CodeReaderSettings;
				deviceGuardZone.GuardZone.GuardZoneDevices.Add(gkGuardZoneDevice);
				deviceGuardZone.GuardZone.OnChanged();
			}
			device.ChangedLogic();
			device.OnChanged();
		}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:24,代码来源:GKManager.Actions.cs

示例4: SetDeviceLogic

		public static void SetDeviceLogic(GKDevice device, GKLogic logic, bool isNs = false)
		{
			if (isNs)
				device.NSLogic = logic;
			else
				device.Logic = logic;

			device.ChangedLogic();
			device.OnChanged();
		}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:10,代码来源:GKManager.Device.cs

示例5: ChangeIsInMPT

		public static void ChangeIsInMPT(GKDevice device, bool isInMPT)
		{
			if (device != null)
			{
				device.IsInMPT = isInMPT;
				var deviceViewModel = DevicesViewModel.Current.AllDevices.FirstOrDefault(x => x.Device.UID == device.UID);
				if (deviceViewModel != null)
				{
					deviceViewModel.UpdateProperties();
				}
				device.OnChanged();
			}
		}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:13,代码来源:MPTViewModel.cs

示例6: RemoveDeviceFromGuardZone

		public static void RemoveDeviceFromGuardZone(GKDevice device, GKGuardZone guardZone)
		{
			if (guardZone != null)
			{
				guardZone.GuardZoneDevices.RemoveAll(x => x.DeviceUID == device.UID);
				device.GuardZones.RemoveAll(x => x.UID == guardZone.UID);
				guardZone.OutputDependentElements.RemoveAll(x => x.UID == device.UID);
				device.InputDependentElements.RemoveAll(x => x.UID == guardZone.UID);
				device.OnChanged();
			}
		}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:11,代码来源:GKManager.Actions.cs

示例7: RemoveDeviceFromZone

		public static void RemoveDeviceFromZone(GKDevice device, GKZone zone)
		{
			if (zone != null)
			{
				device.Zones.Remove(zone);
				device.ZoneUIDs.Remove(zone.UID);
				zone.Devices.Remove(device);
				zone.OutputDependentElements.Remove(device);
				device.InputDependentElements.Remove(zone);
				zone.OnChanged();
				device.OnChanged();
			}
		}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:13,代码来源:GKManager.Actions.cs


注:本文中的RubezhAPI.GK.GKDevice.OnChanged方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。