コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BrowserViewModel" /> class.
 /// </summary>
 /// <param name="scannerService">The scanner.</param>
 /// <param name="dispatcher">The dispatcher.</param>
 /// <param name="filteringService">The filtering service.</param>
 /// <param name="menuService">Blah</param>
 /// <param name="referenceAdapters">The reference adapters.</param>
 /// <param name="publicTransport"></param>
 public BrowserViewModel(IDirectoryScannerService <StorableTaggedFile> scannerService,
                         IDispatcher dispatcher,
                         IFilteringService filteringService,
                         IMenuService menuService,
                         IReferenceAdapters referenceAdapters,
                         IPublicTransport publicTransport)
 {
     this.publicTransport = Guard.IsNull(() => publicTransport);
     scannerService.Guard("scannerService");
     dispatcher.Guard("dispatcher");
     filteringService.Guard("filteringService");
     menuService.Guard("menuService");
     referenceAdapters.Guard("referenceAdapters");
     // TODO: Localize
     menuService.Register(new CallbackMenuItem(null, "Library", new CallbackMenuItem(OnAddFiles, "Add Files")));
     this.scannerService                = Guard.IsNull(() => scannerService);
     this.dispatcher                    = Guard.IsNull(() => dispatcher);
     this.filteringService              = Guard.IsNull(() => filteringService);
     this.scannerService.ScanCompleted += ScannerServiceOnScanCompleted;
     this.scannerService.ScanProgress  += ScannerServiceOnScanProgress;
     localizedMemberPaths               = filteringService.FilterColumns.Select(x => new Alias <string>(x, x)).ToList(); // TODO: Localize
     searchTimer = new DispatcherTimer {
         Interval = TimeSpan.FromMilliseconds(500)
     };
     searchTimer.Tick += SearchTimerOnTick;
     FirstColumn       = new DynamicColumnViewModel(dispatcher);
     SecondColumn      = new DynamicColumnViewModel(dispatcher);
     ThirdColumn       = new DynamicColumnViewModel(dispatcher);
     InitViewModels();
     BuildColumns();
     InitFirstColumn();
 }
コード例 #2
0
        public LogMessages()
        {
            ((ViewInformation)Info).Description = DESCRIPTION;
            presenter = new LogMessagesControl
            {
                DataContext = this,
            };

            Messages = new ObservableCollection <ILogEntry>();

            PropertyChanged += PropertyChangedHandler;

            var dt = new DispatcherTimer(DispatcherPriority.Normal)
            {
                Interval = TimeSpan.FromMilliseconds(200),
            };

            dt.Tick += UpdateTick;
            dt.Start();

            filteringService = ServiceLocator.Instance.Get <IFilteringService <IFilter> >();
            if (filteringService != null)
            {
                if (filteringService is INotifyPropertyChanged notify)
                {
                    notify.PropertyChanged += (sender, e) => ApplyFiltering();
                }
            }

            extractingService = ServiceLocator.Instance.Get <IExtractingService <IExtractor> >();
            if (extractingService != null)
            {
                if (extractingService is INotifyPropertyChanged notify)
                {
                    notify.PropertyChanged += (sender, e) => ApplyExtracting();
                }
            }

            Preferences = ServiceLocator.Instance.Get <IUserPreferences>();
            if (Preferences != null)
            {
                if (Preferences is INotifyPropertyChanged notify)
                {
                    notify.PropertyChanged += (sender, args) =>
                    {
                        var prop = args.PropertyName;
                        switch (prop)
                        {
                        case "SelectedTimeFormatOption":
                        case "ConvertUtcTimesToLocalTimeZone":
                        case "SelectedDateOption":
                            rebuildList = true;
                            break;
                        }
                    };
                }
            }

            InitialiseToolbar();
        }
コード例 #3
0
 public ClothesServices(ImageService imageService, IDatabaseConnectionService connectionService, IEventAggregator eventAggregator, IFilteringService filteringService)
 {
     this.eventAggregator  = eventAggregator;
     dbConnection          = connectionService;
     this.imageService     = imageService;
     this.filteringService = filteringService;
     eventAggregator.GetEvent <ClothesListRefreshRequestedEvent>().Subscribe(RefreshClothesListAsync);
     eventAggregator.GetEvent <RefreshClothesFilteringEvent>().Subscribe(RefreshFiltering);
 }
