/// <summary>
        /// Creates a <see cref="WuApiController"/> which uses the given Interfaces to search, download and install updates.
        /// </summary>
        /// <param name="session">Session to be used.</param>
        /// <param name="updateCollectionFactory">Factory to create <see cref="IUpdateCollection"/>s.</param>
        /// <param name="systemInfo">System informations about the OS enviroment.</param>
        public WuApiController(IUpdateSession session, UpdateCollectionFactory updateCollectionFactory, ISystemInfo systemInfo)
        {
            if (session == null)
            {
                throw new ArgumentNullException(nameof(session));
            }
            if (updateCollectionFactory == null)
            {
                throw new ArgumentNullException(nameof(updateCollectionFactory));
            }
            if (systemInfo == null)
            {
                throw new ArgumentNullException(nameof(systemInfo));
            }

            UpdateSession = session;
            UpdateSession.ClientApplicationID = this.GetType().FullName;
            UpdateSearcher          = session.CreateUpdateSearcher();
            UpdateDownloader        = session.CreateUpdateDownloader();
            UpdateInstaller         = session.CreateUpdateInstaller();
            UpdateCollectionFactory = updateCollectionFactory;
            SystemInfo       = systemInfo;
            StateTransitions = SetupStateTransitions();

            EnterState((SystemInfo.IsRebootRequired()) ? (WuProcessState) new WuStateRebootRequired() : new WuStateReady());
            Log.Info("Initial state: " + _currentState.GetType().Name);
            if (Log.IsDebugEnabled)
            {
                OnStateChanged            += (s, e) => { Log.Debug($"Event {nameof(OnStateChanged)} fired: {e.ToString()}"); };
                OnAsyncOperationCompleted += (s, e) => { Log.Debug($"Event {nameof(OnAsyncOperationCompleted)} fired: {e.ToString()}"); };
                OnProgressChanged         += (s, e) => { Log.Debug($"Event {nameof(OnProgressChanged)} fired: {e.ToString()}"); };
            }
        }
Ejemplo n.º 2
0
 public MasterViewModel(
     IMvxMessenger messenger,
     ISecurityService securityService,
     IWebNavigation webNavigation,
     ISystemInfo systemInfo,
     IAppVersionService appVersionService,
     IStudentDataService studentDataService,
     IRefreshDataService refreshDataService,
     IAbsenceDataService absenceDataService,
     IEvaluationDataService evaluationDataService,
     IEventDataService eventDataService,
     ILessonDataService lessonDataService,
     INoteDataService noteDataService,
     IUzenetDataService uzenetDataService,
     IExamDataService examDataService)
 {
     this._messenger             = messenger;
     this._securityService       = securityService;
     this._webNavigation         = webNavigation;
     this._systemInfo            = systemInfo;
     this._appVersionService     = appVersionService;
     this._studentDataService    = studentDataService;
     this._refreshDataService    = refreshDataService;
     this._absenceDataService    = absenceDataService;
     this._evaluationDataService = evaluationDataService;
     this._eventDataService      = eventDataService;
     this._lessonDataService     = lessonDataService;
     this._noteDataService       = noteDataService;
     this._uzenetDataService     = uzenetDataService;
     this._examDataService       = examDataService;
 }
Ejemplo n.º 3
0
        public ColorbarViewModel(IRegionManager regionManager,
                                 IEventAggregator eventAggregator,
                                 IAppConfiguration appConfiguration,
                                 ILogger <ColorbarViewModel> logger,
                                 IShell shell,
                                 ISystemInfo systemInfo,
                                 LoginManager loginManager)
        {
            _regionManager                = regionManager;
            _eventAggregator              = eventAggregator;
            _appConfiguration             = appConfiguration;
            _logger                       = logger;
            _shell                        = shell;
            _systemInfo                   = systemInfo;
            _loginManager                 = loginManager;
            StutteringFactor              = _appConfiguration.StutteringFactor;
            SelectWindowSize              = _appConfiguration.MovingAverageWindowSize;
            FpsValuesRoundingDigits       = _appConfiguration.FpsValuesRoundingDigits;
            ScreenshotDirectory           = _appConfiguration.ScreenshotDirectory;
            WindowSizes                   = new List <int>(Enumerable.Range(4, 100 - 4));
            RoundingDigits                = new List <int>(Enumerable.Range(0, 8));
            SelectScreenshotFolderCommand = new DelegateCommand(OnSelectScreenshotFolder);
            OpenScreenshotFolderCommand   = new DelegateCommand(OnOpenScreenshotFolder);
            OptionPopupClosed             = eventAggregator.GetEvent <PubSubEvent <ViewMessages.OptionPopupClosed> >();

            HasCustomInfo = SelectedHardwareInfoSource == EHardwareInfoSource.Custom;
            IsLoggedIn    = _loginManager.State.Token != null;
            SetAggregatorEvents();
            SetHardwareInfoDefaultsFromDatabase();
            SubscribeToUpdateSession();
        }
 public CreateTerminalRequestHandler(ConnectionManager sessions, ICliSessionFactory[] factories, ILogger log, ISystemInfo sysinfo)
 {
     _factories   = factories;
     _connections = sessions;
     _log         = log;
     _sysinfo     = sysinfo;
 }
