public void TriggerNotification(BreachType breachType)
 {
     foreach (INotification _notifier in _notifierList)
     {
         _notifier.TriggerNotification(breachType);
     }
 }
Esempio n. 2
0
        public static void CheckAndAlert(AlertTarget alertTarget, BatteryCharacter batteryChar, double temperatureInC)
        {
            BreachType breachType = ClassifyTemperatureBreach(batteryChar.coolingType, temperatureInC);

            if (ConfigurationManager.AppSettings["TestingEnvironment"] == "true")
            {
                new FakeAlertNotifierType()._NotifierType[alertTarget]().TriggerNotification(breachType);
            }
            else
            {
                new AlertNotifierType()._NotifierType[alertTarget]().TriggerNotification(breachType);
            }
        }
        public static bool checkAndAlert(AlertTarget alertTarget, BatteryCharacter batteryChar, double temperatureInC)
        {
            bool checkAlert = false;

            BreachType breachType = classifyTemperatureBreach(batteryChar.coolingType, temperatureInC);
            IAlerter   alerter    = FetchInstance(alertTarget.ToString()) as IAlerter;

            if (alerter != null)
            {
                alerter.TriggerBreachAlert(breachType);
                checkAlert = true;
            }

            return(checkAlert);
        }
Esempio n. 4
0
        public static void checkAndAlert(
            AlertTarget alertTarget, BatteryCharacter batteryChar, double temperatureInC)
        {
            BreachType breachType = classifyTemperatureBreach(
                batteryChar.coolingType, temperatureInC
                );

            switch (alertTarget)
            {
            case AlertTarget.TO_CONTROLLER:
                sendToController(breachType);
                break;

            case AlertTarget.TO_EMAIL:
                sendToEmail(breachType);
                break;
            }
        }
        protected ItemDisplayViewModel GetBreach <T>(BreachType breachType) where T : IBreachCurrency
        {
            var itemDisplayViewModel = new ItemDisplayViewModel(null);

            foreach (var breach in _items.Keys.OfType <T>())
            {
                var breachItem = breach as Item;

                if (breach.Type == breachType)
                {
                    itemDisplayViewModel = new ItemDisplayViewModel(breachItem);

                    _items[breachItem] = itemDisplayViewModel;
                    break;
                }
            }

            return(itemDisplayViewModel);
        }
Esempio n. 6
0
        public static void sendToEmail(BreachType breachType)
        {
            string recepient = "*****@*****.**";

            switch (breachType)
            {
            case BreachType.TOO_LOW:
                Console.WriteLine("To: {}\n", recepient);
                Console.WriteLine("Hi, the temperature is too low\n");
                break;

            case BreachType.TOO_HIGH:
                Console.WriteLine("To: {}\n", recepient);
                Console.WriteLine("Hi, the temperature is too high\n");
                break;

            case BreachType.NORMAL:
                break;
            }
        }
Esempio n. 7
0
        public static void sendToController(BreachType breachType)
        {
            const ushort header = 0xfeed;

            Console.WriteLine("{} : {}\n", header, breachType);
        }
Esempio n. 8
0
 public void TriggerEmail(string Recepient, BreachType _BreachType)
 {
     Console.WriteLine("To:\n", Recepient);
     Console.WriteLine("Hi, the temperature is in normal state\n");
 }
Esempio n. 9
0
 public void TriggerNotification(BreachType breachType)
 {
     IsCompositeTriggerNotificationCalledOnce = true;
 }
 public void DisplayBreachStatus(BreachType breachType, string recepient)
 {
     Console.WriteLine($"To: {recepient}\n");
     Console.WriteLine($"Hi, the temperature is {breachType}\n");
 }
        public void CheckAndAlert(Battery batteryChar, double temperature)
        {
            BreachType breachType = CheckBreachLevel.ClassifyTemperatureBreach(batteryChar.CoolingType, temperature);

            AlertSource.Alert(breachType);
        }
        public void TriggerNotification(BreachType breachType)
        {
            const ushort header = 0xfeed;

            Console.WriteLine("{} : {}\n", header, breachType);
        }
Esempio n. 13
0
 public void TriggerNotification(BreachType breachType)
 {
     Console.WriteLine("Temperature state: " + breachType);
 }
 private T GetBreach <T>(BreachType breachType) where T : IBreachCurrency
 {
     return(_items.OfType <T>().FirstOrDefault(x => x.Type == breachType));
 }
Esempio n. 15
0
        public static void CheckAndAlert(INotification _notifier, BatteryCharacter batteryChar, double temperatureInC)
        {
            BreachType breachType = ClassifyTemperatureBreach(batteryChar.coolingType, temperatureInC);

            _notifier.TriggerNotification(breachType);
        }
Esempio n. 16
0
 public Breachstone(JSONProxy.Item item) : base(item)
 {
     Type = ProxyMapper.GetBreachType(item);
 }
Esempio n. 17
0
 public Splinter(JSONProxy.Item item) : base(item)
 {
     Type = ProxyMapper.GetBreachType(item);
 }
Esempio n. 18
0
 public BreachBlessing(JSONProxy.Item item) : base(item)
 {
     Type = ProxyMapper.GetBreachType(item);
 }
        public void Alert(BreachType breachType)
        {
            string recepient = "*****@*****.**";

            DisplayBreachStatus(breachType, recepient);
        }
Esempio n. 20
0
        public void TriggerNotification(BreachType breachType)
        {
            string recepient = "*****@*****.**";

            new EmailMessageInitializer()._Email[breachType]().TriggerEmail(recepient, breachType);
        }
Esempio n. 21
0
 public void TriggerNotification(BreachType breachType)
 {
     IsConsoleTriggerNotificationCalled = true;
 }
 public void TriggerNotification(BreachType breachType)
 {
     IsEmailTriggerNotificationCalled = true;
 }