Esempio n. 1
0
        public virtual void Save(IPlugin plugin, string file)
        {
            // Append plugin directory
            string realFile = "plugins/" + plugin.Name + "/" + file;

            PluginConfigSerializer.Serialize(realFile, this);
        }
Esempio n. 2
0
        public virtual PluginConfig Load(IPlugin plugin, string file, Type type)
        {
            // Append plugin directory
            string realFile = "plugins/" + plugin.Name + "/" + file;

            if (!Directory.Exists("plugins/" + plugin.Name))
            {
                Directory.CreateDirectory("plugins/" + plugin.Name);
            }

            if (!File.Exists(realFile))
            {
                Save(plugin, file);
            }

            return(PluginConfigSerializer.Deserialize(realFile, type));
        }