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; } }
public Callout(IDispatcherService dispatcherService) { Guard.ArgumentNotNull(() => dispatcherService); this.dispatcherService = dispatcherService; this.MaxNumberOfButtons = 3; }
/// <summary> /// Initializes the <see cref="DispatcherObservableObject"/> class. /// </summary> static DispatcherObservableObject() { var serviceLocator = IoCConfiguration.DefaultServiceLocator; serviceLocator.RegisterTypeIfNotYetRegistered<IDispatcherService, DispatcherService>(); _dispatcherService = serviceLocator.ResolveType<IDispatcherService>(); }
public DialogService(IDispatcherService dispatcher, string applicationName) { if (dispatcher == null) throw new ArgumentNullException(nameof(dispatcher)); Dispatcher = dispatcher; ApplicationName = applicationName; }
public SystemIdentificationViewModel(ISystemIdentificationService systemIdentificationService, IDispatcherService dispatcherService) { Argument.IsNotNull(() => systemIdentificationService); _systemIdentificationService = systemIdentificationService; _dispatcherService = dispatcherService; }
/// <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(); }
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(); }
internal FileOpenModalDialog(IDispatcherService dispatcher) : base(dispatcher) { Dialog = new CommonOpenFileDialog { EnsureFileExists = true }; Filters = new List<FileDialogFilter>(); FilePaths = new List<string>(); }
public ProgressPleaseWaitService(IDispatcherService dispatcherService, IDependencyResolver dependencyResolver) : base(dispatcherService) { Argument.IsNotNull(() => dependencyResolver); _dependencyResolver = dependencyResolver; }
/// <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(); }
public PackageBatchService(IUIVisualizerService uiVisualizerService, IDispatcherService dispatcherService) { Argument.IsNotNull(() => uiVisualizerService); Argument.IsNotNull(() => dispatcherService); _uiVisualizerService = uiVisualizerService; _dispatcherService = dispatcherService; }
public BehaviorWorkspaceProvider(IWorkspaceManager workspaceManager, IWorkspaceBehavior workspaceBehavior, IDispatcherService dispatcherService) : base(workspaceManager) { Argument.IsNotNull(() => workspaceBehavior); Argument.IsNotNull(() => dispatcherService); _workspaceBehavior = workspaceBehavior; _dispatcherService = dispatcherService; }
public CsvTextEditorAutoCompleteProjectWatcher(IProjectManager projectManager, IServiceLocator serviceLocator, IDispatcherService dispatcherService) : base(projectManager) { Argument.IsNotNull(() => serviceLocator); Argument.IsNotNull(() => dispatcherService); _serviceLocator = serviceLocator; _dispatcherService = dispatcherService; }
/// <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; }
public PlayerInventoryViewModel(IDispatcherService dispatcherService, IDialogService dialogService, string steamID) { _dispatcherService = dispatcherService; _dialogService = dialogService; SteamID = steamID; Title = string.Format("玩家: {0} 的背包", SteamID); _ = GetPlayerInventory(); }
internal BindableAttachment( IMessenger messenger, IDiscordService discordService, QuarrelClient quarrelClient, IDispatcherService dispatcherService, Attachment attachment) : base(messenger, discordService, quarrelClient, dispatcherService) { _attachment = attachment; }
public MainViewModel(IUIVisualizerService uiVisualizerService, IDispatcherService dispatcherService) { Argument.IsNotNull(() => uiVisualizerService); Argument.IsNotNull(() => dispatcherService); _uiVisualizerService = uiVisualizerService; _dispatcherService = dispatcherService; ShowInstalledDialog = new Command(OnShowInstalledDialogExecute); }
/// <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; }
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(); }
public FileNodeService(ILogReaderService logReaderService, IDispatcherService dispatcherService, IFilterService filterService) { Argument.IsNotNull(() => logReaderService); Argument.IsNotNull(() => dispatcherService); Argument.IsNotNull(() => filterService); _logReaderService = logReaderService; _dispatcherService = dispatcherService; _filterService = filterService; }
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)); }
public SettingsViewModel(Settings settings, ILogControlService logControlService, IDispatcherService dispatcherService) { Argument.IsNotNull(() => settings); Argument.IsNotNull(() => logControlService); Argument.IsNotNull(() => dispatcherService); Settings = settings; _logControlService = logControlService; _dispatcherService = dispatcherService; }
public SearchHighlight() { var dependencyResolver = this.GetDependencyResolver(); _dispatcherService = dependencyResolver.Resolve <IDispatcherService>(); _searchHighlightService = dependencyResolver.Resolve <ISearchHighlightService>(); _searchHighlightService.Highlighting += OnSearchHighlightServiceHighlighting; _searchHighlightService.Highlighted += OnSearchHighlightServiceHighlighted; }
/// <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 }
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)); }
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; }
public DialogService([NotNull] IDispatcherService dispatcher, string applicationName) { if (dispatcher == null) { throw new ArgumentNullException(nameof(dispatcher)); } Dispatcher = dispatcher; ApplicationName = applicationName; }
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; }
/// <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; }
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); }
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; })); }
public PhotoViewModelFactory( IConfigProvider configProvider, IDispatcherService dispatcherService, IImageSourceLoader imageSourceLoader, IViewerCommands viewerCommands) { _configProvider = configProvider; _dispatcherService = dispatcherService; _imageSourceLoader = imageSourceLoader; _viewerCommands = viewerCommands; }
internal BindableCategoryChannel( IMessenger messenger, IClipboardService clipboardService, IDiscordService discordService, QuarrelClient quarrelClient, IDispatcherService dispatcherService, CategoryChannel channel, GuildMember selfMember) : base(messenger, clipboardService, discordService, quarrelClient, dispatcherService, channel, selfMember) { }
/// <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; }
internal BindableChannelGroup( IMessenger messenger, IDiscordService discordService, QuarrelClient quarrelClient, IDispatcherService dispatcherService, BindableCategoryChannel?key) : base(messenger, discordService, quarrelClient, dispatcherService) { Key = key; Children = new ObservableCollection <BindableChannel>(); }
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); }
public AutomaticSupportService(IProcessService processService, IDispatcherService dispatcherService) { Argument.IsNotNull(() => processService); Argument.IsNotNull(() => dispatcherService); _processService = processService; _dispatcherService = dispatcherService; _startedTime = DateTime.Now; CommandLineParameters = string.Empty; }
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; }
/// <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; }
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; }
public SimpleLogListener(INuGetLogListeningSevice nuGetLogListeningSevice, IEchoService echoService, IDispatcherService dispatcherService) : base(nuGetLogListeningSevice) { Argument.IsNotNull(() => echoService); Argument.IsNotNull(() => dispatcherService); _dispatcherService = dispatcherService; _echo = echoService.GetPackageManagementEcho(); }
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); }
public ViewModelBase(IDispatcherService dispatcherService) { this.dispatcherService = dispatcherService; _saveConfigActions.Add(this.PrivateSaveConfig); dispatcherService.ShutdownStarted -= OnDispatcherService_ShutdownStarted; dispatcherService.ShutdownStarted += OnDispatcherService_ShutdownStarted; PrivateLoadConfig(); }
public SimpleLogListener(INuGetLogListeningSevice nuGetLogListeningSevice, IEchoService echoService, IDispatcherService dispatcherService) : base( nuGetLogListeningSevice) { Argument.IsNotNull(() => echoService); Argument.IsNotNull(() => dispatcherService); _dispatcherService = dispatcherService; _echo = echoService.GetPackageManagementEcho(); }
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; }
public FilterService(IDispatcherService dispatcherService, ILogTableService logTableService, IFileBrowserService fileBrowserService) { Argument.IsNotNull(() => dispatcherService); Argument.IsNotNull(() => logTableService); _dispatcherService = dispatcherService; _logTableService = logTableService; Filter = new Filter(); _fileBrowser = fileBrowserService.FileBrowserModel; }
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); }
static ApplicationWatcherBase() { EnsureSubscribesInitialized(); DispatcherService = ServiceLocator.Default.ResolveType<IDispatcherService>(); DispatcherTimer = new DispatcherTimer(); DispatcherTimer.Interval = TimeSpan.FromMilliseconds(5); DispatcherTimer.Tick += (sender, e) => EnsureMainWindow(); DispatcherTimer.Start(); EnsureMainWindow(); }
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"}); }
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); }
/// <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>(); }
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(); }
/// <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); }