Пример #1
0
        private void GetAccountAutoArchivingSettings()
        {
            var settings = new EmailAccountsArchiveSettings();

            settings.Load();
            EmailArchiveAccountTabs.TabPages.Clear();
            var outlookSession = Application.Session;

            this.Log.Debug($"SettingsDialog: Setting up account archiving widget. Outlook version is {Globals.ThisAddIn.OutlookVersion}; there are {outlookSession.Accounts.Count} accounts");

            if (Globals.ThisAddIn.OutlookVersion >= OutlookMajorVersion.Outlook2010)
            {
                // Uses a Outlook 2013 APIs on Account object: DeliveryStore and GetRootFolder()
                // Needs work to make it work on Outlook 2010 and below.
                foreach (Account account in outlookSession.Accounts)
                {
                    this.Log.Debug($"SettingsDialog: Added email archiving tab for account {account.DisplayName}");
                    AddTabPage(account).LoadSettings(account, settings);
                }
            }
        }
Пример #2
0
        private void GetAccountAutoArchivingSettings()
        {
            var settings = new EmailAccountsArchiveSettings();

            settings.Load(Globals.ThisAddIn.Settings);
            EmailArchiveAccountTabs.TabPages.Clear();
            var outlookSession = Application.Session;

            if (Globals.ThisAddIn.OutlookVersion >= OutlookMajorVersion.Outlook2013)
            {
                // Uses a Outlook 2013 APIs on Account object: DeliveryStore and GetRootFolder()
                // Needs work to make it work on Outlook 2010 and below.
                foreach (Account account in outlookSession.Accounts)
                {
                    var name       = account.DisplayName;
                    var store      = account.DeliveryStore;
                    var rootFolder = store.GetRootFolder();

                    var pageControl = AddTabPage(account);
                    pageControl.LoadSettings(account, settings);
                }
            }
        }