Exemplo n.º 1
0
 /// <summary>
 /// Shows a prompt where the user can enter a string
 /// </summary>
 /// <param name="title">The title the user should see when this prompt shows up</param>
 /// <returns></returns>
 public static int ShowNumber(string title, string description)
 {
     newPrompt = new RemindMePrompt(title, description, PromptReason.NUMERIC);
     newPrompt.ShowDialog();
     BLIO.Log("RemindMePrompt closed and returned " + intReturnValue);
     return(intReturnValue);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Shows a prompt where the user can enter a string
 /// </summary>
 /// <param name="title">The title the user should see when this prompt shows up</param>
 /// <returns></returns>
 public static string ShowText(string title)
 {
     newPrompt = new RemindMePrompt(title, PromptReason.TEXT);
     newPrompt.ShowDialog();
     BLIO.Log("RemindMePrompt closed and returned " + strReturnValue);
     return(strReturnValue);
 }
Exemplo n.º 3
0
        private void postponeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            BLIO.Log("Toolstrip option clicked: Postpone (" + rem.Id + ")");
            int minutes = RemindMePrompt.ShowMinutes("Select your postpone time", "(in minutes or in xhxxm format (1h20m) )");

            if (minutes <= 0)
            {
                BLIO.Log("Postponing reminder with " + minutes + " minutes DENIED.");
                return;
            }

            if (rem.PostponeDate == null)//No postpone yet, create it
            {
                rem.PostponeDate = Convert.ToDateTime(rem.Date.Split(',')[0]).AddMinutes(minutes).ToShortDateString() + " " + Convert.ToDateTime(rem.Date.Split(',')[0]).AddMinutes(minutes).ToShortTimeString();
            }
            else//Already a postponedate, add the time to that date
            {
                rem.PostponeDate = Convert.ToDateTime(rem.PostponeDate).AddMinutes(minutes).ToShortDateString() + " " + Convert.ToDateTime(rem.PostponeDate).AddMinutes(minutes).ToShortTimeString();
            }

            BLReminder.EditReminder(rem);//Push changes

            UCReminders.Instance.UpdateCurrentPage();

            new Thread(() =>
            {
                //Log an entry to the database, for data!
                BLOnlineDatabase.PostponeCount++;
            }).Start();
        }
Exemplo n.º 4
0
 public static int ShowMinutes(string title, string description)
 {
     newPrompt = new RemindMePrompt(title, description, PromptReason.MINUTES);
     newPrompt.ShowDialog();
     if (minutes < 0)
     {
         minutes = 0;
     }
     return(minutes);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Shows a prompt where the user can enter a number
 /// </summary>
 /// <param name="title">The title the user should see when this prompt shows up</param>
 /// <returns></returns>
 public static int ShowNumber(string title)
 {
     newPrompt = new RemindMePrompt(title, PromptReason.NUMERIC);
     newPrompt.ShowDialog();
     BLIO.Log("RemindMePrompt closed and returned " + intReturnValue);
     if (intReturnValue < 0)
     {
         intReturnValue = 0;
     }
     return(intReturnValue);
 }
Exemplo n.º 6
0
        private void bunifuFlatButton2_Click(object sender, EventArgs e)
        {
            string text = RemindMePrompt.ShowText("Enter a message");

            if (!string.IsNullOrWhiteSpace(text))
            {
                RemindMeMessageFormManager.MakeMessagePopup(text, 11);
            }
            else
            {
                RemindMeMessageFormManager.MakeMessagePopup("This is a test.", 4);
            }
        }
Exemplo n.º 7
0
        private void postponeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int minutes = RemindMePrompt.ShowMinutes("Select your postpone time", "(in minutes or in xhxxm format (1h20m) )");

            if (rem.PostponeDate == null)//No postpone yet, create it
            {
                rem.PostponeDate = Convert.ToDateTime(rem.Date.Split(',')[0]).AddMinutes(minutes).ToString();
            }
            else//Already a postponedate, add the time to that date
            {
                rem.PostponeDate = Convert.ToDateTime(rem.PostponeDate).AddMinutes(minutes).ToString();
            }

            BLReminder.EditReminder(rem);//Push changes

            UCReminders.GetInstance().UpdateCurrentPage();
        }
        private void btnPostpone_Click(object sender, EventArgs e)
        {
            BLIO.Log("RemindMeMessageForm option clicked: Postpone (" + theReminder.Id + ")");
            isDialog = true;
            int minutes = RemindMePrompt.ShowMinutes("Select your postpone time", "(in minutes or in xhxxm format (1h20m) )");

            if (minutes <= 0)
            {
                BLIO.Log("Postponing reminder with " + minutes + " minutes DENIED.");
                return;
            }

            if (theReminder.PostponeDate == null)//No postpone yet, create it
            {
                theReminder.PostponeDate = Convert.ToDateTime(theReminder.Date.Split(',')[0]).AddMinutes(minutes).ToShortDateString() + " " + Convert.ToDateTime(theReminder.Date.Split(',')[0]).AddMinutes(minutes).ToShortTimeString();
            }
            else//Already a postponedate, add the time to that date
            {
                theReminder.PostponeDate = Convert.ToDateTime(theReminder.PostponeDate).AddMinutes(minutes).ToShortDateString() + " " + Convert.ToDateTime(theReminder.PostponeDate).AddMinutes(minutes).ToShortTimeString();
            }

            BLReminder.EditReminder(theReminder);//Push changes

            UCReminders.Instance.UpdateCurrentPage();

            new Thread(() =>
            {
                //Log an entry to the database, for data!
                try
                {
                    BLOnlineDatabase.PostponeCount++;
                }
                catch (ArgumentException ex)
                {
                    BLIO.Log("Exception at BLOnlineDatabase.PostponeCount++. -> " + ex.Message);
                    BLIO.WriteError(ex, ex.Message, true);
                }
            }).Start();

            btnPostpone.Enabled = false; //bypass bunifu bug
            this.Dispose();
        }