本文整理汇总了C#中FiresecAPI.Models.Device.OnChanged方法的典型用法代码示例。如果您正苦于以下问题:C# Device.OnChanged方法的具体用法?C# Device.OnChanged怎么用?C# Device.OnChanged使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FiresecAPI.Models.Device
的用法示例。
在下文中一共展示了Device.OnChanged方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddDevice
public Device AddDevice(Device parentDevice, Driver driver, int intAddress)
{
var device = new Device()
{
DriverUID = driver.UID,
Driver = driver,
IntAddress = intAddress,
Parent = parentDevice
};
if (parentDevice.Driver.DriverType == DriverType.MPT)
{
device.ZoneUID = parentDevice.ZoneUID;
}
if (driver.DriverType == DriverType.Valve)
{
device.Properties.Add(new Property() { Name = "Action", Value = "1" });
}
parentDevice.Children.Add(device);
AddAutoCreateChildren(device);
AddAutoChildren(device);
parentDevice.OnChanged();
DeviceConfiguration.Update();
return device;
}
示例2: RemoveOneDevice
public void RemoveOneDevice(Device device)
{
DeviceConfiguration.Devices.Remove(device);
var dependentDevices = new List<Device>(device.DependentDevices);
foreach (var dependentDevice in dependentDevices)
{
if (!device.AllParents.Contains(deletingDevice))
{
DeviceConfiguration.InvalidateOneDevice(dependentDevice);
DeviceConfiguration.UpdateOneDeviceCrossReferences(dependentDevice);
dependentDevice.OnChanged();
}
}
var children = new List<Device>(device.Children);
foreach (var child in children)
{
RemoveOneDevice(child);
}
var parentDevice = device.Parent;
parentDevice.Children.Remove(device);
parentDevice.OnChanged();
device.OnChanged();
}
示例3: ChangeDriver
public void ChangeDriver(Device device, Driver driver)
{
var changeZone = !(device.Driver.IsZoneDevice && driver.IsZoneDevice);
device.Driver = driver;
device.DriverUID = driver.UID;
if (driver.IsRangeEnabled)
device.IntAddress = driver.MinAddress;
if (changeZone)
{
RemoveDeviceFromZone(device, null);
SetDeviceZoneLogic(device, new ZoneLogic());
}
device.Properties = new List<Property>();
device.SystemAUProperties = new List<Property>();
device.DeviceAUProperties = new List<Property>();
device.OnChanged();
}
示例4: SetIsNotUsed
public void SetIsNotUsed(Device device, bool isUsed)
{
device.IsNotUsed = isUsed;
device.OnChanged();
if (isUsed)
{
SetDeviceZoneLogic(device, new ZoneLogic());
}
}
示例5: SetPDUGroupLogic
public void SetPDUGroupLogic(Device device, PDUGroupLogic pduGroupLogic)
{
foreach (var pduGroupDevice in device.PDUGroupLogic.Devices)
{
pduGroupDevice.Device = null;
if (pduGroupDevice.DeviceUID != Guid.Empty)
{
var pduDevice = DeviceConfiguration.Devices.FirstOrDefault(x => x.UID == pduGroupDevice.DeviceUID);
if (pduDevice != null)
{
pduGroupDevice.Device = pduDevice;
pduDevice.DependentDevices.Remove(device);
}
}
}
device.PDUGroupLogic = pduGroupLogic;
DeviceConfiguration.InvalidatePDUDirection(device);
DeviceConfiguration.UpdateOneDeviceCrossReferences(device);
device.OnChanged();
}
示例6: SetIndicatorLogic
public void SetIndicatorLogic(Device device, IndicatorLogic indicatorLogic)
{
foreach (var zone in device.IndicatorLogic.Zones)
zone.IndicatorsInZone.Remove(device);
device.IndicatorLogic = indicatorLogic;
DeviceConfiguration.InvalidateIndicator(device);
DeviceConfiguration.UpdateOneDeviceCrossReferences(device);
device.OnChanged();
}