protected override void Initialize()
		{
			base.Initialize();
			ViewModelsLocator.Initialize(this);

			_storageService = new StorageService(Environment.ExternalStorageDirectory.Path);
			_settingsService = new SettingsService();
			_collectionStorageService = new SqliteCollectionStorageService(new SQLitePlatformAndroid());
			_initializationStateService = new InitializationStateService(2);

			RegisterInstance<IInitializationStateService>(_initializationStateService);

            RegisterInstance<IResourceService>(new ResourceService());
			RegisterInstance<IEmailService>(new EmailService());
			RegisterInstance<IInstallVoiceSynthesisService>(new InstallVoiceSynthesisService());
			RegisterInstance<IScreenService>(new ScreenService());
			RegisterInstance<IFontService>(new FontService());
            RegisterInstance<IMediaService>(new MediaService());
            RegisterInstance<IPopupService>(new PopupService());
            RegisterInstance<ICopyPasteService>(new CopyPasteService());

			TextToSpeechService textToSpeechService = new TextToSpeechService();
			textToSpeechService.Initialized += OnTtsInitialized;

            RegisterInstance<ITextToSpeechService>(textToSpeechService);

			RegisterInstance<IStorageService>(_storageService);
            RegisterInstance<ISettingsService>(_settingsService);
			RegisterInstance<IXmlService>(new XmlService());
			RegisterInstance<ICollectionStorageService>(_collectionStorageService);

			Task.Run((Action)InitializeAsync);
		}
        public AutomationFactory(
            ISchedulerService schedulerService,
            INotificationService notificationService,
            IDateTimeService dateTimeService,
            IDaylightService daylightService,
            IOutdoorTemperatureService outdoorTemperatureService,
            IComponentService componentService,
            ISettingsService settingsService,
            IResourceService resourceService)
        {
            if (schedulerService == null) throw new ArgumentNullException(nameof(schedulerService));
            if (notificationService == null) throw new ArgumentNullException(nameof(notificationService));
            if (dateTimeService == null) throw new ArgumentNullException(nameof(dateTimeService));
            if (daylightService == null) throw new ArgumentNullException(nameof(daylightService));
            if (outdoorTemperatureService == null) throw new ArgumentNullException(nameof(outdoorTemperatureService));
            if (componentService == null) throw new ArgumentNullException(nameof(componentService));
            if (settingsService == null) throw new ArgumentNullException(nameof(settingsService));
            if (resourceService == null) throw new ArgumentNullException(nameof(resourceService));

            _schedulerService = schedulerService;
            _notificationService = notificationService;
            _dateTimeService = dateTimeService;
            _daylightService = daylightService;
            _outdoorTemperatureService = outdoorTemperatureService;
            _componentService = componentService;
            _settingsService = settingsService;
            _resourceService = resourceService;
        }
Beispiel #3
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="context"></param>
 /// <param name="settingsService"> </param>
 /// <param name="emailService"> </param>
 /// <param name="localizationService"> </param>
 /// <param name="activityService"> </param>
 /// <param name="privateMessageService"> </param>
 /// <param name="membershipUserPointsService"> </param>
 /// <param name="topicNotificationService"> </param>
 /// <param name="voteService"> </param>
 /// <param name="badgeService"> </param>
 /// <param name="categoryNotificationService"> </param>
 /// <param name="loggingService"></param>
 /// <param name="uploadedFileService"></param>
 /// <param name="postService"></param>
 /// <param name="pollVoteService"></param>
 /// <param name="pollAnswerService"></param>
 /// <param name="pollService"></param>
 /// <param name="topicService"></param>
 /// <param name="favouriteService"></param>
 /// <param name="categoryService"></param>
 public MembershipService(IMVCForumContext context, ISettingsService settingsService,
     IEmailService emailService, ILocalizationService localizationService, IActivityService activityService,
     IPrivateMessageService privateMessageService, IMembershipUserPointsService membershipUserPointsService,
     ITopicNotificationService topicNotificationService, IVoteService voteService, IBadgeService badgeService,
     ICategoryNotificationService categoryNotificationService, ILoggingService loggingService, IUploadedFileService uploadedFileService,
     IPostService postService, IPollVoteService pollVoteService, IPollAnswerService pollAnswerService,
     IPollService pollService, ITopicService topicService, IFavouriteService favouriteService, 
     ICategoryService categoryService, IPostEditService postEditService)
 {
     _settingsService = settingsService;
     _emailService = emailService;
     _localizationService = localizationService;
     _activityService = activityService;
     _privateMessageService = privateMessageService;
     _membershipUserPointsService = membershipUserPointsService;
     _topicNotificationService = topicNotificationService;
     _voteService = voteService;
     _badgeService = badgeService;
     _categoryNotificationService = categoryNotificationService;
     _loggingService = loggingService;
     _uploadedFileService = uploadedFileService;
     _postService = postService;
     _pollVoteService = pollVoteService;
     _pollAnswerService = pollAnswerService;
     _pollService = pollService;
     _topicService = topicService;
     _favouriteService = favouriteService;
     _categoryService = categoryService;
     _postEditService = postEditService;
     _context = context as MVCForumContext;
 }
        public ControllerSlaveService(
            ISettingsService settingsService,
            ISchedulerService scheduler,
            IDateTimeService dateTimeService,
            IOutdoorTemperatureService outdoorTemperatureService,
            IOutdoorHumidityService outdoorHumidityService,
            IDaylightService daylightService,
            IWeatherService weatherService)
        {
            if (settingsService == null) throw new ArgumentNullException(nameof(settingsService));
            if (scheduler == null) throw new ArgumentNullException(nameof(scheduler));
            if (dateTimeService == null) throw new ArgumentNullException(nameof(dateTimeService));
            if (outdoorTemperatureService == null) throw new ArgumentNullException(nameof(outdoorTemperatureService));
            if (outdoorHumidityService == null) throw new ArgumentNullException(nameof(outdoorHumidityService));
            if (daylightService == null) throw new ArgumentNullException(nameof(daylightService));
            if (weatherService == null) throw new ArgumentNullException(nameof(weatherService));

            _dateTimeService = dateTimeService;
            _outdoorTemperatureService = outdoorTemperatureService;
            _outdoorHumidityService = outdoorHumidityService;
            _daylightService = daylightService;
            _weatherService = weatherService;

            settingsService.CreateSettingsMonitor<ControllerSlaveServiceSettings>(s => Settings = s);

            scheduler.RegisterSchedule("ControllerSlavePolling", TimeSpan.FromMinutes(5), PullValues);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="PluginsController" /> class.
        /// </summary>
        /// <param name="fileSystem">The file system.</param>
        /// <param name="pluginsService">The plugins service.</param>
        /// <param name="nugetService">The nuget service.</param>
        /// <param name="visualStudioService">The visual studio service.</param>
        /// <param name="readMeService">The read me service.</param>
        /// <param name="settingsService">The settings service.</param>
        /// <param name="messageBoxService">The message box service.</param>
        /// <param name="dialogService">The dialog service.</param>
        /// <param name="formsService">The forms service.</param>
        /// <param name="translator">The translator.</param>
        public PluginsController(
            IFileSystem fileSystem,
            IPluginsService pluginsService,
            INugetService nugetService,
            IVisualStudioService visualStudioService,
            IReadMeService readMeService,
            ISettingsService settingsService,
            IMessageBoxService messageBoxService,
            IDialogService dialogService,
            IFormsService formsService,
            ITranslator<Tuple<DirectoryInfoBase, DirectoryInfoBase>, Plugins> translator)
            : base(visualStudioService, 
            readMeService, 
            settingsService, 
            messageBoxService,
            dialogService,
            formsService)
        {
            TraceService.WriteLine("PluginsController::Constructor");

            this.fileSystem = fileSystem;
            this.pluginsService = pluginsService;
            this.nugetService = nugetService;
            this.translator = translator;
        }
Beispiel #6
0
 public TagController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IMembershipService membershipService, ILocalizationService localizationService, IRoleService roleService, ISettingsService settingsService, ITopicTagService topicTagService, ICategoryService categoryService, ICacheService cacheService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
 {
     _topicTagService = topicTagService;
     _categoryService = categoryService;
     _cacheService = cacheService;
 }
Beispiel #7
0
        public TimelineEditor(
            IControlHostService controlHostService,
            ICommandService commandService,
            IContextRegistry contextRegistry,
            IDocumentRegistry documentRegistry,
            IDocumentService documentService,
            IPaletteService paletteService,
            ISettingsService settingsService)
        {
            s_schemaLoader = new SchemaLoader();
            s_repository.DocumentAdded += repository_DocumentAdded;
            s_repository.DocumentRemoved += repository_DocumentRemoved;

            paletteService.AddItem(Schema.markerType.Type, "Timelines", this);
            paletteService.AddItem(Schema.groupType.Type, "Timelines", this);
            paletteService.AddItem(Schema.trackType.Type, "Timelines", this);
            paletteService.AddItem(Schema.intervalType.Type, "Timelines", this);
            paletteService.AddItem(Schema.keyType.Type, "Timelines", this);
            paletteService.AddItem(Schema.timelineRefType.Type, "Timelines", this);

            m_contextRegistry = contextRegistry;
            m_documentRegistry = documentRegistry;
            m_controlHostService = controlHostService;
            m_documentService = documentService;
            m_settingsService = settingsService;
        }
        public TestButtonFactory(ITimerService timerService, ISettingsService settingsService)
        {
            if (timerService == null) throw new ArgumentNullException(nameof(timerService));

            _timerService = timerService;
            _settingsService = settingsService;
        }
Beispiel #9
0
 public StatsController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IMembershipService membershipService, 
     ILocalizationService localizationService, IRoleService roleService, ISettingsService settingsService, ITopicService topicService, IPostService postService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService)
 {
     _topicService = topicService;
     _postService = postService;
 }
