public CalDavSynchronizerToolBar (Application application, ComponentContainer componentContainer, object missing)
    {
      _componentContainer = componentContainer;

      var toolBar = application.ActiveExplorer().CommandBars.Add ("CalDav Synchronizer", MsoBarPosition.msoBarTop, false, true);

      var toolBarBtnOptions = (CommandBarButton) toolBar.Controls.Add (1, missing, missing, missing, missing);
      toolBarBtnOptions.Style = MsoButtonStyle.msoButtonIconAndCaption;
      toolBarBtnOptions.Caption = "Options";
      toolBarBtnOptions.FaceId = 222; // builtin icon: hand hovering above a property list
      toolBarBtnOptions.Tag = "View or set CalDav Synchronizer options";

      toolBarBtnOptions.Click += ToolBarBtn_Options_OnClick;

      _toolBarBtnSyncNow = (CommandBarButton) toolBar.Controls.Add (1, missing, missing, missing, missing);
      _toolBarBtnSyncNow.Style = MsoButtonStyle.msoButtonIconAndCaption;
      _toolBarBtnSyncNow.Caption = "Synchronize";
      _toolBarBtnSyncNow.FaceId = 107; // builtin icon: lightning hovering above a calendar table
      _toolBarBtnSyncNow.Tag = "Synchronize now";
      _toolBarBtnSyncNow.Click += ToolBarBtn_SyncNow_OnClick;

      var toolBarBtnAboutMe = (CommandBarButton) toolBar.Controls.Add (1, missing, missing, missing, missing);
      toolBarBtnAboutMe.Style = MsoButtonStyle.msoButtonIconAndCaption;
      toolBarBtnAboutMe.Caption = "About";
      toolBarBtnAboutMe.FaceId = 487; // builtin icon: blue round sign with "i" letter
      toolBarBtnAboutMe.Tag = "About CalDav Synchronizer";
      toolBarBtnAboutMe.Click += ToolBarBtn_About_OnClick;

      toolBar.Visible = true;
    }
    private void ThisAddIn_Startup (object sender, EventArgs e)
    {
      try
      {
        // Sometimes outlook raises this event multiple times (seems to be a bug)
        if (ComponentContainer != null)
          return;

        XmlConfigurator.Configure();
        s_logger.Info ("Startup entered.");

        ComponentContainer = new ComponentContainer (Application);
        ComponentContainer.SynchronizationFailedWhileReportsFormWasNotVisible += ComponentContainer_SynchronizationFailedWhileReportsFormWasNotVisible;

        if (IsOutlookVersionSmallerThan2010)
        {
          _calDavSynchronizerToolBar = new CalDavSynchronizerToolBar (Application, ComponentContainer, missing);
        }
        s_logger.Info ("Startup exiting.");
      }
      catch (Exception x)
      {
        ExceptionHandler.Instance.HandleException (x, s_logger);
      }
    }
    private void ThisAddIn_Startup (object sender, EventArgs e)
    {
      ComponentContainer.ConfigureServicePointManager();
      ComponentContainer = new ComponentContainer (Application.Session);

      if (IsOutlookVersionSmallerThan2010)
      {
        try
        {
          _calDavSynchronizerToolBar = new CalDavSynchronizerToolBar (Application, ComponentContainer, missing);
        }
        catch (System.Exception ex)
        {
          MessageBox.Show (ex.Message);
        }
      }
    }
    private void ThisAddIn_Startup (object sender, EventArgs e)
    {
      try
      {
        XmlConfigurator.Configure();
        s_logger.Info ("Startup entered.");

        ComponentContainer = new ComponentContainer (Application);

        if (IsOutlookVersionSmallerThan2010)
        {
          _calDavSynchronizerToolBar = new CalDavSynchronizerToolBar (Application, ComponentContainer, missing);
        }
        s_logger.Info ("Startup exiting.");
      }
      catch (Exception x)
      {
        ExceptionHandler.Instance.HandleException (x, s_logger);
      }
    }
 private void ThisAddIn_Startup (object sender, EventArgs e)
 {
   ComponentContainer.ConfigureServicePointManager();
   ComponentContainer = new ComponentContainer (Application.Session);
 }
 private void ThisAddIn_Startup(object sender, EventArgs e)
 {
     ComponentContainer.ConfigureServicePointManager();
     ComponentContainer = new ComponentContainer(Application.Session);
 }
