public static DialogResult Show(MyXtraMessageArgs options) { MyXtraMessageBoxForm messageForm = new MyXtraMessageBoxForm(); DialogResult result = messageForm.ShowForm(options); options.ShowMessageNextTime = messageForm.ShowMessageNextTime; return(result); }
public DialogResult ShowForm(MyXtraMessageArgs messageArgs) { selectNext = messageArgs.ShowNextTime; disablebttns = messageArgs.DisableButtons; disableCancel = messageArgs.DisableCancel; autoClose = messageArgs.AutoClose; countDownCaption = messageArgs.ShowCountdown; timeout = messageArgs.Timeout; center = messageArgs.Center; timeoutResult = messageArgs.AutoCloseResult; return(base.ShowMessageBoxDialog(messageArgs)); }
private void InactivityTimer_Tick(object sender, EventArgs e) { if (UniversalVariables.IsLoggedIn) { //Calculates for how long we have been idle TimeSpan?inactiveTime = idleTimeTool.GetInactiveTime(); Console.WriteLine(inactiveTime); if (inactiveTime.Value.TotalSeconds >= Configurations.TimeoutPeriod.TotalSeconds & idleFlag) { //Idle idleFlag = false; MyXtraMessageArgs myArgs = new MyXtraMessageArgs() { Owner = this, Timeout = Configurations.LogoffPeriod.TotalSeconds.ToString().ToInt(), ShowCountdown = true, AutoClose = true, Icon = MessageBoxIcon.Warning.ToString(), Buttons = MessageBoxButtons.OKCancel, Text = string.Format("OBALog has been inactive for {0} hour/s, {1} minute/s and {2} second/s. It will log off in XXXXX seconds due to inactivity.{3}Click on 'Cancel' to cancel logging off. Clicking on 'OK' will make the system logoff now.", Configurations.TimeoutPeriod.Hours, Configurations.TimeoutPeriod.Minutes, Configurations.TimeoutPeriod.Seconds, Environment.NewLine) }; DialogResult dialogRes = new MyXtraMessageBoxForm().ShowForm(myArgs); switch (dialogRes) { case DialogResult.OK: InactivityTimer.Enabled = false; idleFlag = false; new LockScreen().ShowDialog(); break; case DialogResult.Cancel: idleFlag = true; break; } } } }