Пример #1
0
        private ResourceManager([NotNull] ISourceFilesProvider sourceFilesProvider, [NotNull] IConfiguration configuration)
        {
            Configuration = configuration;

            _sourceFilesProvider = sourceFilesProvider;
            TableEntries         = ResourceEntities.ObservableSelectMany(entity => entity.Entries);
        }
Пример #2
0
        private ResourceManager([NotNull] ISourceFilesProvider sourceFilesProvider)
        {
            Contract.Requires(sourceFilesProvider != null);

            _sourceFilesProvider = sourceFilesProvider;
            _tableEntries        = _resourceEntities.ObservableSelectMany(entity => entity.Entries);
        }
Пример #3
0
        public ResourceViewModel([NotNull] ResourceManager resourceManager, [NotNull] Configuration configuration, [NotNull] ISourceFilesProvider sourceFilesProvider, [NotNull] CodeReferenceTracker codeReferenceTracker, [NotNull] ITracer tracer, [NotNull] PerformanceTracer performanceTracer)
        {
            Contract.Requires(resourceManager != null);
            Contract.Requires(configuration != null);
            Contract.Requires(sourceFilesProvider != null);
            Contract.Requires(codeReferenceTracker != null);
            Contract.Requires(tracer != null);
            Contract.Requires(performanceTracer != null);

            _resourceManager      = resourceManager;
            _configuration        = configuration;
            _sourceFilesProvider  = sourceFilesProvider;
            _codeReferenceTracker = codeReferenceTracker;
            _tracer            = tracer;
            _performanceTracer = performanceTracer;

            _resourceTableEntiyCountUpdateThrottle = new DispatcherThrottle(() => OnPropertyChanged(nameof(ResourceTableEntryCount)));

            _resourceTableEntries = _selectedEntities.ObservableSelectMany(entity => entity.Entries);
            _resourceTableEntries.CollectionChanged += (_, __) => _resourceTableEntiyCountUpdateThrottle.Tick();

            _restartFindCodeReferencesThrottle = new DispatcherThrottle(DispatcherPriority.ContextIdle, () => BeginFindCodeReferences(sourceFilesProvider.SourceFiles));

            resourceManager.TableEntries.CollectionChanged += (_, __) => _restartFindCodeReferencesThrottle.Tick();

            resourceManager.LanguageChanged += ResourceManager_LanguageChanged;
        }
Пример #4
0
        public ResourceManager(ISourceFilesProvider sourceFilesProvider, IConfiguration configuration, ITracer tracer)
        {
            Configuration = configuration;

            _sourceFilesProvider = sourceFilesProvider;
            _tracer      = tracer;
            TableEntries = ResourceEntities.ObservableSelectMany(entity => entity.Entries);
        }
        public ResourceViewModel(ResourceManager resourceManager, IConfiguration configuration, ISourceFilesProvider sourceFilesProvider, CodeReferenceTracker codeReferenceTracker, ITracer tracer, PerformanceTracer performanceTracer)
        {
            ResourceManager       = resourceManager;
            _configuration        = configuration;
            _sourceFilesProvider  = sourceFilesProvider;
            _codeReferenceTracker = codeReferenceTracker;
            _tracer            = tracer;
            _performanceTracer = performanceTracer;

            ResourceTableEntries = SelectedEntities.ObservableSelectMany(entity => entity.Entries);
            ResourceTableEntries.CollectionChanged += (_, __) => ResourceTableEntries_CollectionChanged();

            resourceManager.LanguageChanged += ResourceManager_LanguageChanged;
        }
Пример #6
0
        private ResourceManager(Configuration configuration, CodeReferenceTracker codeReferenceTracker, ITracer tracer, ISourceFilesProvider sourceFilesProvider, PerformanceTracer performanceTracer)
        {
            Contract.Requires(configuration != null);
            Contract.Requires(codeReferenceTracker != null);
            Contract.Requires(tracer != null);
            Contract.Requires(sourceFilesProvider != null);
            Contract.Requires(performanceTracer != null);

            _configuration        = configuration;
            _codeReferenceTracker = codeReferenceTracker;
            _tracer = tracer;
            _sourceFilesProvider  = sourceFilesProvider;
            _performanceTracer    = performanceTracer;
            _resourceTableEntries = _selectedEntities.ObservableSelectMany(entity => entity.Entries);
        }
Пример #7
0
        public ResourceViewModel([NotNull] ResourceManager resourceManager, [NotNull] Configuration configuration, [NotNull] ISourceFilesProvider sourceFilesProvider, [NotNull] CodeReferenceTracker codeReferenceTracker, [NotNull] ITracer tracer, [NotNull] PerformanceTracer performanceTracer)
        {
            Contract.Requires(resourceManager != null);
            Contract.Requires(configuration != null);
            Contract.Requires(sourceFilesProvider != null);
            Contract.Requires(codeReferenceTracker != null);
            Contract.Requires(tracer != null);
            Contract.Requires(performanceTracer != null);

            ResourceManager       = resourceManager;
            _configuration        = configuration;
            _sourceFilesProvider  = sourceFilesProvider;
            _codeReferenceTracker = codeReferenceTracker;
            _tracer            = tracer;
            _performanceTracer = performanceTracer;

            ResourceTableEntries = SelectedEntities.ObservableSelectMany(entity => entity.Entries);
            ResourceTableEntries.CollectionChanged += (_, __) => ResourceTableEntries_CollectionChanged();

            resourceManager.TableEntries.CollectionChanged += (_, __) => BeginFindCodeReferences();
            resourceManager.LanguageChanged += ResourceManager_LanguageChanged;
        }