public DocumentationTagger(ITextView textView, ITextBuffer buffer, IEventAggregator eventAggregator) { _textView = textView; _buffer = buffer; _eventAggregator = eventAggregator; _filename = buffer.GetFileName(); _codyDocsFilename = textView.TextBuffer.GetCodyDocsFileName(); snapshot = textView.TextBuffer.CurrentSnapshot; _documentationAddedListener = new DelegateListener <DocumentationAddedEvent>(OnDocumentationAdded); _eventAggregator.AddListener <DocumentationAddedEvent>(_documentationAddedListener); _documentSavedListener = new DelegateListener <DocumentSavedEvent>(OnDocumentSaved); _eventAggregator.AddListener <DocumentSavedEvent>(_documentSavedListener); _documentatiClosedListener = new DelegateListener <DocumentClosedEvent>(OnDocumentatClosed); _eventAggregator.AddListener <DocumentClosedEvent>(_documentatiClosedListener); _documentationUpdatedListener = new DelegateListener <DocumentationUpdatedEvent>(OnDocumentationUpdated); _eventAggregator.AddListener <DocumentationUpdatedEvent>(_documentationUpdatedListener); _documentationDeletedListener = new DelegateListener <DocumentationDeletedEvent>(OnDocumentationDeleted); _eventAggregator.AddListener <DocumentationDeletedEvent>(_documentationDeletedListener); //TODO: Add event aggregator listener to documentation changed on tracking Span X //TODO: Add event aggregator listener to documentation deleted on tracking Span X CreateTrackingSpans(); }
public CodeHighlighterTagger(ITextView textView, ITextBuffer buffer, IEventAggregator eventAggregator) { _textView = textView; _buffer = buffer; eventAggregator.AddListener(new DelegateListener <SearchResultEvent>(OnSearch), true); eventAggregator.AddListener(new DelegateListener <ExitEvent>(OnExit), true); }
public CoreEventService(IEventAggregator eventAggregator, ICqrsProvider cqrsProvider) { _eventAggregator = eventAggregator; _cqrsProvider = cqrsProvider; _eventAggregator.AddListener(departmentSettingsUpdateHandler); _eventAggregator.AddListener(auditEventHandler); }
public CodeMarkerTagger(ITextView textView, ITextBuffer buffer, IEventAggregator eventAggregator) { _textView = textView; _buffer = buffer; eventAggregator.AddListener(new DelegateListener <SearchResultEvent>(OnSearch), true); eventAggregator.AddListener(new DelegateListener <StartNewSearchEvent>(OnNewSearch), true); eventAggregator.AddListener(new DelegateListener <ExitEvent>(OnExit), true); _searchMarkerViewModel = new MarkerViewModel(); }
public HighlightTagger(IWpfTextView view, ITagAggregator <DocumentationTag> tagAggregator, IEventAggregator eventAggregator) { _tagAggregator = tagAggregator; _eventAggregator = eventAggregator; _tagAggregator.TagsChanged += OnTagsChanged; _buffer = view.TextBuffer; _documentatiClosedListener = new DelegateListener <DocumentClosedEvent>(OnDocumentatClosed); eventAggregator.AddListener <DocumentClosedEvent>(_documentatiClosedListener); _documentationMouseHoverListener = new DelegateListener <MouseHoverOnDocumentationEvent>(OnMouseHover); eventAggregator.AddListener <MouseHoverOnDocumentationEvent>(_documentationMouseHoverListener); _filename = _buffer.GetFileName(); }
public TestListener(IEventAggregator aggregator, SynchronizationContext synchronisationContext = null) { Result = string.Empty; if (synchronisationContext != null) { aggregator.AddListener(this, synchronisationContext); } else { aggregator.AddListener(this); } }
public TestListener(IEventAggregator aggregator, Dispatcher dispatcher) { Result = string.Empty; if (dispatcher != null) { aggregator.AddListener(this, dispatcher); } else { aggregator.AddListener(this); } }
public LicenseSettings() { IEventAggregator eventAggregator = ObjectLocator.GetInstance <IEventAggregator>(); eventAggregator.AddListener <LicenseInitializedEvent>(x => SetData()); eventAggregator.AddListener <ServicesUpdatedEvent>(x => cboService.ItemsSource = UIContext.GetAllServices()); InitializeComponent(); WindowHelper.CheckAndApplyTheme(this); this.Loaded += new RoutedEventHandler(LicenseSettings_GotFocus); SetData(); }
public ITagger <T> CreateTagger <T>(ITextBuffer textBuffer) where T : ITag { var tagger = CreateTagger(textBuffer, lastCoverageLines); eventAggregator.AddListener(tagger, false); return(tagger as ITagger <T>); }
public CoverageLineTaggerProviderBase( IEventAggregator eventAggregator ) { eventAggregator.AddListener(this); this.eventAggregator = eventAggregator; }
public MainWindow() { InitializeComponent(); try { // Apparently this doesn't work in anything but Windows7 IconBitmapDecoder ibd = new IconBitmapDecoder( new Uri(@"pack://*****:*****@"pack://application:,,/Scutex3.ico", UriKind.RelativeOrAbsolute), BitmapCreateOptions.None, BitmapCacheOption.Default); Icon = ibd.Frames[0]; } catch { } } this.Title = ApplicationConstants.IsCommunityEdition ? "Scutex Licensing Manager (Community Edition)" : "Scutex Licensing Manager (Professional Edition)"; try { Bootstrapper.Configure(); _eventAggregator = ObjectLocator.GetInstance<IEventAggregator>(); _eventAggregator.AddListener<ProductsUpdatedEvent>(x => RefreshData()); _eventAggregator.AddListener<LicenseSavedEvent>(x => SetRecentItemsAndRefresh()); _eventAggregator.AddListener<ServicesUpdatedEvent>(x => RefreshData()); } catch { } Initalize(); SetRecentItems(); VerifyFirstTimeRun(); WelcomeScreenForm welcomeScreenForm = new WelcomeScreenForm(); root.Content = welcomeScreenForm; }
public MainWindow() { InitializeComponent(); ribbon.DataContext = this; DataContext = this; try { // Apparently this doesn't work in anything but Windows7 IconBitmapDecoder ibd = new IconBitmapDecoder( new Uri(@"pack://*****:*****@"pack://application:,,/Scutex3.ico", UriKind.RelativeOrAbsolute), BitmapCreateOptions.None, BitmapCacheOption.Default); Icon = ibd.Frames[0]; } catch { } } try { Bootstrapper.Configure(); _eventAggregator = ObjectLocator.GetInstance <IEventAggregator>(); _eventAggregator.AddListener <ProductsUpdatedEvent>(x => RefreshData()); _eventAggregator.AddListener <LicenseSavedEvent>(x => SetRecentItemsAndRefresh()); _eventAggregator.AddListener <ServicesUpdatedEvent>(x => RefreshData()); } catch { } Initalize(); SetRecentItems(); VerifyFirstTimeRun(); WelcomeScreenForm welcomeScreenForm = new WelcomeScreenForm(); root.Content = welcomeScreenForm; }
public ProductsScreen() { InitializeComponent(); _productsService = ObjectLocator.GetInstance<IProductsService>(); _eventAggregator = ObjectLocator.GetInstance<IEventAggregator>(); _eventAggregator.AddListener<ProductsUpdatedEvent>(x => gridProducts.DataSource = _productsService.GetAllProducts()); }
private static void PerformTask(Options options) { if (!String.IsNullOrEmpty(options.ProjectFile)) { IDatabaseProjectService databaseProjectService = ObjectLocator.GetInstance <IDatabaseProjectService>(); IEventAggregator eventAggregator = ObjectLocator.GetInstance <IEventAggregator>(); Console.WriteLine(string.Format("Loading the Dafuscator project: {0}", options.ProjectFile)); Database db = databaseProjectService.GetDatabaseProject(options.ProjectFile); ConnectionString connetionString; if (!String.IsNullOrEmpty(options.ConnectionString)) { connetionString = new ConnectionString(options.ConnectionString); } else { connetionString = db.ConnectionString; } db.ConnectionString = connetionString; eventAggregator.AddListener <StatusUpdateEvent>(e => Console.WriteLine(string.Format("{0}: {1}", DateTime.Now, e.Message))); if (!String.IsNullOrEmpty(options.ExportFile)) { Console.WriteLine(string.Format("Started exporting the Dafuscator project to {0}", options.ExportFile)); IExportService exportService = ObjectLocator.GetInstance <IExportService>(); exportService.ExportTables(db.Tables, options.ExportFile, connetionString); Console.WriteLine("Finished exporting the Dafuscator project."); } else { Console.WriteLine(string.Format("Started the obfuscation of the {0} database.", db.ConnectionString.DatabaseName)); IRunService runService = ObjectLocator.GetInstance <IRunService>(); IReportService reportService = ObjectLocator.GetInstance <IReportService>(); ObfuscationResult result = runService.ObfuscateDatabase(db); string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal); path = path + "\\Dafuscator"; if (Directory.Exists(path) == false) { Directory.CreateDirectory(path); } path = path + string.Format("\\DatabaseObfuscationReport_{0}_{1}_{2}-{3}_{4}.txt", DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Year, DateTime.Now.Hour, DateTime.Now.Minute); reportService.GenerateReportForObfucsationResult(result, path); Console.WriteLine("Finished the obfuscation process in {0}", result.TimeElapsed); } } }
public ScreenCollection(TabControl tabs, IEventAggregator events) { _tabs = tabs; _tabItems.OnMissing = screen => new StoryTellerTabItem(screen, events); // Sends a message when the user select a different tab on the screen _tabs.SelectionChanged += (s, c) => events.SendMessage<UserScreenActivation>(); // Hack. Sigh. events.AddListener(new RenameTestHandler(new ScreenFinder(this), this)); }
public ServiceInitializationWindow() { InitializeComponent(); WindowHelper.CheckAndApplyTheme(this); _eventAggregator = ObjectLocator.GetInstance<IEventAggregator>(); _eventAggregator.AddListener<ServiceTestingEvent>(x => ServiceTestingAndInitialization(x)); _servicesService = ObjectLocator.GetInstance<IServicesService>(); }
public ProductsScreen() { InitializeComponent(); WindowHelper.CheckAndApplyTheme(this); _productsService = ObjectLocator.GetInstance<IProductsService>(); _eventAggregator = ObjectLocator.GetInstance<IEventAggregator>(); _eventAggregator.AddListener<ProductsUpdatedEvent>(x => gridProducts.ItemsSource = _productsService.GetAllProducts()); }
public ProductsScreen() { InitializeComponent(); WindowHelper.CheckAndApplyTheme(this); _productsService = ObjectLocator.GetInstance <IProductsService>(); _eventAggregator = ObjectLocator.GetInstance <IEventAggregator>(); _eventAggregator.AddListener <ProductsUpdatedEvent>(x => gridProducts.ItemsSource = _productsService.GetAllProducts()); }
public ServiceInitializationWindow() { InitializeComponent(); WindowHelper.CheckAndApplyTheme(this); _eventAggregator = ObjectLocator.GetInstance <IEventAggregator>(); _eventAggregator.AddListener <ServiceTestingEvent>(x => ServiceTestingAndInitialization(x)); _servicesService = ObjectLocator.GetInstance <IServicesService>(); }
public LibraryContentOperations(ILibraryOperations library, ILibraryView libraryView, IErrorHandler errorHandler, IFileValidator fileValidator, Dispatcher dispatcher, IEventAggregator eventAggregator) { _library = library; _libraryView = libraryView; _errorHandler = errorHandler; _fileValidator = fileValidator; _eventAggregator = eventAggregator; _eventAggregator.AddListener(this); Debug.Assert(_fileValidator != null); Debug.Assert(_errorHandler != null); }
public Presenter(TView view, TModel model, IEventAggregator eventAggregator) { ArgumentCheck.IsNotNull(view); ArgumentCheck.IsNotNull(eventAggregator); ArgumentCheck.IsNotNull(model); View = view; Model = model; View.SetEventPublisher(eventAggregator); eventAggregator.AddListener(this); EventAggregator = eventAggregator; }
// The destination override is tested as part of the monitoring integration public Task <TResponse> Request <TResponse>(object request, RequestOptions options = null) { options = options ?? new RequestOptions(); var envelope = new Envelope { Message = request, ReplyRequested = typeof(TResponse).Name }; if (options.Destination != null) { envelope.Destination = options.Destination; } var listener = new ReplyListener <TResponse>(_events, envelope.CorrelationId, options.Timeout); _events.AddListener(listener); _sender.Send(envelope); return(listener.Completion); }
public DocumentedCodeHighlighterTagger(ITextView textView, ITextBuffer buffer, IEventAggregator eventAggregator) { _textView = textView; _buffer = buffer; _eventAggregator = eventAggregator; _filename = GetFileName(buffer); _documentationAddedListener = new DelegateListener <DocumentationAddedEvent>(OnDocumentationAdded); _eventAggregator.AddListener <DocumentationAddedEvent>(_documentationAddedListener); _documentSavedListener = new DelegateListener <DocumentSavedEvent>(OnDocumentSaved); _eventAggregator.AddListener <DocumentSavedEvent>(_documentSavedListener); _documentatiClosedListener = new DelegateListener <DocumentClosedEvent>(OnDocumentatClosed); _eventAggregator.AddListener <DocumentClosedEvent>(_documentatiClosedListener); _documentationUpdatedListener = new DelegateListener <DocumentationUpdatedEvent>(OnDocumentationUpdated); _eventAggregator.AddListener <DocumentationUpdatedEvent>(_documentationUpdatedListener); _documentationDeletedListener = new DelegateListener <DocumentationDeletedEvent>(OnDocumentationDeleted); _eventAggregator.AddListener <DocumentationDeletedEvent>(_documentationDeletedListener); //TODO: Add event aggregator listener to documentation changed on tracking Span X //TODO: Add event aggregator listener to documentation deleted on tracking Span X CreateTrackingSpans(); }
public BasicSettings() { InitializeComponent(); WindowHelper.CheckAndApplyTheme(this); //btnAddProduct.Foreground = new SolidColorBrush(Colors.DarkSlateBlue); //Colors.CornflowerBlue //btnRegenerateKeys.Foreground = new SolidColorBrush(Colors.DarkSlateBlue); UIContext.InitializeForNewLicense(); License = UIContext.License; IEventAggregator eventAggregator = ObjectLocator.GetInstance <IEventAggregator>(); eventAggregator.AddListener <ProductsUpdatedEvent>(x => cboProduct.ItemsSource = UIContext.GetProducts()); eventAggregator.SendMessage <LicenseInitializedEvent>(); }
public LoadingAnimationLarge() { InitializeComponent(); IEventAggregator eventAggregator = ObjectLocator.GetInstance <IEventAggregator>(); eventAggregator.AddListener <StatusUpdateEvent>(e => lblStatus.Dispatcher.Invoke( System.Windows.Threading.DispatcherPriority.Normal, new Action( delegate() { lblStatus.Text = e.Message; } ) ) ); }
public LibraryView(ITagCache tags, IPathsCache paths, IBinariesCache binaries, Dispatcher dispatcher, ILibraryOperations libraryOps, IErrorHandler errorHandler, IFileValidator fileValidator, IEventAggregator eventAggregator) { _tags = tags; _paths = paths; _binariesCache = binaries; _dispatcher = dispatcher; _eventAggregator = eventAggregator; _sourceNodes = new ObservableCollection <LibraryViewNode>(); _nodeViewer = new PropertyOrderedObservableCollectionViewer <LibraryViewNode>(_dispatcher); _nodeViewer.SetMediator(this); _nodeViewer.Attach(_sourceNodes); _nodeViewer.OrderBy(f => f.Name, new [] { "Name" }, false); _eventAggregator.AddListener(this, _dispatcher); LoadedBinariesCache = new LoadedBinaryCache(100, binaries); Operations = new LibraryContentOperations(libraryOps, this, errorHandler, fileValidator, _dispatcher, _eventAggregator); _dispatcher.BeginInvoke(new Action(PerformLoad)); }
/// <summary> /// Initializes a new instance of the <see cref="OutputToolWindowControl"/> class. /// </summary> public OutputToolWindowControl(IEventAggregator eventAggregator) { this.eventAggregator = eventAggregator; InitializeComponent(); eventAggregator.SendMessage(new DpiChangedMessage { DpiScale = VisualTreeHelper.GetDpi(this) }); var environmentFont = new EnvironmentFont(); environmentFont.Changed += (sender, fontDetails) => { eventAggregator.SendMessage(new EnvironmentFontDetailsChangedMessage { FontDetails = fontDetails }); }; environmentFont.Initialize(this); this.Loaded += OutputToolWindowControl_Loaded; eventAggregator.AddListener(this); eventAggregator.SendMessage(new ReadyForReportMessage()); }
protected CocoJumperBaseCommand(AsyncPackage package, OleMenuCommandService commandService, IVsTextManager textManager, IVsEditorAdaptersFactoryService editorAdaptersFactoryService, IEventAggregator eventAggregator, Guid commandSet, int commandId) { _package = package ?? throw new ArgumentNullException(nameof(package)); _vsTextManager = textManager ?? throw new ArgumentNullException(nameof(textManager)); _editorAdaptersFactoryService = editorAdaptersFactoryService ?? throw new ArgumentNullException(nameof(editorAdaptersFactoryService)); eventAggregator.AddListener(new DelegateListener <ExitEvent>(OnExit), true); commandService = commandService ?? throw new ArgumentNullException(nameof(commandService)); CommandID menuCommandID = new CommandID(commandSet, commandId); MenuCommand menuItem = new MenuCommand(Execute, menuCommandID); commandService.AddCommand(menuItem); }
public MainVm(ILibraryLocationDialog locationDialog, ILibrarySelector librarySelector, IErrorHandlerView errorHandler, IFileValidator validator, ImbSettings appSettings, IEventAggregator eventAggregator) { _locationDialog = locationDialog; _librarySelector = librarySelector; _errorHandlerView = errorHandler; _errorHandler = _errorHandlerView.ErrorHandler; _fileValidator = validator; _appSettings = appSettings; _eventAggregator = eventAggregator; _newCommand = new BlockableCommand <object>(false, NewLibrary); _openCommand = new BlockableCommand <object>(false, OpenLibrary); _addCommand = new BlockableCommand <object>(true, AddFile); _removeCommand = new BlockableCommand <object>(true, RemoveFile); _newFolderCommand = new BlockableCommand <object>(true, NewFolder); DropHandler.Current.SetErrorHandler(_errorHandler); DropHandler.Current.SetFileValidator(_fileValidator); Title = "Imb - no library open"; _eventAggregator.AddListener(this); }
public OutboundEventProvider(IEventAggregator eventAggregator, IOutboundQueueProvider outboundQueueProvider, ISignalrProvider signalrProvider) { _eventAggregator = eventAggregator; _outboundQueueProvider = outboundQueueProvider; _signalrProvider = signalrProvider; _rabbitTopicProvider = new RabbitTopicProvider(); _eventAggregator.AddListener(unitStatusHandler); _eventAggregator.AddListener(unitTypeGroupAvailabilityHandler); _eventAggregator.AddListener(unitTypeDepartmentAvailabilityHandler); _eventAggregator.AddListener(userStaffingHandler); _eventAggregator.AddListener(userRoleGroupAvailabilityHandler); _eventAggregator.AddListener(userRoleDepartmentAvailabilityHandler); _eventAggregator.AddListener(personnelStatusChangedHandler); _eventAggregator.AddListener(userCreatedHandler); _eventAggregator.AddListener(userAssignedToGroupHandler); _eventAggregator.AddListener(calendarEventUpcomingHandler); _eventAggregator.AddListener(calendarEventAddedHandler); _eventAggregator.AddListener(calendarEventUpdatedHandler); _eventAggregator.AddListener(documentAddedHandler); _eventAggregator.AddListener(noteAddedHandler); _eventAggregator.AddListener(unitAddedHandler); _eventAggregator.AddListener(logAddedHandler); _eventAggregator.AddListener(resourceOrderAddedHandler); _eventAggregator.AddListener(workerHeartbeatHandler); _eventAggregator.AddListener(dListCheckHandler); _eventAggregator.AddListener(shiftTradeRequestedHandler); _eventAggregator.AddListener(shiftTradeRejectedEventHandler); _eventAggregator.AddListener(shiftTradeFilledEventHandler); _eventAggregator.AddListener(shiftCreatedEventHandler); _eventAggregator.AddListener(shiftUpdatedEventHandler); _eventAggregator.AddListener(shiftDaysAddedEventHandler); // Topics (SignalR Integration) _eventAggregator.AddListener(personnelStatusChangedTopicHandler); _eventAggregator.AddListener(personnelStaffingChangedTopicHandler); _eventAggregator.AddListener(unitStatusTopicHandler); _eventAggregator.AddListener(callAddedTopicHandler); }
public static IEventSubscriptionManager AddListener(object listener, bool?holdStrongReference = null) { return(eventAggregator.AddListener(listener, holdStrongReference)); }
public EditorPresenter(EditorMenuPresenter presenter, IEditorView view, EditorModel model, IEventAggregator eventAggregator) : base(view, model, eventAggregator) { ArgumentCheck.IsNotNull(presenter); eventAggregator.AddListener(this); }
public OutboundEventProvider(IEventAggregator eventAggregator, IOutboundQueueProvider outboundQueueProvider, ISignalrProvider signalrProvider) { _eventAggregator = eventAggregator; _outboundQueueProvider = outboundQueueProvider; _signalrProvider = signalrProvider; _rabbitTopicProvider = new RabbitTopicProvider(); _eventAggregator.AddListener(new UnitStatusHandler(), true); _eventAggregator.AddListener(new UnitTypeGroupAvailabilityHandler(), true); _eventAggregator.AddListener(new UnitTypeDepartmentAvailabilityHandler(), true); _eventAggregator.AddListener(new UserStaffingHandler(), true); _eventAggregator.AddListener(new UserRoleGroupAvailabilityHandler(), true); _eventAggregator.AddListener(new UserRoleDepartmentAvailabilityHandler(), true); _eventAggregator.AddListener(new PersonnelStatusChangedHandler(), true); _eventAggregator.AddListener(new UserCreatedHandler(), true); _eventAggregator.AddListener(new UserAssignedToGroupHandler(), true); _eventAggregator.AddListener(new CalendarEventUpcomingHandler(), true); _eventAggregator.AddListener(new CalendarEventAddedHandler(), true); _eventAggregator.AddListener(new CalendarEventUpdatedHandler(), true); _eventAggregator.AddListener(new DocumentAddedHandler(), true); _eventAggregator.AddListener(new NoteAddedHandler(), true); _eventAggregator.AddListener(new UnitAddedHandler(), true); _eventAggregator.AddListener(new LogAddedHandler(), true); _eventAggregator.AddListener(new DepartmentSettingsChangedHandler(), true); _eventAggregator.AddListener(new WorkerHeartbeatHandler(), true); _eventAggregator.AddListener(new DListCheckHandler(), true); _eventAggregator.AddListener(new ShiftTradeRequestedHandler(), true); _eventAggregator.AddListener(new ShiftTradeRejectedEventHandler(), true); _eventAggregator.AddListener(new ShiftTradeFilledEventHandler(), true); _eventAggregator.AddListener(new ShiftCreatedEventHandler(), true); _eventAggregator.AddListener(new ShiftUpdatedEventHandler(), true); _eventAggregator.AddListener(new ShiftDaysAddedEventHandler(), true); // Topics (SignalR Integration) _eventAggregator.AddListener(new PersonnelStatusChangedTopicHandler(), true); _eventAggregator.AddListener(new PersonnelStaffingChangedTopicHandler(), true); _eventAggregator.AddListener(new UnitStatusTopicHandler(), true); _eventAggregator.AddListener(new CallAddedTopicHandler(), true); }
public void Register_null() { Assert.Throws <ArgumentNullException>(() => eventAggregator.AddListener <object>(null)); }