本文整理匯總了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();
}