/// <summary> /// Save plugins info to the file /// </summary> public virtual void Save() { //save the file string filePath = _fileProvider.MapPath(VerivoxPluginDefaults.PluginsInfoFilePath); string text = JsonConvert.SerializeObject(this, Formatting.Indented); _fileProvider.WriteAllText(filePath, text, Encoding.UTF8); }
/// <summary> /// Save plugin descriptor to the plugin description file /// </summary> public virtual void Save() { IVerivoxFileProvider fileProvider = EngineContext.Current.Resolve <IVerivoxFileProvider>(); //get the description file path if (OriginalAssemblyFile == null) { throw new Exception($"Cannot load original assembly path for {SystemName} plugin."); } string filePath = fileProvider.Combine(fileProvider.GetDirectoryName(OriginalAssemblyFile), VerivoxPluginDefaults.DescriptionFileName); if (!fileProvider.FileExists(filePath)) { throw new Exception($"Description file for {SystemName} plugin does not exist. {filePath}"); } //save the file string text = JsonConvert.SerializeObject(this, Formatting.Indented); fileProvider.WriteAllText(filePath, text, Encoding.UTF8); }