Ejemplo n.º 5
0
        public virtual void TestSystemInfo()
        {
            ISystemInfo systemInfo = _client1.SystemInfo();

            Assert.IsNotNull(systemInfo);
            Assert.IsGreater(1, systemInfo.TotalSize());
        }
Ejemplo n.º 6
0
        public OverlayEntryProvider(ISensorService sensorService,
                                    IAppConfiguration appConfiguration,
                                    IEventAggregator eventAggregator,
                                    IOnlineMetricService onlineMetricService,
                                    ISystemInfo systemInfo, IRTSSService rTSSService,
                                    ILogger <OverlayEntryProvider> logger)
        {
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();

            _sensorService       = sensorService;
            _appConfiguration    = appConfiguration;
            _eventAggregator     = eventAggregator;
            _onlineMetricService = onlineMetricService;
            _systemInfo          = systemInfo;
            _rTSSService         = rTSSService;
            _logger = logger;

            _onDictionaryUpdatedBuffered = _sensorService
                                           .OnDictionaryUpdated
                                           .Replay(1)
                                           .AutoConnect(0);

            _ = Task.Run(async() => await LoadOrSetDefault())
                .ContinueWith(task => _taskCompletionSource.SetResult(true));

            SubscribeToOptionPopupClosed();

            _logger.LogDebug("{componentName} Ready", this.GetType().Name);

            stopwatch.Stop();
            _logger.LogInformation(this.GetType().Name + " {initializationTime}s initialization time", Math.Round(stopwatch.ElapsedMilliseconds * 1E-03, 1));
        }
Ejemplo n.º 7
0
 public ShellOperation(
     IActionCenter actionCenter,
     IAudio audio,
     INotificationInfo aboutInfo,
     INotificationController aboutController,
     ClientContext context,
     IKeyboard keyboard,
     ILogger logger,
     INotificationInfo logInfo,
     INotificationController logController,
     IPowerSupply powerSupply,
     ISystemInfo systemInfo,
     ITaskbar taskbar,
     ITaskview taskview,
     IText text,
     IUserInterfaceFactory uiFactory,
     IWirelessAdapter wirelessAdapter) : base(context)
 {
     this.aboutInfo       = aboutInfo;
     this.aboutController = aboutController;
     this.actionCenter    = actionCenter;
     this.audio           = audio;
     this.keyboard        = keyboard;
     this.logger          = logger;
     this.logInfo         = logInfo;
     this.logController   = logController;
     this.powerSupply     = powerSupply;
     this.systemInfo      = systemInfo;
     this.text            = text;
     this.taskbar         = taskbar;
     this.taskview        = taskview;
     this.uiFactory       = uiFactory;
     this.wirelessAdapter = wirelessAdapter;
 }
 public UtilizationStore(ISystemInfo systemInfo, IDnsStatic dnsStatic, IConfiguration configuration, IAgentHealthReporter agentHealthReporter)
 {
     _systemInfo          = systemInfo;
     _dnsStatic           = dnsStatic;
     _configuration       = configuration;
     _agentHealthReporter = agentHealthReporter;
 }
Ejemplo n.º 9
0
        Session PrepareSession(ISessionWriter sessionManager, ISystemInfo systemInfo, out bool isNewSession)
        {
            var sessions = sessionManager.GetOpenSessions();

            Session session = null;

            isNewSession = false;
            if (sessions.Count > 0)
            {
                Console.WriteLine("Choose session to resume: ");
                for (int i = 0; i < sessions.Count; i++)
                {
                    Console.WriteLine($"{i + 1}: {sessions[i].Student}, {sessions[i].StartDt.ToLocalTime()}");
                }
                Console.WriteLine($"{sessions.Count + 1}: Start new session");
                var choice = InputChoice("Your choice: ", sessions.Count + 1);
                if (choice <= sessions.Count)
                {
                    session = sessions[choice - 1];
                    sessionManager.ResumeSession(session);
                }
            }

            if (session == null)
            {
                session = StartNewSession(systemInfo);
                sessionManager.CreateNewSession(session);
                isNewSession = true;
            }
            return(session);
        }
