Exemple #1
0
        public OscilloscopeJournalViewModel(IValueViewModelFactory valueViewModelFactory,
                                            ILocalizerService localizerService, Func <IBoolValue> boolValueGettingFunc,
                                            ILoadingSequenceLoaderRegistry loadingSequenceLoaderRegistry, IJournalLoaderProvider journalLoaderProvider, OscillogramLoader oscillogramLoader)
        {
            this._valueViewModelFactory    = valueViewModelFactory;
            this._localizerService         = localizerService;
            this._boolValueGettingFunc     = boolValueGettingFunc;
            _loadingSequenceLoaderRegistry = loadingSequenceLoaderRegistry;
            _journalLoaderProvider         = journalLoaderProvider;
            _oscillogramLoader             = oscillogramLoader;
            this.LoadCommand  = new RelayCommand(this.OnLoadExecute);
            this.SelectedRows = new List <int>();
            _loaderHooks      = new LoaderHooks(() =>
            {
                Table = new DynamicDataTable(this.JournalParametersNameList, null, true);
                RaisePropertyChanged(nameof(this.Table));
                RaisePropertyChanged(nameof(this.JournalParametersNameList));
            }, list =>
            {
                List <IFormattedValueViewModel> formattedValueViewModels = new List <IFormattedValueViewModel>();
                int index                   = this.Table.GetCurrentValueCount();
                IBoolValue boolValue        = this._boolValueGettingFunc();
                boolValue.BoolValueProperty = this._oscillogramLoader.TryGetOscillogram(index, out string s, _oscilloscopeViewModel, _oscilloscopeModel, _oscilloscopeViewModel.DeviceContext);
                formattedValueViewModels.Add(this._valueViewModelFactory.CreateFormattedValueViewModel(boolValue));
                formattedValueViewModels.AddRange(list.Select((formattedValue =>
                                                               this._valueViewModelFactory.CreateFormattedValueViewModel(formattedValue))).ToList());

                this.Table.AddFormattedValueViewModel(formattedValueViewModels);
            });
 public ModbusEntityEditingViewModel(ILocalizerService localizerService)
 {
     this._localizerService     = localizerService;
     this.WriteCommand          = new RelayCommand <object>(this.OnExecuteWrite, CanExecuteWrite);
     this.CancelCommand         = new RelayCommand <object>(this.OnExecuteCancel);
     this.ChangeBitValueCommand = new RelayCommand <int?>(this.OnExecuteChangeBitValue);
 }
Exemple #3
0
        public FormulaFormatterViewModel(ILocalizerService localizerService, ITypesContainer container,
                                         Func <IArgumentViewModel> argumentViewModelGettingFunc,
                                         ISharedResourcesGlobalViewModel sharedResourcesGlobalViewModel, IFormattingService formattingService)
        {
            _localizerService               = localizerService;
            _container                      = container;
            _argumentViewModelGettingFunc   = argumentViewModelGettingFunc;
            _sharedResourcesGlobalViewModel = sharedResourcesGlobalViewModel;
            _formattingService              = formattingService;
            ArgumentViewModels              = new ObservableCollection <IArgumentViewModel>();
            _formulaFormatter               =
                _container.Resolve <IUshortsFormatter>(StringKeys.FORMULA_FORMATTER) as IFormulaFormatter;

            if (_formulaFormatter == null)
            {
                throw new ArgumentException();
            }

            CheckCommand          = new RelayCommand(OnCheckCommandExecute);
            DeleteArgumentCommand = new RelayCommand <IArgumentViewModel>(OnDeleteArgumentExecute);
            AddArgumentCommand    = new RelayCommand(OnAddArgumentExecute);
            _formulaFormatter.NumberOfSimbolsAfterComma = 3;

            InitializeFormulaTooltip();
        }
Exemple #4
0
 public AllianceService(
     IAllianceRepository aRepo,
     IAllianceLocalStorageCache aCache,
     IAllianceUserRepository aUserRepo,
     IAllianceUserLocalStorageCache aUserCache,
     IAllianceRequestMessageRepository armRepo,
     IAllianceRequestMessageLocalStorageCache armCache,
     IAllianceRoleRepository aRolesRepo,
     IAllianceRoleLocalStorageCache aRolesCache,
     IAlianceNameSercherPkCache aNameSercher,
     IGDetailPlanetLocalStorageCache planetDetailCache,
     IAllianceTechLocalStorageCache aTechCahce,
     IAllianceFleetLocalStorageCache aFleetCache,
     IAllianceTechRepository aTechRepo,
     IChannelService channelService, ILocalizerService localizer)
 {
     _aRepo             = aRepo;
     _aCache            = aCache;
     _aUserRepo         = aUserRepo;
     _aUserCache        = aUserCache;
     _armRepo           = armRepo;
     _armCache          = armCache;
     _aRolesRepo        = aRolesRepo;
     _aRolesCache       = aRolesCache;
     _aNameSercher      = aNameSercher;
     _planetDetailCache = planetDetailCache;
     _aTechCahce        = aTechCahce;
     _aFleetCache       = aFleetCache;
     _aTechRepo         = aTechRepo;
     _localizer         = localizer;
     _channelService    = (ChannelService)channelService;
 }
        /// <summary>
        /// Standard CTOR
        /// </summary>
        public ShellSettingsFlyoutViewModel()
        {
            this.localizerService = UnityContainer.Resolve<ILocalizerService>(ServiceNames.LocalizerService);

            // Get the config file
            this.applicationConfig = this.UnityContainer.Resolve<IConfigurationFile>(FileAndFolderConstants.ApplicationConfigFile);

            // create metro theme color menu items for the demo
            this.ApplicationThemes = ThemeManager.AppThemes
                                           .Select(a => new ApplicationTheme() { Name = a.Name, BorderColorBrush = a.Resources["BlackColorBrush"] as Brush, ColorBrush = a.Resources["WhiteColorBrush"] as Brush })
                                           .ToList();

            // create accent colors list
            this.AccentColors = ThemeManager.Accents
                                            .Select(a => new AccentColor() { Name = a.Name, ColorBrush = a.Resources["AccentColorBrush"] as Brush })
                                            .ToList();

            this.Swatches = new SwatchesProvider().Swatches;

            // Language
            var languageTag = applicationConfig.Sections["GeneralSettings"].Settings["Language"].Value;
            var localizerService = this.UnityContainer.Resolve<ILocalizerService>(ServiceNames.LocalizerService);
            if (localizerService != null)
            {
                this.SelectedLanguage = localizerService.SupportedLanguages.Where(l => l.IetfLanguageTag.Equals(languageTag)).FirstOrDefault();
            }

            // Theme
            string themeName = applicationConfig.Sections["GeneralSettings"].Settings["Theme"].Value;
            this.SelectedTheme = this.ApplicationThemes.Where(t => t.Name.Equals(themeName)).FirstOrDefault();

            // Accent color
            string accentColor = applicationConfig.Sections["GeneralSettings"].Settings["AccentColor"].Value;
            this.SelectedAccentColor = this.AccentColors.Where(t => t.Name.Equals(accentColor)).FirstOrDefault();
        }
        public static IReadOnlyDictionary <string, string> GetGameTranstaleGroup(this ILocalizerService localizer, GameTranslateType translateType)
        {
            var isnt = new TranslateCollections();

            switch (translateType)
            {
            case GameTranslateType.alliance:
                return(isnt.AllianceTranslates);

            case GameTranslateType.mapInfo:
                return(isnt.MapTranslates);

            case GameTranslateType.confederation:
                return(isnt.ConfederationTranslates);

            case GameTranslateType.journal:
                return(isnt.JournalTranslates);

            case GameTranslateType.common:
                return(isnt.CommonTranslates);

            case GameTranslateType.unit:
                return(isnt.UnitTranslates);

            default:
                return(null);
            }
        }
        /// <summary>
        /// CTOR
        /// </summary>
        public ShellSettingsFlyoutViewModel()
        {
            this.localizerService = Container.Resolve <ILocalizerService>(ServiceNames.LocalizerService);
            //TODO MahApps.Metro主题 以及控件颜色 设置成中文
            // create metro theme color menu items for the demo
            this.ApplicationThemes = ThemeManager.AppThemes
                                     .Select(a => new ApplicationTheme()
            {
                Name             = a.Name,
                BorderColorBrush = a.Resources["BlackColorBrush"] as Brush,
                ColorBrush       = a.Resources["WhiteColorBrush"] as Brush
            })
                                     .ToList();

            // create accent colors list
            this.AccentColors = ThemeManager.Accents
                                .Select(a => new AccentColor()
            {
                Name       = a.Name,
                ColorBrush = a.Resources["AccentColorBrush"] as Brush
            })
                                .ToList();

            this.SelectedTheme       = this.ApplicationThemes.FirstOrDefault();
            this.SelectedAccentColor = this.AccentColors.FirstOrDefault(c => c.Name.Equals("Cyan"));
        }
Exemple #8
0
 public JournalOutService(IGDetailPlanetService gDetailPlanetService,
                          IGGeometryPlanetService geometryPlanetService,
                          ISystemService systemService,
                          IUTaskService uTaskService,
                          IUReportService uReportService,
                          IUSpyService uSpyService,
                          IMothershipService mothershipService,
                          ISpriteImages spriteImages,
                          ISynchronizer synchronizer,
                          IMapAdressService mapAdressService,
                          IUMotherJumpService motherJumpService,
                          IGameUserService gameUserService,
                          IStoreService storeService, ILocalizerService localizer)
 {
     _gDetailPlanetService  = gDetailPlanetService;
     _geometryPlanetService = geometryPlanetService;
     _systemService         = systemService;
     _uTaskService          = uTaskService;
     _uReportService        = uReportService;
     _uSpyService           = uSpyService;
     _mothershipService     = mothershipService;
     _spriteImages          = spriteImages;
     _synchronizer          = synchronizer;
     _mapAdressService      = mapAdressService;
     _motherJumpService     = motherJumpService;
     _gameUserService       = gameUserService;
     _storeService          = storeService;
     _localizer             = localizer;
 }
Exemple #9
0
        public LexemManager(ILocalizerService localizerService)
        {
            _localizerService = localizerService;

            AddVisitorInfo("Add", new AddVisitor(this));
            AddVisitorInfo("GetDeviceValue", new GetDeviceValueVisitor(this));
            AddVisitorInfo("SetDeviceValue", new SetDeviceValueVisitor(this));
            AddVisitorInfo("SetResultValue", new SetResultValueVisitor(this));
            AddVisitorInfo("GetResultValue", new GetResultValueVisitor(this));
            AddVisitorInfo("Pow", new PowVisitor(this));
            AddVisitorInfo("Multiply", new MultiplyVisitor(this));
            AddVisitorInfo("Subtract", new SubtractVisitor(this));
            AddVisitorInfo("Divide", new DivideVisitor(this));
            AddVisitorInfo("Compare", new CompareVisitor(this));
            AddVisitorInfo("GetBitOfResource", new GetBitOfResourceVisitor(this));
            AddVisitorInfo("SetBitOfResource", new SetBitOfResourceVisitor(this));

            AddVisitorInfo("SetVariable", new SetVariableVisitor(this));
            AddVisitorInfo("GetVariable", new GetVariableVisitor(this));

            AddVisitorInfo("Select", new SelectVisitor(this));

            AddVisitorInfo("GetInputValue", new GetInputVisitor(this));

            AddVisitorInfo("If", (new IfVisitor(this)));
            AddVisitorInfo("Do", (new DoVisitor(this)));
            AddVisitorInfo("InvertSign", (new InvertSignVisitor(this)));


            AddVisitorInfo("ConvertUnsignedToInt16", (new ConvertUnsignedToInt16Visitor(this)));
            AddVisitorInfo("ConvertInt16ToUnsigned", (new ConvertInt16ToUnsignedVisitor(this)));
            AddVisitorInfo("HideCurrentProperty", (new HideCurrentPropertyVisitor(this)));
        }
Exemple #10
0
 public ExcelExportService(ISerializerService serializerService,
                           IApplicationGlobalCommands applicationGlobalCommands, ILocalizerService localizerService)
 {
     _serializerService         = serializerService;
     _applicationGlobalCommands = applicationGlobalCommands;
     _localizerService          = localizerService;
 }
Exemple #11
0
        /// <summary>
        /// CTOR
        /// </summary>
        public ShellSettingsFlyoutViewModel()
        {
            localizerService = Container.Resolve <ILocalizerService>(ServiceNames.LocalizerService);

            // create metro theme color menu items for the demo
            ApplicationThemes = ThemeManager.AppThemes
                                .Select(a => new ApplicationTheme()
            {
                Name             = a.Name,
                BorderColorBrush = a.Resources["BlackColorBrush"] as Brush,
                ColorBrush       = a.Resources["WhiteColorBrush"] as Brush
            })
                                .ToList();

            // create accent colors list
            AccentColors = ThemeManager.Accents
                           .Select(a => new AccentColor()
            {
                Name = a.Name, ColorBrush = a.Resources["AccentColorBrush"] as Brush
            })
                           .ToList();

            SelectedTheme       = ApplicationThemes.Where(c => c.Name.Equals(Properties.Settings.Default.Theme)).FirstOrDefault();
            SelectedAccentColor = AccentColors.Where(c => c.Name.Equals(Properties.Settings.Default.Color)).FirstOrDefault();
            SelectedLanguage    = SupportedLanguages.Where(c => c.Name.Equals(Properties.Settings.Default.Language)).FirstOrDefault();

            Container.Resolve <ILoggerFacade>().Log("ShellSettingsFlyoutViewModel created", Category.Info, Priority.None);
        }
 public ConfigurationEditorViewModelValidator(IFormatterEditorFactory formatterEditorFactory,
                                              ILocalizerService localizerService, ISharedResourcesGlobalViewModel sharedResourcesGlobalViewModel)
 {
     _formatterEditorFactory         = formatterEditorFactory;
     _localizerService               = localizerService;
     _sharedResourcesGlobalViewModel = sharedResourcesGlobalViewModel;
 }
Exemple #13
0
        public DeviceEditingViewModel(Func <IDeviceDefinitionViewModel> deviceDefinitionCreator,
                                      IDevicesContainerService devicesContainerService, ITypesContainer container,
                                      IDialogCoordinator dialogCoordinator, ILocalizerService localizerService, IFlyoutService flyoutService)
        {
            DeviceDefinitions = new ObservableCollection <IDeviceDefinitionViewModel>();
            DeviceConnections = new ObservableCollection <IViewModel>();
            //подгрузка всех файлов с определениями (вынести в асинхронный метод)

            _deviceDefinitionCreator = deviceDefinitionCreator;
            _devicesContainerService = devicesContainerService;
            _container         = container;
            _dialogCoordinator = dialogCoordinator;
            _localizerService  = localizerService;
            _flyoutService     = flyoutService;

            SubmitCommand             = new RelayCommand(OnSubmitCommand, () => _canSubmitCommandExecute);
            OpenDeviceFromFileCommand = new RelayCommand(OnOpenDeviceFromFileExecute);

            //подгрузка всех зарегистрированных фабрик разных видов подключений
            IEnumerable <IDeviceConnectionFactory> deviceConnectionFactories =
                _container.ResolveAll <IDeviceConnectionFactory>();

            foreach (IDeviceConnectionFactory deviceConnectionFactory in deviceConnectionFactories)
            {
                DeviceConnections.Add(deviceConnectionFactory.CreateDeviceConnectionViewModel());
            }
        }
 public ImportPropertiesFromExcelTypeAHelper(IExcelImporter excelImporter, ILocalizerService localizerService,
                                             Func <ComplexPropertyEditorViewModel> complexPropertyEditorViewModelFactory, Func <IFormatterParametersViewModel> formatterParametersViewModelFactory, Func <PropertyEditorViewModel> propertyViewModelFactory)
 {
     _excelImporter    = excelImporter;
     _localizerService = localizerService;
     _formatterParametersViewModelFactory = formatterParametersViewModelFactory;
     _propertyViewModelFactory            = propertyViewModelFactory;
 }
Exemple #15
0
        public MenuViewModel()
        {
            MainPageCommand = new DelegateCommand(ClickMainPageMenu);
            AboutCommand    = new DelegateCommand(ClickAboutMenu);
            HelpCommand     = new DelegateCommand(ClickHelpMenu);

            localizerService = Resolve <ILocalizerService>();
        }
Exemple #16
0
 public ApplicationGlobalCommands(ITypesContainer container,
                                  IDialogCoordinator dialogCoordinator,
                                  ILocalizerService localizerService)
 {
     _container         = container;
     _dialogCoordinator = dialogCoordinator;
     _localizerService  = localizerService;
 }
        public static string _getLangFromPath(this ILocalizerService service, HttpContext context)
        {
            var pathSegments = context.Request.Path.Value.Split('/').ToList();

            var path = context.Request.Path.Value;

            return(path.Length >= 3 ? context.Request.Path.Value.Substring(1, 2) : service.DefaultLang);
        }
        public static string GetGameTranslateName(this ILocalizerService localizer, string translateType, string key)
        {
            GameTranslateType tType;

            return(Enum.TryParse(translateType, true, out tType)
                ? localizer.GetTranslateName(localizer.GetGameTranstaleGroup(tType), key)
                : "");
        }
 public DictionaryMatchingFormatterValidator(ILocalizerService localizerService)
 {
     RuleFor(model => model.KeyValuesDictionary)
     .Must(pairs => !pairs.GroupBy(pair => pair.Key).Any(grouping => grouping.Count() > 1))
     .WithMessage(
         localizerService.GetLocalizedString(ApplicationGlobalNames.StatusMessages
                                             .DUBLICATE_VALUES_MESSAGE));
 }
Exemple #20
0
 public FormulaFormatterViewModelValidator(ILocalizerService localizerService)
 {
     RuleFor(model => model.FormulaString).NotEmpty()
     .WithMessage(localizerService.GetLocalizedString(ApplicationGlobalNames.StatusMessages
                                                      .NULL_OR_EMPTY_MESSAGE));
     RuleFor(model => model.FormulaString).Must(((args, s) => IsFormulaStringValid(s, args)))
     .WithMessage(localizerService.GetLocalizedString(ApplicationGlobalNames.StatusMessages.FORMAT_ERROR));
 }
Exemple #21
0
        public ShellViewModel
            (ILogService logService,
            ILogServiceViewModel logServiceViewModel,
            IDevicesContainerService devicesContainerService,
            IDialogCoordinator dialogCoordinator,
            IApplicationGlobalCommands applicationGlobalCommands,
            IRegionManager regionManager,
            ILocalizerService localizerService,
            IDeviceViewModelFactory deviceViewModelFactory,
            IFragmentPaneViewModelFactory fragmentPaneViewModelFactory,
            IProjectBrowserViewModel projectBrowserViewModel,
            IUniconProjectService uniconProjectService, ToolBarViewModel toolBarViewModel,
            RecentProjectsViewModelFactory recentProjectsViewModelFactory,
            IMainMenuService mainMenuService,
            DynamicMainMenuViewModel dynamicMainMenuViewModel,
            IFlyoutService flyoutService
            , IGlobalEventManager globalEventManger)
        {
            LogServiceViewModel     = logServiceViewModel;
            ProjectBrowserViewModel = projectBrowserViewModel;
            LogService = logService;
            _devicesContainerService = devicesContainerService;
            _devicesContainerService.ConnectableItemChanged += OnDeviceChanged;
            _dialogCoordinator            = dialogCoordinator;
            _applicationGlobalCommands    = applicationGlobalCommands;
            _regionManager                = regionManager;
            _localizerService             = localizerService;
            _deviceViewModelFactory       = deviceViewModelFactory;
            _fragmentPaneViewModelFactory = fragmentPaneViewModelFactory;
            _uniconProjectService         = uniconProjectService;

            ExitCommand = new RelayCommand(OnExit);
            NavigateToDeviceEditorCommand = new RelayCommand(OnNavigateToDeviceEditor);
            NavigateToDeviceAddingCommand = new RelayCommand(OnNavigateToDeviceAddingExecute);
            NavigateToWebSyncViewCommand  = new RelayCommand(OnNavigateToWebSyncViewExecute);
            AddNewFragmentCommand         = new RelayCommand <IFragmentViewModel>(OnExecuteAddNewFragment);
            _fragmentsOpenedCollection    = new ObservableCollection <IFragmentPaneViewModel>();
            OpenOscillogramCommand        = new RelayCommand(OnOpenOscillogramExecute);
            OnClosingCommand  = new RelayCommand <CancelEventArgs>(OnExecuteClosing);
            AnchorableWindows = new ObservableCollection <IAnchorableWindow>
            {
                ProjectBrowserViewModel, LogServiceViewModel
            };
            ToolBarViewModel                = toolBarViewModel;
            DynamicMainMenuViewModel        = dynamicMainMenuViewModel;
            _recentProjectsViewModelFactory = recentProjectsViewModelFactory;
            _mainMenuService                = mainMenuService;
            StaticOptionsButtonsHelper.InitializeStaticButtons(this);
            NewProjectCommand        = new RelayCommand(OnNewProjectExecute);
            SaveProjectCommand       = new RelayCommand(OnSaveProjectExecute);
            SaveAsProjectCommand     = new RelayCommand(OnSaveAsProjectExecute);
            OpenProjectCommand       = new RelayCommand(OnOpenProjectExecute);
            OpenRecentProjectCommand = new RelayCommand <object>(OnOpenRecentProjectExecute);

            OnLoadedCommand = new RelayCommand(OnLoadedExecute);
            _uniconProjectService.SetDialogContext(this);
            _applicationGlobalCommands.SetGlobalDialogContext(this);
        }
 public DeviceEditingViewModelValidator(ILocalizerService localizerService)
 {
     RuleFor(model => model.SelectedDevice).NotNull()
     .WithMessage(localizerService.GetLocalizedString(ApplicationGlobalNames.StatusMessages.SELECTED_DEVICE_NULL_MESSAGE));
     RuleFor(model => model.SelectedDeviceConnection).NotNull()
     .WithMessage(localizerService.GetLocalizedString(ApplicationGlobalNames.StatusMessages.SELECTED_CONNECTION_NULL_MESSAGE));
     RuleFor(model => model.DeviceSignature).Must(s => !string.IsNullOrWhiteSpace(s))
     .WithMessage(localizerService.GetLocalizedString(ApplicationGlobalNames.StatusMessages.NULL_OR_EMPTY_MESSAGE));
 }
Exemple #23
0
        public ModbusTcpConnection(IQueryResultFactory queryResultFactory, ILocalizerService localizerService) : base(
                queryResultFactory)
        {
            _queryResultFactory = queryResultFactory;
            _localizerService   = localizerService;

            Port      = PORT_DEFAULT;
            IpAddress = IP_DEFAULT;
        }
Exemple #24
0
        public ShellSettingsFlyoutViewModel(IRegionManager regionManager, IMessageService messageService)
            : base(regionManager)
        {
            //Prism.Unity.UnityContainerExtension container = Con
            localizerService = Prism.Ioc.ContainerLocator.Container.Resolve <ILocalizerService>();

            //this.localizerService = localizerService;
            //Prism.Ioc.ContainerLocator.Container.Resolve<ILocalizerService>(ServiceNames.LocalizerService);
        }
Exemple #25
0
 public MissingDependenciesConfigurationValidator(IFormatterEditorFactory formatterEditorFactory,
                                                  ILocalizerService localizerService, ISharedResourcesGlobalViewModel sharedResourcesGlobalViewModel,
                                                  IDependenciesService dependenciesService, DependencyFillHelper dependencyFillHelper)
 {
     _formatterEditorFactory         = formatterEditorFactory;
     _localizerService               = localizerService;
     _sharedResourcesGlobalViewModel = sharedResourcesGlobalViewModel;
     _dependenciesService            = dependenciesService;
     _dependencyFillHelper           = dependencyFillHelper;
 }
Exemple #26
0
        public UniconJournalViewModel(ILocalizerService localizerService,
                                      IFragmentOptionsViewModel fragmentOptionsViewModel,
                                      Func <IFragmentOptionGroupViewModel> fragmentOptionGroupViewModelgetFunc,
                                      Func <IFragmentOptionCommandViewModel> fragmentOptionCommandViewModelgetFunc,
                                      IApplicationGlobalCommands applicationGlobalCommands, ITypesContainer typesContainer, ILogService logService
                                      , IApplicationSettingsService applicationSettingsService, IJournalLoaderProvider journalLoaderProvider,
                                      IValueViewModelFactory valueViewModelFactory)

        {
            _localizerService          = localizerService;
            _applicationGlobalCommands = applicationGlobalCommands;
            _typesContainer            = typesContainer;
            _logService = logService;
            _applicationSettingsService = applicationSettingsService;
            _journalLoaderProvider      = journalLoaderProvider;
            _valueViewModelFactory      = valueViewModelFactory;
            IFragmentOptionGroupViewModel fragmentOptionGroupViewModel = fragmentOptionGroupViewModelgetFunc();

            fragmentOptionGroupViewModel.NameKey = "Device";
            IFragmentOptionCommandViewModel fragmentOptionCommandViewModel = fragmentOptionCommandViewModelgetFunc();

            fragmentOptionCommandViewModel.TitleKey = "Load";
            fragmentOptionCommandViewModel.IconKey  = IconResourceKeys.IconInboxIn;
            fragmentOptionGroupViewModel.FragmentOptionCommandViewModels.Add(fragmentOptionCommandViewModel);
            LoadCommand = new RelayCommand(OnLoadJournal, CanLoadExecute);
            fragmentOptionCommandViewModel.OptionCommand = LoadCommand;
            fragmentOptionsViewModel.FragmentOptionGroupViewModels.Add(fragmentOptionGroupViewModel);

            fragmentOptionCommandViewModel               = fragmentOptionCommandViewModelgetFunc();
            fragmentOptionCommandViewModel.TitleKey      = "Open";
            fragmentOptionCommandViewModel.IconKey       = IconResourceKeys.IconDiscUpload;
            fragmentOptionCommandViewModel.OptionCommand = new RelayCommand(OnExecuteLoadJournal);
            fragmentOptionGroupViewModel.FragmentOptionCommandViewModels.Add(fragmentOptionCommandViewModel);

            fragmentOptionCommandViewModel               = fragmentOptionCommandViewModelgetFunc();
            fragmentOptionCommandViewModel.TitleKey      = "Save";
            fragmentOptionCommandViewModel.IconKey       = IconResourceKeys.IconDiscDownload;
            fragmentOptionCommandViewModel.OptionCommand = new RelayCommand(OnExecuteSaveJournal);
            fragmentOptionGroupViewModel.FragmentOptionCommandViewModels.Add(fragmentOptionCommandViewModel);

            fragmentOptionCommandViewModel               = fragmentOptionCommandViewModelgetFunc();
            fragmentOptionCommandViewModel.TitleKey      = ApplicationGlobalNames.UiCommandStrings.SAVE_FOR_PRINT;
            fragmentOptionCommandViewModel.IconKey       = IconResourceKeys.IconPrintText;
            fragmentOptionCommandViewModel.OptionCommand = new RelayCommand(OnExecuteExportJournal);
            fragmentOptionGroupViewModel.FragmentOptionCommandViewModels.Add(fragmentOptionCommandViewModel);

            _loaderHooks = new LoaderHooks(
                () => { Table.Values.Clear(); }, list =>
            {
                Table.AddFormattedValueViewModel(list.Select(formattedValue =>
                                                             _valueViewModelFactory.CreateFormattedValueViewModel(formattedValue)).ToList());
            });
            FragmentOptionsViewModel = fragmentOptionsViewModel;
            CanExecuteJournalLoading = true;
        }
Exemple #27
0
        public static IReadOnlyList <IButtonsView> MapControllButtons(ILocalizerService localizer)
        {
            var list = new List <IButtonsView>();
            var cb   = MapControlsActionsTranslate(localizer);

            for (byte i = 0; i < cb.Count; i++)
            {
                list.Add(ButtonsView.MapControlBtns(i, cb[i]));
            }
            return(list);
        }
Exemple #28
0
 public RegexConditionsValidator(IFormatterEditorFactory formatterEditorFactory,
                                 ILocalizerService localizerService, ISharedResourcesGlobalViewModel sharedResourcesGlobalViewModel,
                                 IDependenciesService dependenciesService, DependencyFillHelper dependencyFillHelper, IFormatterInfoService formatterInfoService)
 {
     _formatterEditorFactory         = formatterEditorFactory;
     _localizerService               = localizerService;
     _sharedResourcesGlobalViewModel = sharedResourcesGlobalViewModel;
     _dependenciesService            = dependenciesService;
     _dependencyFillHelper           = dependencyFillHelper;
     _formatterInfoService           = formatterInfoService;
 }
Exemple #29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GenresController"/> class.
 /// </summary>
 ///
 /// <param name="repository">The repository.</param>
 /// <param name="logger">The logger.</param>
 /// <param name="mapper">The mapper.</param>
 /// <param name="localizer">The localizer.</param>
 public GenresController
 (
     IGenreRepository repository,
     ILogger <GenresController> logger,
     IMapper mapper,
     ILocalizerService localizer
 )
     : base(logger, mapper, localizer)
 {
     this.Repository = repository;
 }
 public ComPortConfigurationViewModelValidator(ILocalizerService localizerService)
 {
     //    RuleFor(model => model.SelectedParity).Must(parity => parity != Parity.None).WithMessage(
     //        localizerService.GetLocalizedString(ApplicationGlobalNames.StatusMessages.NULL_OR_EMPTY_MESSAGE));
     RuleFor(model => model.SelectedStopBits).Must(sb => sb != StopBits.None).WithMessage(
         localizerService.GetLocalizedString(ApplicationGlobalNames.StatusMessages.NULL_OR_EMPTY_MESSAGE));
     RuleFor(model => model.WaitAnswer).Must(sb => sb > 0).WithMessage(
         localizerService.GetLocalizedString(ApplicationGlobalNames.StatusMessages.MUST_BE_POSITIVE));
     RuleFor(model => model.WaitByte).Must(sb => sb > 0).WithMessage(
         localizerService.GetLocalizedString(ApplicationGlobalNames.StatusMessages.MUST_BE_POSITIVE));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PersonRepository"/> class.
 /// </summary>
 ///
 /// <param name="context">The context</param>
 /// <param name="localizer">The localizer.</param>
 /// <param name="lookupNormalizer">The lookup normalizer.</param>
 /// <param name="logger">The logger.</param>
 public PersonRepository
 (
     MovieContext context,
     ILocalizerService localizer,
     ILookupNormalizer lookupNormalizer,
     ILogger <PersonRepository> logger
 )
     : base(context, localizer, lookupNormalizer, logger)
 {
     // Nothing to do here.
 }
        /// <summary>
        /// CTOR
        /// </summary>
        public ShellSettingsFlyoutViewModel()
        {
            this.localizerService = Container.Resolve<ILocalizerService>(ServiceNames.LocalizerService);

            // create metro theme color menu items for the demo
            this.ApplicationThemes = ThemeManager.AppThemes
                                           .Select(a => new ApplicationTheme() { Name = a.Name, BorderColorBrush = a.Resources["BlackColorBrush"] as Brush, ColorBrush = a.Resources["WhiteColorBrush"] as Brush })
                                           .ToList();

            // create accent colors list
            this.AccentColors = ThemeManager.Accents
                                            .Select(a => new AccentColor() { Name = a.Name, ColorBrush = a.Resources["AccentColorBrush"] as Brush })
                                            .ToList();

            this.SelectedTheme = this.ApplicationThemes.FirstOrDefault();
            this.SelectedAccentColor = this.AccentColors.Where(c => c.Name.Equals("Cyan")).FirstOrDefault();
        }