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


C# IArea.AddComponent方法代码示例

本文整理汇总了C#中IArea.AddComponent方法的典型用法代码示例。如果您正苦于以下问题:C# IArea.AddComponent方法的具体用法?C# IArea.AddComponent怎么用?C# IArea.AddComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IArea的用法示例。


在下文中一共展示了IArea.AddComponent方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RegisterLogicalActuator

        public LogicalBinaryStateActuator RegisterLogicalActuator(IArea area, Enum id)
        {
            if (area == null) throw new ArgumentNullException(nameof(area));

            var actuator = new LogicalBinaryStateActuator(ComponentIdGenerator.Generate(area.Id, id), _timerService);
            area.AddComponent(actuator);

            return actuator;
        }
开发者ID:chkr1011,项目名称:CK.HomeAutomation,代码行数:9,代码来源:ActuatorFactory.cs

示例2: Create

		public static void Create(IArea area, float minScaling, float maxScaling, bool scaleObjectsX = true, bool scaleObjectsY = true, bool scaleVolume = true)
		{
            var component = area.AddComponent<IScalingArea>();
            component.MinScaling = minScaling;
            component.MaxScaling = maxScaling;
            component.ScaleObjectsX = scaleObjectsX;
            component.ScaleObjectsY = scaleObjectsY;
            component.ScaleVolume = scaleVolume;
		}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:9,代码来源:AGSScalingArea.cs

示例3: RegisterHumiditySensor

        public IHumiditySensor RegisterHumiditySensor(IArea area, Enum id, INumericValueSensorEndpoint endpoint)
        {
            if (area == null) throw new ArgumentNullException(nameof(area));
            if (endpoint == null) throw new ArgumentNullException(nameof(endpoint));

            var humditySensor = new HumiditySensor(ComponentIdGenerator.Generate(area.Id, id), _settingsService, endpoint);
            area.AddComponent(humditySensor);

            return humditySensor;
        }
开发者ID:chkr1011,项目名称:CK.HomeAutomation,代码行数:10,代码来源:SensorFactory.cs

示例4: RegisterLamp

        public ILamp RegisterLamp(IArea area, Enum id, IBinaryOutput output)
        {
            if (area == null) throw new ArgumentNullException(nameof(area));
            if (output == null) throw new ArgumentNullException(nameof(output));

            var lamp = new Lamp(ComponentIdGenerator.Generate(area.Id, id), new PortBasedBinaryStateEndpoint(output));
            area.AddComponent(lamp);

            return lamp;
        }
开发者ID:chkr1011,项目名称:CK.HomeAutomation,代码行数:10,代码来源:ActuatorFactory.cs

示例5: RegisterMotionDetector

        public IMotionDetector RegisterMotionDetector(IArea area, Enum id, IBinaryInput input)
        {
            if (area == null) throw new ArgumentNullException(nameof(area));
            if (input == null) throw new ArgumentNullException(nameof(input));

            var motionDetector = new MotionDetector(
                ComponentIdGenerator.Generate(area.Id, id),
                new PortBasedMotionDetectorEndpoint(input),
                _schedulerService,
                _settingsService);

            area.AddComponent(motionDetector);

            return motionDetector;
        }
开发者ID:chkr1011,项目名称:CK.HomeAutomation,代码行数:15,代码来源:SensorFactory.cs

示例6: RegisterButton

        public IButton RegisterButton(IArea area, Enum id, IBinaryInput input, Action<IButton> initializer = null)
        {
            if (area == null) throw new ArgumentNullException(nameof(area));
            if (input == null) throw new ArgumentNullException(nameof(input));

            var button = new Button(
                ComponentIdGenerator.Generate(area.Id, id),
                new PortBasedButtonEndpoint(input),
                _timerService,
                _settingsService);

            initializer?.Invoke(button);

            area.AddComponent(button);
            return button;
        }
开发者ID:chkr1011,项目名称:CK.HomeAutomation,代码行数:16,代码来源:SensorFactory.cs