Ejemplo n.º 10
0
        public ColorbarViewModel(IRegionManager regionManager,
                                 IEventAggregator eventAggregator,
                                 IAppConfiguration appConfiguration,
                                 ILogger <ColorbarViewModel> logger,
                                 IShell shell,
                                 ISystemInfo systemInfo,
                                 LoginManager loginManager)
        {
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();

            _regionManager    = regionManager;
            _eventAggregator  = eventAggregator;
            _appConfiguration = appConfiguration;
            _logger           = logger;
            _shell            = shell;
            _systemInfo       = systemInfo;
            _loginManager     = loginManager;

            RoundingDigits = new List <int>(Enumerable.Range(0, 8));
            SelectScreenshotFolderCommand = new DelegateCommand(OnSelectScreenshotFolder);
            OpenScreenshotFolderCommand   = new DelegateCommand(OnOpenScreenshotFolder);

            HasCustomInfo = SelectedHardwareInfoSource == EHardwareInfoSource.Custom;
            IsLoggedIn    = _loginManager.State.Token != null;
            SetAggregatorEvents();
            SubscribeToAggregatorEvents();
            SetHardwareInfoDefaultsFromDatabase();

            stopwatch.Stop();
            _logger.LogInformation(this.GetType().Name + " {initializationTime}s initialization time", Math.Round(stopwatch.ElapsedMilliseconds * 1E-03, 1));
        }
Ejemplo n.º 11
0
 public UILogic()
 {
     taker          = new ScreenshotTaker();
     sessionManager = Factory.Instance.GetSessionManager();
     appMonitor     = Factory.Instance.GetApplicationMonitor();
     systemInfo     = Factory.Instance.GetSystemInfo();
 }
Ejemplo n.º 12
0
        internal static int GetDp(int fontSize)
        {
            int         dpi;
            ISystemInfo iSysInfo = DependencyService.Get <ISystemInfo>();

            iSysInfo.TryGetValue <int>("http://tizen.org/feature/screen.dpi", out dpi);
            return(fontSize * 160 / dpi);
        }
Ejemplo n.º 13
0
        public VersionRegistry(Uri uri, IApiLocalObjectCacheManager cacheManager, ISystemInfo systemInfo) {
            _cacheManager = cacheManager;
            _systemInfo = systemInfo;

            _versionInfoUrl = Tools.Transfer.JoinUri(uri, VersionInfoFile);
            LocalVersionInfo = new VersionInfoDto();
            VersionInfo = new VersionInfoDto();
        }
Ejemplo n.º 14
0
 public NeedUpdateViewModel(
     ISystemInfo systemInfo,
     IWebNavigation webNvigation,
     IAppVersionService appVersionService)
 {
     this._systemInfo        = systemInfo;
     this._webNavigation     = webNvigation;
     this._appVersionService = appVersionService;
 }
Ejemplo n.º 15
0
        public VersionRegistry(Uri uri, IApiLocalObjectCacheManager cacheManager, ISystemInfo systemInfo)
        {
            _cacheManager = cacheManager;
            _systemInfo   = systemInfo;

            _versionInfoUrl  = Tools.Transfer.JoinUri(uri, VersionInfoFile);
            LocalVersionInfo = new VersionInfoDto();
            VersionInfo      = new VersionInfoDto();
        }
