コード例 #1
0
        public NotificationService(IViewModelFactory viewModelFactory, IDispatcherService dispatcherService,
            INotificationPositionService notificationPositionService)
        {
            Argument.IsNotNull(() => viewModelFactory);
            Argument.IsNotNull(() => dispatcherService);
            Argument.IsNotNull(() => notificationPositionService);

            _viewModelFactory = viewModelFactory;
            _dispatcherService = dispatcherService;
            _notificationPositionService = notificationPositionService;

            CurrentNotifications = new ObservableCollection<INotification>();

            DefaultBorderBrush = Brushes.Black;
            DefaultBackgroundBrush = Brushes.DodgerBlue;
            DefaultFontBrush = Brushes.WhiteSmoke;

            var app = Application.Current;
            if (app != null)
            {
                var accentColorBrush = app.TryFindResource("AccentColorBrush") as SolidColorBrush;
                if (accentColorBrush != null)
                {
                    DefaultBorderBrush = accentColorBrush;
                    DefaultBackgroundBrush = new SolidColorBrush(Color.FromArgb(255, 245, 245, 245));
                    DefaultFontBrush = Brushes.Black;
                    accentColorBrush.Color.CreateAccentColorResourceDictionary();
                }

                _mainWindow = app.MainWindow;
            }
        }
コード例 #2
0
        public Callout(IDispatcherService dispatcherService)
        {
            Guard.ArgumentNotNull(() => dispatcherService);

            this.dispatcherService = dispatcherService;
            this.MaxNumberOfButtons = 3;
        }
コード例 #3
0
        /// <summary>
        /// Initializes the <see cref="DispatcherObservableObject"/> class.
        /// </summary>
        static DispatcherObservableObject()
        {
            var serviceLocator = IoCConfiguration.DefaultServiceLocator;
            serviceLocator.RegisterTypeIfNotYetRegistered<IDispatcherService, DispatcherService>();

            _dispatcherService = serviceLocator.ResolveType<IDispatcherService>();
        }
コード例 #4
0
        public DialogService(IDispatcherService dispatcher, string applicationName)
        {
            if (dispatcher == null) throw new ArgumentNullException(nameof(dispatcher));

            Dispatcher = dispatcher;
            ApplicationName = applicationName;
        }
コード例 #5
0
        public SystemIdentificationViewModel(ISystemIdentificationService systemIdentificationService, IDispatcherService dispatcherService)
        {
            Argument.IsNotNull(() => systemIdentificationService);

            _systemIdentificationService = systemIdentificationService;
            _dispatcherService = dispatcherService;
        }
コード例 #6
0
ファイル: MessageService.cs プロジェクト: Catel/Catel
        /// <summary>
        /// Initializes a new instance of the <see cref="MessageService"/> class.
        /// </summary>
        /// <param name="dispatcherService">The dispatcher service.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="dispatcherService"/> is <c>null</c>.</exception>
        public MessageService(IDispatcherService dispatcherService)
        {
            Argument.IsNotNull("dispatcherService", dispatcherService);

            _dispatcherService = dispatcherService;
            Initialize();
        }
コード例 #7
0
        public LogViewerViewModel(ITypeFactory typeFactory, IDispatcherService dispatcherService, LogViewerLogListener logViewerLogListener)
        {
            Argument.IsNotNull(() => typeFactory);
            Argument.IsNotNull(() => dispatcherService);
            Argument.IsNotNull(() => logViewerLogListener);

            _typeFactory = typeFactory;
            _dispatcherService = dispatcherService;
            _logViewerLogListener = logViewerLogListener;

            LogListenerType = typeof(LogViewerLogListener);
            ShowDebug = true;
            ShowInfo = true;
            ShowWarning = true;
            ShowError = true;

            var typeNames = new FastObservableCollection<string>
            {
                defaultComboBoxItem
            };

            TypeNames = typeNames;

            ResetEntriesCount();
        }
