示例#1
0
 /// <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;
 }
示例#2
0
 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);
 }