当前位置: 首页>>代码示例>>C#>>正文


C# Device.OnChanged方法代码示例

本文整理汇总了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;
		}
开发者ID:saeednazari,项目名称:Rubezh,代码行数:25,代码来源:FiresecConfiguration.Actions.cs

示例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();
		}
开发者ID:saeednazari,项目名称:Rubezh,代码行数:25,代码来源:FiresecConfiguration.Actions.cs

示例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();
		}
开发者ID:saeednazari,项目名称:Rubezh,代码行数:17,代码来源:FiresecConfiguration.Actions.cs

示例4: SetIsNotUsed

		public void SetIsNotUsed(Device device, bool isUsed)
		{
			device.IsNotUsed = isUsed;
			device.OnChanged();
			if (isUsed)
			{
				SetDeviceZoneLogic(device, new ZoneLogic());
			}
		}
开发者ID:saeednazari,项目名称:Rubezh,代码行数:9,代码来源:FiresecConfiguration.Actions.cs

示例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();
        }
开发者ID:saeednazari,项目名称:Rubezh,代码行数:21,代码来源:FiresecConfiguration.Actions.cs

示例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();
 }
开发者ID:saeednazari,项目名称:Rubezh,代码行数:9,代码来源:FiresecConfiguration.Actions.cs


注:本文中的FiresecAPI.Models.Device.OnChanged方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。