コード例 #8
0
 internal FileOpenModalDialog(IDispatcherService dispatcher)
     : base(dispatcher)
 {
     Dialog = new CommonOpenFileDialog { EnsureFileExists = true };
     Filters = new List<FileDialogFilter>();
     FilePaths = new List<string>();
 }
コード例 #9
0
        public ProgressPleaseWaitService(IDispatcherService dispatcherService, IDependencyResolver dependencyResolver)
            : base(dispatcherService)
        {
            Argument.IsNotNull(() => dependencyResolver);

            _dependencyResolver = dependencyResolver;
        }
コード例 #10
0
ファイル: LocationServiceBase.cs プロジェクト: Catel/Catel
        /// <summary>
        /// Initializes a new instance of the <see cref="LocationServiceBase"/> class.
        /// </summary>
        /// <param name="dispatcherService">The dispatcher service.</param>
        protected LocationServiceBase(IDispatcherService dispatcherService)
        {
            Argument.IsNotNull("dispatcherService", dispatcherService);

            _dispatcherService = dispatcherService;

            Initialize();
        }
コード例 #11
0
        public PackageBatchService(IUIVisualizerService uiVisualizerService, IDispatcherService dispatcherService)
        {
            Argument.IsNotNull(() => uiVisualizerService);
            Argument.IsNotNull(() => dispatcherService);

            _uiVisualizerService = uiVisualizerService;
            _dispatcherService = dispatcherService;
        }
コード例 #12
0
        public BehaviorWorkspaceProvider(IWorkspaceManager workspaceManager, IWorkspaceBehavior workspaceBehavior, IDispatcherService dispatcherService) 
            : base(workspaceManager)
        {
            Argument.IsNotNull(() => workspaceBehavior);
            Argument.IsNotNull(() => dispatcherService);

            _workspaceBehavior = workspaceBehavior;
            _dispatcherService = dispatcherService;
        }
コード例 #13
0
        public CsvTextEditorAutoCompleteProjectWatcher(IProjectManager projectManager, IServiceLocator serviceLocator,
                                                       IDispatcherService dispatcherService)
            : base(projectManager)
        {
            Argument.IsNotNull(() => serviceLocator);
            Argument.IsNotNull(() => dispatcherService);

            _serviceLocator    = serviceLocator;
            _dispatcherService = dispatcherService;
        }
コード例 #14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BindableUser"/> class.
 /// </summary>
 internal BindableUser(
     IMessenger messenger,
     IDiscordService discordService,
     QuarrelClient quarrelClient,
     IDispatcherService dispatcherService,
     User user) :
     base(messenger, discordService, quarrelClient, dispatcherService)
 {
     _user = user;
 }
コード例 #15
0
        public PlayerInventoryViewModel(IDispatcherService dispatcherService, IDialogService dialogService, string steamID)
        {
            _dispatcherService = dispatcherService;
            _dialogService     = dialogService;
            SteamID            = steamID;

            Title = string.Format("玩家: {0} 的背包", SteamID);

            _ = GetPlayerInventory();
        }
コード例 #16
0
 internal BindableAttachment(
     IMessenger messenger,
     IDiscordService discordService,
     QuarrelClient quarrelClient,
     IDispatcherService dispatcherService,
     Attachment attachment) :
     base(messenger, discordService, quarrelClient, dispatcherService)
 {
     _attachment = attachment;
 }
コード例 #17
0
ファイル: MainViewModel.cs プロジェクト: llenroc/Orc.Squirrel
        public MainViewModel(IUIVisualizerService uiVisualizerService, IDispatcherService dispatcherService)
        {
            Argument.IsNotNull(() => uiVisualizerService);
            Argument.IsNotNull(() => dispatcherService);

            _uiVisualizerService = uiVisualizerService;
            _dispatcherService = dispatcherService;

            ShowInstalledDialog = new Command(OnShowInstalledDialogExecute);
        }
