Ejemplo n.º 1
0
        private void Inbox_ItemAdd(object item)
        {
            var mail = (FollowUpItem.GetFollowUpItem(item) as FollowUpMailItem);

            if (mail == null)
            {
                return;
            }

            mail.ClearParentFlag();

            //COMMENTED BECAUSE NOTHING BELOW HERE
            //if (mail.SentOn < DateTime.Now.AddHours(Settings.Default.IgnoreSentItemsBeforeHours))
            //    //Sent longer than X hours ago -- don't bother
            //    return;
        }
Ejemplo n.º 2
0
        //Create callback methods here. For more information about adding callback methods, visit http://go.microsoft.com/fwlink/?LinkID=271226

        //public void Ribbon_Load(Office.IRibbonUI ribbonUI)
        //{
        //    this.ribbon = ribbonUI;
        //}

        public void TaskContext_Click(dynamic sender)
        {
            var explorer = Globals.GreatFollowUpperAddin.Application.ActiveExplorer();

            if (explorer?.Selection == null)
            {
                return;
            }
            if (explorer.Selection.Count > 1 && Control.ModifierKeys == Keys.Shift) //Do not support multi selection and pop up dialog box
            {
                return;
            }


            foreach (object i in explorer.Selection)
            {
                FollowUpItem item;
                try
                {
                    item = FollowUpItem.GetFollowUpItem(i);
                }
                catch (RuntimeBinderException)
                {
                    MessageBox.Show("Type of a selected item not supported", GreatFollowUpperAddin.Name, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    break;
                }

                if (Control.ModifierKeys == Keys.Shift)
                {
                    var fupf = new FollowUpForm(item, FollowUpItem.FollowUpTrigger.Ribbon, sender.Tag);
                    fupf.Show();
                }
                else
                {
                    DateTime?followUpDate = Utils.ParseFollowUpDate(sender.Tag);
                    item.DoFollowUp(true, followUpDate, false, item.ReminderSet, false, false);
                }
            }



            //if (!License.IsLicenseValid())
            //    return;

            //var explorer = Globals.GreatFollowUpperAddin.Application.ActiveExplorer();
            //if (explorer?.Selection == null || explorer.Selection.Count != 1)
            //    return;

            //FollowUpItem item;
            //try
            //{
            //    item = FollowUpItem.GetFollowUpItem(explorer.Selection[1]);
            //}
            //catch (RuntimeBinderException)
            //{
            //    MessageBox.Show("Type of selected item not supported", GreatFollowUpperAddin.Name, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            //    return;
            //}

            ////var mail = (Outlook.MailItem)item;

            //if (Control.ModifierKeys == Keys.Shift)
            //{
            //    var fupf = new FollowUpForm(item, FollowUpItem.FollowUpTrigger.Ribbon, sender.Tag);
            //    fupf.Show();
            //}
            //else
            //{
            //    DateTime? followUpDate = Utils.ParseFollowUpDate(sender.Tag);
            //    item.DoFollowUp(true, followUpDate, false, item.ReminderSet, false, false);
            //}
        }
Ejemplo n.º 3
0
        private void Categorize(object item)
        {
            var i = FollowUpItem.GetFollowUpItem(item);

            i?.Categorize();
        }