コード例 #4
0
        public LogStateViewModel(
            IRules filtering,
            ILogVisualizer logVisualizer,
            IFilteringService filteringService)
        {
            LogVisualizer = logVisualizer;

            _filtering        = filtering;
            _filteringService = filteringService;
            _filteringService.FilteringRequested += FilteringServiceOnFilteringRequested;
        }
コード例 #5
0
        public ClothesFilteringViewModel(IEventAggregator eventAggregator, ITypeFilteringConditionsService typeFilteringConditionsService, IFilteringService filteringService)
        {
            this.eventAggregator = eventAggregator;
            this.typeFilteringConditionsService = typeFilteringConditionsService;
            this.filteringService = filteringService;

            SelectedFilter = FilterTabs[0];

            filteringService.TypesFilterListUpdated += FilteringService_TypesFilterListUpdated;
            SelectedTypeFilter = TypesFilterList[0];
        }
コード例 #6
0
 public LogVisualizerViewModel(IFoldingService foldingService,
                               IRules rules, IFilteringService filteringService,
                               IVisualTransformers visualTransformers,
                               ISearchService searchService)
 {
     _foldingService       = foldingService;
     _rules                = rules;
     _filteringService     = filteringService;
     _searchService        = searchService;
     LineTransformers      = visualTransformers;
     ContextMenuExtensions = new BindableCollection <IEditorContextMenuItem>()
     {
         new EditorContextMenuItem("Show logs before", ShowLogsBefore),
         new EditorContextMenuItem("Show logs after", ShowLogsAfter),
         new EditorContextMenuSeparator(),
         new EditorContextMenuItem("Filter by selection", FilterBySelection, PackIconKind.AlertOutline),
         new EditorContextMenuItem("Filter out selection", FilterOutSelection),
         new EditorContextMenuSeparator(),
         new EditorContextMenuItem("Add selection to Search panel", AddToSearch, PackIconKind.SearchWeb)
     };
 }
コード例 #7
0
ファイル: LogMessages.cs プロジェクト: Irmanster/mngSentinel
        public LogMessages()
        {
            ((ViewInformation)Info).Description = DESCRIPTION;
            presenter = new LogMessagesControl {
                DataContext = this
            };

            Messages         = new ObservableCollection <ILogEntry>();
            PropertyChanged += PropertyChangedHandler;

            DispatcherTimer dt = new DispatcherTimer(DispatcherPriority.Normal)
            {
                Interval = TimeSpan.FromMilliseconds(200)
            };

            dt.Tick += UpdateTick;
            dt.Start();

            filteringService = ServiceLocator.Instance.Get <IFilteringService <IFilter> >();
            if (filteringService != null)
            {
                var notify = filteringService as INotifyPropertyChanged;
                if (notify != null)
                {
                    notify.PropertyChanged += (sender, e) => ApplyFiltering();
                }
            }

            extractingService = ServiceLocator.Instance.Get <IExtractingService <IExtractor> >();
            if (extractingService != null)
            {
                var notify = extractingService as INotifyPropertyChanged;
                if (notify != null)
                {
                    notify.PropertyChanged += (sender, e) => ApplyExtracting();
                }
            }

            InitialiseToolbar();
        }
コード例 #8
0
ファイル: LogMessages.cs プロジェクト: jkoplo/Sentinel
        public LogMessages()
        {
            ((ViewInformation) Info).Description = DESCRIPTION;
            presenter = new LogMessagesControl { DataContext = this };

            Messages = new ObservableCollection<ILogEntry>();
            PropertyChanged += PropertyChangedHandler;

            DispatcherTimer dt = new DispatcherTimer(DispatcherPriority.Normal)
                                     {
                                         Interval = TimeSpan.FromMilliseconds(200)
                                     };
            dt.Tick += UpdateTick;
            dt.Start();

            filteringService = ServiceLocator.Instance.Get<IFilteringService<IFilter>>();
            if (filteringService != null)
            {
                var notify = filteringService as INotifyPropertyChanged;
                if (notify != null)
                {
                    notify.PropertyChanged += (sender, e) => ApplyFiltering();
                }
            }

            extractingService = ServiceLocator.Instance.Get<IExtractingService<IExtractor>>();
            if (extractingService != null)
            {
                var notify = extractingService as INotifyPropertyChanged;
                if (notify != null)
                {
                    notify.PropertyChanged += (sender, e) => ApplyExtracting();
                }
            }

            InitialiseToolbar();
        }