コード例 #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BindableSelfUser"/> class.
 /// </summary>
 internal BindableSelfUser(
     IMessenger messenger,
     IDiscordService discordService,
     QuarrelClient quarrelClient,
     IDispatcherService dispatcherService,
     SelfUser selfUser) :
     base(messenger, discordService, quarrelClient, dispatcherService)
 {
     _selfUser = selfUser;
 }
コード例 #19
0
ファイル: MainVM.cs プロジェクト: msin/PluginAppDemo
        public void OnLoaded()
        {
            _dispatcherService = this.GetService<IDispatcherService>();
            _splashScreenService = this.GetService<ISplashScreenService>();
            _frameService = this.GetService<INavigationService>();

            var plugins = IoC.Instance.GetAllInstances<IPlugin>();
            Plugins = new ObservableCollection<IPlugin>(plugins);
            SelectedPlugin = Plugins.FirstOrDefault();
        }
コード例 #20
0
ファイル: FileNodeService.cs プロジェクト: sk8tz/LogViewer
        public FileNodeService(ILogReaderService logReaderService, IDispatcherService dispatcherService, IFilterService filterService)
        {
            Argument.IsNotNull(() => logReaderService);
            Argument.IsNotNull(() => dispatcherService);
            Argument.IsNotNull(() => filterService);

            _logReaderService = logReaderService;
            _dispatcherService = dispatcherService;
            _filterService = filterService;
        }
コード例 #21
0
 public DashboardController(IDispatcherService dispatcherService, IDashboardService dashboardService, ICarService carService, ICompanyService companyService, IRequestService requestService)
 {
     this._dispatcherService   = dispatcherService;
     this._dashboardService    = dashboardService;
     this._carService          = carService;
     this._companyService      = companyService;
     this._requestService      = requestService;
     this.ApplicationDbContext = new Models.ApplicationDbContext();
     this.UserManager          = new UserManager <ApplicationUser>(new UserStore <ApplicationUser>(this.ApplicationDbContext));
 }
コード例 #22
0
        public FileNodeService(ILogReaderService logReaderService, IDispatcherService dispatcherService, IFilterService filterService)
        {
            Argument.IsNotNull(() => logReaderService);
            Argument.IsNotNull(() => dispatcherService);
            Argument.IsNotNull(() => filterService);

            _logReaderService  = logReaderService;
            _dispatcherService = dispatcherService;
            _filterService     = filterService;
        }
コード例 #23
0
        public SettingsViewModel(Settings settings, ILogControlService logControlService, IDispatcherService dispatcherService)
        {
            Argument.IsNotNull(() => settings);
            Argument.IsNotNull(() => logControlService);
            Argument.IsNotNull(() => dispatcherService);

            Settings           = settings;
            _logControlService = logControlService;
            _dispatcherService = dispatcherService;
        }
コード例 #24
0
ファイル: SettingsViewModel.cs プロジェクト: icygit/Orchestra
        public SettingsViewModel(Settings settings, ILogControlService logControlService, IDispatcherService dispatcherService)
        {
            Argument.IsNotNull(() => settings);
            Argument.IsNotNull(() => logControlService);
            Argument.IsNotNull(() => dispatcherService);

            Settings = settings;
            _logControlService = logControlService;
            _dispatcherService = dispatcherService;
        }
コード例 #25
0
        public SearchHighlight()
        {
            var dependencyResolver = this.GetDependencyResolver();

            _dispatcherService      = dependencyResolver.Resolve <IDispatcherService>();
            _searchHighlightService = dependencyResolver.Resolve <ISearchHighlightService>();

            _searchHighlightService.Highlighting += OnSearchHighlightServiceHighlighting;
            _searchHighlightService.Highlighted  += OnSearchHighlightServiceHighlighted;
        }
コード例 #26
0
        /// <summary>
        /// Executes the specified delegate asynchronously with the specified arguments on the thread that the Dispatcher was created on.
        /// </summary>
        /// <param name="dispatcherService">The dispatcher service.</param>
        /// <param name="action">The action.</param>
        /// <returns>The task representing the action.</returns>
        public static async Task InvokeAsync(this IDispatcherService dispatcherService, Action action)
        {
            var dispatcher = dispatcherService.CurrentDispatcher;

#if NET40
            await DispatcherExtensions.InvokeAsync(dispatcher, action);
#else
            await dispatcher.InvokeAsync(action);
#endif
        }
