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