Example #1
0
        /// <summary>
        /// Load the plugins.
        /// </summary>
        /// <history>
        /// [Curtis_Beard]      07/28/2006	Created
        /// [Curtis_Beard]      08/07/2007	CHG: remove check against version
        /// </history>
        public static void Load()
        {
            // for right now, just load the internal plugins
            Plugins.MicrosoftWord.MicrosoftWordPlugin wordPlugin = new Plugins.MicrosoftWord.MicrosoftWordPlugin();
            PluginWrapper wrapper = new PluginWrapper(wordPlugin, string.Empty, wordPlugin.Name, true, true);

            Add(wrapper);

            // enable/disable plugins based on saved state (if found)
            string[] plugins = Common.SplitByString(Core.PluginSettings.Plugins, Constants.PLUGIN_SEPARATOR);
            foreach (string plugin in plugins)
            {
                string[] values = Common.SplitByString(plugin, Constants.PLUGIN_ARGS_SEPARATOR);
                if (values.Length == 3)
                {
                    string name    = values[0];
                    string version = values[1];
                    string enabled = values[2];

                    for (int i = 0; i < __PluginCollection.Count; i++)
                    {
                        if (__PluginCollection[i].Plugin.Name.Equals(name))
                        {
                            __PluginCollection[i].Enabled = bool.Parse(enabled);
                            break;
                        }
                    }
                }
            }
        }
Example #2
0
        /// <summary>
        /// Load the plugins.
        /// </summary>
        /// <history>
        /// [Curtis_Beard]      07/28/2006	Created
        /// [Curtis_Beard]      08/07/2007	CHG: remove check against version
        /// </history>
        public static void Load()
        {
            // for right now, just load the internal plugins
             Plugins.MicrosoftWord.MicrosoftWordPlugin wordPlugin = new Plugins.MicrosoftWord.MicrosoftWordPlugin();
             PluginWrapper wrapper = new PluginWrapper(wordPlugin, string.Empty, wordPlugin.Name, true, true);
             Add(wrapper);

             // enable/disable plugins based on saved state (if found)
             string[] plugins = Common.SplitByString(Core.PluginSettings.Plugins, Constants.PLUGIN_SEPARATOR);
             foreach (string plugin in plugins)
             {
            string[] values = Common.SplitByString(plugin, Constants.PLUGIN_ARGS_SEPARATOR);
            if (values.Length == 3)
            {
               string name = values[0];
               string version = values[1];
               string enabled = values[2];

               for (int i = 0; i < __PluginCollection.Count; i++)
               {
                  if (__PluginCollection[i].Plugin.Name.Equals(name))
                  {
                     __PluginCollection[i].Enabled = bool.Parse(enabled);
                     break;
                  }
               }
            }
             }
        }