public override ICollection<Task> CreatePreExecutionTasks(FormPropertyBag propertyBag)
 {
     if (content == null) return null;
     List<Task> tasks = new List<Task>();
     tasks.Add(new Task(() => content.UpdateDistributionGroups()));
     return tasks;
 }
 public DistributionGroupControl(FormPropertyBag bag)
 {
     if (bag == null)
     {
         throw new ArgumentNullException("bag");
     }
     this.propertyBag = bag;
     InitializeComponent();
 }
 public DistributionGroupControl(FormPropertyBag bag)
 {
     if (bag == null)
     {
         throw new ArgumentNullException("bag");
     }
     this.propertyBag = bag;
     InitializeComponent();
 }
        public override ICollection <Task> CreatePreExecutionTasks(FormPropertyBag propertyBag)
        {
            if (content == null)
            {
                return(null);
            }
            List <Task> tasks = new List <Task>();

            tasks.Add(new Task(() => content.UpdateDistributionGroups()));
            return(tasks);
        }
 public override ICollection<AddinPageContent> CreatePages(FormPropertyBag propertyBag)
 {
     List<AddinPageContent> list = new List<AddinPageContent>();
     content = new DistributionGroupTabContent(propertyBag)
     {
         Title = Resources.DGTab_Name,
         HelpLink = null,
         HelpLinkText = null
     };
     list.Add(content);
     return list;
 }
        public override ICollection <AddinPageContent> CreatePages(FormPropertyBag propertyBag)
        {
            List <AddinPageContent> list = new List <AddinPageContent>();

            content = new DistributionGroupTabContent(propertyBag)
            {
                Title        = Resources.DGTab_Name,
                HelpLink     = null,
                HelpLinkText = null
            };
            list.Add(content);
            return(list);
        }
 public override Form CreateForm(FormPropertyBag bag)
 {
     UserPropertyAdvancedForm ret = new UserPropertyAdvancedForm(null == bag ? string.Empty : bag.UserName);
     if ((null == bag) || string.IsNullOrEmpty(bag.UserName) || !ret.loadUserData())
     {
         MessageBox.Show(Resources.ContosoServicesSubTab_ErrorDescription, "", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
         return null;
     }
     else
     {
         return ret;
     }
 }
        public override Form CreateForm(FormPropertyBag bag)
        {
            UserPropertyAdvancedForm ret = new UserPropertyAdvancedForm(null == bag ? string.Empty : bag.UserName);

            if ((null == bag) || string.IsNullOrEmpty(bag.UserName) || !ret.loadUserData())
            {
                MessageBox.Show(Resources.ContosoServicesSubTab_ErrorDescription, "", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
                return(null);
            }
            else
            {
                return(ret);
            }
        }
 public DistributionGroupTabContent(FormPropertyBag propertyBag)
     : base(propertyBag)
 {
     tabControl            = new DistributionGroupControl(base.PropertyBag);
     tabControl.Dock       = DockStyle.Fill;
     tabControl.AutoScroll = false;
     // ATTENTION:
     // the reason of loading data in page initiailzing coz that we need the UserName in propertyBag which will be
     // filled in with data after the controls are created. Therefore, we cannot get data we want in this ctor.
     this.PageInitializing += (object sender, EventArgs e) => { this.tabControl.StartLoadingData(); };
     this.PageValidating   += (object sender, CancelEventArgs e) =>
     {
         // Putting the data here coz this method is called in UI thread
         base.PropertyBag.AddinData[Constants.ExtendedParam_DGs] = tabControl.GetDistributionGroupsString();
     };
 }
 public override ICollection <Task> CreatePostExecutionTasks(FormPropertyBag propertyBag)
 {
     return(null);
 }
 public DistributionGroupTabContent(FormPropertyBag propertyBag)
     : base(propertyBag)
 {
     tabControl = new DistributionGroupControl(base.PropertyBag);
     tabControl.Dock = DockStyle.Fill;
     tabControl.AutoScroll = false;
     // ATTENTION:
     // the reason of loading data in page initiailzing coz that we need the UserName in propertyBag which will be
     // filled in with data after the controls are created. Therefore, we cannot get data we want in this ctor.
     this.PageInitializing += (object sender, EventArgs e) => { this.tabControl.StartLoadingData(); };
     this.PageValidating += (object sender, CancelEventArgs e) =>
         {
             // Putting the data here coz this method is called in UI thread
             base.PropertyBag.AddinData[Constants.ExtendedParam_DGs] = tabControl.GetDistributionGroupsString();
         };
 }
 public override ICollection<Task> CreatePostExecutionTasks(FormPropertyBag propertyBag)
 {
     return null;
 }