示例7: RegisterRollerShutter

        public IRollerShutter RegisterRollerShutter(IArea area, Enum id, IBinaryOutput powerOutput, IBinaryOutput directionOutput)
        {
            if (area == null) throw new ArgumentNullException(nameof(area));
            if (powerOutput == null) throw new ArgumentNullException(nameof(powerOutput));
            if (directionOutput == null) throw new ArgumentNullException(nameof(directionOutput));

            var rollerShutter = new RollerShutter(
                ComponentIdGenerator.Generate(area.Id, id),
                new PortBasedRollerShutterEndpoint(powerOutput, directionOutput),
                _timerService,
                _schedulerService,
                _settingsService);

            area.AddComponent(rollerShutter);

            return rollerShutter;
        }
开发者ID:chkr1011,项目名称:CK.HomeAutomation,代码行数:17,代码来源:ActuatorFactory.cs

示例8: Create

 public static void Create(IArea area, float minZoom, float maxZoom)
 {
     var component = area.AddComponent<IZoomArea>();
     component.MinZoom = minZoom;
     component.MaxZoom = maxZoom;
 }
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:6,代码来源:AGSZoomArea.cs

示例9: RegisterRollerShutterButtons

        public void RegisterRollerShutterButtons(
            IArea area,
            Enum upId,
            IBinaryInput upInput,
            Enum downId,
            IBinaryInput downInput)
        {
            if (area == null) throw new ArgumentNullException(nameof(area));
            if (upInput == null) throw new ArgumentNullException(nameof(upInput));
            if (downInput == null) throw new ArgumentNullException(nameof(downInput));

            var upButton = new Button(
                ComponentIdGenerator.Generate(area.Id, upId),
                new PortBasedButtonEndpoint(upInput),
                _timerService,
                _settingsService);

            area.AddComponent(upButton);

            var downButton = new Button(
                ComponentIdGenerator.Generate(area.Id, downId),
                new PortBasedButtonEndpoint(downInput),
                _timerService,
                _settingsService);

            area.AddComponent(downButton);
        }
开发者ID:chkr1011,项目名称:CK.HomeAutomation,代码行数:27,代码来源:SensorFactory.cs

示例10: RegisterWindow

        public IWindow RegisterWindow(IArea area, Enum id, Action<Window> initializer)
        {
            if (area == null) throw new ArgumentNullException(nameof(area));
            if (initializer == null) throw new ArgumentNullException(nameof(initializer));

            var window = new Window(ComponentIdGenerator.Generate(area.Id, id), _settingsService);
            initializer(window);

            area.AddComponent(window);
            return window;
        }
开发者ID:chkr1011,项目名称:CK.HomeAutomation,代码行数:11,代码来源:SensorFactory.cs

示例11: RegisterVirtualButton

        public IButton RegisterVirtualButton(IArea area, Enum id, Action<IButton> initializer = null)
        {
            if (area == null) throw new ArgumentNullException(nameof(area));

            var virtualButton = new Button(ComponentIdGenerator.Generate(area.Id, id), new EmptyButtonEndpoint(), _timerService, _settingsService);
            initializer?.Invoke(virtualButton);

            area.AddComponent(virtualButton);
            return virtualButton;
        }
开发者ID:chkr1011,项目名称:CK.HomeAutomation,代码行数:10,代码来源:SensorFactory.cs

示例12: RegisterStateMachine

        public IStateMachine RegisterStateMachine(IArea area, Enum id, Action<StateMachine, IArea> initializer)
        {
            if (area == null) throw new ArgumentNullException(nameof(area));
            if (initializer == null) throw new ArgumentNullException(nameof(initializer));

            var stateMachine = new StateMachine(ComponentIdGenerator.Generate(area.Id, id));

            initializer(stateMachine, area);
            stateMachine.SetInitialState(BinaryStateId.Off);

            area.AddComponent(stateMachine);
            return stateMachine;
        }
开发者ID:chkr1011,项目名称:CK.HomeAutomation,代码行数:13,代码来源:ActuatorFactory.cs

示例13: RegisterSocket

        public ISocket RegisterSocket(IArea area, Enum id, IBinaryOutput output)
        {
            if (area == null) throw new ArgumentNullException(nameof(area));
            if (output == null) throw new ArgumentNullException(nameof(output));

            var socket = new Socket(ComponentIdGenerator.Generate(area.Id, id), new PortBasedBinaryStateEndpoint(output));
            area.AddComponent(socket);

            return socket;
        }
开发者ID:chkr1011,项目名称:CK.HomeAutomation,代码行数:10,代码来源:ActuatorFactory.cs


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