コード例 #27
0
 Task <long> DoBehcmark(IDispatcherService service, IUIAwaiter awaiter, IBenchmarkItem target)
 {
     return(Task.Factory.StartNew <long>(() =>
     {
         using (var token = awaiter.BeginAwaiting(() => target.Benchmark())) {
             service.BeginInvoke(() => token.Run());
             return token.ElapsedMilliseconds;
         }
     }, TaskCreationOptions.LongRunning));
 }
コード例 #28
0
        protected ChildWindowViewModel(Window window, uint messageCode)
        {
            this._DispatcherService = SimpleIoc.Default.GetInstance <IDispatcherService>();
            this._HandleRepository  = SimpleIoc.Default.GetInstance <IHandleRepositoryViewModel <T> >();

            this._Window     = window;
            this.MessageCode = messageCode;

            this._Window.Loaded += this.OnLoaded;
        }
コード例 #29
0
        public DialogService([NotNull] IDispatcherService dispatcher, string applicationName)
        {
            if (dispatcher == null)
            {
                throw new ArgumentNullException(nameof(dispatcher));
            }

            Dispatcher      = dispatcher;
            ApplicationName = applicationName;
        }
コード例 #30
0
        public PluginSelectedToPresetExportListCommandContainer(ICommandManager commandManager,
                                                                IServiceLocator serviceLocator
                                                                )
            : base(Commands.Plugin.SelectedToPresetExportList, commandManager, serviceLocator)
        {
            _applicationService = ServiceLocator.ResolveType <IApplicationService>();
            _dispatcherService  = ServiceLocator.ResolveType <IDispatcherService>();
            _licenseService     = ServiceLocator.ResolveType <ILicenseService>();

            _globalFrontendService.SelectedPlugins.CollectionChanged += OnSelectedPluginsListChanged;
        }
コード例 #31
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BreatheServices"/> class.
 /// </summary>
 /// <param name="dispatcherService">The dispatcher service.</param>
 /// <param name="dialogService">The dialog service.</param>
 public BreatheServices(
     IDispatcherService dispatcherService,
     IDialogService dialogService,
     IAdapterWrapper bluetoothManager,
     IFitbitService fitbitService)
 {
     this.DispatcherService = dispatcherService;
     this.DialogService     = dialogService;
     this.BluetoothManager  = bluetoothManager;
     this.FitbitService     = fitbitService;
 }
        public DialogLicenseVisualizerService(IUIVisualizerService uiVisualizerService, ILicenseInfoService licenseInfoService,
                                              IDispatcherService dispatcherService)
        {
            Argument.IsNotNull(() => uiVisualizerService);
            Argument.IsNotNull(() => licenseInfoService);
            Argument.IsNotNull(() => dispatcherService);

            _uiVisualizerService = uiVisualizerService;
            _licenseInfoService  = licenseInfoService;
            _dispatcherService   = dispatcherService;
        }
コード例 #33
0
        public MailListViewModel(IEventAggregator eventAggregator, IDispatcherService dispatcherService,
                                 IEmailService emailService)
        {
            this.eventAggregator   = eventAggregator;
            this.dispatcherService = dispatcherService;
            this.emailService      = emailService;

            EmailFolderChangeEvent evt = eventAggregator.GetEvent <EmailFolderChangeEvent>();

            evt.Subscribe(OnEmailFolderChanged);
        }
        public InvalidateCommandManagerOnViewModelInitializationAuditor(ICommandManager commandManager,
                                                                        IDispatcherService dispatcherService)
        {
            Argument.IsNotNull(() => commandManager);
            Argument.IsNotNull(() => dispatcherService);

            _commandManager    = commandManager;
            _dispatcherService = dispatcherService;

            _timer = new Timer(OnTimerTick, null, Timeout.InfiniteTimeSpan, Timeout.InfiniteTimeSpan);
        }