Ejemplo n.º 16
0
 public IndexGetHandler(
     ISecureSession<Token> secureSession,
     DashboardGetHandler dashboard,
     ISystemInfo systemInfo)
 {
     _secureSession = secureSession;
     _dashboard = dashboard;
     _systemInfo = systemInfo;
 }
        internal void BuildObjectGraph(Action shutdown)
        {
            const int FIVE_SECONDS   = 5000;
            const int THIRTY_SECONDS = 30000;

            var args          = Environment.GetCommandLineArgs();
            var nativeMethods = new NativeMethods();

            logger     = new Logger();
            systemInfo = new SystemInfo();

            InitializeConfiguration();
            InitializeLogging();
            InitializeText();

            var messageBox     = new MessageBox(text);
            var desktopFactory = new DesktopFactory(ModuleLogger(nameof(DesktopFactory)));
            var explorerShell  = new ExplorerShell(ModuleLogger(nameof(ExplorerShell)), nativeMethods);
            var processFactory = new ProcessFactory(ModuleLogger(nameof(ProcessFactory)));
            var proxyFactory   = new ProxyFactory(new ProxyObjectFactory(), logger);
            var runtimeHost    = new RuntimeHost(appConfig.RuntimeAddress, new HostObjectFactory(), ModuleLogger(nameof(RuntimeHost)), FIVE_SECONDS);
            var serviceProxy   = new ServiceProxy(appConfig.ServiceAddress, new ProxyObjectFactory(), ModuleLogger(nameof(ServiceProxy)));
            var sessionContext = new SessionContext();
            var uiFactory      = new UserInterfaceFactory(text);

            var bootstrapOperations = new Queue <IOperation>();
            var sessionOperations   = new Queue <IRepeatableOperation>();

            bootstrapOperations.Enqueue(new I18nOperation(logger, text, textResource));
            bootstrapOperations.Enqueue(new CommunicationHostOperation(runtimeHost, logger));

            sessionOperations.Enqueue(new SessionInitializationOperation(configuration, logger, runtimeHost, sessionContext));
            sessionOperations.Enqueue(new ConfigurationOperation(args, configuration, new HashAlgorithm(), logger, sessionContext));
            sessionOperations.Enqueue(new ClientTerminationOperation(logger, processFactory, proxyFactory, runtimeHost, sessionContext, THIRTY_SECONDS));
            sessionOperations.Enqueue(new KioskModeTerminationOperation(desktopFactory, explorerShell, logger, processFactory, sessionContext));
            sessionOperations.Enqueue(new ServiceOperation(logger, runtimeHost, serviceProxy, sessionContext, THIRTY_SECONDS));
            sessionOperations.Enqueue(new KioskModeOperation(desktopFactory, explorerShell, logger, processFactory, sessionContext));
            sessionOperations.Enqueue(new ClientOperation(logger, processFactory, proxyFactory, runtimeHost, sessionContext, THIRTY_SECONDS));
            sessionOperations.Enqueue(new SessionActivationOperation(logger, sessionContext));

            var bootstrapSequence = new OperationSequence(logger, bootstrapOperations);
            var sessionSequence   = new RepeatableOperationSequence(logger, sessionOperations);

            RuntimeController = new RuntimeController(
                appConfig,
                logger,
                messageBox,
                bootstrapSequence,
                sessionSequence,
                runtimeHost,
                serviceProxy,
                sessionContext,
                shutdown,
                text,
                uiFactory);
        }
Ejemplo n.º 18
0
        public WpfStartupManager(ISystemInfo systemInfo, ICacheManager cacheManager, IDialogManager dialogManager)
            : base(systemInfo, cacheManager) {
            UiRoot.Main = new UiRoot(dialogManager);

            // This is the main UserError handler so that when the MainWindow is not yet existing, or no longer existing, we can handle usererrors
            // TODO: We should re-evaluate if handling UserErrors before or after the MainWindow is useful, or that they should either be handled differently
            // or that we should make sure that such errors can only occur during the life cycle of the MainWindow?
            _wpfErrorHandler = new WpfErrorHandler(dialogManager);
            UserError.RegisterHandler(x => _wpfErrorHandler.Handler(x));
        }
Ejemplo n.º 19
0
 public AppStartLogic(
     IMvxApplication application,
     IMvxNavigationService navigationService,
     IAppVersionService appVersionService,
     ISystemInfo systemInfo)
 {
     this.\u002Ector(application, navigationService);
     this._appVersionService = appVersionService;
     this._systemInfo        = systemInfo;
 }
Ejemplo n.º 20
0
        private void AddInfo(ScanResult scanResult, ISystemInfo systemInfo, long size)
        {
            var info = new ItemInfo
            {
                Name          = systemInfo.Name,
                LastWriteTime = systemInfo.LastWriteTime,
                Size          = size,
            };

            scanResult.Add(info);
        }
Ejemplo n.º 21
0
 private void AssertFreespaceInfo(ISystemInfo info)
 {
     Assert.IsNotNull(info);
     SystemInfoTestCase.Item item = new SystemInfoTestCase.Item();
     Db().Store(item);
     Db().Commit();
     Db().Delete(item);
     Db().Commit();
     Assert.IsTrue(info.FreespaceEntryCount() > 0);
     Assert.IsTrue(info.FreespaceSize() > 0);
 }
Ejemplo n.º 22
0
 public DashboardGetHandler(
     ISecureSession<Token> secureSession,
     ISystemInfo systemInfo,
     IRepository<ScheduleFile> schedules,
     IRepository<Batch> batches)
 {
     _secureSession = secureSession;
     _systemInfo = systemInfo;
     _schedules = schedules;
     _batches = batches;
 }
Ejemplo n.º 23
0
		private void AssertFreespaceInfo(ISystemInfo info)
		{
			Assert.IsNotNull(info);
			SystemInfoTestCase.Item item = new SystemInfoTestCase.Item();
			Db().Store(item);
			Db().Commit();
			Db().Delete(item);
			Db().Commit();
			Assert.IsTrue(info.FreespaceEntryCount() > 0);
			Assert.IsTrue(info.FreespaceSize() > 0);
		}
