コード例 #1
0
 public void TestCloseBrowserProcessCallsShutdown()
 {
     _uiHelper = Substitute.For<IUiHelper>();
     _browsersManagerApi = new BrowsersManagerApi(_browserWindowsManager, _uiHelper);
     _browsersManagerApi.CloseBrowserProcess();
     _uiHelper.Received().GracefulShutdown();
 }
コード例 #2
0
ファイル: ExplorerWatcher.cs プロジェクト: artgo/CefSharp
 public ExplorerWatcher(ILogger logger, IUiHelper uiHelper, Action actionOnStartup, Action actionOnShutdown)
 {
     _logger = logger;
     _uiHelper = uiHelper;
     _actionOnStartup = actionOnStartup;
     _actionOnShutdown = actionOnShutdown;
 }
コード例 #3
0
 public void TestCloseBrowserProcessCallsShutdown()
 {
     _uiHelper           = Substitute.For <IUiHelper>();
     _browsersManagerApi = new BrowsersManagerApi(_browserWindowsManager, _uiHelper);
     _browsersManagerApi.CloseBrowserProcess();
     _uiHelper.Received().GracefulShutdown();
 }
コード例 #4
0
 public ExplorerWatcher(ILogger logger, IUiHelper uiHelper, Action actionOnStartup, Action actionOnShutdown)
 {
     _logger           = logger;
     _uiHelper         = uiHelper;
     _actionOnStartup  = actionOnStartup;
     _actionOnShutdown = actionOnShutdown;
 }
コード例 #5
0
 public void TestCloseAllApplicationsAndRemoveSessionInfoRemovesSessionInfo()
 {
     _uiHelper = Substitute.For<IUiHelper>();
     _browsersManagerApi = new BrowsersManagerApi(_browserWindowsManager, _uiHelper);
     var appDirectSession = _browserWindowsManager.Session;
     _browsersManagerApi.CloseAllApplicationsAndRemoveSessionInfo();
     Assert.AreNotEqual(appDirectSession, _browserWindowsManager.Session);
 }
コード例 #6
0
        public void TestCloseAllApplicationsAndRemoveSessionInfoRemovesSessionInfo()
        {
            _uiHelper           = Substitute.For <IUiHelper>();
            _browsersManagerApi = new BrowsersManagerApi(_browserWindowsManager, _uiHelper);
            var appDirectSession = _browserWindowsManager.Session;

            _browsersManagerApi.CloseAllApplicationsAndRemoveSessionInfo();
            Assert.AreNotEqual(appDirectSession, _browserWindowsManager.Session);
        }
コード例 #7
0
 public void TestDisplayApplicationCallGetOrCreateBrowserWindow()
 {
     _uiHelper = Substitute.For<IUiHelper>();
     var windowMock = Substitute.For<IBrowserWindow>();
     _browserWindowsManager.GetOrCreateBrowserWindow(null).ReturnsForAnyArgs(windowMock);
     _browsersManagerApi = new BrowsersManagerApi(_browserWindowsManager, _uiHelper);
     _browsersManagerApi.DisplayApplication(new Application());
     _browserWindowsManager.Received().GetOrCreateBrowserWindow(Arg.Any<IApplication>());
 }
コード例 #8
0
        public void Init()
        {
            _uiHelper             = new TestUiHelper();
            _browserObject        = Substitute.For <IBrowserObject>();
            _browserWindowMock    = Substitute.For <IBrowserWindow>();
            _browserWindowBuilder = new TestBrowserWindowsBuilder(_browserWindowMock);

            _browserWindowsManager = new BrowserWindowsManager(_browserObject, _uiHelper, _browserWindowBuilder);
        }
コード例 #9
0
        public void Init()
        {
            _uiHelper = new TestUiHelper();
            _browserObject = Substitute.For<IBrowserObject>();
            _browserWindowMock = Substitute.For<IBrowserWindow>();
            _browserWindowBuilder = new TestBrowserWindowsBuilder(_browserWindowMock);

            _browserWindowsManager = new BrowserWindowsManager(_browserObject, _uiHelper, _browserWindowBuilder);
        }