コード例 #35
0
 Task <long> DoCycle(IDispatcherService dispatcher, IUIAwaiter awaiter, IBenchmarkItem target, object uiControl)
 {
     return(DoSetup(dispatcher, awaiter, target, uiControl)
            .ContinueWith(_ =>
                          DoBehcmark(dispatcher, awaiter, target).Result)
            .ContinueWith(run =>
     {
         DoTearDown(dispatcher, awaiter, target, uiControl).Wait();
         return run.Result;
     }));
 }
コード例 #36
0
        public DialogLicenseVisualizerService(IUIVisualizerService uiVisualizerService, ILicenseInfoService licenseInfoService,
            IDispatcherService dispatcherService)
        {
            Argument.IsNotNull(() => uiVisualizerService);
            Argument.IsNotNull(() => licenseInfoService);
            Argument.IsNotNull(() => dispatcherService);

            _uiVisualizerService = uiVisualizerService;
            _licenseInfoService = licenseInfoService;
            _dispatcherService = dispatcherService;
        }
コード例 #37
0
 public PhotoViewModelFactory(
     IConfigProvider configProvider,
     IDispatcherService dispatcherService,
     IImageSourceLoader imageSourceLoader,
     IViewerCommands viewerCommands)
 {
     _configProvider    = configProvider;
     _dispatcherService = dispatcherService;
     _imageSourceLoader = imageSourceLoader;
     _viewerCommands    = viewerCommands;
 }
コード例 #38
0
 internal BindableCategoryChannel(
     IMessenger messenger,
     IClipboardService clipboardService,
     IDiscordService discordService,
     QuarrelClient quarrelClient,
     IDispatcherService dispatcherService,
     CategoryChannel channel,
     GuildMember selfMember) :
     base(messenger, clipboardService, discordService, quarrelClient, dispatcherService, channel, selfMember)
 {
 }
コード例 #39
0
ファイル: RelayCommand.cs プロジェクト: Elvagan/TaskChecker
        /// <summary>
        /// Initializes a new instance of the <see cref="RelayCommand"/> class.
        /// </summary>
        /// <param name="execute">The execute.</param>
        /// <param name="canExecute">The can execute.</param>
        /// <param name="dispatcherService">The dispatcher service.</param>
        /// <exception cref="ArgumentNullException">execute</exception>
        public RelayCommand(Action <object> execute, Predicate <object> canExecute, IDispatcherService dispatcherService)
        {
            if (execute == null)
            {
                throw new ArgumentNullException(nameof(execute));
            }

            _executeWithParams    = execute;
            _canExecuteWithParams = canExecute;
            _dispatcherService    = dispatcherService;
        }
コード例 #40
0
 internal BindableChannelGroup(
     IMessenger messenger,
     IDiscordService discordService,
     QuarrelClient quarrelClient,
     IDispatcherService dispatcherService,
     BindableCategoryChannel?key) :
     base(messenger, discordService, quarrelClient, dispatcherService)
 {
     Key      = key;
     Children = new ObservableCollection <BindableChannel>();
 }
コード例 #41
0
        ICommand wrongBookLocationCleanAllCommand; //对应按钮的事件

        public WrongBookLocationViewModel(IUnityContainer container, IRegionManager regionManager)
        {
            this.container         = container;
            this.regionManager     = regionManager;
            this.eventAggregator   = container.Resolve <IEventAggregator>();
            this.dispatcherService = container.Resolve <IDispatcherService>();
            //初始化控件用到的变量
            this.onThisShelfAllBookList           = new ObservableCollection <BookItemOfWrongLocation>();
            this.notOnThisShelfBookList           = new ObservableCollection <BookItemOfWrongLocation>();
            this.wrongBookLocationCleanAllCommand = new DelegateCommand(wrongBookLocationCleanAllCommandExecute, wrongBookLocationCleanAllCommandCanExecute);
        }
