예제 #1
0
        public Main(IEventAggregator eventAggregator, IPilotDialogService service, IPilotStorageCommandController pilotStorageCommandController)
        {
            _pilotStorageCommandController = pilotStorageCommandController;
            eventAggregator.Subscribe(this);
            InitColorScheme(service);

            Application.Current.Dispatcher.BeginInvoke(new Action(SubscribeHotKey));
        }
예제 #2
0
        private void InitColorScheme(IPilotDialogService pilotDialogService)
        {
            var accentColorObj = ColorConverter.ConvertFromString(pilotDialogService.AccentColor);

            if (accentColorObj == null)
            {
                return;
            }

            var accentColor = (Color)accentColorObj;

            ColorScheme.Initialize(accentColor, pilotDialogService.Theme);
        }
        public CardControlViewModel(IAttribute attribute, IType type, object initValue, bool isReadOnly,
                                    IPilotDialogService dialogService, IObjectsRepository repository, IObjectCardAutoComplete autoComplete,
                                    IAttributeFormatParser attributeFormatParser, bool editMode)
        {
            if (dialogService == null)
            {
                throw new ArgumentNullException(nameof(dialogService));
            }
            if (repository == null)
            {
                throw new ArgumentNullException(nameof(repository));
            }
            if (attributeFormatParser == null)
            {
                throw new ArgumentNullException(nameof(attributeFormatParser));
            }
            if (autoComplete == null)
            {
                throw new ArgumentNullException(nameof(autoComplete));
            }
            if (attribute == null)
            {
                throw new ArgumentNullException(nameof(attribute));
            }

            _type                  = type;
            _dialogService         = dialogService;
            _repository            = repository;
            _attributeFormatParser = attributeFormatParser;
            _autoComplete          = autoComplete;
            _editMode              = editMode;

            Attribute      = attribute;
            _originalValue = DValue.GetDValue(initValue);
            _value         = initValue;
            IsReadOnly     = isReadOnly;

            Format = _attributeFormatParser.GetAttributeFormat(Attribute.Configuration);
            if (_originalValue != null && (_originalValue.DateValue != null && Format == null))
            {
                Format = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern;
            }

            Culture = _attributeFormatParser.GetAttributeFormatCulture(Attribute.Configuration);
        }
예제 #4
0
        public ProjectCloneCreator(IObjectsRepository repository, IPilotDialogService pilotDialogService, IAttributeFormatParser attributeFormatParser,
                                   IObjectModifier modifier, IFileProvider fileProvider, ITabServiceProvider tabServiceProvider)
        {
            _repository            = repository;
            _pilotDialogService    = pilotDialogService;
            _attributeFormatParser = attributeFormatParser;
            _fileProvider          = fileProvider;
            _tabServiceProvider    = tabServiceProvider;
            _modifier = modifier;

            InitColorScheme(pilotDialogService);

            Icon = "menu_icon_dark.svg";
            if (pilotDialogService.Theme == ThemeNames.Jedi)
            {
                Icon = "menu_icon_light.svg";
            }
        }
예제 #5
0
        public ManagerEdition(IObjectsRepository repository,
                              IObjectModifier modifier,
                              IPilotDialogService dialogService,
                              ISearchService search,
                              IFileProvider fileProvider,
                              ITabServiceProvider tabServiceProvider)
        {
            var accentColor = (Color)ColorConverter.ConvertFromString(dialogService.AccentColor);

            ColorScheme.Initialize(accentColor);

            _repository         = repository;
            _modifier           = modifier;
            _search             = search;
            _fileProvider       = fileProvider;
            _tabServiceProvider = tabServiceProvider;
            _dialogService      = dialogService;
            InitializeObjects();
        }
예제 #6
0
 public ProjectCloneToolbar(IObjectsRepository repository, IPilotDialogService pilotDialogService, IAttributeFormatParser attributeFormatParser,
                            IObjectModifier modifier, IFileProvider fileProvider, ITabServiceProvider tabServiceProvider)
 {
     _projectCloneCreator = new ProjectCloneCreator(repository, pilotDialogService, attributeFormatParser, modifier, fileProvider, tabServiceProvider);
 }
 public ProjectCardPageViewModel(CreationInfo creationInfo, IObjectsRepository repository, IPilotDialogService dialogService, IAttributeFormatParser attributeFormatParser)
 {
     _creationInfo        = creationInfo;
     _objectCardViewModel = new ObjectCardViewModel(repository, dialogService, attributeFormatParser);
     _objectCardViewModel.IsValidInputChanged += OnIsValidInputChanged;
 }