コード例 #1
0
ファイル: iAlarm.cs プロジェクト: DragonXYZ/iview-scada
        public void Reconhecer()
        {
            AbstractAlarm drv   = _bs.Current as AbstractAlarm;
            IAlarm        alarm = AlarmManager.Instance.Alarms.Find(delegate(IAlarm alm) { return(alm.Name == drv.Name && alm.TimeStamp == drv.TimeStamp); });

            alarm.TimeStampAck = DateTime.Now.ToString();
        }
コード例 #2
0
        public void Execute(IAlarm alarm)
        {
            if (alarm.CurrentStatus != AlarmStatus.Activated) return;

            alarm.Trigger();
            alarm.EventDispatcher.Dispatch(new AlarmTriggerdEvent(_detector));
        }
コード例 #3
0
        public AlarmMetadata AskAlarmMetadata(IAlarm alarm = null)
        {
            using (var alarmForm = new AlarmForm())
            {
                if (alarm != null)
                {
                    alarmForm.timeAlarmTime.Value = alarm.Time;
                    alarmForm.timeAlarmTitle.Text = alarm.Title;
                }
                else
                {
                    alarmForm.timeAlarmTitle.Clear();
                    alarmForm.timeAlarmTime.Value = DateTime.Now;
                }

                if (alarmForm.ShowDialog() == DialogResult.OK)
                {
                    return(new AlarmMetadata
                    {
                        Title = alarmForm.timeAlarmTitle.Text,
                        Time = alarmForm.timeAlarmTime.Value
                    });
                }

                return(null);
            }
        }
コード例 #4
0
ファイル: FakeAlarmService.cs プロジェクト: zhiyix/Alarmy
        public void TriggerAlarmStatusChange(IAlarm alarm)
        {
            if (!this.alarms.Contains(alarm))
                this.alarms.Add(alarm);

            this.OnAlarmStatusChange.Invoke(e: new AlarmEventArgs(alarm));
        }
コード例 #5
0
 //public UC2M2_UC3M3_Measure(IDAQ actualDaq, DataTreatment _dataTreatment, UC5S1_Alarm alarmController)
 public UC2M2_UC3M3_Measure(IDAQ actualDaq, DataTreatment _dataTreatment, IAlarm alarmController, IFilter filter)
 {
     Daq              = actualDaq;
     dataTreatment    = _dataTreatment;
     AlarmController  = alarmController;
     FilterController = filter;
 }
コード例 #6
0
 public OrderHub(IOrdersService ordersService, IAlarm alarm, ILogger <OrderHub> logger, IHubContext <UserOrdersHub> hubUser)
 {
     this.ordersService = ordersService;
     this.alarm         = alarm;
     this.logger        = logger;
     this.hubUser       = hubUser;
 }
コード例 #7
0
 public DoorControlClass(IAlarm alarm, IDoor door, IEntryNotification entryNotification, IUserValidation userValidation)
 {
     _alarm             = alarm;
     _door              = door;
     _entryNotification = entryNotification;
     _userValidation    = userValidation;
 }
コード例 #8
0
 public NSubstituteDoorControlFactory()
 {
     UserValidation    = Substitute.For <IUserValidation>();
     Door              = Substitute.For <IDoor>();
     EntryNotification = Substitute.For <IEntryNotification>();
     Alarm             = Substitute.For <IAlarm>();
 }
コード例 #9
0
 public DoorControl(IUserValidation userValidation, IAlarm alarm, IDoor door, IEntryNotification entryNotification)
 {
     UserValidation    = userValidation;
     Alarm             = alarm;
     Door              = door;
     EntryNotification = entryNotification;
 }
コード例 #10
0
        /// <summary>
        /// Registers the given alarm to the given host.
        /// </summary>
        /// <param name="host">Host.</param>
        /// <param name="alarm">Alarm.</param>
        /// <returns>True if the alarm was registered to the host.</returns>
        public bool RegisterAlarmToHost(object host, IAlarm alarm)
        {
            if (HostHasAlarmOfType(alarm.GetType(), host))
            {
                Log.E(this, "Object " + host + " already has an alarm of type " + alarm.GetType().Name);
                return(false);
            }
            HashSet <IAlarm> alarms = null;

            if (__alarmMapping.ContainsKey(host))
            {
                alarms = __alarmMapping[host];
            }
            else
            {
                __alarmMapping[host] = alarms = new HashSet <IAlarm>();
            }

            alarm.id = ++alarmIdCounter;
            __idAlarmMapping.Add(alarm.id, alarm);
            alarms.Add(alarm);
            alarm.onAlarmEvent += OnAlarmEvent;


            return(true);
        }