コード例 #42
0
        public AutomaticSupportService(IProcessService processService, IDispatcherService dispatcherService)
        {
            Argument.IsNotNull(() => processService);
            Argument.IsNotNull(() => dispatcherService);

            _processService    = processService;
            _dispatcherService = dispatcherService;

            _startedTime          = DateTime.Now;
            CommandLineParameters = string.Empty;
        }
コード例 #43
0
ファイル: MessageService.cs プロジェクト: rchcomm/Orchestra
        public MessageService(IDispatcherService dispatcherService, IUIVisualizerService uiVisualizerService, IViewModelFactory viewModelFactory)
            : base(dispatcherService)
        {
            Argument.IsNotNull(() => dispatcherService);
            Argument.IsNotNull(() => uiVisualizerService);
            Argument.IsNotNull(() => viewModelFactory);

            _dispatcherService   = dispatcherService;
            _uiVisualizerService = uiVisualizerService;
            _viewModelFactory    = viewModelFactory;
        }
コード例 #44
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BindableItem"/> class.
 /// </summary>
 public BindableItem(
     IMessenger messenger,
     IDiscordService discordService,
     QuarrelClient quarrelClient,
     IDispatcherService dispatcherService)
 {
     _messenger         = messenger;
     _discordService    = discordService;
     _quarrelClient     = quarrelClient;
     _dispatcherService = dispatcherService;
 }
コード例 #45
0
ファイル: MessageService.cs プロジェクト: WildGums/Orchestra
        public MessageService(IDispatcherService dispatcherService, IUIVisualizerService uiVisualizerService, IViewModelFactory viewModelFactory)
            : base(dispatcherService)
        {
            Argument.IsNotNull(() => dispatcherService);
            Argument.IsNotNull(() => uiVisualizerService);
            Argument.IsNotNull(() => viewModelFactory);

            _dispatcherService = dispatcherService;
            _uiVisualizerService = uiVisualizerService;
            _viewModelFactory = viewModelFactory;
        }
 public PluginRemoveSelectedPluginsCommandContainer(ICommandManager commandManager,
                                                    IServiceLocator serviceLocator)
     : base(Commands.Plugin.RemoveSelectedPlugins, commandManager, serviceLocator)
 {
     _messageService      = serviceLocator.ResolveType <IAdvancedMessageService>();
     _dataPersister       = serviceLocator.ResolveType <DataPersisterService>();
     _presetDataPersister = serviceLocator.ResolveType <PresetDataPersisterService>();
     _dispatcherService   = serviceLocator.ResolveType <IDispatcherService>();
     _globalService       = serviceLocator.ResolveType <GlobalService>();
     _globalFrontendService.SelectedPlugins.CollectionChanged += SelectedPluginsOnCollectionChanged;
 }
コード例 #47
0
        public AutomaticSupportService(IProcessService processService, IDispatcherService dispatcherService)
        {
            Argument.IsNotNull(() => processService);
            Argument.IsNotNull(() => dispatcherService);

            _processService = processService;
            _dispatcherService = dispatcherService;

            _startedTime = DateTime.Now;
            CommandLineParameters = string.Empty;
        }
コード例 #48
0
        public SimpleLogListener(INuGetLogListeningSevice nuGetLogListeningSevice,
                                 IEchoService echoService, IDispatcherService dispatcherService)
            : base(nuGetLogListeningSevice)
        {
            Argument.IsNotNull(() => echoService);
            Argument.IsNotNull(() => dispatcherService);

            _dispatcherService = dispatcherService;

            _echo = echoService.GetPackageManagementEcho();
        }
コード例 #49
0
        ICommand wrongBookLocationCleanAllCommand; //对应按钮的事件

        public WrongBookLocationViewModel(IUnityContainer container, IRegionManager regionManager)
        {
            this.container = container;
            this.regionManager = regionManager;
            this.eventAggregator = container.Resolve<IEventAggregator>();
            this.dispatcherService = container.Resolve<IDispatcherService>();
            //初始化控件用到的变量
            this.onThisShelfAllBookList = new ObservableCollection<BookItemOfWrongLocation>();
            this.notOnThisShelfBookList = new ObservableCollection<BookItemOfWrongLocation>();
            this.wrongBookLocationCleanAllCommand = new DelegateCommand(wrongBookLocationCleanAllCommandExecute, wrongBookLocationCleanAllCommandCanExecute);
        }
