internal static AddinInfo ReadFromDescription(AddinDescription description) { AddinInfo info = new AddinInfo(); info.id = description.LocalId; info.namspace = description.Namespace; info.name = description.Name; info.version = description.Version; info.author = description.Author; info.copyright = description.Copyright; info.url = description.Url; info.description = description.Description; info.category = description.Category; info.baseVersion = description.CompatVersion; foreach (Dependency dep in description.MainModule.Dependencies) { info.Dependencies.Add(dep); } foreach (ModuleDescription mod in description.OptionalModules) { foreach (Dependency dep in mod.Dependencies) { info.OptionalDependencies.Add(dep); } } return(info); }
public static AddinInfo ReadFromAddinFile(StreamReader r) { XmlDocument doc = new XmlDocument(); doc.Load(r); r.Close(); AddinInfo info = new AddinInfo(); info.id = doc.DocumentElement.GetAttribute("id"); info.namspace = doc.DocumentElement.GetAttribute("namespace"); info.name = doc.DocumentElement.GetAttribute("name"); if (info.id == "") { info.id = info.name; } info.version = doc.DocumentElement.GetAttribute("version"); info.author = doc.DocumentElement.GetAttribute("author"); info.copyright = doc.DocumentElement.GetAttribute("copyright"); info.url = doc.DocumentElement.GetAttribute("url"); info.description = doc.DocumentElement.GetAttribute("description"); info.category = doc.DocumentElement.GetAttribute("category"); info.baseVersion = doc.DocumentElement.GetAttribute("compatVersion"); ReadDependencies(info.Dependencies, info.OptionalDependencies, doc.DocumentElement); return(info); }
internal void ResetCachedData() { // The domain may have changed if (sourceFile != null) { domain = database.GetFolderDomain(null, Path.GetDirectoryName(sourceFile)); } desc = null; addin = null; }
void LoadAddinInfo() { if (addin == null) { try { AddinDescription m = Description; sourceFile = m.AddinFile; addin = AddinInfo.ReadFromDescription(m); } catch (Exception ex) { throw new InvalidOperationException("Could not read add-in file: " + configFile, ex); } } }
void LoadAddinInfo() { if (addin == null) { try { AddinDescription m = Description; sourceFile = m.AddinFile; addin = AddinInfo.ReadFromDescription(m); } catch (Exception ex) { throw new InvalidOperationException("Could not read add-in file: " + database.GetDescriptionPath(domain, id), ex); } } }
internal void ResetCachedData() { // The domain may have changed (?!) // This check has been commented out because GetFolderDomain will fail if sourceFile changed // or if there is no folder info for the add-in (it may happen when using pre-generated add-in // scan data files). // A domain change at run-time is an unlikely scenario and not properly supported anyway in // other parts of the code. In general, changes in an already loaded add-in are not supported. // if (sourceFile != null) // domain = database.GetFolderDomain (null, Path.GetDirectoryName (sourceFile)); desc = null; addin = null; }
void LoadAddinInfo() { if (addin == null) { try { AddinDescription m = Description; sourceFile = m.AddinFile; addin = AddinInfo.ReadFromDescription (m); } catch (Exception ex) { throw new InvalidOperationException ("Could not read add-in file: " + configFile, ex); } } }
internal void ResetCachedData() { desc = null; addin = null; }
public int CompareVersionTo (AddinInfo other) { return Addin.CompareVersions (this.version, other.Version); }
internal static AddinInfo ReadFromDescription (AddinDescription description) { AddinInfo info = new AddinInfo (); info.id = description.LocalId; info.namspace = description.Namespace; info.name = description.Name; info.version = description.Version; info.author = description.Author; info.copyright = description.Copyright; info.url = description.Url; info.description = description.Description; info.category = description.Category; info.baseVersion = description.CompatVersion; foreach (Dependency dep in description.MainModule.Dependencies) info.Dependencies.Add (dep); foreach (ModuleDescription mod in description.OptionalModules) { foreach (Dependency dep in mod.Dependencies) info.OptionalDependencies.Add (dep); } return info; }
public static AddinInfo ReadFromAddinFile (StreamReader r) { XmlDocument doc = new XmlDocument (); doc.Load (r); r.Close (); AddinInfo info = new AddinInfo (); info.id = doc.DocumentElement.GetAttribute ("id"); info.namspace = doc.DocumentElement.GetAttribute ("namespace"); info.name = doc.DocumentElement.GetAttribute ("name"); if (info.id == "") info.id = info.name; info.version = doc.DocumentElement.GetAttribute ("version"); info.author = doc.DocumentElement.GetAttribute ("author"); info.copyright = doc.DocumentElement.GetAttribute ("copyright"); info.url = doc.DocumentElement.GetAttribute ("url"); info.description = doc.DocumentElement.GetAttribute ("description"); info.category = doc.DocumentElement.GetAttribute ("category"); info.baseVersion = doc.DocumentElement.GetAttribute ("compatVersion"); ReadDependencies (info.Dependencies, info.OptionalDependencies, doc.DocumentElement); return info; }
internal void ResetCachedData () { // The domain may have changed if (sourceFile != null) domain = database.GetFolderDomain (null, Path.GetDirectoryName (sourceFile)); desc = null; addin = null; }
void LoadAddinInfo () { if (addin == null) { try { AddinDescription m = Description; sourceFile = m.AddinFile; addin = AddinInfo.ReadFromDescription (m); } catch (Exception ex) { throw new InvalidOperationException ("Could not read add-in file: " + database.GetDescriptionPath (domain, id), ex); } } }
public bool SupportsVersion(string version) { return(AddinInfo.SupportsVersion(version)); }
public int CompareVersionTo(AddinInfo other) { return(Addin.CompareVersions(this.version, other.Version)); }