示例#7
0
        public CalDavSynchronizerToolBar(Explorer explorer, ComponentContainer componentContainer, object missing, bool wireClickEvents)
        {
            _componentContainer = componentContainer;

            _toolBar = explorer.CommandBars.Add("CalDav Synchronizer", MsoBarPosition.msoBarTop, false, true);

            _toolBarBtnOptions         = (CommandBarButton)_toolBar.Controls.Add(1, missing, missing, missing, missing);
            _toolBarBtnOptions.Style   = MsoButtonStyle.msoButtonIconAndCaption;
            _toolBarBtnOptions.Caption = "Synchronization Profiles";
            _toolBarBtnOptions.FaceId  = 222; // builtin icon: hand hovering above a property list
            _toolBarBtnOptions.Tag     = "View or set CalDav Synchronization Profiles";
            if (wireClickEvents)
            {
                _toolBarBtnOptions.Click += ToolBarBtn_Options_OnClick;
            }


            _toolBarBtnGeneralOptions         = (CommandBarButton)_toolBar.Controls.Add(1, missing, missing, missing, missing);
            _toolBarBtnGeneralOptions.Style   = MsoButtonStyle.msoButtonIconAndCaption;
            _toolBarBtnGeneralOptions.Caption = "General Options";
            _toolBarBtnGeneralOptions.FaceId  = 222; // builtin icon: hand hovering above a property list
            _toolBarBtnGeneralOptions.Tag     = "View or set CalDav Synchronizer general options";
            if (wireClickEvents)
            {
                _toolBarBtnGeneralOptions.Click += ToolBarBtn_GeneralOptions_OnClick;
            }

            _toolBarBtnSyncNow         = (CommandBarButton)_toolBar.Controls.Add(1, missing, missing, missing, missing);
            _toolBarBtnSyncNow.Style   = MsoButtonStyle.msoButtonIconAndCaption;
            _toolBarBtnSyncNow.Caption = "Synchronize";
            _toolBarBtnSyncNow.FaceId  = 107; // builtin icon: lightning hovering above a calendar table
            _toolBarBtnSyncNow.Tag     = "Synchronize now";
            if (wireClickEvents)
            {
                _toolBarBtnSyncNow.Click += ToolBarBtn_SyncNow_OnClick;
            }

            _toolBarBtnAboutMe         = (CommandBarButton)_toolBar.Controls.Add(1, missing, missing, missing, missing);
            _toolBarBtnAboutMe.Style   = MsoButtonStyle.msoButtonIconAndCaption;
            _toolBarBtnAboutMe.Caption = "About";
            _toolBarBtnAboutMe.FaceId  = 487; // builtin icon: blue round sign with "i" letter
            _toolBarBtnAboutMe.Tag     = "About CalDav Synchronizer";
            if (wireClickEvents)
            {
                _toolBarBtnAboutMe.Click += ToolBarBtn_About_OnClick;
            }

            _toolBarBtnReports         = (CommandBarButton)_toolBar.Controls.Add(1, missing, missing, missing, missing);
            _toolBarBtnReports.Style   = MsoButtonStyle.msoButtonIconAndCaption;
            _toolBarBtnReports.Caption = "Reports";
            _toolBarBtnReports.FaceId  = 433; // builtin icon: statistics
            _toolBarBtnReports.Tag     = "Show reports of last sync runs";
            if (wireClickEvents)
            {
                _toolBarBtnReports.Click += ToolBarBtn_Reports_OnClick;
            }

            _toolBarBtnStatus         = (CommandBarButton)_toolBar.Controls.Add(1, missing, missing, missing, missing);
            _toolBarBtnStatus.Style   = MsoButtonStyle.msoButtonIconAndCaption;
            _toolBarBtnStatus.Caption = "Status";
            _toolBarBtnStatus.FaceId  = 433; // builtin icon: statistics
            _toolBarBtnStatus.Tag     = "Show  syncronization status";
            if (wireClickEvents)
            {
                _toolBarBtnStatus.Click += ToolBarBtn_Status_OnClick;
            }

            _toolBar.Visible = true;
        }