コード例 #50
0
        public ViewModelBase(IDispatcherService dispatcherService)
        {
            this.dispatcherService = dispatcherService;

            _saveConfigActions.Add(this.PrivateSaveConfig);

            dispatcherService.ShutdownStarted -= OnDispatcherService_ShutdownStarted;
            dispatcherService.ShutdownStarted += OnDispatcherService_ShutdownStarted;

            PrivateLoadConfig();
        }
コード例 #51
0
        public SimpleLogListener(INuGetLogListeningSevice nuGetLogListeningSevice,
            IEchoService echoService, IDispatcherService dispatcherService)
            : base( nuGetLogListeningSevice)
        {            
            Argument.IsNotNull(() => echoService);
            Argument.IsNotNull(() => dispatcherService);

            _dispatcherService = dispatcherService;

            _echo = echoService.GetPackageManagementEcho();
        }
コード例 #52
0
        public ApplicationController([NotNull] IEventAggregator eventAggregator, [NotNull] ILiveTileManager liveTileManager, [NotNull] IDispatcherService dispatcherService, [NotNull] ITelemetryService telemetry)
        {
            Guard.NotNull(eventAggregator, nameof(eventAggregator));
            Guard.NotNull(liveTileManager, nameof(liveTileManager));
            Guard.NotNull(dispatcherService, nameof(dispatcherService));
            Guard.NotNull(telemetry, nameof(telemetry));

            this.eventAggregator = eventAggregator;
            this.liveTileManager = liveTileManager;
            this.dispatcherService = dispatcherService;
            this.telemetry = telemetry;
        }
コード例 #53
0
ファイル: FilterService.cs プロジェクト: sk8tz/LogViewer
        public FilterService(IDispatcherService dispatcherService, ILogTableService logTableService,
            IFileBrowserService fileBrowserService)
        {
            Argument.IsNotNull(() => dispatcherService);
            Argument.IsNotNull(() => logTableService);

            _dispatcherService = dispatcherService;
            _logTableService = logTableService;

            Filter = new Filter();
            _fileBrowser = fileBrowserService.FileBrowserModel;
        }
コード例 #54
0
        public MailListViewModel(IEventAggregator eventAggregator,
            IDispatcherService dispatcherService,
            IEmailService emailService)
        {
            this.eventAggregator = eventAggregator;
              this.dispatcherService = dispatcherService;
              this.emailService = emailService;

              EmailFolderChangeEvent evt =
            eventAggregator.GetEvent<EmailFolderChangeEvent>();

              evt.Subscribe(OnEmailFolderChanged);
        }
コード例 #55
0
        static ApplicationWatcherBase()
        {
            EnsureSubscribesInitialized();

            DispatcherService = ServiceLocator.Default.ResolveType<IDispatcherService>();

            DispatcherTimer = new DispatcherTimer();
            DispatcherTimer.Interval = TimeSpan.FromMilliseconds(5);
            DispatcherTimer.Tick += (sender, e) => EnsureMainWindow();
            DispatcherTimer.Start();

            EnsureMainWindow();
        }
コード例 #56
0
        public RecodeBookLocationViewModel(IUnityContainer container, IRegionManager regionManager)
        {
            this.container = container; this.regionManager = regionManager;
            this.eventAggregator = container.Resolve<IEventAggregator>();
            this.dispatcherService = container.Resolve<IDispatcherService>();
            //### ui中用到的变量
            this.bookItemList = new ObservableCollection<BookItem>();
            this.bookItemCount = 1;
            this.shelfName = "";
            this.shelfRfid = "";
            //this.bookItemList.Add(new BookItem() { ID = "1", BookName="123",BookAccessCode="TP123",BookRFIDCode="0x123"});
 
        }
