Exemple #1
0
 internal IList<GnuKey> GetPrivateKeys(string gnuPgPath)
 {
   _gnuPg.BinaryPath = gnuPgPath;
   if ( _gnuPg.BinaryExists() )
     return GetPrivateKeys();
   else
     return new List<GnuKey>();
 }
Exemple #2
0
    private void OutlookGnuPG_Startup(object sender, EventArgs e)
    {
      _settings = new Properties.Settings();

      if (string.IsNullOrEmpty(_settings.GnuPgPath))
      {
        _gnuPg = new GnuPG();
        Settings(); // Prompt for GnuPG Path
      }
      else
      {
        _gnuPg = new GnuPG(null, _settings.GnuPgPath);
        if (!_gnuPg.BinaryExists())
        {
          _settings.GnuPgPath = string.Empty;
          Settings(); // Prompt for GnuPG Path
        }
      }
      _gnuPg.OutputType = OutputTypes.AsciiArmor;

      _WrappedObjects = new Dictionary<Guid, object>();

      // Initialize command bar.
      // Must be saved/closed in Explorer Close event.
      // See http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/df53276b-6b44-448f-be86-7dd46c3786c7/
      AddGnuPGCommandBar(this.Application.ActiveExplorer());

      // Register an event for ItemSend
      Application.ItemSend += Application_ItemSend;
#if VSTO2008
      ((ApplicationEvents_11_Event)Application).Quit += OutlookGnuPG_Quit;
#endif

      // Initialize the outlook explorers
      _explorers = this.Application.Explorers;
      _explorers.NewExplorer += new Outlook.ExplorersEvents_NewExplorerEventHandler(OutlookGnuPG_NewExplorer);
      for (int i = _explorers.Count; i >= 1; i--)
      {
        WrapExplorer(_explorers[i]);
      }

      // Initialize the outlook inspectors
      _inspectors = this.Application.Inspectors;
      _inspectors.NewInspector += new Outlook.InspectorsEvents_NewInspectorEventHandler(OutlookGnuPG_NewInspector);
    }