Ejemplo n.º 24
0
        public bool OnPreUpdate(PreUpdateEvent ev)
        {
            ISystemInfo entity = ev.Entity as ISystemInfo;

            if (entity != null)
            {
                var currentDate = DateTime.Now;
                entity.Modified = currentDate;
                SetState(ev.Persister, ev.State, ModificationDatePropertyName, currentDate);
            }
            return(false);
        }
Ejemplo n.º 25
0
 public ConnectionManager(IMessageBus mBus, ILogger log, ISystemInfo sysinfo)
 {
     _connections        = new ConcurrentDictionary <Guid, UserConnection>();
     _systemInfo         = sysinfo;
     _log                = log;
     _mBus               = mBus;
     _cancel             = new CancellationTokenSource();
     _unsubscribeActions = new List <UnsubscribeAction>();
     _unsubscribeActions.Add(mBus.Queue.SubscribeContextHandler <ConnectionConnectRequest>(HandleConnectionRequest));
     _unsubscribeActions.Add(mBus.Queue.SubscribeHandler <ConnectionDisconnectedRequest>(HandleDisconnectionRequest));
     _unsubscribeActions.Add(mBus.Queue.SubscribeHandler <UserConnectionEvent>(HandleSessionConnection));
     Task.Run((Func <Task>)CheckForDisconnectedAsync);
 }
 public ConnectionManager(IMessageBus mBus, ILogger log, ISystemInfo sysinfo)
 {
     _connections = new ConcurrentDictionary<Guid, UserConnection>();
     _systemInfo = sysinfo;
     _log = log;
     _mBus = mBus;
     _cancel = new CancellationTokenSource();
     _unsubscribeActions = new List<UnsubscribeAction>();
     _unsubscribeActions.Add(mBus.Queue.SubscribeContextHandler<ConnectionConnectRequest>(HandleConnectionRequest));
     _unsubscribeActions.Add(mBus.Queue.SubscribeHandler<ConnectionDisconnectedRequest>(HandleDisconnectionRequest));
     _unsubscribeActions.Add(mBus.Queue.SubscribeHandler<UserConnectionEvent>(HandleSessionConnection));
     Task.Run((Func<Task>)CheckForDisconnectedAsync);
 }
Ejemplo n.º 27
0
        Session StartNewSession(ISystemInfo systemInfo)
        {
            Console.WriteLine("New session");
            var student = InputString("Enter your name and surname: ", StringNotEmpty);
            var group   = InputString("Enter your group: ", StringNotEmpty);
            var subject = InputString("Enter subject: ", IsValidCourseName);

            return(new Session
            {
                Student = student,
                Group = group,
                Subject = subject,
                HardwareInfo = systemInfo.Get()
            });
        }
Ejemplo n.º 28
0
        public ConnectionHandler(ISerializer serializer, ICollectorWireFactory collectorWireFactory, IProcessStatic processStatic, IDnsStatic dnsStatic, ILabelsService labelsService, Environment environment, ISystemInfo systemInfo, IAgentHealthReporter agentHealthReporter, IEnvironment environmentVariableHelper)
        {
            _serializer                = serializer;
            _collectorWireFactory      = collectorWireFactory;
            _processStatic             = processStatic;
            _dnsStatic                 = dnsStatic;
            _labelsService             = labelsService;
            _environment               = environment;
            _systemInfo                = systemInfo;
            _agentHealthReporter       = agentHealthReporter;
            _environmentVariableHelper = environmentVariableHelper;

            _connectionInfo  = new ConnectionInfo(_configuration);
            _dataRequestWire = new NoOpCollectorWire();
        }
        public void Setup()
        {
            _systemInfo          = Mock.Create <ISystemInfo>();
            _agentHealthReporter = Mock.Create <IAgentHealthReporter>();

            Mock.Arrange(() => _systemInfo.GetTotalLogicalProcessors()).Returns(6);
            Mock.Arrange(() => _systemInfo.GetTotalPhysicalMemoryBytes()).Returns((ulong)16000 * 1024 * 1024);

            _dnsStatic = Mock.Create <IDnsStatic>();
            Mock.Arrange(() => _dnsStatic.GetHostName()).Returns("Host-Name");
            Mock.Arrange(() => _dnsStatic.GetFullHostName()).Returns("Host-Name.Domain");
            Mock.Arrange(() => _dnsStatic.GetIpAddresses()).Returns(new List <string> {
                "127.0.0.1", "0.0.0.0"
            });
        }
