Пример #1
0
 public void ThenTheNotifyIconIsSetTo(NotifyIconState iconState)
 {
     Assert.IsNotNull(ViewModel);
     Assert.IsNotNull(ViewModel.NotifyIcon);
     Assert.IsInstanceOfType(ViewModel.NotifyIcon, typeof(BitmapImage));
     Assert.AreEqual(IconStates[iconState], ((BitmapImage)ViewModel.NotifyIcon).UriSource.OriginalString);
 }
        private void SetIconState(NotifyIconState state)
        {
            switch (state)
            {
            case NotifyIconState.Connected:
                NotifyIcon = ConnectedNotifyIcon;
                break;

            case NotifyIconState.Disconnected:
                NotifyIcon   = DisconnectedNotifyIcon;
                StateSummary = "Octopus Notify (Disconnected)";
                break;

            case NotifyIconState.Error:
                NotifyIcon = ErrorNotifyIcon;
                break;

            default:
                throw new InvalidOperationException("Unknown icon type");
            }
        }
 private void SaveState()
 {
     lastMessage = NotifyIconState.getState(notifyIcon);
 }