public Device CreateTV(string name, IChannelableModule channelModule, IVariable volumeModule)
        {
            TelevisionSet newDevice = new TelevisionSet(name, channelModule, volumeModule);

            EventCall(String.Format("{0}:\t \"{1}\" has created.", this.GetType(), name));

            return(newDevice);
        }
Example #2
0
        /// <summary>
        /// Creates start devices and signs the events. Works with console.
        /// </summary>
        private void CreateStartState()
        {
            SignBuilderEvent();

            Device lampForFridge = builder.CreateLamp("FridgeLamp");

            IVariable volumeModuleRadio = builder.CreateVariableModule(1, 100, 10, 50);
            IVariable volumeModuleTV    = builder.CreateVariableModule(1, 100, 5, 50);

            IChannelableModule channelModuleRadio = builder.CreateChannelModule();
            IChannelableModule channelModuleTV    = builder.CreateChannelModule();

            deviceList.Add("HallWay", builder.CreateLamp("HallWay"));
            deviceList.Add("SAMSUNG", builder.CreateAirConditioning("SAMSUNG"));
            deviceList.Add("ORISTON", builder.CreateFridge("ORISTON", (ILampable)lampForFridge));
            deviceList.Add("BEREZA", builder.CreateTV("BEREZA", channelModuleTV, volumeModuleTV));
            deviceList.Add("SVOBODA", builder.CreateRadio("SVOBODA", channelModuleRadio, volumeModuleRadio));

            foreach (KeyValuePair <string, Device> item in deviceList)
            {
                SignEvent(item.Value);
            }
        }
Example #3
0
 public Radio(string name, IChannelableModule channelModule, IVariable volumeModule)
     : base(name)
 {
     VolumeModule  = volumeModule;
     ChannelModule = channelModule;
 }
 public TelevisionSet(string name, IChannelableModule channelModule, IVariable volumeModule)
     : base(name)
 {
     VolumeModule  = volumeModule;
     ChannelModule = channelModule;
 }