コード例 #10
0
        public void TestDisplayApplicationCallGetOrCreateBrowserWindow()
        {
            _uiHelper = Substitute.For <IUiHelper>();
            var windowMock = Substitute.For <IBrowserWindow>();

            _browserWindowsManager.GetOrCreateBrowserWindow(null).ReturnsForAnyArgs(windowMock);
            _browsersManagerApi = new BrowsersManagerApi(_browserWindowsManager, _uiHelper);
            _browsersManagerApi.DisplayApplication(new Application());
            _browserWindowsManager.Received().GetOrCreateBrowserWindow(Arg.Any <IApplication>());
        }
コード例 #11
0
 public void Init()
 {
     _service = Substitute.For<IBrowsersManagerApi, ICommunicationObject>();
     _serviceStarter = Substitute.For<IServiceBuilder<IBrowsersManagerApi>>();
     _serviceStarter.CreateServiceAndTryToConnect().Returns(_service);
     _uiHelper = Substitute.For<IUiHelper>();
     _log = Substitute.For<ILogger>();
     _communicationObject = (ICommunicationObject)_service;
     _serviceClient = new AbstractServiceClient<IBrowsersManagerApi>(_serviceStarter, _uiHelper, _log);
 }
コード例 #12
0
 public void Init()
 {
     _service        = Substitute.For <IBrowsersManagerApi, ICommunicationObject>();
     _serviceStarter = Substitute.For <IServiceBuilder <IBrowsersManagerApi> >();
     _serviceStarter.CreateServiceAndTryToConnect().Returns(_service);
     _uiHelper            = Substitute.For <IUiHelper>();
     _log                 = Substitute.For <ILogger>();
     _communicationObject = (ICommunicationObject)_service;
     _serviceClient       = new AbstractServiceClient <IBrowsersManagerApi>(_serviceStarter, _uiHelper, _log);
 }
コード例 #13
0
 public void Init()
 {
     _browserApi     = Substitute.For <IBrowsersManagerApi, ICommunicationObject>();
     _serviceStarter = Substitute.For <IServiceBuilder <IBrowsersManagerApi> >();
     _serviceStarter.CreateServiceAndTryToConnect().Returns(_browserApi);
     _uiHelper                   = Substitute.For <IUiHelper>();
     _log                        = Substitute.For <ILogger>();
     _communicationObject        = (ICommunicationObject)_browserApi;
     _browserWindowsCommunicator = new BrowserWindowsCommunicator(_serviceStarter, _uiHelper, _log);
 }
コード例 #14
0
 public void Init()
 {
     _browserApi = Substitute.For<IBrowsersManagerApi, ICommunicationObject>();
     _serviceStarter = Substitute.For<IServiceBuilder<IBrowsersManagerApi>>();
     _serviceStarter.CreateServiceAndTryToConnect().Returns(_browserApi);
     _uiHelper = Substitute.For<IUiHelper>();
     _log = Substitute.For<ILogger>();
     _communicationObject = (ICommunicationObject)_browserApi;
     _browserWindowsCommunicator = new BrowserWindowsCommunicator(_serviceStarter, _uiHelper, _log);
 }
コード例 #15
0
ファイル: TaskbarPanel.xaml.cs プロジェクト: artgo/CefSharp
        public TaskbarPanel(ILatch latch, ILogger logger, MainViewModel mainViewModel, IUiHelper uiHelper)
        {
            _log = logger;
            _mainViewModel = mainViewModel;
            _uiHelper = uiHelper;

            InitializeComponent();
            InitializeMainWindowLatch = latch;

            ViewModel = new TaskbarPanelViewModel(_mainViewModel.MyApplications.Where(a => a.Application.PinnedToTaskbar && !a.IsUnsupported).ToList());
            DataContext = ViewModel;
        }
コード例 #16
0
        public TaskbarPanel(ILatch latch, ILogger logger, MainViewModel mainViewModel, IUiHelper uiHelper)
        {
            _log           = logger;
            _mainViewModel = mainViewModel;
            _uiHelper      = uiHelper;

            InitializeComponent();
            InitializeMainWindowLatch = latch;

            ViewModel   = new TaskbarPanelViewModel(_mainViewModel.MyApplications.Where(a => a.Application.PinnedToTaskbar && !a.IsUnsupported).ToList());
            DataContext = ViewModel;
        }
コード例 #17
0
        public BrowsersManagerApi(IBrowserWindowsManager browserWindowsManager, IUiHelper uiHelper)
        {
            if (browserWindowsManager == null)
            {
                throw new ArgumentNullException("browserWindowsManager");
            }

            if (uiHelper == null)
            {
                throw new ArgumentNullException("uiHelper");
            }

            _browserWindowsManager = browserWindowsManager;
            _uiHelper = uiHelper;
        }
コード例 #18
0
        public WpfCefRenderHandler(AvaloniaCefBrowser owner, IUiHelper uiHelper)
        {
            if (owner == null)
            {
                throw new ArgumentNullException("owner");
            }

            if (uiHelper == null)
            {
                throw new ArgumentNullException("uiHelper");
            }

            _owner    = owner;
            _uiHelper = uiHelper;
        }
コード例 #19
0
ファイル: BrowsersManagerApi.cs プロジェクト: artgo/CefSharp
        public BrowsersManagerApi(IBrowserWindowsManager browserWindowsManager, IUiHelper uiHelper)
        {
            if (browserWindowsManager == null)
            {
                throw new ArgumentNullException("browserWindowsManager");
            }

            if (uiHelper == null)
            {
                throw new ArgumentNullException("uiHelper");
            }

            _browserWindowsManager = browserWindowsManager;
            _uiHelper = uiHelper;
        }
コード例 #20
0
        public BrowserWindowsManager(IBrowserObject browserObject, IUiHelper uiHelper, IBrowserWindowsBuilder<IBrowserWindow> browserWindowsBuilder)
        {
            if (browserObject == null)
            {
                throw new ArgumentNullException("browserObject");
            }

            if (uiHelper == null)
            {
                throw new ArgumentNullException("uiHelper");
            }

            _browserObject = browserObject;
            _uiHelper = uiHelper;
            _browserWindowsBuilder = browserWindowsBuilder;
        }
コード例 #21
0
        public BrowserWindowsManager(IBrowserObject browserObject, IUiHelper uiHelper, IBrowserWindowsBuilder <IBrowserWindow> browserWindowsBuilder)
        {
            if (browserObject == null)
            {
                throw new ArgumentNullException("browserObject");
            }

            if (uiHelper == null)
            {
                throw new ArgumentNullException("uiHelper");
            }

            _browserObject         = browserObject;
            _uiHelper              = uiHelper;
            _browserWindowsBuilder = browserWindowsBuilder;
        }
コード例 #22
0
        //public BaseViewModel()
        //{

        //}


        //  public ServiceClient.ServiceClient Servicebroker = new ServiceClient.ServiceClient { BaseUrl = SuperApp.Instance.DEV_Endpoint, TokenKey = SuperApp.Instance.CurrentTokenKey };

        public BaseViewModel(IConnectivityService connectivityService
                             , IUiHelper uiHelper
                             , INavigationService navigationService
                             , ILogger logger)
        {
            ConnectivityService = connectivityService;

            UiHelper          = uiHelper;
            NavigationService = navigationService;
            Logger            = logger;


            // will this fire in previous loaded viewmodels????
            CrossConnectivity.Current.ConnectivityTypeChanged += (object sender, Plugin.Connectivity.Abstractions.ConnectivityTypeChangedEventArgs e) =>
            {
                NotifyPropertyChanged("InternetConnection");
            };
        }
