Ejemplo n.º 1
0
        void btnTimedTriggerAdd_Click(object sender, MVControlEventArgs e)
        {
            try
            {
                if (int.Parse(edtTimedTriggerMinutes.Text) <= 0)
                {
                    throw new Exception("Value for Minutes must be a whole number greater than 0.");
                }

                if (edtTimedTriggerMessage.Text.Length <= 0)
                {
                    throw new Exception("You have to enter a Message for your Timer.");
                }

                TimedTrigger trigger = new TimedTrigger(
                    int.Parse(edtTimedTriggerMinutes.Text),
                    (Webhook)chcTimedTriggerWebhook.Data[chcTimedTriggerWebhook.Selected],
                    edtTimedTriggerMessage.Text,
                    true);

                TimedTriggers.Add(trigger);

                RefreshTimedTriggerList();
                SaveSettings();
            }
            catch (Exception ex)
            {
                Util.WriteToChat("Error adding new Timer: " + ex.Message);
                Util.LogError(ex);
            }
        }
Ejemplo n.º 2
0
 void PrintTimedTrigger(TimedTrigger trigger)
 {
     try
     {
         Util.WriteToChat(trigger.ToString());
     }
     catch (Exception ex)
     {
         Util.LogError(ex);
     }
 }