コード例 #11
0
 public DoorControl(IDoor door, IAlarm alarm, IValidator validator, INotifier notifier)
 {
     _Door      = door;
     _Alarm     = alarm;
     _Validator = validator;
     _Notifier  = notifier;
 }
コード例 #12
0
 public DoorControl(IUserValidation uv, IEntryNotification en, IDoor door, IAlarm alarm)
 {
     _uv    = uv;
     _en    = en;
     _door  = door;
     _alarm = alarm;
 }
コード例 #13
0
 public DoorControl(IDoor door, IUserValidation userValidation, IEntryNotification entryNotification, IAlarm alarm)
 {
     _door              = door;
     _userValidation    = userValidation;
     _entryNotification = entryNotification;
     _alarm             = alarm;
 }
コード例 #14
0
 public Car(IMyIoCContainer myIoCContainer, IAlarm alarmSystem, IAirBag airBagSystem, IPowerSteering powerSteeringSystem)
 {
     _myIoCContainer = myIoCContainer;
     AddAccessory(alarmSystem);
     AddAccessory(airBagSystem);
     AddAccessory(powerSteeringSystem);
 }
コード例 #15
0
        private static void Main(string[] args)
        {
            var builder = new ConfigurationBuilder()
                          .SetBasePath(Directory.GetCurrentDirectory())
                          .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);

            IConfigurationRoot configuration = builder.Build();

            var carType = configuration.GetSection("carType").Value;

            Console.WriteLine("The car type is :" + carType);

            Console.WriteLine("Please press the option");
            Console.WriteLine("i/I for increase car speed");
            Console.WriteLine("d/D for decrease car speed");
            Console.WriteLine("u/U for unlock car");
            Console.WriteLine("l/L for lock car");
            Console.WriteLine("e/E for exit the application");

            var simulator   = new CarSpeedSimulator();
            var speedometer = new Speedometer(simulator);

            IAlarm alarm      = carType == "normal1" ? (IAlarm) new Alarm() : new FreecolAlarm();
            var    speedAlarm = new SpeedAlarm(alarm, speedometer);
            var    seatBelt   = new SeatBelt(alarm, speedometer);

            while (true)
            {
                var key = Console.ReadKey();
                Console.WriteLine();
                var keyChar      = key.KeyChar;
                var optionString = keyChar.ToString().ToLower();

                if (optionString == "i")
                {
                    simulator.Increase();
                }
                else if (optionString == "d")
                {
                    simulator.Decrease();
                }
                else if (optionString == "l")
                {
                    seatBelt.Lock();
                }
                else if (optionString == "u")
                {
                    seatBelt.UnLock();
                }
                else if (optionString == "e")
                {
                    break;
                }
                else
                {
                    Console.WriteLine("unknown option");
                }
            }
        }
コード例 #16
0
ファイル: iAlarm.cs プロジェクト: DragonXYZ/iview-scada
        private void Update()
        {
            _refreshTmr.Stop();

            // Remove os alarmes reconhecidos
            foreach (DataGridViewRow dgvr in dgvAlarms.Rows)
            {
                if (dgvr.Cells["ColumnTimeStamp"].Value != null && Convert.ToDateTime(dgvr.Cells["ColumnTimeStamp"].Value) <= DateTime.Now.Subtract(new TimeSpan(24, 0, 0)))
                {
                    _bs.RemoveAt(dgvr.Index);
                }
            }

            // Reserva a lista de alarmes recentes
            List <IAlarm> list = AlarmManager.Instance.Alarms.FindAll(delegate(IAlarm alarm) { return(alarm.TimeStampAck == null && Convert.ToDateTime(alarm.TimeStamp) > DateTime.Now.Subtract(new TimeSpan(24, 0, 0))); });

            // Decide qual lista vai utilizar
            // A preferência é para a maior lista
            if (list.Count >= _almList.Count)
            {
                foreach (IAlarm alm in list)
                {
                    IAlarm currAlm = _almList.Find(delegate(IAlarm alarm){ return(alarm.Name == alm.Name && alarm.TimeStamp == alm.TimeStamp); });
                    if (currAlm != null)
                    {
                        currAlm.TimeStampAck = alm.TimeStampAck;
                    }
                    else
                    {
                        _almList.Insert(0, alm);
                    }
                }
            }
            else
            {
                for (int i = 0; i < _almList.Count; i++)
                {
                    IAlarm currAlm = list.Find(delegate(IAlarm alarm){ return(alarm.Name == _almList[i].Name && alarm.TimeStamp == _almList[i].TimeStamp); });
                    if (currAlm != null)
                    {
                        _almList[i].TimeStampAck = currAlm.TimeStampAck;
                    }
                }
            }

            foreach (DataGridViewRow dgvr in dgvAlarms.Rows)
            {
                if (dgvr.Cells["ColumnTimeStampAck"].Value == null)
                {
                    dgvr.DefaultCellStyle.BackColor = Color.Red;
                }
                else
                {
                    dgvr.DefaultCellStyle.BackColor = Color.LightGray;
                }
            }

            _refreshTmr.Start();
        }
コード例 #17
0
 public DoorControl(IDoorControlFactory factory)
 {
     _userValidation    = factory.CreateUserValidation();
     _door              = factory.CreateDoor();
     _entryNotification = factory.CreateEntryNotification();
     _alarm             = factory.CreateAlarm();
     _doorState         = State.DoorClosed;
 }
コード例 #18
0
 public DoorControl(IDoor door, IAlarm alarm, IEntryNotification entryNotification, IUserValidation userValidation)
 {
     _door              = door;
     _alarm             = alarm;
     _entryNotification = entryNotification;
     _userValidation    = userValidation;
     _doorState         = DState.Closed;
 }
コード例 #19
0
 private static void UpdateAlarmItem(IAlarm alarm, ListViewItem alarmItem)
 {
     alarmItem.Text             = alarm.Title;
     alarmItem.SubItems[1].Text = alarm.Time.ToShortTimeString();
     alarmItem.SubItems[2].Text = AlarmStatusText(alarm);
     alarmItem.Tag       = alarm;
     alarmItem.BackColor = GetColor(alarm);
 }
コード例 #20
0
 public void SetUp()
 {
     _door              = Substitute.For <IDoor>();
     _alarm             = Substitute.For <IAlarm>();
     _entryNotification = Substitute.For <IEntryNotification>();
     _userValidation    = Substitute.For <IUserValidation>();
     _uut = new DoorControlClass(_alarm, _door, _entryNotification, _userValidation);
 }
コード例 #21
0
ファイル: DoorControl.cs プロジェクト: SWTTeam10/DoorControlA
 public DoorControl(IDoor door, IUserValidation UV, IEntryNotification EN, IAlarm alarm)
 {
     _door           = door;
     _userValidation = UV;
     _entry          = EN;
     _alarm          = alarm;
     _state          = DoorControlState.Closed;
 }
コード例 #22
0
        public bool Match(IAlarm alarm)
        {
            if (alarm == null)
                throw new ArgumentNullException("alarm");

            var isFinished = alarm.Status == AlarmStatus.Canceled || alarm.Status == AlarmStatus.Completed;
            return !isFinished || alarm.Time >= GetTime().AddMinutes(-this.freshnessInMinutes);
        }
コード例 #23
0
 public void SetUp()
 {
     _doorFake              = Substitute.For <IDoor>();
     _alarmFake             = Substitute.For <IAlarm>();
     _entryNotificationFake = Substitute.For <IEntryNotification>();
     _userValidationFake    = Substitute.For <IUserValidation>();
     _uut = new DoorControl(_doorFake, _alarmFake, _entryNotificationFake, _userValidationFake);
 }
コード例 #24
0
 public void Setup()
 {
     _alarm             = Substitute.For <IAlarm>();
     _door              = Substitute.For <IDoor>();
     _entryNotification = Substitute.For <IEntryNotification>();
     _userValidation    = Substitute.For <IUserValidation>();
     _uut = new DoorControl(_door, _userValidation, _entryNotification, _alarm);
 }
コード例 #25
0
 public void Setup()
 {
     alarm             = Substitute.For <IAlarm>();
     door              = Substitute.For <IDoor>();
     entryNotification = Substitute.For <IEntryNotification>();
     userValidation    = Substitute.For <IUserValidation>();
     _uut              = new Door_control.DoorControl(door, userValidation, entryNotification, alarm);
 }
