public Ping() { pingSender.PingCompleted += new PingCompletedEventHandler(PingComplete); this.context = new PingContext(this); this.context.Observer = ObserverTrace.Instance(traceName); this.context.EndHandler += new EventHandler <EventArgs>(StateMachineEnd); this.context.EnterInitialState(); Reset(); }
private static void ConfigureServices() { var services = new ServiceCollection(); services.AddDbContext <PingContext>(options => options.UseSqlServer(@"Server=(localdb)\MSSQLLocalDB;Database=Ping;Trusted_Connection=True;") , ServiceLifetime.Transient); services.AddScoped <ServiceFactory>(p => p.GetService); services.AddSingleton <Publisher>(); services.AddTransient <INotificationHandler <Pinged>, AsyncPingedHandler>(); services.AddTransient <INotificationHandler <Pinged>, FaultyPingedHandler>(); services.AddTransient <INotificationHandler <Pinged>, AsyncPingedSupressTransactionHandler>(); var provider = services.BuildServiceProvider(); _publisher = provider.GetRequiredService <Publisher>(); _dbContext = provider.GetRequiredService <PingContext>(); }
public AsyncPingedHandler(PingContext context) { _context = context; }
public AsyncPingedSupressTransactionHandler(PingContext context) { _context = context; }