public void HandleQuit(QuitEvent quitEvent) { foreach (var handler in internalHandlers) { handler.HandleQuit(quitEvent); } }
private static void CurrentDomainOnDomainUnload(object sender, EventArgs eventArgs) { Logger.DebugWithLineNumber("Start CurrentDomainOnDomainUnload."); //------------------------------------------- // Shut down nodes. //------------------------------------------- foreach (var appDomainNodeTask in AppDomainNodeTasks) { appDomainNodeTask.Value.Dispose(); } //------------------------------------------- // Shut down managers. //------------------------------------------- foreach (var appDomainManagerTask in AppDomainManagerTasks) { appDomainManagerTask.Value.Dispose(); } QuitEvent.Set(); Logger.DebugWithLineNumber("Finished CurrentDomainOnDomainUnload."); }
void TriggerQuitEvent(object sender, ButtonEventArgs e) { if (QuitEvent != null) { QuitEvent.Invoke(this, EventArgs.Empty); } }
private static void StartSelfHosting() { var configuration = new Configuration(Settings.Default.IntegrationControllerBaseAddress); var address = configuration.BaseAddress.Scheme + "://+:" + configuration.BaseAddress.Port + "/"; using (WebApp.Start(address, appBuilder => { var builder = new ContainerBuilder(); var container = builder.Build(); var config = new HttpConfiguration { DependencyResolver = new AutofacWebApiDependencyResolver(container) }; config.MapHttpAttributeRoutes(); appBuilder.UseAutofacMiddleware(container); appBuilder.UseAutofacWebApi(config); appBuilder.UseWebApi(config); })) { Logger.InfoWithLineNumber("Started listening on port : ( " + address + " )"); QuitEvent.WaitOne(); } }
/// <summary> /// <para>This event is called internally when a use sends QUIT</para> /// </summary> /// <param name="nick">Nickname of user who quit</param> /// <param name="message">Message associated with quit ('reason')</param> protected virtual void OnQuit(string nick, string message) { foreach (Channel c in Channels) { c.Users.Remove(nick); } QuitEvent.Raise(this, new QuitEventArgs(nick, message)); }
private static bool ConsoleCtrlCheck(CtrlTypes ctrlType) { if (ctrlType == CtrlTypes.CtrlCloseEvent || ctrlType == CtrlTypes.CtrlShutdownEvent) { QuitEvent.Set(); return(true); } return(false); }
protected virtual void OnQuit(string source, string message) { string sourceNick = source.GetNickFromSource(); lock (_channels) { foreach (var c in _channels.Values.Where(x => x.HasUser(sourceNick))) { c.RemoveUser(sourceNick); } } QuitEvent.Raise(this, new QuitEventArgs(source, message)); }
private static void StartLoadBalancerProxy(IEnumerable <Uri> managerUriList) { Logger.DebugWithLineNumber("Start."); var configuration = new Configuration(Settings.Default.ManagerLocationUri); var address = configuration.BaseAddress.Scheme + "://+:9000/StardustDashboard"; RoundRobin.Set(managerUriList.ToList()); using (WebApp.Start <LoadBalancerStartup>(address)) { Logger.InfoWithLineNumber("Load balancer started listening on port : ( " + address + " )"); QuitEvent.WaitOne(); } }
void OnQuit(QuitEvent e) { Dictionary <string, object> UserProperties = new Dictionary <string, object>(); UserProperties.Add("SDistanceMax", _distanceMax); UserProperties.Add("SLastWindow", _lastMenu); UserProperties.Add("SCoins", _sumCoin); UserProperties.Add("STSession", Time.time - _lastEndSessionTime); UserProperties.Add("SRun", _runCount); UserProperties.Add("STMenus", Time.time - _lastEndSessionTime - _sumRunTime); UserProperties.Add("STRuns", _sumRunTime); _amplitude.logEvent("EndSession", UserProperties); _distanceMax = 0; _sumRunTime = 0; _sumCoin = 0; _runCount = 0; _lastEndSessionTime = Time.time; }
public static void Main(string[] args) { if (args.Length < 2) { PokewatchLogger.Log("[-]Missing Arguments. Indeces of account and regions must be specified.", "PokewatchUnknown"); Environment.Exit(2); } s_config = ConfigurationManager.ReadConfiguration("Pokewatch"); if (s_config == null) { Environment.Exit(2); } try { s_account = s_config.PoGoAccounts[int.Parse(args[0])]; for (int i = 1; i < args.Length; i++) { s_regions.Add(s_config.Regions[int.Parse(args[i])]); } } catch { PokewatchLogger.Log("[-]Arguments do not align with provided configuration: " + string.Join(" ", args), "PokewatchUnknown"); Environment.Exit(2); } try { s_scanAreas = s_regions.SelectMany(r => r.Locations.Select(l => new ScanArea { Location = l, Name = r.Name, Prefix = r.Prefix, Suffix = r.Suffix, Inclusions = r.Inclusions, Exclusions = r.Exclusions })).ToList(); s_currentScan = s_scanAreas.First(); s_scanIndex = 0; } catch { PokewatchLogger.Log("[-]Invalid Region Configuration", AccountManager.GetAccountName(s_account)); Environment.Exit(2); } Console.Title = AccountManager.GetAccountName(s_account) + ": " + string.Join(", ", s_regions.Select(r => r.Name)); s_pogoSession = AccountManager.SignIn(s_account, s_currentScan.Location); if (s_pogoSession == null) { PokewatchLogger.Log("[-]Unable to sign in to PokemonGo.", AccountManager.GetAccountName(s_account)); Environment.Exit(3); } if (!PrepareTwitterClient()) { Environment.Exit(4); } PokewatchLogger.Log("[+]Sucessfully signed in to twitter.", AccountManager.GetAccountName(s_account)); if (s_pogoSession.StartupAsync().Result) { PokewatchLogger.Log("[-]POGO Couldn't start.", "PokewatchUnknown"); Environment.Exit(2); } s_pogoSession.AccessTokenUpdated += (sender, eventArgs) => { PokewatchLogger.Log("[+]Access token updated.", AccountManager.GetAccountName(s_account)); }; s_pogoSession.Map.Update += (sender, eventArgs) => { PokewatchLogger.Log("[+]Location Acknowleged. Searching...", AccountManager.GetAccountName(s_account)); if (Search()) { UpdateLocation(); } }; Console.CancelKeyPress += (sender, eArgs) => { QuitEvent.Set(); eArgs.Cancel = true; }; QuitEvent.WaitOne(); }
public override void HandleQuit(QuitEvent ev) { Bind(ev.User); }
public static void OnQuit(QuitEvent evt) { Sdl.Quit(); Environment.Exit(0); }
public virtual void HandleQuit(QuitEvent ev) { }
protected virtual void OnQuit(RemoteServer server) { QuitEvent?.Invoke(server, EventArgs.Empty); }
public override void HandleQuit(QuitEvent ev) { DisplayEvent(ev.User + " has quit (" + ev.Reason + ")", ev.User, new ChatChannel(CHANNEL_QUIT)); }
public static void SendQuitEvent(object sender, QuitEvent evt) { var handler = OnQuit; handler?.Invoke(sender, evt); }
public static void PublishQuitEvent() { QuitEvent?.Invoke(); Instance.EmitSignal(nameof(Quit)); }
internal void OnQuit() { QuitEvent?.Invoke(); Dispose(); }
public void OnQuit(EventArgs e) { QuitEvent?.Invoke(this, e); }
private void OnApplicationQuit() { QuitEvent.Invoke(); }
protected virtual void RaiseQuitEvent(TokenEventArgs e) { QuitEvent?.Invoke(this, e); }
public static void FireQuitEvent() { QuitEvent?.Invoke(null, null); }
private IrcEvent ParseQuit(UserData sender, EntityData target, string[] param, string text) { // Export before deleting data var ev = new QuitEvent((User)sender, text); Entities.DropUser(sender); return ev; }