コード例 #26
0
 public void Setup()
 {
     alarm             = new FakeAlarm();
     door              = new FakeDoor();
     entryNotification = new FakeEntryNotfication();
     userValidation    = new FakeUserValidation();
     _uut              = new Door_control.DoorControl(door, userValidation, entryNotification, alarm);
 }
コード例 #27
0
ファイル: MainPageViewModel.cs プロジェクト: phucth8297/Scrum
        public MainPageViewModel(INavigationService navigationService, IAlarm alarm)
            : base(navigationService)
        {
            Title = "Main Page";

            _alarm         = alarm;
            CommandNameCmd = new DelegateCommand <object>(OnCommandName);
        }
コード例 #28
0
        private void Alarm_StatusChanged(object sender, AlarmStatusChangedEventArgs e)
        {
            IAlarm alarm = sender as IAlarm;
            string s     = string.Format("Alarm '{0}' {1}", alarm.Name, e.Value ? "on" : "off");

            log.Debug(s);
            CreateEvent(EventTypes.IO, s);
        }
コード例 #29
0
 public DoorControl(IDoor door, IUserValidation user, IEntryNotification noti, IAlarm alarm)
 {
     _door  = door;
     _user  = user;
     _noti  = noti;
     _alarm = alarm;
     _state = DoorState.DoorClosed;
 }
コード例 #30
0
 public SecurityDoor(IDoor door, IAlarm alarm, int alarmTimeout)
 {
     _door           = door;
     _alarm          = alarm;
     _timer          = new Timer();
     _timer.Interval = alarmTimeout;
     _timer.Elapsed += (o, e) => _alarm.Alert("Alarm!");
 }
コード例 #31
0
 public DoorController(IAlarm alarm, IDoor door, IEntryNotification entryNotification, IUserValidation userValidation)
 {
     _alarm                 = alarm;
     _door                  = door;
     _entryNotification     = entryNotification;
     _userValidation        = userValidation;
     door.DoorChangedEvent += HandleDoorChanged;
 }
コード例 #32
0
        public void AddAlarm(IAlarm alarm)
        {
            if (alarm == null) return;

            if (AlarmExist(alarm.AlarmNo))
                return;

            Items.Add(alarm.AlarmNo, alarm);
        }
コード例 #33
0
 public DoorControl(IAlarm alarm, IDoor door, IEntryNotification notification, IUserValidation validation)
 {
     _door              = door;
     _door.Control      = this;
     _entryNotification = notification;
     _alarm             = alarm;
     _validation        = validation;
     _state             = States.DoorClosed;
 }
コード例 #34
0
        static void Main(string[] args)
        {
            AlarmClock ac = new AlarmClock();
            IAlarm     ar = (IAlarm)ac;
            IClock     cl = (IClock)ac;

            FuncAlarm(ar);
            FuncClock(cl);
        }
コード例 #35
0
 public void Execute(IAlarm alarm)
 {
     switch (alarm.CurrentStatus)
     {
         case AlarmStatus.Activated:
         case AlarmStatus.Triggerd:
             alarm.Receive(new TurnOffCommand(_initiator));
             break;
         case AlarmStatus.Deactivated:
             alarm.Receive(new TurnOnCommand(_initiator));
             break;
     }
 }
コード例 #36
0
ファイル: AlarmService.cs プロジェクト: zhiyix/Alarmy
        public void Add(IAlarm alarm)
        {
            if (alarm == null)
                throw new ArgumentNullException("alarm");

            lock (this.cache)
            {
                this.cache.Add(alarm.Id, alarm);
                this.UpdateRepository();

                if (this.OnAlarmAdd != null)
                    this.OnAlarmAdd.Invoke(this, new AlarmEventArgs(alarm));

                this.CheckAlarmStatus(alarm);
            }
        }
コード例 #37
0
        public NotificationAlarm(Unit unit, IAlarm alarm, bool ack)
        {
            this.Unit = unit;
            this.Date = DateTime.Now;
            this.State = alarm.State;
            this.Prefix = "UN";
            this.Code = alarm.Code;
            this.Description = alarm.Description;
            this.Ack = ack;

            string[] codeComp = alarm.Code.Split(new Char[] { '-' });

            if (codeComp.Length > 1)
            {
                this.Prefix = codeComp[0].Substring(0, 2).ToUpper();
            }
        }
