Пример #1
0
        public Notifier()
        {
            this.Closing += new CancelEventHandler(Notifier_Closing);
            InitializeComponent();
            Dictionary<string, int> snoozeAmounts = new Dictionary<string, int>();
            snoozeAmounts.Add("5 Minutes", 5);
            snoozeAmounts.Add("15 Minutes", 15);
            snoozeAmounts.Add("30 Minutes", 30);
            snoozeAmounts.Add("1 Hour", 60);
            snoozeAmounts.Add("3 Hours", 60 * 3);
            snoozeAmounts.Add("6 Hours", 60 * 6);
            snoozeAmounts.Add("12 Hours", 60 * 12);
            snoozeAmounts.Add("1 Day", 60 * 24);

            foreach (string snoozeAmount in snoozeAmounts.Keys)
            {
                TaggedMenuItem item = new TaggedMenuItem(snoozeAmount, snoozeAmounts[snoozeAmount]);
                item.Click += new EventHandler(item_Click);

                _snoozeMenuItem.MenuItems.Add(item);
            }
            this._viewDetailsbutton.Image = Properties.Resources.button_blue;
            this._viewDetailsbutton.PushImage = Properties.Resources.button_blue_hover;
            this._dueLabel.PushImage = Properties.Resources.button_black;
            this._dueLabel.Image = Properties.Resources.button_black;
        }
Пример #2
0
        public Notifier()
        {
            this.Closing += new CancelEventHandler(Notifier_Closing);
            InitializeComponent();
            Dictionary <string, int> snoozeAmounts = new Dictionary <string, int>();

            snoozeAmounts.Add("5 Minutes", 5);
            snoozeAmounts.Add("15 Minutes", 15);
            snoozeAmounts.Add("30 Minutes", 30);
            snoozeAmounts.Add("1 Hour", 60);
            snoozeAmounts.Add("3 Hours", 60 * 3);
            snoozeAmounts.Add("6 Hours", 60 * 6);
            snoozeAmounts.Add("12 Hours", 60 * 12);
            snoozeAmounts.Add("1 Day", 60 * 24);

            foreach (string snoozeAmount in snoozeAmounts.Keys)
            {
                TaggedMenuItem item = new TaggedMenuItem(snoozeAmount, snoozeAmounts[snoozeAmount]);
                item.Click += new EventHandler(item_Click);

                _snoozeMenuItem.MenuItems.Add(item);
            }
            this._viewDetailsbutton.Image     = Properties.Resources.button_blue;
            this._viewDetailsbutton.PushImage = Properties.Resources.button_blue_hover;
            this._dueLabel.PushImage          = Properties.Resources.button_black;
            this._dueLabel.Image = Properties.Resources.button_black;
        }
Пример #3
0
        private void item_Click(object sender, EventArgs e)
        {
            TaggedMenuItem menuItem = (TaggedMenuItem)sender;

            _callRecord.WasNotified = false;
            _callRecord.NotifyDate  = DateTime.Now.AddMinutes((int)menuItem.Tag);

            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }