Ejemplo n.º 1
0
 /// <summary>
 /// Configures user AddIn support.
 /// </summary>
 /// <param name="addInInstallTemp">
 /// The AddIn installation temporary directory.
 /// ConfigureUserAddIns will install the AddIns from this directory and
 /// store the parameter value in <see cref="AddInManager.AddInInstallTemp"/>.
 /// </param>
 /// <param name="userAddInPath">
 /// The path where user AddIns are installed to.
 /// AddIns from this directory will be loaded.
 /// </param>
 public void ConfigureUserAddIns(string addInInstallTemp, string userAddInPath)
 {
     if (!externalAddInsConfigured)
     {
         throw new InvalidOperationException("ConfigureExternalAddIns must be called before ConfigureUserAddIns");
     }
     AddInManager.AddInInstallTemp = addInInstallTemp;
     AddInManager.UserAddInPath    = userAddInPath;
     if (Directory.Exists(addInInstallTemp))
     {
         AddInManager.InstallAddIns(disabledAddIns);
     }
     if (Directory.Exists(userAddInPath))
     {
         AddAddInsFromDirectory(userAddInPath);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Use the specified configuration file to store information about
 /// disabled AddIns and external AddIns.
 /// You have to call this method to support the <see cref="AddInManager"/>.
 /// </summary>
 /// <param name="addInConfigurationFile">
 /// The name of the file used to store the list of disabled AddIns
 /// and the list of installed external AddIns.
 /// A good value for this parameter would be
 /// <c>Path.Combine(<see cref="PropertyService.ConfigDirectory"/>, "AddIns.xml")</c>.
 /// </param>
 public void ConfigureExternalAddIns(string addInConfigurationFile)
 {
     externalAddInsConfigured           = true;
     AddInManager.ConfigurationFileName = addInConfigurationFile;
     AddInManager.LoadAddInConfiguration(addInFiles, disabledAddIns);
 }