private static void timer_Tick(object sender, EventArgs e) { StoreSetting setting = SettingManager.GetStoreSetting("EnableAutoLogoffForDialogWindows"); bool disableForDialogWindows = ((setting.IntValue == null) || (setting.IntValue.Value == 0)); if (disableForDialogWindows && PosDialogWindow.HasPosDialogWindowsOpen) { return; } setting = SettingManager.GetStoreSetting("AutoLogoffTimeout"); if (setting.IntValue != null) { SettingManager.SetStoreSetting("AutoLogoffTimeout", setting.IntValue.Value.Clamp(5, 9999)); } if (UserControlManager.UserInactivity <= new TimeSpan(0, 0, 10)) { return; } if (AutoLogout != null) { AutoLogout.Invoke(null, new EventArgs()); } CloseDialogWindows(); StopAutoLogoutTimer(); Singleton.Logout(); MainWindow.Singleton.loginControl.Visibility = Visibility.Visible; MainWindow.Singleton.orderEntryControl.Visibility = Visibility.Hidden; }
public void SetLoginParameters(string parameters) { Debug.Log("SetLoginParameters: " + parameters); param = parameters; GameObject gameObject = GameObject.Find("Main"); if (null != gameObject) { AutoLogout component = gameObject.GetComponent <AutoLogout>(); if (null != component) { component.Relogin(param); } } }