Nexus.Client.ModManagement.CategoryManager.ReadVersion C# (CSharp) Method

ReadVersion() public static method

Reads the category manager version from the given category file.
public static ReadVersion ( string p_strCategoryPath ) : System.Version
p_strCategoryPath string The category file whose version is to be read.
return System.Version
		public static Version ReadVersion(string p_strCategoryPath)
		{
			if (!File.Exists(p_strCategoryPath))
				return new Version("0.0.0.0");

			XDocument docCategory = XDocument.Load(p_strCategoryPath);

			XElement xelCategory = docCategory.Element("categoryManager");
			if (xelCategory == null)
				return new Version("0.0.0.0");

			XAttribute xatVersion = xelCategory.Attribute("fileVersion");
			if (xatVersion == null)
				return new Version("0.0.0.0");

			return new Version(xatVersion.Value);
		}