コード例 #23
0
ファイル: App.xaml.cs プロジェクト: PlumpMath/CefSharp-1
        private TaskbarPanel CreateTaskbarPanel(MainViewModel mainViewModel, IUiHelper uiHelper)
        {
            try
            {
                var taskbarPanel = new TaskbarPanel(_mainWindowReadyLatch, new NLogLogger("TaskbarPanel"), mainViewModel, uiHelper);
                taskbarPanel.InitializeButtons();

                return(taskbarPanel);
            }
            catch (Exception ex)
            {
                _log.ErrorException("Failed to initialize taskbar module", ex);
                uiHelper.ShowMessage(ex.ToString());
                uiHelper.IgnoreException(_instanceMutex.ReleaseMutex);
                _instanceMutex = null;
                Current.Shutdown();
                Environment.Exit(0);
            }

            return(null);
        }
コード例 #24
0
        public AbstractServiceClient(IServiceBuilder <T> serviceStarter, IUiHelper uiHelper, ILogger log)
        {
            if (serviceStarter == null)
            {
                throw new ArgumentNullException("serviceStarter");
            }

            if (uiHelper == null)
            {
                throw new ArgumentNullException("uiHelper");
            }

            if (log == null)
            {
                throw new ArgumentNullException("log");
            }

            _serviceStarter = serviceStarter;
            _uiHelper       = uiHelper;
            _log            = log;
        }
コード例 #25
0
        public WpfCefRenderHandler(WpfCefBrowser owner, ILogger logger, IUiHelper uiHelper)
        {
            if (owner == null)
            {
                throw new ArgumentNullException("owner");
            }

            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            if (uiHelper == null)
            {
                throw new ArgumentNullException("uiHelper");
            }

            _owner    = owner;
            _logger   = logger;
            _uiHelper = uiHelper;
        }
コード例 #26
0
        public WpfCefRenderHandler(WpfCefBrowser owner, ILogger logger, IUiHelper uiHelper)
        {
            if (owner == null)
            {
                throw new ArgumentNullException("owner");
            }

            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            if (uiHelper == null)
            {
                throw new ArgumentNullException("uiHelper");
            }

            _owner = owner;
            _logger = logger;
            _uiHelper = uiHelper;
        }
コード例 #27
0
ファイル: SessionKeeper.cs プロジェクト: artgo/CefSharp
        public SessionKeeper(MainApplicationServiceClient mainAppClient, IBrowserWindowsManager browserWindowsManager,
            IBrowserWindowsBuilder<IBrowserWindow> browserWindowsBuilder, ILogger log, IUiHelper uiHelper)
        {
            if (mainAppClient == null)
            {
                throw new ArgumentNullException("mainAppClient");
            }

            if (browserWindowsManager == null)
            {
                throw new ArgumentNullException("browserWindowsManager");
            }

            if (browserWindowsBuilder == null)
            {
                throw new ArgumentNullException("browserWindowsBuilder");
            }

            if (log == null)
            {
                throw new ArgumentNullException("log");
            }

            if (uiHelper == null)
            {
                throw new ArgumentNullException("uiHelper");
            }

            _mainAppClient = mainAppClient;
            _log = log;
            _uiHelper = uiHelper;
            _sessionUpdator = KeepUpdatingSession;
            _browserWindowsManager = browserWindowsManager;
            _browserWindowsBuilder = browserWindowsBuilder;
            _updaterThread = new Thread(_sessionUpdator);
        }
コード例 #28
0
ファイル: SessionKeeper.cs プロジェクト: PlumpMath/CefSharp-1
        public SessionKeeper(MainApplicationServiceClient mainAppClient, IBrowserWindowsManager browserWindowsManager,
                             IBrowserWindowsBuilder <IBrowserWindow> browserWindowsBuilder, ILogger log, IUiHelper uiHelper)
        {
            if (mainAppClient == null)
            {
                throw new ArgumentNullException("mainAppClient");
            }

            if (browserWindowsManager == null)
            {
                throw new ArgumentNullException("browserWindowsManager");
            }

            if (browserWindowsBuilder == null)
            {
                throw new ArgumentNullException("browserWindowsBuilder");
            }

            if (log == null)
            {
                throw new ArgumentNullException("log");
            }

            if (uiHelper == null)
            {
                throw new ArgumentNullException("uiHelper");
            }

            _mainAppClient         = mainAppClient;
            _log                   = log;
            _uiHelper              = uiHelper;
            _sessionUpdator        = KeepUpdatingSession;
            _browserWindowsManager = browserWindowsManager;
            _browserWindowsBuilder = browserWindowsBuilder;
            _updaterThread         = new Thread(_sessionUpdator);
        }