コード例 #38
0
ファイル: Journal.cs プロジェクト: vulsim/prism-client
        public void Log(IUnit unit, IAlarm alarm)
        {
            int code = 10000;
            string[] codeComp = alarm.Code.Split(new Char[] { '-' });

            if (codeComp.Length == 2)
            {
                code += Convert.ToInt32(codeComp[1]);
            }

            try
            {
                switch (alarm.State)
                {
                    case ParamState.Idle:
                    case ParamState.A:
                        EventLog.WriteEntry(Journal.EventLogSource, String.Format("{0} [{1}, {2}]: {3}", unit.FullName, alarm.Code, ParamStateConverter.ToString(alarm.State), alarm.Description), EventLogEntryType.Information, code, Convert.ToInt16(unit.SymbolicName));
                        break;
                    case ParamState.B:
                        EventLog.WriteEntry(Journal.EventLogSource, String.Format("{0} [{1}, {2}]: {3}", unit.FullName, alarm.Code, ParamStateConverter.ToString(alarm.State), alarm.Description), EventLogEntryType.Warning, code, Convert.ToInt16(unit.SymbolicName));
                        break;
                    case ParamState.C:
                        EventLog.WriteEntry(Journal.EventLogSource, String.Format("{0} [{1}, {2}]: {3}", unit.FullName, alarm.Code, ParamStateConverter.ToString(alarm.State), alarm.Description), EventLogEntryType.Error, code, Convert.ToInt16(unit.SymbolicName));
                        break;
                    case ParamState.Unknown:
                    default:
                        EventLog.WriteEntry(Journal.EventLogSource, String.Format("{0} [{1}, {2}]: {3}", unit.FullName, alarm.Code, ParamStateConverter.ToString(alarm.State), alarm.Description), EventLogEntryType.Information, code, Convert.ToInt16(unit.SymbolicName));
                        break;
                }
            }
            catch (SystemException e)
            {

            }

        }
コード例 #39
0
ファイル: AlarmService.cs プロジェクト: zhiyix/Alarmy
        public void Remove(IAlarm alarm)
        {
            if (alarm == null)
                throw new ArgumentNullException("alarm");

            lock (this.cache)
            {
                this.cache.Remove(alarm.Id);
                this.UpdateRepository();

                if (this.OnAlarmRemoval != null)
                    this.OnAlarmRemoval.Invoke(this, new AlarmEventArgs(alarm));
            }
        }
コード例 #40
0
ファイル: FakeAlarmService.cs プロジェクト: zhiyix/Alarmy
 public void Add(IAlarm alarm)
 {
     this.alarms.Add(alarm);
     this.OnAlarmAdd.Invoke(e: new AlarmEventArgs(alarm));
 }
コード例 #41
0
        public void UpdateAlarm(Unit unit, IAlarm alarm)
        {
            lock (Alarms)
            {
                List<NotificationAlarm> alarms = new List<NotificationAlarm>(Alarms);

                foreach (var notificationAlarm in alarms)
                {
                    if (notificationAlarm.Unit.Uri.Equals(unit.Uri) && notificationAlarm.Code.Equals(alarm.Code))
                    {
                        if (notificationAlarm.State != alarm.State)
                        {
                            if (alarm.State == ParamState.Idle)
                            {
                                Alarms.Remove(notificationAlarm);

                                if (GeneralAlarmsStateChangedEvent != null)
                                {
                                    GeneralAlarmsStateChangedEvent(this);
                                }

                                CanPlayShortNotification = true;
                                return;
                            }

                            notificationAlarm.State = alarm.State;
                            notificationAlarm.Ack = false;

                            if (GeneralAlarmsStateChangedEvent != null)
                            {
                                GeneralAlarmsStateChangedEvent(this);
                            }

                            CanPlayShortNotification = true;

                            if (notificationAlarm.State == ParamState.C)
                            {
                                LongNotificationTimer.Stop();
                                LongNotificationTimer.Interval = 3000;
                                LongNotificationTimer.Start();
                            }
                        }

                        return;
                    }
                }

                if (alarm.State > ParamState.Idle)
                {
                    NotificationAlarm notificationAlarm = new NotificationAlarm(unit, alarm, false);
                    Alarms.Add(notificationAlarm);

                    if (GeneralAlarmsStateChangedEvent != null)
                    {
                        GeneralAlarmsStateChangedEvent(this);
                    }

                    CanPlayShortNotification = true;

                    if (notificationAlarm.State == ParamState.C)
                    {
                        LongNotificationTimer.Stop();
                        LongNotificationTimer.Interval = 3000;
                        LongNotificationTimer.Start();
                    }
                }
            }
        }