Ejemplo n.º 30
0
        public void CreateSurveyService()
        {
            _fileCacher        = A.Fake <IFileCacher>();
            _systemInfo        = A.Fake <ISystemInfo>();
            _entityCreator     = A.Fake <IEntityCreator>();
            _fileCacherCreator = A.Fake <ICreator <IFileCacher> >();

            A.CallTo(() => _systemInfo.PlatformName).Returns("WIN");
            A.CallTo(() => _fileCacherCreator.Get()).Returns(_fileCacher);
            A.CallTo(() => _entityCreator.Create <SomeImportantResponse>())
            .Returns(new SomeImportantResponse(_systemInfo));

            _surveyService = new SomeService(_systemInfo, _entityCreator, A.Fake <ISettingsManager>(),
                                             _fileCacherCreator, A.Fake <IFileSystemManager>(), A.Fake <ILogger>());
        }
Ejemplo n.º 31
0
        public ControlViewModel(IRecordDirectoryObserver recordObserver,
                                IEventAggregator eventAggregator,
                                IAppConfiguration appConfiguration, RecordManager recordManager,
                                ISystemInfo systemInfo,
                                ProcessList processList,
                                ILogger <ControlViewModel> logger,
                                ApplicationState applicationState)
        {
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();

            _recordObserver   = recordObserver;
            _eventAggregator  = eventAggregator;
            _appConfiguration = appConfiguration;
            _recordManager    = recordManager;
            _systemInfo       = systemInfo;
            _processList      = processList;
            _logger           = logger;
            _applicationState = applicationState;

            //Commands
            DeleteRecordFileCommand          = new DelegateCommand(OnDeleteRecordFile);
            MoveRecordFileCommand            = new DelegateCommand(OnMoveRecordFile);
            DuplicateRecordFileCommand       = new DelegateCommand(OnDuplicateRecordFile);
            AcceptEditingDialogCommand       = new DelegateCommand(OnAcceptEditingDialog);
            CancelEditingDialogCommand       = new DelegateCommand(OnCancelEditingDialog);
            AddCpuInfoCommand                = new DelegateCommand(OnAddCpuInfo);
            AddGpuInfoCommand                = new DelegateCommand(OnAddGpuInfo);
            AddRamInfoCommand                = new DelegateCommand(OnAddRamInfo);
            DeleteRecordCommand              = new DelegateCommand(OnPressDeleteKey);
            OpenObservedFolderCommand        = new DelegateCommand(OnOpenObservedFolder);
            DeleteFolderCommand              = new DelegateCommand(OnDeleteFolder);
            OpenCreateSubFolderDialogCommand = new DelegateCommand(() =>
            {
                CreateFolderDialogIsOpen = true;
                TreeViewSubFolderName    = string.Empty;
                CreateFolderdialogIsOpenStream.OnNext(true);
            });
            SelectedRecordingsCommand      = new DelegateCommand <object>(OnSelectedRecordings);
            CreateFolderCommand            = new DelegateCommand(OnCreateSubFolder);
            CloseCreateFolderDialogCommand = new DelegateCommand(() =>
            {
                CreateFolderDialogIsOpen = false;
                CreateFolderdialogIsOpenStream.OnNext(false);
            }
                                                                 );
            ReloadRootFolderCommand = new DelegateCommand(() => TreeViewUpdateStream.OnNext(default));
Ejemplo n.º 32
0
 void ThenTestClientPropertiesWereApplied(ISystemInfo testClient, int testClientNumber)
 {
     Assert.Equal(testClient.CustomString, ClientsCollection.Clients[testClientNumber].CustomString);
     Assert.Equal(testClient.EnvironmentVersion, ClientsCollection.Clients[testClientNumber].EnvironmentVersion);
     Assert.Equal(testClient.Fqdn, ClientsCollection.Clients[testClientNumber].Fqdn);
     Assert.Equal(testClient.Hostname, ClientsCollection.Clients[testClientNumber].Hostname);
     Assert.Equal(testClient.IsAdmin, ClientsCollection.Clients[testClientNumber].IsAdmin);
     Assert.Equal(testClient.IsInteractive, ClientsCollection.Clients[testClientNumber].IsInteractive);
     Assert.Equal(testClient.Language, ClientsCollection.Clients[testClientNumber].Language);
     // Xunit.Assert.Equal(testClient.OsEdition, ClientsCollection.Clients[testClientCounter].OsEdition);
     // Xunit.Assert.Equal(testClient.OsName, ClientsCollection.Clients[testClientCounter].OsName);
     Assert.Equal(testClient.OsVersion, ClientsCollection.Clients[testClientNumber].OsVersion);
     Assert.Equal(testClient.UptimeSeconds, ClientsCollection.Clients[testClientNumber].UptimeSeconds);
     Assert.Equal(testClient.UserDomainName, ClientsCollection.Clients[testClientNumber].UserDomainName);
     Assert.Equal(testClient.Username, ClientsCollection.Clients[testClientNumber].Username);
 }
Ejemplo n.º 33
0
        public OverlayEntryProvider(ISensorService sensorService,
                                    IAppConfiguration appConfiguration,
                                    IEventAggregator eventAggregator,
                                    IOnlineMetricService onlineMetricService,
                                    ISystemInfo systemInfo)
        {
            _sensorService       = sensorService;
            _appConfiguration    = appConfiguration;
            _eventAggregator     = eventAggregator;
            _onlineMetricService = onlineMetricService;
            _systemInfo          = systemInfo;

            _ = Task.Run(async() => await LoadOrSetDefault())
                .ContinueWith(task => _taskCompletionSource.SetResult(true));

            SubscribeToOptionPopupClosed();
        }
Ejemplo n.º 34
0
        public async Task <SaveResponse <ISystemInfo> > SaveAsync(ISystemInfo systemInfo)
        {
            var saveResponse = new SaveResponse <ISystemInfo>();

            try
            {
                saveResponse = await _systemInfoRepository.SaveAsync(systemInfo);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                saveResponse.AddError(ex);
                _logManager.LogError(ex, "Error saving systemInfo");
            }

            return(saveResponse);
        }
Ejemplo n.º 35
0
        public ServersViewModel(ServerInfoOverlayViewModel siovm, IDialogManager dialogManager, UserSettings settings,
                                SettingsViewModel settingsVM, LaunchManager launchManager, IContentManager contentManager,
                                ISystemInfo systemInfo, IViewModelFactory factory)
        {
            _settings         = settings;
            _launchManager    = launchManager;
            _contentManager   = contentManager;
            SystemInfo        = systemInfo;
            _dialogManager    = dialogManager;
            Settings          = settingsVM;
            ServerInfoOverlay = siovm;
            _factory          = factory;

            DisplayName = "Servers";
            ModuleName  = ControllerModules.ServerBrowser;
            AssignServerList();
        }
Ejemplo n.º 36
0
 public RecordManager(ILogger <RecordManager> logger,
                      IAppConfiguration appConfiguration,
                      IRecordDirectoryObserver recordObserver,
                      IAppVersionProvider appVersionProvider,
                      ISensorService sensorService,
                      ISystemInfo systemInfo,
                      ProcessList processList,
                      IRTSSService rTSSService)
 {
     _logger             = logger;
     _appConfiguration   = appConfiguration;
     _recordObserver     = recordObserver;
     _appVersionProvider = appVersionProvider;
     _sensorService      = sensorService;
     _systemInfo         = systemInfo;
     _processList        = processList;
     _rTSSService        = rTSSService;
 }
        public WebSocketQueueServer(IPEndPoint endpoint, ISystemInfo sysinfo, ILogger log)
        {
            _log = log;
            _sysInfo = sysinfo;
            _cancellation = new CancellationTokenSource();
            _serializator = new DefaultEventSerializator();

            Queue = ServiceBusFactory.New(sbc =>
            {
                sbc.UseBinarySerializer();
                sbc.ReceiveFrom("loopback://localhost/queue");
            });

            _wsServer = new WebSocketListener(endpoint, new WebSocketListenerOptions
            {
                PingTimeout = Timeout.InfiniteTimeSpan,
                OnHttpNegotiation = HttpNegotiation
            });
            var rfc6455 = new WebSocketFactoryRfc6455(_wsServer);
            _wsServer.Standards.RegisterStandard(rfc6455);
        }
Ejemplo n.º 38
0
 public PlayStartupManager(UserSettings settings, IShutdownHandler shutdownHandler,
     IFirstTimeLicense firstTimeLicense, ISystemInfo systemInfo, IUserSettingsStorage storage,
     ISoftwareUpdate softwareUpdate, Container container, ICacheManager cacheManager,
     Cache.ImageFileCache imageFileCache,
     IPreRequisitesInstaller prerequisitesInstaller, ContactList contactList,
     IContentManager contentManager, IDialogManager dialogManager,
     VersionRegistry versionRegistry, Lazy<IUpdateManager> updateManager)
     : base(systemInfo, cacheManager, dialogManager) {
     _settings = settings;
     _shutdownHandler = shutdownHandler;
     _firstTimeLicense = firstTimeLicense;
     _softwareUpdate = softwareUpdate;
     _container = container;
     _imageFileCache = imageFileCache;
     _prerequisitesInstaller = prerequisitesInstaller;
     _contactList = contactList;
     _contentManager = contentManager;
     _dialogManager = dialogManager;
     _versionRegistry = versionRegistry;
     _updateManager = updateManager;
     _systemInfo = systemInfo;
     _storage = storage;
 }
        public bool Connect()
        {
            // do not use CurrentDevice here (rather, use _currentDevice) because CurrentDevice.Get()
            // can call back into Connect

            if (CurrentConnectableDevice != null)
            {
                // we're already connected to this device! :)
                //if (_currentDevice == _connectedDevice/* && _connectedDevice.IsConnected()*/)
                //    return true;

                try
                {
                    // disconnect the existing device
                    if (CurrentDevice != null)
                        CurrentDevice.Disconnect();

                    CurrentDevice = CurrentConnectableDevice.Connect();

                    SystemInfo = CurrentDevice.GetSystemInfo();

                    if (SystemInfo.OSBuildNo < MIN_SUPPORTED_BUILD_NUMBER)
                    {
                        throw new Exception("Windows Phone Power Tools only support build " + MIN_SUPPORTED_BUILD_NUMBER + " and above. This device is on " + SystemInfo.OSBuildNo + ".");
                    }

                    StatusMessage = "Currently connected to " + _currentConnectableDevice.Name;

                    Connected = true;
                    IsError = false;

                    RefreshInstalledApps();
                }
                catch (Exception ex)
                {
                    SmartDeviceException smartDeviceEx = ex as SmartDeviceException;

                    if (smartDeviceEx != null)
                    {
                        if (ex.Message == "0x89731811")
                        {
                            StatusMessage = "Connection Error! Zune is either not running or not connected to the device.";
                        }
                        else if (ex.Message == "0x89731812")
                        {
                            StatusMessage = "Connection Error! Unlock your phone and make sure it is paired with Zune";
                        }
                        else if (ex.Message == "0x89740005")
                        {
                            StatusMessage = "Developer unlock has expired. Lock and re-unlock your phone using the SDK registration tool";
                        }
                        else
                        {
                            StatusMessage = "Connection Error! Message: " + ex.Message;
                        }
                    }
                    else
                    {
                        StatusMessage = ex.Message;
                    }

                    IsError          = true;
                    Connected        = false;
                    SystemInfo       = null;
                }
            }

            return Connected;
        }
Ejemplo n.º 40
0
 void ThenTestClientPropertiesWereApplied(ISystemInfo testClient, int testClientNumber)
 {
     Assert.Equal(testClient.CustomString, ClientsCollection.Clients[testClientNumber].CustomString);
     Assert.Equal(testClient.EnvironmentVersion, ClientsCollection.Clients[testClientNumber].EnvironmentVersion);
     Assert.Equal(testClient.Fqdn, ClientsCollection.Clients[testClientNumber].Fqdn);
     Assert.Equal(testClient.Hostname, ClientsCollection.Clients[testClientNumber].Hostname);
     Assert.Equal(testClient.IsAdmin, ClientsCollection.Clients[testClientNumber].IsAdmin);
     Assert.Equal(testClient.IsInteractive, ClientsCollection.Clients[testClientNumber].IsInteractive);
     Assert.Equal(testClient.Language, ClientsCollection.Clients[testClientNumber].Language);
     // Xunit.Assert.Equal(testClient.OsEdition, ClientsCollection.Clients[testClientCounter].OsEdition);
     // Xunit.Assert.Equal(testClient.OsName, ClientsCollection.Clients[testClientCounter].OsName);
     Assert.Equal(testClient.OsVersion, ClientsCollection.Clients[testClientNumber].OsVersion);
     Assert.Equal(testClient.UptimeSeconds, ClientsCollection.Clients[testClientNumber].UptimeSeconds);
     Assert.Equal(testClient.UserDomainName, ClientsCollection.Clients[testClientNumber].UserDomainName);
     Assert.Equal(testClient.Username, ClientsCollection.Clients[testClientNumber].Username);
 }
Ejemplo n.º 41
0
 public StartupManager(ISystemInfo systemInfo, ICacheManager cacheManager) {
     _systemInfo = systemInfo;
     _cacheManager = cacheManager;
 }
Ejemplo n.º 42
0
 void ThenTestClientPropertiesWereApplied(ISystemInfo testClient)
 {
     int testClientNumber = ClientsCollection.Clients.Count - 1;
     ThenTestClientPropertiesWereApplied(testClient, testClientNumber);
 }
Ejemplo n.º 43
0
 void THEN_Test_Client_Properties_Were_Applied(ISystemInfo testClient)
 {
     int testClientNumber = ClientsCollection.Clients.Count - 1;
     THEN_Test_Client_Properties_Were_Applied(testClient, testClientNumber);
 }