/// <summary> /// Reads the plugin config file /// </summary> /// <param name="filename">Filename</param> /// <returns></returns> public static PluginConfig Read(string filename) { var config = new PluginConfig(); if (!File.Exists(filename)) return config; var doc = XDocument.Load(filename, LoadOptions.None); var root = doc.Root; if (root.Name == XML_ROOT_NAME) Read(root, config); return config; }
static void Read(XElement root, PluginConfig config) { config.OSVersion = ReadVersion(root, OS_VERSION_SECT); config.FrameworkVersion = ReadVersion(root, FRAMEWORK_VERSION_SECT); config.AppVersion = ReadVersion(root, APP_VERSION_SECT); }