public StatisticsLogger(EventBroker broker, IWebContext context, Collector collector, StatisticsRepository repository) { this.broker = broker; this.context = context; this.filler = collector; this.repository = repository; }
public virtual void Configure(IEngine engine, ContainerManager containerManager, EventBroker broker, SmartStoreConfig configuration) { //other dependencies containerManager.AddComponentInstance<SmartStoreConfig>(configuration, "sm.configuration"); containerManager.AddComponentInstance<IEngine>(engine, "sm.engine"); containerManager.AddComponentInstance<ContainerConfigurer>(this, "sm.containerConfigurer"); //type finder containerManager.AddComponent<ITypeFinder, WebAppTypeFinder>("sm.typeFinder"); //register dependencies provided by other assemblies var typeFinder = containerManager.Resolve<ITypeFinder>(); containerManager.UpdateContainer(x => { var drTypes = typeFinder.FindClassesOfType<IDependencyRegistrar>(); var drInstances = new List<IDependencyRegistrar>(); foreach (var drType in drTypes) drInstances.Add((IDependencyRegistrar)Activator.CreateInstance(drType)); //sort drInstances = drInstances.AsQueryable().OrderBy(t => t.Order).ToList(); foreach (var dependencyRegistrar in drInstances) dependencyRegistrar.Register(x, typeFinder); }); // event broker containerManager.AddComponentInstance(broker); // AutofacDependencyResolver var scopeProvider = new AutofacLifetimeScopeProvider(containerManager.Container); var dependencyResolver = new AutofacDependencyResolver(containerManager.Container, scopeProvider); DependencyResolver.SetResolver(dependencyResolver); }
public virtual void Configure(IEngine engine, EventBroker broker, ConfigurationManagerWrapper configuration) { configuration.Start(); engine.Container.AddComponentInstance("n2.configuration", typeof(ConfigurationManagerWrapper), configuration); engine.Container.AddComponentInstance("n2.engine", typeof(IEngine), engine); engine.Container.AddComponentInstance("n2.container", typeof(IServiceContainer), engine.Container); engine.Container.AddComponentInstance("n2.containerConfigurer", typeof(ContainerConfigurer), this); AddComponentInstance(engine.Container, configuration.GetConnectionStringsSection()); AddComponentInstance(engine.Container, configuration.Sections.Engine); if (configuration.Sections.Engine != null) RegisterConfiguredComponents(engine.Container, configuration.Sections.Engine); AddComponentInstance(engine.Container, configuration.Sections.Web); if (configuration.Sections.Web != null) InitializeEnvironment(engine.Container, configuration.Sections); AddComponentInstance(engine.Container, configuration.Sections.Database); AddComponentInstance(engine.Container, configuration.Sections.Management); AddComponentInstance(engine.Container, broker); engine.Container.AddComponent("n2.typeFinder", typeof(ITypeFinder), typeof(WebAppTypeFinder)); engine.Container.AddComponent("n2.webContext", typeof(N2.Web.IWebContext), typeof(N2.Web.AdaptiveContext)); engine.Container.AddComponent("n2.serviceRegistrator", typeof(ServiceRegistrator), typeof(ServiceRegistrator)); var registrator = engine.Container.Resolve<ServiceRegistrator>(); var services = registrator.FindServices(); var configurationKeys = GetComponentConfigurationKeys(configuration); services = registrator.FilterServices(services, configurationKeys); registrator.RegisterServices(services); }
public FileSystemHandlerFactory(IFileSystem fs, IEditManager editManager, IWebContext requestContext, EventBroker broker) { this.fs = fs; this.editManager = editManager; this.requestContext = requestContext; this.broker = broker; }
public void MultiplePublisherMultipleSubscriber() { EventBroker eb = new EventBroker(); Subscriber.Count = 0; Publisher p1 = new Publisher(); Publisher p2 = new Publisher(); Subscriber s1 = new Subscriber(); Subscriber s2 = new Subscriber(); Subscriber s3 = new Subscriber(); eb.Register(p1); eb.Register(p2); eb.Register(s1); eb.Register(s2); eb.Register(s3); p1.CallCount(); p2.CallCount(); eb.Unregister(p1); eb.Unregister(p2); eb.Unregister(s1); eb.Unregister(s2); eb.Unregister(s3); Assert.AreEqual(6, Subscriber.Count); }
public virtual void Configure(IEngine engine, ContainerManager containerManager, EventBroker broker, SiteConfig configuration) { //other dependencies containerManager.AddComponentInstance<SiteConfig>(configuration, "site.configuration"); containerManager.AddComponentInstance<IEngine>(engine, "site.engine"); containerManager.AddComponentInstance<ContainerConfigurer>(this, "site.containerConfigurer"); //type finder containerManager.AddComponent<ITypeFinder, WebAppTypeFinder>("site.typeFinder"); //register dependencies provided by other assemblies var typeFinder = containerManager.Resolve<ITypeFinder>(); containerManager.UpdateContainer(x => { var drTypes = typeFinder.FindClassesOfType<IDependencyRegistrar>(); var drInstances = new List<IDependencyRegistrar>(); foreach (var drType in drTypes) drInstances.Add((IDependencyRegistrar)Activator.CreateInstance(drType)); //sort drInstances = drInstances.AsQueryable().OrderBy(t => t.Order).ToList(); foreach (var dependencyRegistrar in drInstances) dependencyRegistrar.Register(x, typeFinder); }); //event broker containerManager.AddComponentInstance(broker); //service registration containerManager.AddComponent<DependencyAttributeRegistrator>("site.serviceRegistrator"); var registrator = containerManager.Resolve<DependencyAttributeRegistrator>(); var services = registrator.FindServices(); var configurations = GetComponentConfigurations(configuration); services = registrator.FilterServices(services, configurations); registrator.RegisterServices(services); }
public virtual void Configure(ICore core, ContainerManager containerManager, EventBroker broker/*, AaronConfig configuration*/) { //other dependencies //containerManager.AddComponentInstance<AaronConfig>(configuration, "aaron.configuration"); containerManager.AddComponentInstance<ICore>(core, "aaron.core"); containerManager.AddComponentInstance<ContainerConfigurer>(this, "aaron.containerConfigurer"); //type finder containerManager.AddComponent<ITypeFinder, WebAppTypeFinder>("aaron.typeFinder"); //register dependencies provided by other assemblies var typeFinder = containerManager.Resolve<ITypeFinder>(); containerManager.UpdateContainer(x => { var drTypes = typeFinder.FindClassesOfType<IDependencyRegistrar>(); var drInstances = new List<IDependencyRegistrar>(); foreach (var drType in drTypes) drInstances.Add((IDependencyRegistrar)Activator.CreateInstance(drType)); //sort drInstances = drInstances.AsQueryable().OrderBy(t => t.Order).ToList(); foreach (var dependencyRegistrar in drInstances) dependencyRegistrar.Register(x, typeFinder); }); //event broker containerManager.AddComponentInstance(broker); containerManager.AddComponent<DeasyAttributeRegistrator>(); var deasyAttributeRegistrator = containerManager.Resolve<DeasyAttributeRegistrator>(); var deasyAttributes = deasyAttributeRegistrator.FindDeasyAttributes(); deasyAttributeRegistrator.RegisterDeasy(deasyAttributes); }
public static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var eventBroker = new EventBroker(); IVhptManager vhptManager = new VhptManager(); var vhpts = vhptManager.GetAllVhpts(); var controllers = from vhpt in vhpts select CreateVhptController(vhpt, eventBroker); foreach (var vhptController in controllers) { eventBroker.Register(vhptController); vhptController.Initialize(); } var mainForm = new MainForm(); var importDialogFactory = new JokeImportProgressDialogFactory(); var importer = new Importer(new JokeOracle(), new JokeImporter(), importDialogFactory, new UserInterfaceThreadSynchronizer()); importDialogFactory.Initialize(mainForm, importer); mainForm.Initialize( new VhptUserControlFactory(eventBroker), from vhpt in vhpts select new VhptIdentification(vhpt.Id, vhpt.Name), importer); eventBroker.Register(mainForm); Application.Run(mainForm); }
public virtual void Configure(IEngine engine, EventBroker broker, ConfigurationManagerWrapper configuration) { engine.Container.AddComponentInstance("n2.configuration", typeof(ConfigurationManagerWrapper), configuration); engine.Container.AddComponentInstance("n2.engine", typeof(IEngine), engine); engine.Container.AddComponentInstance("n2.container", typeof(IServiceContainer), engine.Container); engine.Container.AddComponentInstance("n2.containerConfigurer", typeof(ContainerConfigurer), this); AddComponentInstance(engine.Container, configuration.GetConnectionStringsSection()); AddComponentInstance(engine.Container, configuration.Sections.Engine); RegisterConfiguredComponents(engine.Container, configuration.Sections.Engine); AddComponentInstance(engine.Container, configuration.Sections.Web); InitializeEnvironment(engine.Container, configuration.Sections); AddComponentInstance(engine.Container, configuration.Sections.Database); AddComponentInstance(engine.Container, configuration.Sections.Management); AddComponentInstance(engine.Container, broker); var skipTypes = configuration.Sections.Engine.Components.GetConfiguredServiceTypes(); AddComponentUnlessConfigured(engine.Container, typeof(BasicTemporaryFileHelper), typeof(BasicTemporaryFileHelper), skipTypes); AddComponentUnlessConfigured(engine.Container, typeof(TypeCache), typeof(TypeCache), skipTypes); AddComponentUnlessConfigured(engine.Container, typeof(ITypeFinder), typeof(WebAppTypeFinder), skipTypes); AddComponentUnlessConfigured(engine.Container, typeof(ServiceRegistrator), typeof(ServiceRegistrator), skipTypes); var registrator = engine.Container.Resolve<ServiceRegistrator>(); var services = registrator.FindServices(); var configurationKeys = configuration.GetComponentConfigurationKeys(); services = registrator.FilterServices(services, configurationKeys); services = registrator.FilterServices(services, skipTypes); registrator.RegisterServices(services); InitializeUrlParser(engine.Container); }
private bool CanBrokerSendMessagesInBatch(MockClientCallback client, EventBroker broker) { int EXPECTED_MSG_COUNT = 100; int messageCount = 1; // try different batch sizes while (messageCount < EXPECTED_MSG_COUNT) { client.Reset(); Assert.AreEqual(0, client.EventsSent.Count); broker.Suspended = true; MockEvent[] events = new MockEvent[messageCount]; for (int i = 0; i < events.Length; i++) { events[i] = new MockEvent(true); broker.Send(events[i]); } broker.Suspended = false; Thread.Sleep(500); if (messageCount > 1 && client.EventsSetSent.Count == 1) { client.Reset(); return true; } messageCount++; // increase # of messages to send } return false; }
private static VhptController CreateVhptController(IVhpt vhpt, EventBroker eventBroker) { var jokeTeller = new JokeTeller(new ModuleController(), new JokeEngine()); jokeTeller.Initialize(); eventBroker.Register(jokeTeller); return new VhptController(vhpt, new ActiveStateMachine<VhptStates, VhptEvents>(), jokeTeller); }
public void SetUp() { this.testee = new EventBroker(); this.testee.Register(this); this.simpleEventWasCalled = false; this.valueFromCustomEventArgs = null; }
public virtual void Configure(IEngine engine, ContainerManager containerManager, EventBroker broker, NopConfig configuration) { //register dependencies provided by other assemblies containerManager.AddComponent<IWebHelper, WebHelper>("nop.webHelper"); containerManager.AddComponent<ITypeFinder, WebAppTypeFinder>("nop.typeFinder"); var typeFinder = containerManager.Resolve<ITypeFinder>(); containerManager.UpdateContainer(x => { var drTypes = typeFinder.FindClassesOfType<IDependencyRegistrar>(); var drInstances = new List<IDependencyRegistrar>(); foreach (var drType in drTypes) drInstances.Add((IDependencyRegistrar)Activator.CreateInstance(drType)); //sort drInstances = drInstances.AsQueryable().OrderBy(t => t.Order).ToList(); foreach (var dependencyRegistrar in drInstances) dependencyRegistrar.Register(x, typeFinder); }); //Register event consumers var consumers = typeFinder.FindClassesOfType(typeof (IConsumer<>)).ToList(); containerManager.UpdateContainer(x => { foreach(var consumer in consumers) { x.RegisterType(consumer) .As(consumer.FindInterfaces((type, criteria) => { var isMatch = type.IsGenericType && ((Type)criteria).IsAssignableFrom(type.GetGenericTypeDefinition()); return isMatch; }, typeof (IConsumer<>))) .InstancePerHttpRequest(); } }); containerManager.AddComponent<IEventPublisher, EventPublisher>("nop.eventPublisher"); containerManager.AddComponent<ISubscriptionService, SubscriptionService>("nop.subscriptionService"); //other dependencies containerManager.AddComponentInstance<NopConfig>(configuration, "nop.configuration"); containerManager.AddComponentInstance<IEngine>(engine, "nop.engine"); containerManager.AddComponentInstance<ContainerConfigurer>(this, "nop.containerConfigurer"); //if (configuration.Components != null) // RegisterConfiguredComponents(containerManager, configuration.Components); //event broker containerManager.AddComponentInstance(broker); //service registration containerManager.AddComponent<DependencyAttributeRegistrator>("nop.serviceRegistrator"); var registrator = containerManager.Resolve<DependencyAttributeRegistrator>(); var services = registrator.FindServices(); var configurations = GetComponentConfigurations(configuration); services = registrator.FilterServices(services, configurations); registrator.RegisterServices(services); }
public void SetUp() { Subscriber.Count = 0; this.testee = new EventBroker(); this.p = new Publisher(); this.s = new Subscriber(); this.testee.Register(this.p); this.testee.Register(this.s); }
/// <summary>Creates a new instance of the RequestLifeCycleHandler class.</summary> /// <param name="webContext">The web context wrapper.</param> /// <param name="broker"></param> /// <param name="dispatcher"></param> /// <param name="adapters"></param> /// <param name="errors"></param> /// <param name="configuration"></param> public RequestLifeCycleHandler(IWebContext webContext, EventBroker broker, RequestPathProvider dispatcher, IContentAdapterProvider adapters, IErrorNotifier errors, ConfigurationManagerWrapper configuration) { rewriteMethod = configuration.Sections.Web.Web.Rewrite; managementUrl = configuration.Sections.Management.ManagementInterfaceUrl; this.webContext = webContext; this.broker = broker; this.adapters = adapters; this.errors = errors; this.dispatcher = dispatcher; }
public MainWindowViewModel(string customerDataFile) { base.DisplayName = "MainWindowViewModel.Display Name"; VsbDirectory = Visibility.Hidden; _eventBroker = Session.EventBroker(); _eventBroker.Register(this); this._customerRepository = new CustomerRepositoryOld(customerDataFile); _commands = CommandsForNav; _workspaces = Workspaces; InitializeLogin(); }
public InstallationChecker(IWebContext webContext, EventBroker broker, ConfigurationManagerWrapper configuration, InstallationManager installer) { if (configuration.Sections.Management.Installer.CheckInstallationStatus) { welcomeUrl = configuration.Sections.Management.Installer.WelcomeUrl; managementUrl = configuration.Sections.Management.ManagementInterfaceUrl; this.installer = installer; this.webContext = webContext; this.broker = broker; this.broker.BeginRequest += BeginRequest; } }
public virtual void Configure(IEngine engine, EventBroker broker, ConfigurationManagerWrapper configuration) { engine.Container.AddComponentInstance("n2.configuration", typeof(ConfigurationManagerWrapper), configuration); engine.Container.AddComponentInstance("n2.engine", typeof(IEngine), engine); engine.Container.AddComponentInstance("n2.container", typeof(IServiceContainer), engine.Container); engine.Container.AddComponentInstance("n2.containerConfigurer", typeof(ContainerConfigurer), this); AddComponentInstance(engine.Container, configuration.GetConnectionStringsSection()); AddComponentInstance(engine.Container, configuration.Sections.Engine); RegisterConfiguredComponents(engine.Container, configuration.Sections.Engine); AddComponentInstance(engine.Container, configuration.Sections.Web); InitializeEnvironment(engine.Container, configuration.Sections); AddComponentInstance(engine.Container, configuration.Sections.Database); AddComponentInstance(engine.Container, configuration.Sections.Management); AddComponentInstance(engine.Container, broker); var skipTypes = configuration.Sections.Engine.Components.GetConfiguredServiceTypes(); #if DEBUG_2 var watf = new WebAppTypeFinder(new TypeCache(new BasicTemporaryFileHelper(null)), configuration.Sections.Engine); engine.Container.AddComponentInstance(watf.GetType().FullName, typeof(ITypeFinder), watf); var registrator = new ServiceRegistrator(watf, engine.Container); #else AddComponentUnlessConfigured(engine.Container, typeof(BasicTemporaryFileHelper), typeof(BasicTemporaryFileHelper), skipTypes); AddComponentUnlessConfigured(engine.Container, typeof(TypeCache), typeof(TypeCache), skipTypes); AddComponentUnlessConfigured(engine.Container, typeof(ITypeFinder), typeof(WebAppTypeFinder), skipTypes); AddComponentUnlessConfigured(engine.Container, typeof(ServiceRegistrator), typeof(ServiceRegistrator), skipTypes); var registrator = engine.Container.Resolve<ServiceRegistrator>(); #endif var services = registrator.FindServices(); var configurationKeys = configuration.GetComponentConfigurationKeys(); services = registrator.FilterServices(services, configurationKeys); services = registrator.FilterServices(services, skipTypes); registrator.RegisterServices(services); // workaround for problem with open generic binding for IRepository<> - requires that [Service] attributes be removed var cir = engine.Container.Resolve<IContentItemRepository>(); // register the signleton the hard way engine.Container.AddComponentInstance("n2.IRepository.ContentItem", typeof(IRepository<ContentItem>), cir); #if DEBUG_2 // double check container sanity var test = engine.Container.Resolve<IRepository<ContentItem>>(); Logger.Debug(cir.GetType().FullName); Logger.Debug(test.GetType().FullName); if (!cir.Equals(test)) throw new Exception("inconsistent repositories"); #endif InitializeUrlParser(engine.Container); }
public void PublisherWithoutSubscriber() { EventBroker eb = new EventBroker(); Publisher p = new Publisher(); Subscriber.Count = 0; eb.Register(p); p.CallCount(); eb.Unregister(p); Assert.AreEqual(0, Subscriber.Count); }
public void PublishShouldSignalSubscriberUsingDefaultSynchronizationContext() { // arrange var target = new EventBroker(); var handler = new Mock<Action<string, object, EventArgs>>(); handler.Setup( f => f( It.IsAny<string>(), It.IsAny<object>(), It.IsAny<EventArgs>() ) ); // act target.Subscribe<EventArgs>( "Test", handler.Object ); target.Publish( "Test", null, EventArgs.Empty ); // assert handler.Verify( f => f( "Test", null, EventArgs.Empty ), Times.Once() ); }
private void SimpleEvent(int runNumber) { EventBroker eventBroker = new EventBroker(); var p = new Publisher(); var s = new Subscriber(); eventBroker.Register(p); eventBroker.Register(s); this.Run( p.FireEvent, runNumber + " simple event", 0); }
public void SetUp() { this.testee = new EventBroker(); this.publisher = new NamedPublisher("Test.One"); this.subscriberParent = new NamedSubscriber("Test"); this.subscriberTwin = new NamedSubscriber("Test.One"); this.subscriberSibling = new NamedSubscriber("Test.Two"); this.subscriberChild = new NamedSubscriber("Test.One.Child"); this.testee.Register(this.publisher); this.testee.Register(this.subscriberParent); this.testee.Register(this.subscriberTwin); this.testee.Register(this.subscriberSibling); this.testee.Register(this.subscriberChild); }
/// <summary>Creates a new instance of the RequestLifeCycleHandler class.</summary> /// <param name="webContext">The web context wrapper.</param> /// <param name="broker"></param> /// <param name="installer"></param> /// <param name="dispatcher"></param> /// <param name="adapters"></param> /// <param name="errors"></param> /// <param name="editConfig"></param> /// <param name="hostConfig"></param> /// <param name="managementUrls"></param> public RequestLifeCycleHandler(IWebContext webContext, EventBroker broker, InstallationManager installer, RequestPathProvider dispatcher, IContentAdapterProvider adapters, IErrorHandler errors, IEditUrlManager editUrlManager, EditSection editConfig, HostSection hostConfig) { checkInstallation = editConfig.Installer.CheckInstallationStatus; welcomeUrl = editConfig.Installer.WelcomeUrl; managementUrl = editConfig.ManagementInterfaceUrl; rewriteMethod = hostConfig.Web.Rewrite; this.webContext = webContext; this.broker = broker; this.adapters = adapters; this.errors = errors; this.editUrlManager = editUrlManager; this.installer = installer; this.dispatcher = dispatcher; }
static void Main(string[] args) { Console.Title = "Procurement"; using (var eventBroker = new EventBroker()) { eventBroker.ConnectionStatus += (s, ev) => Console.WriteLine("Procurement: " + (ev.Success ? "Connected!" : ev.ErrorMessage)); eventBroker.Remotely("http://localhost:53001/") .Subscribe(new ProductOrderPointReachedEventConsumer()) .Remotely("http://localhost:53002/") .Subscribe(new ProductOrderPointReachedEventConsumer()); Console.ReadKey(); } }
public InstallationChecker(IWebContext webContext, EventBroker broker, ConfigurationManagerWrapper configuration, InstallationManager installer) { this.installer = installer; if (configuration.Sections.Management.Installer.CheckInstallationStatus) { welcomeUrl = configuration.Sections.Management.Installer.WelcomeUrl; managementUrl = configuration.Sections.Management.Paths.ManagementInterfaceUrl; this.webContext = webContext; this.broker = broker; this.broker.BeginRequest += BeginRequest; this.status = installer.GetStatus(); } else { installer.UpdateStatus(SystemStatusLevel.Unconfirmed); } }
static void Main(string[] args) { IEventBroker broker = new EventBroker(); using (var manager = new ParameterManager(broker)) { var parameter1 = new Parameter(broker) {Name = "CD", Value = 10}; var parameter2 = new Parameter(broker) {Name = "HEIGHT", Value = 100}; parameter1.Value = 12; parameter1.Value = 13; parameter1.Value = 14; parameter1.Value = 15; parameter1.Value = 15; parameter2.Value = 0; } }
private void TrueMatcher(int runNumber) { EventBroker eventBroker = new EventBroker(); eventBroker.AddGlobalMatcher(new Matcher(true)); var p = new Publisher(); var s = new Subscriber(); eventBroker.Register(p); eventBroker.Register(s); this.Run( p.FireEvent, runNumber + " true matcher", 0); }
static void Main(string[] args) { Console.Title = "Computer Stock"; using (var eventBroker = new EventBroker("http://localhost:53002/")) { eventBroker.ConnectionStatus += (s, ev) => Console.WriteLine("Computer stock: " + (ev.Success ? "Connected!" : ev.ErrorMessage)); eventBroker .Locally() .Subscribe<ProductShippedEvent>(x=> Console.WriteLine(String.Format("{0} order packed and shipped", x.ProductName))) .Remotely("http://localhost:53000/") .Subscribe(new ProductOrderedEventConsumer(eventBroker)); Console.ReadKey(); } }
public static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); EventBroker eventBroker = new EventBroker(); // add log extension to the event broker to get log messages eventBroker.AddExtension(new DebugLogger()); Pong oponent = new Pong(); Ping form = new Ping(); eventBroker.Register(oponent); eventBroker.Register(form); Application.Run(form); }
public void SeveralHandlers() { EventBroker eventBroker = new EventBroker(); Publisher p = new Publisher(); Subscriber s1 = new Subscriber(); Subscriber s2 = new Subscriber(); eventBroker.Register(p); eventBroker.Register(s1); eventBroker.Register(s2); CancelEventArgs e = new CancelEventArgs(false); p.Fire(e); Assert.AreEqual(1, s1.NumberOfHandledEvents, "s1 was not called"); Assert.AreEqual(0, s2.NumberOfHandledEvents, "s2 was called"); }
/// <summary> /// Создает DC поезд /// </summary> /// <returns></returns> /// <exception cref="ArgumentOutOfRangeException">less zero.</exception> public static BaseTrain GetDCTrain(String trainName, EventBroker broker) { return(new DCTrain(АdditionalParameterRepository.GetDCMachineParametres(trainName), АdditionalParameterRepository.GetDCTrainParametres(trainName), trainName, broker)); }
public BugsJune() { RuntimeHost.Initialize(); EventBroker.ClearAllSubscriptions(); }
public void Dispose() { RuntimeHost.CleanUp(); EventBroker.ClearAllSubscriptions(); }
public void SetupEventBroker() { "Establish an event broker".x(() => this.eventBroker = new EventBroker()); }
public void UnRegist(EventBroker eventBroker) { eventBroker.Unregister(this); }
void OnDestroy() { EventBroker.Instance().UnsubscribeMessage <RequirementUIMessage>(UpdateRequirementUI); EventBroker.Instance().UnsubscribeMessage <CurrentStylePointsMessage>(UpdateStylePointsUI); EventBroker.Instance().UnsubscribeMessage <SendActiveMissionMessage>(OnGetMissionData); }
public Foo(EventBroker broker) { Broker = broker ?? throw new ArgumentNullException(paramName: nameof(broker)); }
void SaveDocument_Executed(object sender, ExecutedRoutedEventArgs e) { ClientStats.LogEvent("Save document in message details view"); EventBroker.Publish(AppEvents.Save, (Document)e.Parameter); }
public IconHandler(IProvider <VirtualPathProvider> vppProvider, EventBroker broker) { this.vppProvider = vppProvider; this.broker = broker; }
public AcceptanceTests_FirstPart() { RuntimeHost.Initialize(); EventBroker.ClearAllSubscriptions(); }
private void SceneUnloaded(AsyncOperation operation) { EventBroker.TriggerOnSceneUnloaded(); }
void Awake() { EventBroker.Instance().SubscribeMessage <SendActiveMissionMessage>(OnGetMissionData); }
void OnDisable() { EventBroker.Instance().UnsubscribeMessage <EventTogglePopWindow>(ValidateShouldDressUp); }
void OnDestroy() { EventBroker.Instance().UnsubscribeMessage <EventMysteryBoxBought>(OnLootBoxPurchased); EventBroker.Instance().UnsubscribeMessage <EventMysteryBoxOpened>(OnLootBoxOpened); }
public void Regist(EventBroker eventBroker) { eventBroker.Register(this); }