コード例 #1
0
ファイル: ThisAddIn.cs プロジェクト: s0lt4r/spamgrabber
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            _ReportSpam      = ReportSpam;
            _ReportHam       = ReportHam;
            _ReportSelected  = ReportSelected;
            _SafeView        = SafeView;
            _CopyToClipboard = CopyToClipboard;
            _Settings        = Settings;

            Explorer _objExplorer = Globals.ThisAddIn.Application.ActiveExplorer();

            //_cbSpamGrabber = _objExplorer.CommandBars.Add("SpamGrabber", Office.MsoBarPosition.msoBarTop, false, true);
            _cbSpamGrabber = _objExplorer.CommandBars["Standard"];

            _cbbDefaultSpam = CreateCommandBarButton(_cbSpamGrabber,
                                                     "Report Spam", "Report to Default Spam profile", "Report to Default Spam profile",
                                                     Office.MsoButtonStyle.msoButtonIcon, Properties.Resources.spamgrab_red,
                                                     true, true, _cbSpamGrabber.Controls.Count, _ReportSpam);

            _cbbDefaultHam = CreateCommandBarButton(_cbSpamGrabber,
                                                    "Report Ham", "Report to Default Ham profile", "Report to Default Ham profile",
                                                    Office.MsoButtonStyle.msoButtonIcon, Properties.Resources.spamgrab_green,
                                                    false, GlobalSettings.ShowHamButton, _cbSpamGrabber.Controls.Count, _ReportHam);

            _cbcbProfile         = AddComboBox(_cbSpamGrabber);
            _cbcbProfile.Visible = GlobalSettings.ShowSelectButton;

            _cbbReportSelected = CreateCommandBarButton(_cbSpamGrabber,
                                                        "Report", "Report to Selected Profile", "Report to Selected Profile",
                                                        Office.MsoButtonStyle.msoButtonCaption, null,
                                                        false, GlobalSettings.ShowSelectButton, _cbSpamGrabber.Controls.Count, _ReportSelected);

            _cbbPreview = CreateCommandBarButton(_cbSpamGrabber,
                                                 "Safe View", "Safe Preview", "Safe Preview",
                                                 Office.MsoButtonStyle.msoButtonIcon, Properties.Resources.search4doc,
                                                 true, GlobalSettings.ShowPreviewButton, _cbSpamGrabber.Controls.Count, _SafeView);

            _cbbCopyToClipboard = CreateCommandBarButton(_cbSpamGrabber,
                                                         "Copy Source", "Copy Source to Clipboard", "Copy Source to Clipboard",
                                                         Office.MsoButtonStyle.msoButtonIcon, Properties.Resources.spamgrab_copy,
                                                         false, GlobalSettings.ShowCopyButton, _cbSpamGrabber.Controls.Count, _CopyToClipboard);

            _cbbOptions = CreateCommandBarButton(_cbSpamGrabber,
                                                 "Options", "SpamGrabber Options", "SpamGrabber Options",
                                                 Office.MsoButtonStyle.msoButtonIcon, Properties.Resources.spamgrab_settings,
                                                 false, GlobalSettings.ShowSettingsButton, _cbSpamGrabber.Controls.Count, _Settings);

            Reporting.Application = Globals.ThisAddIn.Application;
        }
コード例 #2
0
ファイル: ThisAddIn.cs プロジェクト: s0lt4r/spamgrabber
        private Office.CommandBarComboBox AddComboBox(Office.CommandBar commandBar)
        {
            if (_cbcbProfile == null)
            {
                _cbcbProfile = (Office.CommandBarComboBox)
                    commandBar.Controls.Add(Office.MsoControlType.msoControlComboBox, 1, "Select spam profile", commandBar.Controls.Count, true);

                _cbcbProfile.Style = Office.MsoComboStyle.msoComboLabel;
                _cbcbProfile.Caption = "Select profile:";
                _cbcbProfile.TooltipText = "Select profile to report to";
                _cbcbProfile.BeginGroup = true;
                this.LoadDropDown();
            }
            return _cbcbProfile;
        }
