本文整理汇总了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();
}
示例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();
}
示例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();
}
}
示例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();
}
示例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();
}