コード例 #29
0
 public void Init()
 {
     _uiHelper = new TestUiHelper();
     _analytics = Substitute.For<IAnalytics>();
     _asyncAnalytics = new AsyncAnalytics(_analytics, _uiHelper);
 }
コード例 #30
0
 private void InitWithMocks()
 {
     _uiHelper = Substitute.For<IUiHelper>();
     _analytics = Substitute.For<IAnalytics>();
     _asyncAnalytics = new AsyncAnalytics(_analytics, _uiHelper);
 }
コード例 #31
0
 public void Init()
 {
     _uiHelper = new TestUiHelper();
     _browserWindowsManager = Substitute.For <IBrowserWindowsManager>();
     _browsersManagerApi    = new BrowsersManagerApi(_browserWindowsManager, _uiHelper);
 }
コード例 #32
0
 public AsyncAnalytics(IAnalytics analyticsImpl, IUiHelper uiHelper)
 {
     _analyticsImpl = analyticsImpl;
     _uiHelper      = uiHelper;
 }
コード例 #33
0
 public void Init()
 {
     _uiHelper = new TestUiHelper();
     _browserWindowsManager = Substitute.For<IBrowserWindowsManager>();
     _browsersManagerApi = new BrowsersManagerApi(_browserWindowsManager, _uiHelper);
 }
コード例 #34
0
ファイル: App.xaml.cs プロジェクト: artgo/CefSharp
        private TaskbarPanel CreateTaskbarPanel(MainViewModel mainViewModel, IUiHelper uiHelper)
        {
            try
            {
                var taskbarPanel = new TaskbarPanel(_mainWindowReadyLatch, new NLogLogger("TaskbarPanel"), mainViewModel, uiHelper);
                taskbarPanel.InitializeButtons();

                return taskbarPanel;
            }
            catch (Exception ex)
            {
                _log.ErrorException("Failed to initialize taskbar module", ex);
                uiHelper.ShowMessage(ex.ToString());
                uiHelper.IgnoreException(_instanceMutex.ReleaseMutex);
                _instanceMutex = null;
                Current.Shutdown();
                Environment.Exit(0);
            }

            return null;
        }
コード例 #35
0
 public BrowserWindowsCommunicator(IServiceBuilder <IBrowsersManagerApi> serviceStarter, IUiHelper uiHelper, ILogger log)
     : base(serviceStarter, uiHelper, log)
 {
 }
コード例 #36
0
ファイル: AsyncAnalytics.cs プロジェクト: artgo/CefSharp
 public AsyncAnalytics(IAnalytics analyticsImpl, IUiHelper uiHelper)
 {
     _analyticsImpl = analyticsImpl;
     _uiHelper = uiHelper;
 }
コード例 #37
0
 public HomeViewModel(IConnectivityService connectivityService
                      , IUiHelper uiHelper
                      , INavigationService navigationService
                      , ILogger logger) : base(connectivityService, uiHelper, navigationService, logger)
 {
 }
コード例 #38
0
ファイル: AsyncAnalyticsTest.cs プロジェクト: artgo/CefSharp
 private void InitWithMocks()
 {
     _uiHelper = Substitute.For<IUiHelper>();
     _analytics = Substitute.For<IAnalytics>();
     _asyncAnalytics = new AsyncAnalytics(_analytics, _uiHelper);
 }
コード例 #39
0
ファイル: AsyncAnalyticsTest.cs プロジェクト: artgo/CefSharp
 public void Init()
 {
     _uiHelper = new TestUiHelper();
     _analytics = Substitute.For<IAnalytics>();
     _asyncAnalytics = new AsyncAnalytics(_analytics, _uiHelper);
 }
コード例 #40
0
 public MainApplicationServiceClient(IServiceBuilder <IMainApplication> serviceStarter, IUiHelper uiHelper, ILogger log)
     : base(serviceStarter, uiHelper, log)
 {
 }