コード例 #57
0
        public SystemInfoViewModel(ISystemInfoService systemInfoService, IDispatcherService dispatcherService, IClipboardService clipboardService)
        {
            Argument.IsNotNull(() => systemInfoService);
            Argument.IsNotNull(() => dispatcherService);
            Argument.IsNotNull(() => clipboardService);

            _systemInfoService = systemInfoService;
            _dispatcherService = dispatcherService;
            _clipboardService = clipboardService;

            SystemInfo = new List<KeyValuePair<string, string>> { new KeyValuePair<string, string>(string.Empty, string.Empty) };

            CopyToClipboard = new Command(OnCopyToClipboardExecute);
        }
コード例 #58
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TraceOutputViewModel" /> class.
        /// </summary>
        /// <param name="dispatcherService">The dispatcher service.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="dispatcherService"/> is <c>null</c>.</exception>
        public TraceOutputViewModel(IDispatcherService dispatcherService)
        {
            Argument.IsNotNull("dispatcherService", dispatcherService);

            _dispatcherService = dispatcherService;

            CopyToClipboard = new Command(OnCopyToClipboardExecute, OnCopyToClipboardCanExecute);
            ClearOutput = new Command(OnClearOutputExecute);

            _traceListener = new OutputTraceListener();
            Trace.Listeners.Add(_traceListener);

            _traceListener.ActiveTraceLevel = TraceLevel.Verbose;
            _traceListener.WrittenLine += WriteLine;

            TraceEntryCollection = new ObservableCollection<TraceEntry>();
        }
コード例 #59
0
        public AppInstalledViewModel(IProcessService processService, IDispatcherService dispatcherService)
        {
            Argument.IsNotNull(() => processService);
            Argument.IsNotNull(() => dispatcherService);

            _processService = processService;
            _dispatcherService = dispatcherService;

            RunApplication = new Command(OnRunApplicationExecute);

            var appName = _entryAssembly.Title();
            var appVersion = _entryAssembly.InformationalVersion() ?? _entryAssembly.Version();

            Title = string.Format("{0} v{1} is installed", appName, appVersion);

            AppIcon = ExtractLargestIcon();
            AppName = appName;
            AppVersion = appVersion;
            AccentColorBrush = AccentColorHelper.GetAccentColor();
        }
コード例 #60
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ShellViewModel"/> class.
        /// </summary>
        public ShellViewModel(ILogAnalyzerService logAnalyzerService, IFileWatcherService fileWatcherService, IDispatcherService dispatcherService, 
            IOpenFileService openFileService, IPleaseWaitService pleaseWaitService, IMessageService messageService)
        {
            _logAnalyzerService = logAnalyzerService;
            _fileWatcherService = fileWatcherService;
            _dispatcherService = dispatcherService;
            _openFileService = openFileService;
            _pleaseWaitService = pleaseWaitService;
            _messageService = messageService;

            ParseCommand = new Command(OnParseCommandExecute, OnParseCommandCanExecute);

            LoadFile = new Command<string>(OnLoadFileExecute);

            OpenFileCommand = new Command(OnOpenFileCommandExecute);

            ExitCommand = new Command(OnExitCommandExecute);

            Document = new TextDocument();

            Filter = new LogFilter
                {
                    EnableDebug = true,
                    EnableError = true,
                    EnableInfo = true,
                    EnableWarning = true
                };

            Filter.PropertyChanged += OnFilterPropertyChanged;

            Document.Changed += DocumentChanged;

            _logEntries = new FastObservableCollection<LogEntry>();

            using (var reader = new XmlTextReader("Resources\\HighlightingDefinition.xshd"))
            {
                HighlightingDefinition = HighlightingLoader.Load(reader, HighlightingManager.Instance);
            }

            HighlightingManager.Instance.RegisterHighlighting("CatelHighlighting", new[] { ".cool" }, HighlightingDefinition);
        }