當前位置: 首頁>>代碼示例>>C#>>正文


C# XDevice.OnChanged方法代碼示例

本文整理匯總了C#中XFiresecAPI.XDevice.OnChanged方法的典型用法代碼示例。如果您正苦於以下問題:C# XDevice.OnChanged方法的具體用法?C# XDevice.OnChanged怎麽用?C# XDevice.OnChanged使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在XFiresecAPI.XDevice的用法示例。


在下文中一共展示了XDevice.OnChanged方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: RemoveDevice

		public static void RemoveDevice(XDevice device)
		{
			var parentDevice = device.Parent;
			foreach (var zone in device.Zones)
			{
				zone.Devices.Remove(device);
				zone.OnChanged();
			}
			foreach (var direction in device.Directions)
			{
				direction.InputDevices.Remove(device);
				direction.OutputDevices.Remove(device);
				var directionDevice = direction.DirectionDevices.FirstOrDefault(x => x.Device == device);
				if (directionDevice != null)
				{
					direction.DirectionDevices.Remove(directionDevice);
					direction.InputDevices.Remove(device);
				}

				direction.OnChanged();
			}
			parentDevice.Children.Remove(device);
			Devices.Remove(device);

			if (parentDevice.DriverType == XDriverType.RSR2_KAU_Shleif)
				RebuildRSR2Addresses(parentDevice.Parent);
			device.OnChanged();
		}
開發者ID:saeednazari,項目名稱:Rubezh,代碼行數:28,代碼來源:XManager.Actions.cs

示例2: AddDeviceToZone

		public static void AddDeviceToZone(XDevice device, XZone zone)
		{
			if (!device.Zones.Contains(zone))
				device.Zones.Add(zone);
			if (!device.ZoneUIDs.Contains(zone.UID))
				device.ZoneUIDs.Add(zone.UID);
			zone.Devices.Add(device);
			zone.OnChanged();
			device.OnChanged();
		}
開發者ID:saeednazari,項目名稱:Rubezh,代碼行數:10,代碼來源:XManager.Actions.cs

示例3: RemoveDeviceFromZone

		public static void RemoveDeviceFromZone(XDevice device, XZone zone)
		{
			if (zone != null)
			{
				device.Zones.Remove(zone);
				device.ZoneUIDs.Remove(zone.UID);
				zone.Devices.Remove(device);
				zone.OnChanged();
				device.OnChanged();
			}
		}
開發者ID:saeednazari,項目名稱:Rubezh,代碼行數:11,代碼來源:XManager.Actions.cs

示例4: ChangeDeviceZones

 public static void ChangeDeviceZones(XDevice device, List<XZone> 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:saeednazari,項目名稱:Rubezh,代碼行數:18,代碼來源:XManager.Actions.cs

示例5: ChangeDeviceLogic

		public static void ChangeDeviceLogic(XDevice device, XDeviceLogic deviceLogic)
		{
			foreach (var clause in device.DeviceLogic.Clauses)
			{
				foreach (var direction in clause.Directions)
				{
					direction.OutputDevices.Remove(device);
					direction.OnChanged();
					device.Directions.Remove(direction);
				}
			}
			device.DeviceLogic = deviceLogic;
			UpdateConfigurationHelper.InvalidateOneLogic(DeviceConfiguration, device, device.DeviceLogic);
			device.OnChanged();
		}
開發者ID:saeednazari,項目名稱:Rubezh,代碼行數:15,代碼來源:XManager.Actions.cs


注:本文中的XFiresecAPI.XDevice.OnChanged方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。