Beispiel #10
0
        public MainVM(IApplicationManager appManager, ISettingsService settingsSvc)
        {
            _appManager = appManager;
            _settingsService = settingsSvc;

            int portNum = 1;
            if (Int32.TryParse(settingsSvc.Get("LastExternalPort"), out portNum))
                _selectedExternalPort = portNum;
            else
                _selectedExternalPort = 1;

            string lastSite = settingsSvc.Get("LastSiteName");
            if (!String.IsNullOrEmpty(lastSite) && AvailableSites.Contains(lastSite))
                _selectedSite = lastSite;
            else
                _selectedSite = AvailableSites.Count > 0 ? AvailableSites[0] : null;

            string lastPool = settingsSvc.Get("LastPoolName");
            if (!String.IsNullOrEmpty(lastPool) && AvailableSites.Contains(lastPool))
                _selectedPool = lastPool;
            else
                _selectedPool = AvailablePools.Count > 0 ? AvailablePools[0] : null;

            bool autoBrowse = true;
            if (Boolean.TryParse(_settingsService.Get("LastAutoBrowse"), out autoBrowse))
                _autoBrowse = autoBrowse;
            else
                _autoBrowse = true;

            AppConfigPath = _settingsService.Get("ConfigPath");
        }
Beispiel #11
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        /// <param name="windowService">
        /// The window service
        /// </param>
        /// <param name="addinService">
        /// The add-in service
        /// </param>
        /// <param name="settingsService">
        /// The settings service
        /// </param>
        public MainViewModel(IWindowService windowService, IAddinService addinService, ISettingsService settingsService)
        {
            this.windowService = windowService;

            var projects = settingsService.GetProjects();
            var projectModel = projects.FirstOrDefault();

            var tt = addinService.TaskTrackers.First();
            var qs = tt.GenerateQuerySettings();

            if (!projects.Any())
            {
                projectModel = new ProjectModel("Demo project", tt.Id);
                var ss = new SecureString();
                ss.AppendChar('H');
                ss.AppendChar('e');
                ss.AppendChar('l');
                ss.AppendChar('l');
                ss.AppendChar('o');

                var testSettings = new Dictionary<string, SecureString>
                {
                    { "SomeKey1", ss },
                    { "SomeKey2", ss }
                };

                var projectSettings1 = new SettingsModel(projectModel.InternalUrn, testSettings);
                settingsService.SaveProject(projectModel, projectSettings1);
            }

            var projectSettings2 = settingsService.GetProjectSettings(projectModel);
            this.Tasks = new ObservableCollection<ITaskModel>(tt.GetAssignedToUser(projectModel, projectSettings2));

            settingsService.SaveProject(projectModel);
        }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="unitOfWorkManager"> </param>
 /// <param name="membershipService"> </param>
 /// <param name="localizationService"></param>
 /// <param name="settingsService"> </param>
 /// <param name="badgeService"> </param>
 /// <param name="loggingService"> </param>
 public AdminBadgeController(IBadgeService badgeService, IPostService postService, ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, 
     IMembershipService membershipService, ILocalizationService localizationService, ISettingsService settingsService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, settingsService)
 {
     _badgeService = badgeService;
     _postService = postService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="OptionsPresenter" /> class.
 /// </summary>
 /// <param name="view">The view.</param>
 /// <param name="settingsService">The settings service.</param>
 public OptionsPresenter(
     IOptionsView view,
     ISettingsService settingsService)
 {
     this.view = view;
     this.settingsService = settingsService;
 }
 public TestResultsController(IUnityContainer container, IRegionManager regionManager, IEventAggregator eventAggregator, ISettingsService settingsService)
 {
     _container = container;
     _regionManager = regionManager;
     _eventAggregator = eventAggregator;
     _settingsService = settingsService;
 }
		protected override void Initialize(Frame rootFrame, Dictionary<string, Type> views, Dictionary<string, Type> dialogs)
		{
			base.Initialize(rootFrame, views, dialogs);

			_storageService = new StorageService(FileSystem.Current.LocalStorage.Path);
			_settingsService = new SettingsService();
			_collectionStorageService = new SqliteCollectionStorageService(new SQLitePlatformWinRT());

            RegisterInstance<INavigationService>(new NavigationService(rootFrame,views));
			RegisterInstance<IEmailService>(new EmailService());
			RegisterInstance<IResourceService>(new ResourceService());
			RegisterInstance<IEmailService>(new EmailService());
			//RegisterInstance<IInstallVoiceSynthesisService>(new InstallVoiceSynthesisService());
			RegisterInstance<IScreenService>(new ScreenService());
			RegisterInstance<IFontService>(new FontService());
            RegisterInstance<IMediaService>(new MediaService());
            RegisterInstance<IPopupService>(new PopupService());
            RegisterInstance<ICopyPasteService>(new CopyPasteService());
            RegisterInstance<ITextToSpeechService>(new TextToSpeechService());

			RegisterInstance<IStorageService>(_storageService);
            RegisterInstance<ISettingsService>(_settingsService);
			RegisterInstance<IXmlService>(new XmlService());
			RegisterInstance<ICollectionStorageService>(_collectionStorageService);

			InitializeAsync();
		}
Beispiel #16
0
 public GoodreadsService(ISettingsService settingsService, IHttpRequestHelper httpRequestHelper,
                         IGoodReadsXmlMappingService goodReadsXmlMappingService)
 {
     _settingsService = settingsService;
     _httpRequestHelper = httpRequestHelper;
     _goodReadsXmlMappingService = goodReadsXmlMappingService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ProjectTemplateTranslator" /> class.
 /// </summary>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="visualStudioService">The visual studio service.</param>
 public ProjectTemplateTranslator(
     ISettingsService settingsService,
     IVisualStudioService visualStudioService)
 {
     this.settingsService = settingsService;
     this.visualStudioService = visualStudioService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TokensTranslator"/> class.
 /// </summary>
 public TokensTranslator(
     IVisualStudioService visualStudioService,
     ISettingsService settingsService)
 {
     this.visualStudioService = visualStudioService;
     this.settingsService = settingsService;
 }
		public BackgroundAction(ActionPerformer actionPerformer, ISettingsService settingsService)
		{
			syncContext = SynchronizationContext.Current;
			var culture = settingsService.CurrentSettings.Language.Culture;
			thread = new Thread(state => RunWorker(actionPerformer))
			         {IsBackground = true, CurrentCulture = culture, CurrentUICulture = culture};
		}
        public PackageManager(IAvailablePackagesService availablePackagesService, IPackageVersionService packageVersionService, IPackageService packageService, IFileStorageService fileStorageService, ICommandExecuter commandExecuter, ISettingsService settingsService, IInstalledPackagesService installedPackagesService)
        {
            _packageVersionService = packageVersionService;
            _packageService = packageService;
            _availablePackagesService = availablePackagesService;
            _fileStorageService = fileStorageService;
            _commandExecuter = commandExecuter;
            _settingsService = settingsService;
            _installedPackagesService = installedPackagesService;
            _packageVersionService.VersionChanged += VersionChangedHandler;
            _packageVersionService.RunStarted += PackageVersionServiceStarted;
            _availablePackagesService.RunFinshed += PackagesServiceRunFinished;
            _installedPackagesService.RunFinshed += PackagesServiceRunFinished;
            _packageService.RunFinshed += PackageServiceRunFinished;
            _packageService.RunStarted += PackageServiceRunStarted;
            _availablePackagesService.RunFailed += PackagesServiceRunFailed;
            _installedPackagesService.RunFailed += PackagesServiceRunFailed;
            _availablePackagesService.RunStarted += PackagesServiceRunStarted;
            _installedPackagesService.RunStarted += PackagesServiceRunStarted;

            InitializeComponent();

            tabAvailable.ImageIndex = 0;
            tabInstalled.ImageIndex = 1;
            _installedPackagesService.ListOfDistinctHighestInstalledPackages();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ItemTemplatesPresenter" /> class.
 /// </summary>
 /// <param name="view">The view.</param>
 /// <param name="settingsService">The settings service.</param>
 public ItemTemplatesPresenter(
     IItemTemplatesView view,
     ISettingsService settingsService)
 {
     this.view = view;
     this.settingsService = settingsService;
 }
Beispiel #22
0
 public GameEditor(
     IContextRegistry contextRegistry,
     IDocumentRegistry documentRegistry,            
     IControlHostService controlHostService,
     ICommandService commandService,
     IDocumentService documentService,
     IPaletteService paletteService,
     ISettingsService settingsService,            
     IResourceService resourceService,
     LevelEditorCore.ResourceLister resourceLister,            
     BookmarkLister bookmarkLister
     )
 {
     m_contextRegistry = contextRegistry;
     m_documentRegistry = documentRegistry;
     m_paletteService = paletteService;
     m_settingsService = settingsService;            
     m_documentService = documentService;            
     m_resourceService = resourceService;
     m_resourceLister = resourceLister;            
     m_bookmarkLister = bookmarkLister;
     
     //to-do wire it to to command service
     InputScheme.ActiveControlScheme = new MayaControlScheme();
     ResolveOnLoad = true;
 }
Beispiel #23
0
 public SnippetsController(ILoggingService loggingService, IUnitOfWorkManager unitOfWorkManager, IMembershipService membershipService, 
     ILocalizationService localizationService, IRoleService roleService, ISettingsService settingsService,
     IMembershipUserPointsService membershipUserPointsService, ICacheService cacheService)
     : base(loggingService, unitOfWorkManager, membershipService, localizationService, roleService, settingsService, cacheService)
 {
     _membershipUserPointsService = membershipUserPointsService;
 }
Beispiel #24
0
        public ShellForm(IKernel kernel)
        {
            Asserter.AssertIsNotNull(kernel, "kernel");

            _kernel = kernel;
            _applicationService = _kernel.Get<IApplicationService>();
            _storageService = _kernel.Get<IStorageService>();
            _settingsService = _kernel.Get<ISettingsService>();
            _siteService = _kernel.Get<ISiteService>();
            _controller = _kernel.Get<ShellController>();

            Asserter.AssertIsNotNull(_applicationService, "_applicationService");
            Asserter.AssertIsNotNull(_storageService, "_storageService");
            Asserter.AssertIsNotNull(_settingsService, "_settingsService");
            Asserter.AssertIsNotNull(_siteService, "_siteService");

            InitializeComponent();

            _siteService.Register(SiteNames.ContentSite, contentPanel);
            _siteService.Register(SiteNames.NavigationSite, navigationPanel);
            _siteService.Register(SiteNames.ContentActionsSite, contentActionPanel);

            SetStyle(ControlStyles.OptimizedDoubleBuffer |
                     ControlStyles.AllPaintingInWmPaint |
                     ControlStyles.ResizeRedraw, true);
        }
Beispiel #25
0
        public Window(ComponentId id, ISettingsService settingsService)
            : base(id)
        {
            if (settingsService == null) throw new ArgumentNullException(nameof(settingsService));

            settingsService.CreateSettingsMonitor<ComponentSettings>(Id, s => Settings = s);
        }
        public AreaService(
            IComponentService componentService,
            IAutomationService automationService,
            ISystemEventsService systemEventsService,
            ISystemInformationService systemInformationService,
            IApiService apiService,
            ISettingsService settingsService)
        {
            if (componentService == null) throw new ArgumentNullException(nameof(componentService));
            if (automationService == null) throw new ArgumentNullException(nameof(automationService));
            if (systemEventsService == null) throw new ArgumentNullException(nameof(systemEventsService));
            if (systemInformationService == null) throw new ArgumentNullException(nameof(systemInformationService));
            if (apiService == null) throw new ArgumentNullException(nameof(apiService));
            if (settingsService == null) throw new ArgumentNullException(nameof(settingsService));

            _componentService = componentService;
            _automationService = automationService;
            _apiService = apiService;
            _settingsService = settingsService;

            systemEventsService.StartupCompleted += (s, e) =>
            {
                systemInformationService.Set("Areas/Count", _areas.GetAll().Count);
            };

            apiService.ConfigurationRequested += HandleApiConfigurationRequest;
        }
Beispiel #27
0
 public SabNzbdController(ISettingsService<SabNzbdSettingsDto> settingsService, IThirdPartyService api, ILogger logger)
 {
     SettingsService = settingsService;
     Api = api;
     Logger = logger;
     Settings = SettingsService.GetSettings();
 }
        public SettingsViewModel(ISettingsService settingsService, IWindowManager windowManager, Func<BlogSettingsViewModel> blogSettingsCreator)
        {
            this.settingsService = settingsService;
            this.windowManager = windowManager;
            this.blogSettingsCreator = blogSettingsCreator;

            using (RegistryKey key = Registry.CurrentUser.OpenSubKey("Software").OpenSubKey("Classes"))
            {
                FileMDBinding = key.GetSubKeyNames().Contains(Constants.DefaultExtensions[0]) &&
                    !string.IsNullOrEmpty(key.OpenSubKey(Constants.DefaultExtensions[0]).GetValue("").ToString());

                FileMarkdownBinding = key.GetSubKeyNames().Contains(Constants.DefaultExtensions[1]) &&
                    !string.IsNullOrEmpty(key.OpenSubKey(Constants.DefaultExtensions[1]).GetValue("").ToString());

                FileMDownBinding = key.GetSubKeyNames().Contains(Constants.DefaultExtensions[2]) &&
                    !string.IsNullOrEmpty(key.OpenSubKey(Constants.DefaultExtensions[2]).GetValue("").ToString());

                FileMKDBinding = key.GetSubKeyNames().Contains(Constants.DefaultExtensions[3]) &&
                    !string.IsNullOrEmpty(key.OpenSubKey(Constants.DefaultExtensions[3]).GetValue("").ToString());
            }

            var blogs = settingsService.Get<List<BlogSetting>>("Blogs") ?? new List<BlogSetting>();

            Blogs = new ObservableCollection<BlogSetting>(blogs);
        }
 public ChocolateyLibDirHelper(IChocolateyService chocolateyService, IFileStorageService fileStorageService, ISettingsService settingsService)
 {
     _chocolateyService = chocolateyService;
     _fileStorageService = fileStorageService;
     _settingsService = settingsService;
     _chocolateyService.OutputChanged += VersionChangeFinished;
 }
        public TestHumiditySensor(ComponentId id, ISettingsService settingsService, TestNumericValueSensorEndpoint endpoint)
            : base(id, settingsService, endpoint)
        {
            if (endpoint == null) throw new ArgumentNullException(nameof(endpoint));

            Endpoint = endpoint;
        }
Beispiel #31
0
 public PaymentBanamexViewModel(ISadmApiService sadmApiService, INavigationService navigationService, ISettingsService settingsService, IHudService hudService, ISadmApiService apiService) : base(navigationService, settingsService, hudService, apiService)
 {
     this.sadmApiService = sadmApiService;
 }
Beispiel #32
0
 public SupergroupEditRestrictedViewModel(IProtoService protoService, ICacheService cacheService, ISettingsService settingsService, IEventAggregator aggregator)
     : base(protoService, cacheService, settingsService, aggregator)
 {
     ProfileCommand   = new RelayCommand(ProfileExecute);
     SendCommand      = new RelayCommand(SendExecute);
     EditUntilCommand = new RelayCommand(EditUntilExecute);
     DismissCommand   = new RelayCommand(DismissExecute);
 }
        public ChatSearchViewModel(IProtoService protoService, ICacheService cacheService, ISettingsService settingsService, IEventAggregator aggregator, DialogViewModel viewModel)
            : base(protoService, cacheService, settingsService, aggregator)
        {
            _dialog       = viewModel;
            _loadMoreLock = new DisposableMutex();

            NextCommand     = new RelayCommand(NextExecute, NextCanExecute);
            PreviousCommand = new RelayCommand(PreviousExecute, PreviousCanExecute);
        }
Beispiel #34
0
 public ChangeHotkeyDialogViewModel(ISettingsService settingsService, IMessageBoxService messageBoxService)
 {
     this.settingsService = settingsService;
     this.messageBoxService = messageBoxService;
 }
        public SettingsViewModel(IMvxNavigationService navigationService) : base(navigationService)
        {
            settingsService = Mvx.Resolve <ISettingsService>();

            RepoCount = settingsService.GetListCount();
        }
 public CategoryController(IUserService users, ICategoryService categories, ISettingsService settings) : base(users, settings)
 {
     this.categories = categories;
 }
Beispiel #37
0
 public SettingsController(ISettingsService settingsService, IDeletableEntityRepository <Setting> repository)
 {
     this.settingsService = settingsService;
     this.repository      = repository;
 }
Beispiel #38
0
 public TerminalsManager(ISettingsService settingsService)
 {
     _settingsService = settingsService;
 }
Beispiel #39
0
        public SupergroupEditStickerSetViewModel(IProtoService protoService, ICacheService cacheService, ISettingsService settingsService, IEventAggregator aggregator)
            : base(protoService, cacheService, settingsService, aggregator)
        {
            SendCommand   = new RelayCommand(SendExecute);
            CancelCommand = new RelayCommand(CancelExecute);

            Items = new MvxObservableCollection <StickerSetInfo>();

            Aggregator.Subscribe(this);
        }
 public HomePageViewModel(ISettingsService settingsService, ISettingsFactory settingsFactory)
     : base(settingsService, settingsFactory)
 {
     sourceImg = "resource://Target.Resources.ic_home_black_36px.svg";
 }
Beispiel #41
0
 public SettingsController(ISettingsService settingsService)
 {
     _settingsService = settingsService;
 }
Beispiel #42
0
        public App(AppOptions appOptions)
        {
            _appOptions                = appOptions ?? new AppOptions();
            _userService               = ServiceContainer.Resolve <IUserService>("userService");
            _broadcasterService        = ServiceContainer.Resolve <IBroadcasterService>("broadcasterService");
            _messagingService          = ServiceContainer.Resolve <IMessagingService>("messagingService");
            _stateService              = ServiceContainer.Resolve <IStateService>("stateService");
            _lockService               = ServiceContainer.Resolve <ILockService>("lockService");
            _syncService               = ServiceContainer.Resolve <ISyncService>("syncService");
            _tokenService              = ServiceContainer.Resolve <ITokenService>("tokenService");
            _cryptoService             = ServiceContainer.Resolve <ICryptoService>("cryptoService");
            _cipherService             = ServiceContainer.Resolve <ICipherService>("cipherService");
            _folderService             = ServiceContainer.Resolve <IFolderService>("folderService");
            _settingsService           = ServiceContainer.Resolve <ISettingsService>("settingsService");
            _collectionService         = ServiceContainer.Resolve <ICollectionService>("collectionService");
            _searchService             = ServiceContainer.Resolve <ISearchService>("searchService");
            _authService               = ServiceContainer.Resolve <IAuthService>("authService");
            _platformUtilsService      = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService");
            _storageService            = ServiceContainer.Resolve <IStorageService>("storageService");
            _passwordGenerationService = ServiceContainer.Resolve <IPasswordGenerationService>(
                "passwordGenerationService");
            _i18nService         = ServiceContainer.Resolve <II18nService>("i18nService") as MobileI18nService;
            _deviceActionService = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService");

            InitializeComponent();
            SetCulture();
            ThemeManager.SetThemeStyle("light");
            MainPage = new HomePage();
            var mainPageTask = SetMainPageAsync();

            ServiceContainer.Resolve <MobilePlatformUtilsService>("platformUtilsService").Init();
            _broadcasterService.Subscribe(nameof(App), async(message) =>
            {
                if (message.Command == "showDialog")
                {
                    var details     = message.Data as DialogDetails;
                    var confirmed   = true;
                    var confirmText = string.IsNullOrWhiteSpace(details.ConfirmText) ?
                                      AppResources.Ok : details.ConfirmText;
                    if (!string.IsNullOrWhiteSpace(details.CancelText))
                    {
                        confirmed = await MainPage.DisplayAlert(details.Title, details.Text, confirmText,
                                                                details.CancelText);
                    }
                    else
                    {
                        await MainPage.DisplayAlert(details.Title, details.Text, confirmText);
                    }
                    _messagingService.Send("showDialogResolve", new Tuple <int, bool>(details.DialogId, confirmed));
                }
                else if (message.Command == "locked")
                {
                    await _stateService.PurgeAsync();
                    MainPage = new NavigationPage(new LockPage());
                }
                else if (message.Command == "lockVault")
                {
                    await _lockService.LockAsync(true);
                }
                else if (message.Command == "logout")
                {
                    await LogOutAsync(false);
                }
                else if (message.Command == "loggedOut")
                {
                    // TODO
                }
                else if (message.Command == "unlocked" || message.Command == "loggedIn")
                {
                    // TODO
                }
            });
        }
Beispiel #43
0
 public SettingsPasswordHintViewModel(IProtoService protoService, ICacheService cacheService, ISettingsService settingsService, IEventAggregator aggregator)
     : base(protoService, cacheService, settingsService, aggregator)
 {
     SendCommand = new RelayCommand(SendExecute);
 }
Beispiel #44
0
        public SettingsPasscodeViewModel(IProtoService protoService, ICacheService cacheService, ISettingsService settingsService, IEventAggregator aggregator, IPasscodeService passcodeService)
            : base(protoService, cacheService, settingsService, aggregator)
        {
            _passcodeService = passcodeService;

            ToggleCommand   = new RelayCommand(ToggleExecute);
            EditCommand     = new RelayCommand(EditExecute);
            AutolockCommand = new RelayCommand(AutolockExecute);
        }
Beispiel #45
0
 public PfxFileOptionsFactory(ILogService log, ISettingsService settings, IArgumentsService arguments)
 {
     _log       = log;
     _arguments = arguments;
     _settings  = settings;
 }
Beispiel #46
0
 public PreflightComponent(ISettingsService settingsService, IContentChecker contentChecker)
 {
     _settingsService = settingsService;
     _contentChecker  = contentChecker;
 }
Beispiel #47
0
        public InstantViewModel(IProtoService protoService, ICacheService cacheService, ISettingsService settingsService, IEventAggregator aggregator)
            : base(protoService, cacheService, settingsService, aggregator)
        {
            _gallery = new InstantGalleryViewModel(aggregator);

            ShareCommand    = new RelayCommand(ShareExecute);
            FeedbackCommand = new RelayCommand(FeedbackExecute);
            BrowserCommand  = new RelayCommand(BrowserExecute);
        }
Beispiel #48
0
 public PlexApi(IApi api, ISettingsService <CustomizationSettings> settings, ISettingsService <PlexSettings> p)
 {
     Api           = api;
     _custom       = settings;
     _plexSettings = p;
 }
Beispiel #49
0
 public LeaderViewModel(IDataService dataService, INavigationService navService, ISettingsService setService)
 {
     _dataService = dataService;
     _navService  = navService;
     _setService  = setService;
     Teams        = new BindableCollection <Team>();
 }
Beispiel #50
0
        /// <summary>
        /// Initializes a new instance of the GradeTonnageViewModel class.
        /// </summary>
        /// <param name="logger">Logging for the MapWizard.</param>
        /// <param name="dialogService">Service for using dialogs and notifications.</param>
        /// <param name="settingsService">Service for using and editing settings.</param>
        public GradeTonnageViewModel(ILogger logger, IDialogService dialogService, ISettingsService settingsService)
        {
            this.logger          = logger;
            this.dialogService   = dialogService;
            this.settingsService = settingsService;
            var GTFolder  = Path.Combine(settingsService.RootPath, "GTModel");
            var GTDirInfo = new DirectoryInfo(GTFolder);

            if (!Directory.Exists(GTFolder))
            {
                Directory.CreateDirectory(GTFolder);
            }
            RunToolCommand         = new RelayCommand(RunTool, CanRunTool);
            SelectFileCommand      = new RelayCommand(SelectFile, CanRunTool);
            SelectMetalFileCommand = new RelayCommand(SelectMetalFile, CanRunTool);
            SelectFolderCommand    = new RelayCommand(SelectFolder, CanRunTool);
            SelectModelCommand     = new RelayCommand(SelectResult, CanRunTool);
            ShowModelDialog        = new RelayCommand(OpenModelDialog, CanRunTool);
            OpenGradePlotCommand   = new RelayCommand(OpenGradePlot, CanRunTool);
            OpenTonnagePlotCommand = new RelayCommand(OpenTonnagePlot, CanRunTool);
            viewModelLocator       = new ViewModelLocator();
            result = new GradeTonnageResultModel();
            GradeTonnageInputParams inputParams = new GradeTonnageInputParams();
            string projectFolder         = Path.Combine(settingsService.RootPath, "GTModel");
            string selectedProjectFolder = Path.Combine(settingsService.RootPath, "GTModel", "SelectedResult");

            if (!Directory.Exists(selectedProjectFolder))
            {
                Directory.CreateDirectory(selectedProjectFolder);
            }
            string param_json = Path.Combine(selectedProjectFolder, "GradeTonnage_input_params.json");

            if (File.Exists(param_json))
            {
                try
                {
                    inputParams.Load(param_json);
                    Model = new GradeTonnageModel
                    {
                        CSVPath           = inputParams.CSVPath,
                        IsTruncated       = inputParams.IsTruncated,
                        PdfType           = inputParams.PDFType,
                        MinDepositCount   = Convert.ToInt32(inputParams.MinDepositCount),
                        RandomSampleCount = Convert.ToInt32(inputParams.RandomSampleCount),
                        Seed            = Convert.ToInt32(inputParams.Seed),
                        Folder          = inputParams.Folder,
                        ExtensionFolder = inputParams.ExtensionFolder,
                        RunGrade        = inputParams.RunGrade,
                        RunTonnage      = inputParams.RunTonnage,
                        ModelType       = inputParams.ModelType
                    };
                }
                catch (Exception ex)
                {
                    Model = new GradeTonnageModel();
                    logger.Error(ex, "Failed to read json file");
                    dialogService.ShowNotification("Couldn't load Grade Tonnage tool's inputs correctly.", "Error");
                    viewModelLocator.SettingsViewModel.WriteLogText("Couldn't load Grade Tonnage tool's inputs correctly.", "Error");
                }
            }
            else
            {
                Model = new GradeTonnageModel();
            }
            if (Directory.GetFiles(selectedProjectFolder).Length != 0)
            {
                LoadResults();
            }
            FindModelnames(projectFolder);
            var lastRunFile = Path.Combine(projectFolder, "GradeTonnage_last_run.lastrun");

            if (File.Exists(lastRunFile))
            {
                Model.LastRunDate = "Last Run: " + (new FileInfo(lastRunFile)).LastWriteTime.ToString();
            }
        }
        public SupergroupMembersViewModelBase(IProtoService protoService, ICacheService cacheService, ISettingsService settingsService, IEventAggregator aggregator, SupergroupMembersFilter filter, Func <string, SupergroupMembersFilter> search)
            : base(protoService, cacheService, settingsService, aggregator)
        {
            _filter = filter;
            _find   = search;

            Members = new SearchCollection <ChatMember, ChatMemberCollection>(SetItems, new ChatMemberHandler());
        }
Beispiel #52
0
        public WalletImportViewModel(ITonService tonService, IProtoService protoService, ICacheService cacheService, ISettingsService settingsService, IEventAggregator aggregator)
            : base(tonService, protoService, cacheService, settingsService, aggregator)
        {
            Items = new MvxObservableCollection <WalletWordViewModel>();

            for (int i = 0; i < 12; i++)
            {
                Items.Add(new WalletWordViewModel {
                    Index = i + 1
                });
                Items.Add(new WalletWordViewModel {
                    Index = i + 13
                });
            }

            TooBadCommand = new RelayCommand(TooBadExecute);
            SendCommand   = new RelayCommand(SendExecute);
        }
Beispiel #53
0
        private void deleteSpravochItemBtn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            switch (gridName)
            {
            case Utils.GridName.Units:

                if (unitsBS.Count != 0)
                {
                    if (MessageBox.Show("Удалить?", "Подтверждение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        Error.ErrorCRUD result = this.unitsService.UnitDelete((UnitsDTO)unitsBS.Current);
                        if (result == Error.ErrorCRUD.NoError)
                        {
                            this.unitsBS.RemoveCurrent();
                            unitsService                 = Program.kernel.Get <IUnitsService>();
                            unitsBS.DataSource           = unitsService.GetUnits();
                            this.spravochGrid.DataSource = null;
                            this.spravochGrid.DataSource = this.unitsBS;
                        }
                        else
                        {
                            switch (result)
                            {
                            case Error.ErrorCRUD.RelationError:
                                MessageBox.Show("Ед.измерения нельзя удалить. Есть связанные данные!", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                break;

                            case Error.ErrorCRUD.DatabaseError:
                                MessageBox.Show("Ошибка Базы данных!", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                break;

                            default:
                                break;
                            }
                        }
                    }
                }
                break;

            case Utils.GridName.Users:

                if (usersBS.Count != 0)
                {
                    if (MessageBox.Show("Удалить?", "Подтверждение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        if (this.usersService.UserDeleteById(((UsersDTO)usersBS.Current).UserId))
                        {
                            int rowHandle = spravochGridView.FocusedRowHandle - 1;
                            spravochGridView.BeginDataUpdate();

                            usersService            = Program.kernel.Get <IUsersService>();
                            usersBS.DataSource      = usersService.GetUsers();
                            spravochGrid.DataSource = usersBS;

                            spravochGridView.EndDataUpdate();
                            spravochGridView.FocusedRowHandle = (spravochGridView.IsValidRowHandle(rowHandle)) ? rowHandle : -1;
                        }
                    }
                }
                break;

            case Utils.GridName.Contractors:

                if (contractorsBS.Count != 0)
                {
                    if (MessageBox.Show("Удалить?", "Подтверждение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        Error.ErrorCRUD result = this.contractorsService.ContractorDelete((ContractorsDTO)contractorsBS.Current);
                        if (result == Error.ErrorCRUD.NoError)
                        {
                            this.contractorsBS.RemoveCurrent();

                            contractorsService           = Program.kernel.Get <IContractorsService>();
                            contractorsBS.DataSource     = contractorsService.GetContractors();
                            this.spravochGrid.DataSource = null;
                            this.spravochGrid.DataSource = this.contractorsBS;
                        }
                        else
                        {
                            switch (result)
                            {
                            case Error.ErrorCRUD.RelationError:
                                MessageBox.Show("Поставщика нельзя удалить. Есть связанные данные!", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                break;

                            case Error.ErrorCRUD.DatabaseError:
                                MessageBox.Show("Ошибка Базы данных!", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                break;

                            default:
                                break;
                            }
                        }
                    }
                }
                break;

            case Utils.GridName.StorageGroups:

                if (storageGroupsBS.Count != 0)
                {
                    if (MessageBox.Show("Удалить?", "Подтверждение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        Error.ErrorCRUD result = this.storageGroupsService.StorageGroupsDelete((StorageGroupsDTO)storageGroupsBS.Current);
                        if (result == Error.ErrorCRUD.NoError)
                        {
                            this.storageGroupsBS.RemoveCurrent();

                            storageGroupsService         = Program.kernel.Get <IStorageGroupsService>();
                            storageGroupsBS.DataSource   = storageGroupsService.GetStorageGroups();
                            this.spravochGrid.DataSource = null;
                            this.spravochGrid.DataSource = this.storageGroupsBS;
                        }
                        else
                        {
                            switch (result)
                            {
                            case Error.ErrorCRUD.RelationError:
                                MessageBox.Show("Складскую группу нельзя удалить. Есть связанные данные!", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                break;

                            case Error.ErrorCRUD.DatabaseError:
                                MessageBox.Show("Ошибка Базы данных!", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                break;

                            default:
                                break;
                            }
                        }
                    }
                }
                break;

            case Utils.GridName.Measures:

                if (measuresBS.Count != 0)
                {
                    if (MessageBox.Show("Удалить?", "Подтверждение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        if (this.measuresService.MeasureDelete((MeasuresDTO)measuresBS.Current))
                        {
                            this.measuresBS.RemoveCurrent();
                        }

                        measuresService              = Program.kernel.Get <IMeasuresService>();
                        measuresBS.DataSource        = measuresService.GetMeasures();
                        this.spravochGrid.DataSource = null;
                        this.spravochGrid.DataSource = this.measuresBS;
                    }
                }
                break;

            case Utils.GridName.Currency:

                if (currencyBS.Count != 0)
                {
                    if (MessageBox.Show("Удалить?", "Подтверждение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        if (this.currencyService.CurrencyDelete((CurrencyDTO)currencyBS.Current))
                        {
                            this.currencyBS.RemoveCurrent();
                        }

                        currencyService              = Program.kernel.Get <ICurrencyService>();
                        currencyBS.DataSource        = currencyService.GetCurrency();
                        this.spravochGrid.DataSource = null;
                        this.spravochGrid.DataSource = this.currencyBS;
                    }
                }
                break;

            case Utils.GridName.ZoneNames:

                if (zoneNamesBS.Count != 0)
                {
                    cellList = wareHousesService.GetWareHouses().ToList();
                    bool anyCellLoading = cellList.Any(s => s.ZoneNameId == (((ZoneNamesDTO)zoneNamesBS.Current).ZoneNameId) && s.LoadingStatusId > 1);    // проверка загруженности зоны

                    if (anyCellLoading)
                    {
                        if (MessageBox.Show("Удалить?", "Подтверждение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            if (this.zoneNamesService.ZoneAllDelete(((ZoneNamesDTO)zoneNamesBS.Current).ZoneNameId))      //удаление данных по всем связанным таблицам
                            {
                                if (this.zoneNamesService.ZoneNameDelete((ZoneNamesDTO)zoneNamesBS.Current))
                                {
                                    this.zoneNamesBS.RemoveCurrent();
                                }

                                zoneNamesService             = Program.kernel.Get <IZoneNamesService>();
                                zoneNamesBS.DataSource       = zoneNamesService.GetZones();
                                this.spravochGrid.DataSource = null;
                                this.spravochGrid.DataSource = this.zoneNamesBS;
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show("Нельзя удалить зону. В выбранной зоне находиться ТОВАР.", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                break;

            case Utils.GridName.Persons:

                if (personsBS.Count != 0)
                {
                    if (MessageBox.Show("Удалить?", "Подтверждение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        if (this.personsService.PersonDelete((PersonsDTO)personsBS.Current))
                        {
                            this.personsBS.RemoveCurrent();
                        }

                        personsService               = Program.kernel.Get <IPersonsService>();
                        personsBS.DataSource         = personsService.GetPersons();
                        this.spravochGrid.DataSource = null;
                        this.spravochGrid.DataSource = this.personsBS;
                    }
                }
                break;

            case Utils.GridName.Profession:

                if (professionBS.Count != 0)
                {
                    if (MessageBox.Show("Удалить?", "Подтверждение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        if (this.professionService.ProfessionDelete((ProfessionsDTO)professionBS.Current))
                        {
                            this.professionBS.RemoveCurrent();
                        }

                        professionService            = Program.kernel.Get <IProfessionService>();
                        professionBS.DataSource      = professionService.GetProfession();
                        this.spravochGrid.DataSource = null;
                        this.spravochGrid.DataSource = this.professionBS;
                    }
                }
                break;

            case Utils.GridName.Alarms:

                if (alarmsBS.Count != 0)
                {
                    if (MessageBox.Show("Удалить?", "Подтверждение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        if (this.settingsService.AlarmDelete((AlarmsDTO)alarmsBS.Current))
                        {
                            this.alarmsBS.RemoveCurrent();
                        }

                        settingsService              = Program.kernel.Get <ISettingsService>();
                        alarmsBS.DataSource          = settingsService.GetAlarms();
                        this.spravochGrid.DataSource = null;
                        this.spravochGrid.DataSource = this.alarmsBS;
                    }
                }
                break;

            default:

                break;
            }
        }
Beispiel #54
0
 public DialogEventLogViewModel(IProtoService protoService, ICacheService cacheService, ISettingsService settingsService, IEventAggregator aggregator, ILocationService locationService, INotificationsService pushService, IPlaybackService playbackService, IVoIPService voipService, INetworkService networkService, IMessageFactory messageFactory)
     : base(protoService, cacheService, settingsService, aggregator, locationService, pushService, playbackService, voipService, networkService, messageFactory)
 {
     HelpCommand = new RelayCommand(HelpExecute);
 }
Beispiel #55
0
        private void editSpravochItemBtn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            switch (gridName)
            {
            case Utils.GridName.Units:

                if (unitsBS.Count != 0)
                {
                    using (UnitEditFm unitEditFm = new UnitEditFm(Utils.Operation.Update, (UnitsDTO)unitsBS.Current))
                    {
                        if (unitEditFm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            int return_UnitId = unitEditFm.Return();
                            spravochGridView.BeginDataUpdate();

                            unitsService            = Program.kernel.Get <IUnitsService>();
                            unitsBS.DataSource      = unitsService.GetUnits();
                            spravochGrid.DataSource = unitsBS;

                            spravochGridView.EndDataUpdate();
                            int rowHandle = spravochGridView.LocateByValue("UnitId", return_UnitId);
                            spravochGridView.FocusedRowHandle = rowHandle;
                        }
                    }
                }
                break;

            case Utils.GridName.Users:

                if (usersBS.Count != 0)
                {
                    using (UserEditFm userEditFm = new UserEditFm(Utils.Operation.Update, (UsersDTO)usersBS.Current))
                    {
                        if (userEditFm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            int return_UserId = userEditFm.Return();
                            spravochGridView.BeginDataUpdate();

                            usersService            = Program.kernel.Get <IUsersService>();
                            usersBS.DataSource      = usersService.GetUsers();
                            spravochGrid.DataSource = usersBS;

                            spravochGridView.EndDataUpdate();
                            int rowHandle = spravochGridView.LocateByValue("UserId", return_UserId);
                            spravochGridView.FocusedRowHandle = rowHandle;
                        }
                    }
                }
                break;

            case Utils.GridName.Contractors:

                if (contractorsBS.Count != 0)
                {
                    using (ContractorEditFm contractorEditFm = new ContractorEditFm(Utils.Operation.Update, (ContractorsDTO)contractorsBS.Current))
                    {
                        if (contractorEditFm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            int return_ContractorId = contractorEditFm.Return();
                            spravochGridView.BeginDataUpdate();

                            contractorsService       = Program.kernel.Get <IContractorsService>();
                            contractorsBS.DataSource = contractorsService.GetContractors();
                            spravochGrid.DataSource  = contractorsBS;

                            spravochGridView.EndDataUpdate();
                            int rowHandle = spravochGridView.LocateByValue("ContractorId", return_ContractorId);
                            spravochGridView.FocusedRowHandle = rowHandle;
                        }
                    }
                    break;
                }
                break;

            case Utils.GridName.StorageGroups:

                if (storageGroupsBS.Count != 0)
                {
                    using (StorageGroupEditFm storageGroupEditFm = new StorageGroupEditFm(Utils.Operation.Update, (StorageGroupsDTO)storageGroupsBS.Current))
                    {
                        if (storageGroupEditFm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            int return_StorageGroupId = storageGroupEditFm.Return();
                            spravochGridView.BeginDataUpdate();

                            storageGroupsService       = Program.kernel.Get <IStorageGroupsService>();
                            storageGroupsBS.DataSource = storageGroupsService.GetStorageGroups();
                            spravochGrid.DataSource    = storageGroupsBS;

                            spravochGridView.EndDataUpdate();
                            int rowHandle = spravochGridView.LocateByValue("StorageGroupId", return_StorageGroupId);
                            spravochGridView.FocusedRowHandle = rowHandle;
                        }
                    }
                    break;
                }
                break;

            case Utils.GridName.Measures:

                if (measuresBS.Count != 0)
                {
                    new MeasureEditFm(Utils.Operation.Update, (MeasuresDTO)measuresBS.Current, (obj) => { }).ShowDialog();
                    measuresService       = Program.kernel.Get <IMeasuresService>();
                    measuresBS.DataSource = measuresService.GetMeasures();

                    this.spravochGrid.DataSource = null;
                    this.spravochGrid.DataSource = this.measuresBS;
                }
                break;

            case Utils.GridName.Currency:

                if (currencyBS.Count != 0)
                {
                    //new CurrencyEditFm(Utils.Operation.Update, (CurrencyDTO)currencyBS.Current, (obj) => { }).ShowDialog();
                    currencyService              = Program.kernel.Get <ICurrencyService>();
                    currencyBS.DataSource        = currencyService.GetCurrency();
                    this.spravochGrid.DataSource = null;
                    this.spravochGrid.DataSource = this.currencyBS;
                }
                break;

            case Utils.GridName.ZoneNames:

                if (zoneNamesBS.Count != 0)
                {
                    new ZoneNameEditFm(Utils.Operation.Update, (ZoneNamesDTO)zoneNamesBS.Current).ShowDialog();
                    zoneNamesService             = Program.kernel.Get <IZoneNamesService>();
                    zoneNamesBS.DataSource       = zoneNamesService.GetZones();
                    this.spravochGrid.DataSource = null;
                    this.spravochGrid.DataSource = this.zoneNamesBS;
                }
                break;

            case Utils.GridName.Persons:

                if (personsBS.Count != 0)
                {
                    using (PersonEditFm personEditFm = new PersonEditFm(Utils.Operation.Update, (PersonsDTO)personsBS.Current))
                    {
                        if (personEditFm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            int return_PersonId = personEditFm.Return();
                            spravochGridView.BeginDataUpdate();

                            personsService          = Program.kernel.Get <IPersonsService>();
                            personsBS.DataSource    = personsService.GetPersons();
                            spravochGrid.DataSource = personsBS;

                            spravochGridView.EndDataUpdate();
                            int rowHandle = spravochGridView.LocateByValue("PersonId", return_PersonId);
                            spravochGridView.FocusedRowHandle = rowHandle;
                        }
                    }
                }
                break;

            case Utils.GridName.Profession:

                if (professionBS.Count != 0)
                {
                    using (ProfessionEditFm professionEditFm = new ProfessionEditFm(Utils.Operation.Update, (ProfessionsDTO)professionBS.Current))
                    {
                        if (professionEditFm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            int return_Id = professionEditFm.Return();
                            spravochGridView.BeginDataUpdate();

                            professionService       = Program.kernel.Get <IProfessionService>();
                            personsBS.DataSource    = professionService.GetProfession();
                            spravochGrid.DataSource = professionBS;

                            spravochGridView.EndDataUpdate();
                            int rowHandle = spravochGridView.LocateByValue("Id", return_Id);
                            spravochGridView.FocusedRowHandle = rowHandle;
                        }
                    }
                }
                break;

            case Utils.GridName.Alarms:

                if (alarmsBS.Count != 0)
                {
                    using (AlarmEditFm alarmEditFm = new AlarmEditFm(Utils.Operation.Update, (AlarmsDTO)alarmsBS.Current))
                    {
                        if (alarmEditFm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            int return_Id = alarmEditFm.Return();
                            spravochGridView.BeginDataUpdate();

                            settingsService         = Program.kernel.Get <ISettingsService>();
                            alarmsBS.DataSource     = settingsService.GetAlarms();
                            spravochGrid.DataSource = alarmsBS;

                            spravochGridView.EndDataUpdate();
                            int rowHandle = spravochGridView.LocateByValue("Id", return_Id);
                            spravochGridView.FocusedRowHandle = rowHandle;
                        }
                    }
                }
                break;

            default:

                break;
            }
        }
Beispiel #56
0
        public App(AppOptions appOptions)
        {
            Options = appOptions ?? new AppOptions();
            if (Options.IosExtension)
            {
                Current = this;
                return;
            }
            _userService               = ServiceContainer.Resolve <IUserService>("userService");
            _broadcasterService        = ServiceContainer.Resolve <IBroadcasterService>("broadcasterService");
            _messagingService          = ServiceContainer.Resolve <IMessagingService>("messagingService");
            _stateService              = ServiceContainer.Resolve <IStateService>("stateService");
            _vaultTimeoutService       = ServiceContainer.Resolve <IVaultTimeoutService>("vaultTimeoutService");
            _syncService               = ServiceContainer.Resolve <ISyncService>("syncService");
            _tokenService              = ServiceContainer.Resolve <ITokenService>("tokenService");
            _cryptoService             = ServiceContainer.Resolve <ICryptoService>("cryptoService");
            _cipherService             = ServiceContainer.Resolve <ICipherService>("cipherService");
            _folderService             = ServiceContainer.Resolve <IFolderService>("folderService");
            _settingsService           = ServiceContainer.Resolve <ISettingsService>("settingsService");
            _collectionService         = ServiceContainer.Resolve <ICollectionService>("collectionService");
            _searchService             = ServiceContainer.Resolve <ISearchService>("searchService");
            _authService               = ServiceContainer.Resolve <IAuthService>("authService");
            _platformUtilsService      = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService");
            _storageService            = ServiceContainer.Resolve <IStorageService>("storageService");
            _secureStorageService      = ServiceContainer.Resolve <IStorageService>("secureStorageService");
            _passwordGenerationService = ServiceContainer.Resolve <IPasswordGenerationService>(
                "passwordGenerationService");
            _i18nService         = ServiceContainer.Resolve <II18nService>("i18nService") as MobileI18nService;
            _deviceActionService = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService");

            Bootstrap();
            _broadcasterService.Subscribe(nameof(App), async(message) =>
            {
                if (message.Command == "showDialog")
                {
                    var details     = message.Data as DialogDetails;
                    var confirmed   = true;
                    var confirmText = string.IsNullOrWhiteSpace(details.ConfirmText) ?
                                      AppResources.Ok : details.ConfirmText;
                    Device.BeginInvokeOnMainThread(async() =>
                    {
                        if (!string.IsNullOrWhiteSpace(details.CancelText))
                        {
                            confirmed = await Current.MainPage.DisplayAlert(details.Title, details.Text, confirmText,
                                                                            details.CancelText);
                        }
                        else
                        {
                            await Current.MainPage.DisplayAlert(details.Title, details.Text, confirmText);
                        }
                        _messagingService.Send("showDialogResolve", new Tuple <int, bool>(details.DialogId, confirmed));
                    });
                }
                else if (message.Command == "locked")
                {
                    await LockedAsync(!(message.Data as bool?).GetValueOrDefault());
                }
                else if (message.Command == "lockVault")
                {
                    await _vaultTimeoutService.LockAsync(true);
                }
                else if (message.Command == "logout")
                {
                    Device.BeginInvokeOnMainThread(async() =>
                                                   await LogOutAsync((message.Data as bool?).GetValueOrDefault()));
                }
                else if (message.Command == "loggedOut")
                {
                    // Clean up old migrated key if they ever log out.
                    await _secureStorageService.RemoveAsync("oldKey");
                }
                else if (message.Command == "resumed")
                {
                    if (Device.RuntimePlatform == Device.iOS)
                    {
                        ResumedAsync();
                    }
                }
                else if (message.Command == "slept")
                {
                    if (Device.RuntimePlatform == Device.iOS)
                    {
                        await SleptAsync();
                    }
                }
                else if (message.Command == "migrated")
                {
                    await Task.Delay(1000);
                    await SetMainPageAsync();
                }
                else if (message.Command == "popAllAndGoToTabGenerator" ||
                         message.Command == "popAllAndGoToTabMyVault")
                {
                    Device.BeginInvokeOnMainThread(async() =>
                    {
                        if (Current.MainPage is TabsPage tabsPage)
                        {
                            while (tabsPage.Navigation.ModalStack.Count > 0)
                            {
                                await tabsPage.Navigation.PopModalAsync(false);
                            }
                            if (message.Command == "popAllAndGoToTabMyVault")
                            {
                                Options.MyVaultTile = false;
                                tabsPage.ResetToVaultPage();
                            }
                            else
                            {
                                Options.GeneratorTile = false;
                                tabsPage.ResetToGeneratorPage();
                            }
                        }
                    });
                }
            });
        }
        public NoteEntryPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, IDatabaseService databaseService, IApplicationState applicationState, IConnectivity connectivity, ISessionUpdateService sessionUpdateService, ISettingsService settingsService) : base(applicationState)
        {
            _navigationService    = navigationService;
            _pageDialogService    = pageDialogService;
            _databaseService      = databaseService;
            _connectivity         = connectivity;
            _sessionUpdateService = sessionUpdateService;
            _settingsService      = settingsService;

            DoneCommand   = new DelegateCommand(() => OnDoneCommand().IgnoreResult());
            CancelCommand = new DelegateCommand(() => OnCancelCommand().IgnoreResult());
        }
Beispiel #58
0
        public SpravochFm(Utils.GridName aName)
        {
            InitializeComponent();

            gridName = aName;

            splashScreenManager.ShowWaitForm();

            switch (aName)
            {
            case Utils.GridName.Units:
                unitsService       = Program.kernel.Get <IUnitsService>();
                unitsBS.DataSource = unitsService.GetUnits();
                GridColumnCreate(Utils.dictUnits, gridName);
                spravochGrid.DataSource = unitsBS;
                this.Text = "Справочник единиц измерения";
                access    = UsersService.AuthorizatedUserAccess.Any(c => c.TaskName == "unitsItem" && c.AccessRightId == 1);  //чтение
                if (access)
                {
                    AuthorizatedUserAccess();
                }

                break;

            case Utils.GridName.Users:
                usersService       = Program.kernel.Get <IUsersService>();
                usersBS.DataSource = usersService.GetUsers();
                GridColumnCreate(Utils.dictUsers, gridName);
                spravochGrid.DataSource = usersBS;
                this.Text = "Справочник пользователей";
                access    = UsersService.AuthorizatedUserAccess.Any(c => c.TaskName == "usersItem" && c.AccessRightId == 1);

                break;

            case Utils.GridName.Contractors:
                contractorsService       = Program.kernel.Get <IContractorsService>();
                contractorsBS.DataSource = contractorsService.GetContractors();
                GridColumnCreate(Utils.dictContractors, gridName);
                spravochGrid.DataSource = contractorsBS;
                this.Text = "Справочник контрагентов";
                access    = UsersService.AuthorizatedUserAccess.Any(c => c.TaskName == "contractorsItem" && c.AccessRightId == 1);
                break;

            case Utils.GridName.Measures:
                measuresService       = Program.kernel.Get <IMeasuresService>();
                measuresBS.DataSource = measuresService.GetMeasures();
                GridColumnCreate(Utils.dictMeasures, gridName);
                spravochGrid.DataSource = measuresBS;
                this.Text = "Справочник габаритов/размеров";
                access    = UsersService.AuthorizatedUserAccess.Any(c => c.TaskName == "measuresItem" && c.AccessRightId == 1);
                break;

            case Utils.GridName.Currency:
                currencyService       = Program.kernel.Get <ICurrencyService>();
                currencyBS.DataSource = currencyService.GetCurrency();
                GridColumnCreate(Utils.dictCurrency, gridName);
                spravochGrid.DataSource = currencyBS;
                this.Text = "Справочник валют";
                access    = UsersService.AuthorizatedUserAccess.Any(c => c.TaskName == "currencyItem" && c.AccessRightId == 1);
                break;

            case Utils.GridName.ZoneNames:
                zoneNamesService       = Program.kernel.Get <IZoneNamesService>();
                wareHousesService      = Program.kernel.Get <IWareHousesService>();
                zoneNamesBS.DataSource = zoneNamesService.GetZones();
                GridColumnCreate(Utils.dictZoneNames, gridName);
                spravochGrid.DataSource = zoneNamesBS;
                this.Text = "Зоны хранения";

                break;

            case Utils.GridName.StorageGroups:
                storageGroupsService       = Program.kernel.Get <IStorageGroupsService>();
                storageGroupsBS.DataSource = storageGroupsService.GetStorageGroups();
                GridColumnCreate(Utils.dictStorageGroups, gridName);
                spravochGrid.DataSource = storageGroupsBS;
                this.Text = "Складские группы";
                access    = UsersService.AuthorizatedUserAccess.Any(c => c.TaskName == "storageGroupsItem" && c.AccessRightId == 1);
                break;

            case Utils.GridName.Persons:
                personsService       = Program.kernel.Get <IPersonsService>();
                personsBS.DataSource = personsService.GetPersons();
                GridColumnCreate(Utils.dictPersons, gridName);
                spravochGrid.DataSource = personsBS;
                this.Text = "Ответственные лица";
                access    = UsersService.AuthorizatedUserAccess.Any(c => c.TaskName == "personsItem" && c.AccessRightId == 1);
                break;

            case Utils.GridName.Profession:
                professionService       = Program.kernel.Get <IProfessionService>();
                professionBS.DataSource = professionService.GetProfession();
                GridColumnCreate(Utils.dictProfession, gridName);
                spravochGrid.DataSource = professionBS;
                this.Text = "Профессии";
                access    = UsersService.AuthorizatedUserAccess.Any(c => c.TaskName == "professionItem" && c.AccessRightId == 1);
                break;

            case Utils.GridName.Alarms:
                settingsService     = Program.kernel.Get <ISettingsService>();
                alarmsBS.DataSource = settingsService.GetAlarms();
                GridColumnCreate(Utils.dictAlarms, gridName);
                spravochGrid.DataSource = alarmsBS;
                this.Text = "Журнал сообшений об ошибках";
                access    = UsersService.AuthorizatedUserAccess.Any(c => c.TaskName == "alarmItem" && c.AccessRightId == 1);
                break;

            default:

                break;
            }

            if (access)
            {
                AuthorizatedUserAccess();
            }
            splashScreenManager.CloseWaitForm();
        }
Beispiel #59
0
 public static string?DefaultPassword(ISettingsService settings)
 => settings.Store.PfxFile?.DefaultPassword;
Beispiel #60
0
        public PlaybackService(IProtoService protoService, ICacheService cacheService, ISettingsService settingsService, IEventAggregator aggregator)
        {
            _protoService    = protoService;
            _cacheService    = cacheService;
            _settingsService = settingsService;
            _aggregator      = aggregator;

            _mediaPlayer = new MediaPlayer();
            _mediaPlayer.PlaybackSession.PlaybackStateChanged += OnPlaybackStateChanged;
            _mediaPlayer.PlaybackSession.PositionChanged      += OnPositionChanged;
            _mediaPlayer.MediaFailed             += OnMediaFailed;
            _mediaPlayer.MediaEnded              += OnMediaEnded;
            _mediaPlayer.SourceChanged           += OnSourceChanged;
            _mediaPlayer.CommandManager.IsEnabled = false;

            _transport = _mediaPlayer.SystemMediaTransportControls;
            _transport.ButtonPressed += Transport_ButtonPressed;

            _transport.AutoRepeatMode = _settingsService.Playback.RepeatMode;
            _isRepeatEnabled          = _settingsService.Playback.RepeatMode == MediaPlaybackAutoRepeatMode.Track
                ? null
                : _settingsService.Playback.RepeatMode == MediaPlaybackAutoRepeatMode.List
                ? true
                : (bool?)false;

            _mapping = new Dictionary <string, PlaybackItem>();
            _inverse = new Dictionary <string, Deferral>();
            _binders = new Dictionary <string, MediaBindingEventArgs>();

            aggregator.Subscribe(this);
        }