예제 #1
0
        public ShellView()
        {
            InitializeComponent();
            Container.Initialize(new List <string>()
            {
                "SourceControlMonitor.exe", "Infrastructure.dll", "DataServices.dll"
            });

            this.DataContext            = ViewModelLocator.GetSharedViewModel <IShellViewModel>();
            this.notifyIcon.DataContext = ViewModelLocator.GetSharedViewModel <ITaskBarIconViewModel>();

            _mediator = MediatorLocator.GetSharedMediator();
            _mediator.Subscribe <ShowApplicationEvent>(ignore => OnDoubleClick(null, null));

            this.StateChanged += (s, e) =>
            {
                if (this.WindowState == WindowState.Minimized)
                {
                    _mediator.NotifyColleaguesAsync <ApplicationHiddenEvent>(null);
                    Hide();
                    notifyIcon.Visibility = Visibility.Visible;
                }
                else
                {
                    notifyIcon.HideBalloonTip();
                    notifyIcon.Visibility = Visibility.Collapsed;
                }
            };
        }
        public PopUpViewModel()
        {
            this.IsPopupVisible = false;
            var mediator = MediatorLocator.GetSharedMediator();

            mediator.Subscribe <ShowPopupEvent>(options => this.Options = options as PopupOptions);
        }
예제 #3
0
 public MessageBoxService()
 {
     _uiDispatcherService = Container.GetSharedInstance <IUiDispatcherService>();
     _mediator            = MediatorLocator.GetSharedMediator();
     _mediator.Subscribe <ApplicationHiddenEvent>(ignore => _applicationHidden   = true);
     _mediator.Subscribe <ApplicationRestoredEvent>(ignore => _applicationHidden = false);
 }
        static BaseDataService()
        {
            _mediator          = MediatorLocator.GetSharedMediator();
            _diffService       = DiffServiceLocator.GetPriorityService();
            _messageBoxService = MessageBoxLocator.GetSharedService();
            _dispatcherService = UiDispatcherLocator.GetSharedDispatcher();

            // handle ssl servers with crappy..umm...unregistered certificates
            ServicePointManager.ServerCertificateValidationCallback += ((sender, certificate, chain, sslPolicyErrors) => true);
        }