Пример #1
0
        public ObjectsRepository(DataProvider dataProvider)
        {
            _dataProvider        = dataProvider;
            _variablesRepository = dataProvider.VariablesRepository;
            _variablesRepository.VariableChanged += (variable, oldName) =>
            {
                UpdateAllFormattedText();
                var nameIsChanged = !Common.IsSameName(variable.Name, oldName);
                if (nameIsChanged)
                {
                    UpdateAllAssignedActions(variable, oldName);
                }
                RefreshSelected();
            };
            _variablesRepository.VariableRemoved += variableName =>
            {
                RemoveFromAssignedObjects(ActionTargetType.Variable, variableName);
            };
            ViewModels.CollectionChanged += OnViewModelsChanged;

            DispatcherHelper.Initialize();
            Messenger.Default.Register <NotificationMessage>(this, ProcessMessage);
            Messenger.Default.Register <NotificationMessage <uint> >(this, ProcessId);
            Messenger.Default.Register <NotificationMessage <bool> >(this, ProcessBool);
        }
Пример #2
0
 public WordRepository(DataProvider dataProvider)
 {
     _variablesRepository = dataProvider.VariablesRepository;
     _projectSettings     = dataProvider.ProjectRepository.ProjectSettings;
     _dialogsHelper       = dataProvider.DialogsManager;
     _tagReplacer         = new TagReplacer(_variablesRepository);
 }