コード例 #3
0
ファイル: ThisAddIn.cs プロジェクト: s0lt4r/spamgrabber
        private Office.CommandBarComboBox AddComboBox(Office.CommandBar commandBar)
        {
            if (_cbcbProfile == null)
            {
                _cbcbProfile = (Office.CommandBarComboBox)
                               commandBar.Controls.Add(Office.MsoControlType.msoControlComboBox, 1, "Select spam profile", commandBar.Controls.Count, true);

                _cbcbProfile.Style       = Office.MsoComboStyle.msoComboLabel;
                _cbcbProfile.Caption     = "Select profile:";
                _cbcbProfile.TooltipText = "Select profile to report to";
                _cbcbProfile.BeginGroup  = true;
                this.LoadDropDown();
            }
            return(_cbcbProfile);
        }
コード例 #4
0
ファイル: ThisAddIn.cs プロジェクト: s0lt4r/spamgrabber
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            _ReportSpam = ReportSpam;
            _ReportHam = ReportHam;
            _ReportSelected = ReportSelected;
            _SafeView = SafeView;
            _CopyToClipboard = CopyToClipboard;
            _Settings = Settings;

            Explorer _objExplorer = Globals.ThisAddIn.Application.ActiveExplorer();
            //_cbSpamGrabber = _objExplorer.CommandBars.Add("SpamGrabber", Office.MsoBarPosition.msoBarTop, false, true);
            _cbSpamGrabber = _objExplorer.CommandBars["Standard"];

            _cbbDefaultSpam = CreateCommandBarButton(_cbSpamGrabber,
                "Report Spam", "Report to Default Spam profile", "Report to Default Spam profile",
                Office.MsoButtonStyle.msoButtonIcon, Properties.Resources.spamgrab_red,
                true, true, _cbSpamGrabber.Controls.Count, _ReportSpam);

            _cbbDefaultHam = CreateCommandBarButton(_cbSpamGrabber,
                "Report Ham", "Report to Default Ham profile", "Report to Default Ham profile",
                Office.MsoButtonStyle.msoButtonIcon, Properties.Resources.spamgrab_green,
                false, GlobalSettings.ShowHamButton, _cbSpamGrabber.Controls.Count, _ReportHam);

            _cbcbProfile = AddComboBox(_cbSpamGrabber);
            _cbcbProfile.Visible = GlobalSettings.ShowSelectButton;

            _cbbReportSelected = CreateCommandBarButton(_cbSpamGrabber,
                "Report", "Report to Selected Profile", "Report to Selected Profile",
                Office.MsoButtonStyle.msoButtonCaption, null,
                false, GlobalSettings.ShowSelectButton, _cbSpamGrabber.Controls.Count, _ReportSelected);

            _cbbPreview = CreateCommandBarButton(_cbSpamGrabber,
                "Safe View", "Safe Preview", "Safe Preview",
                Office.MsoButtonStyle.msoButtonIcon, Properties.Resources.search4doc,
                true, GlobalSettings.ShowPreviewButton, _cbSpamGrabber.Controls.Count, _SafeView);

            _cbbCopyToClipboard = CreateCommandBarButton(_cbSpamGrabber,
                "Copy Source", "Copy Source to Clipboard", "Copy Source to Clipboard",
                Office.MsoButtonStyle.msoButtonIcon, Properties.Resources.spamgrab_copy,
                false, GlobalSettings.ShowCopyButton, _cbSpamGrabber.Controls.Count, _CopyToClipboard);

            _cbbOptions = CreateCommandBarButton(_cbSpamGrabber,
                "Options", "SpamGrabber Options", "SpamGrabber Options",
                Office.MsoButtonStyle.msoButtonIcon, Properties.Resources.spamgrab_settings,
                false, GlobalSettings.ShowSettingsButton, _cbSpamGrabber.Controls.Count, _Settings);

            Reporting.Application = Globals.ThisAddIn.Application;
        }