コード例 #42
0
ファイル: AlarmEventArgs.cs プロジェクト: zhiyix/Alarmy
 public AlarmEventArgs(IAlarm alarm)
 {
     Alarm = alarm;
 }
コード例 #43
0
        public void ModifyAlarm(IAlarm alarm)
        {
            if (alarm == null) return;

            if (AlarmExist(alarm.AlarmNo) == false) return;

            if (Items[alarm.AlarmNo] == null) return;

            IAlarm obj = Items[alarm.AlarmNo];
            obj.AlarmName = alarm.AlarmName;
            obj.Solution = alarm.Solution;
            obj.ImagePath = alarm.ImagePath;
            obj.AlarmStatus = alarm.AlarmStatus;
            obj.AlarmType = alarm.AlarmType;
        }
コード例 #44
0
ファイル: FakeMainView.cs プロジェクト: zhiyix/Alarmy
 public abstract string AskCancelReason(IAlarm alarm);
コード例 #45
0
ファイル: FakeMainView.cs プロジェクト: zhiyix/Alarmy
 public abstract void RemoveAlarm(IAlarm alarm);
コード例 #46
0
ファイル: AlarmCancelEventArgs.cs プロジェクト: zhiyix/Alarmy
 public AlarmCancelEventArgs(IAlarm alarm, string reason)
 {
     this.Reason = reason;
     this.Alarm = alarm;
 }
コード例 #47
0
ファイル: FakeAlarmService.cs プロジェクト: zhiyix/Alarmy
 public void Remove(IAlarm alarm)
 {
     this.alarms.Remove(alarm);
     this.OnAlarmRemoval.Invoke(e: new AlarmEventArgs(alarm));
 }
コード例 #48
0
ファイル: Alarm.cs プロジェクト: zhiyix/Alarmy
        public void Import(IAlarm alarm)
        {
            if (alarm == null)
                throw new ArgumentNullException("alarm");

            this.Status = alarm.Status;
            this.Time = alarm.Time;
            this.Title = alarm.Title;
            this.IsHushed = alarm.IsHushed;
        }
コード例 #49
0
ファイル: FakeAlarmService.cs プロジェクト: zhiyix/Alarmy
 public void Update(IAlarm alarm)
 {
     this.OnAlarmUpdate.Invoke(e: new AlarmEventArgs(alarm));
 }
コード例 #50
0
 public void Execute(IAlarm alarm)
 {
     alarm.Deactivate();
     alarm.EventDispatcher.Dispatch(new DeactivatedEvent(_initiator));
 }
コード例 #51
0
 public void Execute(IAlarm alarm)
 {
     alarm.EventDispatcher.Dispatch(new InvalidLoginEvent());
 }
コード例 #52
0
 public void Add(IAlarm alarm)
 {
     this.Alarms.Add(alarm.Id, alarm);
 }
コード例 #53
0
 public void Update(IAlarm alarm)
 {
     this.Alarms[alarm.Id] = alarm;
 }
コード例 #54
0
 public void Remove(IAlarm alarm)
 {
     this.Alarms.Remove(alarm.Id);
 }
コード例 #55
0
ファイル: FakeAlarm.cs プロジェクト: zhiyix/Alarmy
 public void Import(IAlarm alarm)
 {
 }
コード例 #56
0
ファイル: FakeMainView.cs プロジェクト: zhiyix/Alarmy
 public abstract void UpdateAlarm(IAlarm alarm);
コード例 #57
0
ファイル: FakeMainView.cs プロジェクト: zhiyix/Alarmy
 public abstract void AddAlarm(IAlarm alarm);
コード例 #58
0
ファイル: FakeMainView.cs プロジェクト: zhiyix/Alarmy
 public abstract AlarmMetadata AskAlarmMetadata(IAlarm alarm = null);
コード例 #59
0
ファイル: AlarmService.cs プロジェクト: zhiyix/Alarmy
 private void CheckAlarmStatus(IAlarm cachedAlarm)
 {
     if (cachedAlarm.CheckStatusChange())
     {
         if (this.OnAlarmStatusChange != null)
             this.OnAlarmStatusChange.Invoke(this, new AlarmEventArgs(cachedAlarm));
     }
 }
コード例 #60
0
ファイル: FakeAlarmService.cs プロジェクト: zhiyix/Alarmy
 public void AddStorage(IAlarm alarm)
 {
     this.alarms.Add(alarm);
 }