Exemplo n.º 1
0
        /// <summary>
        /// Initializes the add-in engine.
        /// </summary>
        /// <param name="configDir">
        /// Location of the add-in registry.
        /// </param>
        /// <remarks>
        /// The add-in engine needs to be initialized before doing any add-in operation.
        /// Configuration information about the add-in registry will be stored in the
        /// provided location. The add-in engine will look for add-ins in an 'addins'
        /// subdirectory of the provided directory.
        ///
        /// When specifying a path, it is possible to use a special folder name as root.
        /// For example: [Personal]/.config/MyApp. In this case, [Personal] will be replaced
        /// by the location of the Environment.SpecialFolder.Personal folder. Any value
        /// of the Environment.SpecialFolder enumeration can be used (always between square
        /// brackets)
        /// </remarks>
        public static void Initialize(string configDir)
        {
            Assembly asm = Assembly.GetEntryAssembly();

            if (asm == null)
            {
                asm = Assembly.GetCallingAssembly();
            }
            AddinEngine.Initialize(asm, null, configDir, null, null);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes the add-in engine.
        /// </summary>
        /// <remarks>
        /// The add-in engine needs to be initialized before doing any add-in operation.
        /// When initialized with this method, it will look for add-ins in the global add-in registry.
        /// </remarks>
        public static void Initialize()
        {
            // Code not shared with the other Initialize since I need to get the calling assembly
            Assembly asm = Assembly.GetEntryAssembly();

            if (asm == null)
            {
                asm = Assembly.GetCallingAssembly();
            }
            AddinEngine.Initialize(asm, null, null, null, null);
        }