public void LessSingleTextGreater() { var v1 = new ExtendedVersion("2a"); var v2 = new ExtendedVersion("1a"); Assert.IsFalse(v1 < v2); }
public void LessSingleDoubleGreater() { var v1 = new ExtendedVersion("2.0"); var v2 = new ExtendedVersion("1"); Assert.IsFalse(v1 < v2); }
public void CompareDoubleGreater() { var v1 = new ExtendedVersion("1.2"); var v2 = new ExtendedVersion("1.1"); Assert.IsFalse(v1 == v2); }
public void ZeroVersesLotsLessThan() { var v1 = new ExtendedVersion("0.0"); var v2 = new ExtendedVersion("20071.2.0.0"); Assert.IsTrue(v1 <= v2); }
public void LessSingleDouble() { var v1 = new ExtendedVersion("1"); var v2 = new ExtendedVersion("2.0"); Assert.IsTrue(v1 < v2); }
public void GreaterSingleTextLess() { var v1 = new ExtendedVersion("1a"); var v2 = new ExtendedVersion("2a"); Assert.IsFalse(v1 > v2); }
public void HighVersesLowLessThan() { var v1 = new ExtendedVersion("20081.0"); var v2 = new ExtendedVersion("20071.2.0.0"); Assert.IsFalse(v1 <= v2); }
public void GreaterSingleDoubleLess() { var v1 = new ExtendedVersion("1"); var v2 = new ExtendedVersion("2.0"); Assert.IsFalse(v1 > v2); }
public void GreaterSingleTextGreater() { var v1 = new ExtendedVersion("2a"); var v2 = new ExtendedVersion("1a"); Assert.IsTrue(v1 > v2); }
public void CompareSingleText() { var v1 = new ExtendedVersion("1"); var v2 = new ExtendedVersion("1a"); Assert.IsFalse(v1 == v2); }
public void CompareSingle() { var v1 = new ExtendedVersion("1"); var v2 = new ExtendedVersion("1"); Assert.IsTrue(v1 == v2); }
/// <summary> /// Creates a new update search result. /// </summary> /// <param name="updateAvailable">Indicates whether an update is available.</param> /// <param name="updateUrl">The url of the update.</param> /// <param name="assetUrl">The asset url of the update.</param> /// <param name="version">The version of the update.</param> public UpdateSearchResult(bool updateAvailable, string updateUrl, string assetUrl, ExtendedVersion version) { UpdateAvailable = updateAvailable; UpdateUrl = updateUrl; AssetUrl = assetUrl; Version = version; }
public void LessSingleTextLess() { var v1 = new ExtendedVersion("1a"); var v2 = new ExtendedVersion("2a"); Assert.IsTrue(v1 < v2); }
public void LessSingle() { var v1 = new ExtendedVersion("1"); var v2 = new ExtendedVersion("1"); Assert.IsFalse(v1 < v2); }
public void CompareDoubleTextEqual() { var v1 = new ExtendedVersion("1.1a"); var v2 = new ExtendedVersion("1.1a"); Assert.IsTrue(v1 == v2); }
public void CompareDoubleTextLess() { var v1 = new ExtendedVersion("1.1a"); var v2 = new ExtendedVersion("1.2a"); Assert.IsFalse(v1 == v2); }
public UpdateNotificationWindow() { InitializeComponent(); this.Loaded += WindowLoadedHandler; Version = new ExtendedVersion(1, 0); DataContext = this; CanAuto = false; }
public UpdateNotificationWindow(ExtendedVersion version, bool canAuto) { InitializeComponent(); this.Loaded += WindowLoadedHandler; Version = version; DataContext = this; CanAuto = canAuto; }
private static async Task <string> DownloadChangelogAsync(ExtendedVersion version) { const string changelogUrl = "https://raw.githubusercontent.com/Artentus/ModMyFactory/master/CHANGELOG.md"; string document = string.Empty; try { document = await Task.Run(() => WebHelper.GetDocument(changelogUrl)); int i = document.IndexOf($"#### {version}"); if (i >= 0) { document = document.Substring(i); } } catch (WebException) { } return(document); }
public DedicationManager() { // Get the embedded resource stream. Type type = GetType(); Assembly assembly = type.Assembly; Stream stream = assembly.GetManifestResourceStream(type, "Dedication.xml"); if (stream == null) { throw new InvalidOperationException( "Cannot load Dedication.xml from the assembly to load dedications."); } // Load the XML from the given stream. using (XmlReader reader = XmlReader.Create(stream)) { // Loop through the reader. Dedications = new List <Dedication>(); Dedication dedication = null; while (reader.Read()) { // If we have a "dedication", we are either starting or // finishing one. if (reader.LocalName == "dedication") { if (reader.NodeType == XmlNodeType.Element) { dedication = new Dedication(); } else { Dedications.Add(dedication); dedication = null; } } if (reader.NodeType != XmlNodeType.Element || dedication == null) { continue; } // For the remaining tags, we just need to pull out the text. switch (reader.LocalName) { case "author": string author = reader.ReadString(); dedication.Author = author; break; case "version": string version = reader.ReadString(); var assemblyVersion = new ExtendedVersion(version); dedication.Version = assemblyVersion; break; case "dedicator": string dedicator = reader.ReadString(); dedication.Dedicator = dedicator; break; case "p": string p = reader.ReadOuterXml(); dedication.Html += p; break; } } // Finish up the stream. reader.Close(); } }
public void ParseTextVersion() { var v = new ExtendedVersion("1.2b3"); Assert.AreEqual("1.2b3", v.ToString()); }
public void CompareDoubleTextLess() { var v1 = new ExtendedVersion("1.1a"); var v2 = new ExtendedVersion("1.2a"); Assert.IsFalse(v1 == v2); }
public void CompareOpEqual3() { var v1 = new ExtendedVersion("1.2.3"); Assert.IsTrue(v1.Compare("= 1.2.3"), "With too many spaces"); }
public void ParseTextVersion() { var v = new ExtendedVersion("1.2b3"); Assert.AreEqual("1.2b3", v.ToString()); }
public void ZeroVersesLotsLessThan() { var v1 = new ExtendedVersion("0.0"); var v2 = new ExtendedVersion("20071.2.0.0"); Assert.IsTrue(v1 <= v2); }
public void GreaterSingleTextGreater() { var v1 = new ExtendedVersion("2a"); var v2 = new ExtendedVersion("1a"); Assert.IsTrue(v1 > v2); }
public void ParseSingleNumber() { var v = new ExtendedVersion("1"); Assert.AreEqual("1", v.ToString()); }
public void ParseDebianVersion2() { var v = new ExtendedVersion("1.2-3.4d"); Assert.AreEqual("1.2-3.4d", v.ToString()); }
public void CompareOpEqual3() { var v1 = new ExtendedVersion("1.2.3"); Assert.IsTrue(v1.Compare("= 1.2.3"), "With too many spaces"); }
public void CompareOpEqual2() { var v1 = new ExtendedVersion("1.2.3"); Assert.IsTrue(v1.Compare("=1.2.3"), "Without space"); }
public void ParseSingleNumber() { var v = new ExtendedVersion("1"); Assert.AreEqual("1", v.ToString()); }
public void ParseSpace() { var v = new ExtendedVersion(" "); Assert.IsTrue(v == null, "Never get here"); }
public void LessSingleTextLess() { var v1 = new ExtendedVersion("1a"); var v2 = new ExtendedVersion("2a"); Assert.IsTrue(v1 < v2); }
public void GreaterSingleTextLess() { var v1 = new ExtendedVersion("1a"); var v2 = new ExtendedVersion("2a"); Assert.IsFalse(v1 > v2); }
public void ParseDebianVersion2() { var v = new ExtendedVersion("1.2-3.4d"); Assert.AreEqual("1.2-3.4d", v.ToString()); }
public void HighVersesLowLessThan() { var v1 = new ExtendedVersion("20081.0"); var v2 = new ExtendedVersion("20071.2.0.0"); Assert.IsFalse(v1 <= v2); }
public void ParseSpace() { var v = new ExtendedVersion(" "); Assert.IsTrue(v == null, "Never get here"); }
public void LessSingle() { var v1 = new ExtendedVersion("1"); var v2 = new ExtendedVersion("1"); Assert.IsFalse(v1 < v2); }
public void ParseTwoNumbers() { var v = new ExtendedVersion("1.2"); Assert.AreEqual("1.2", v.ToString()); }
public void LessSingleDouble() { var v1 = new ExtendedVersion("1"); var v2 = new ExtendedVersion("2.0"); Assert.IsTrue(v1 < v2); }
public void CompareDoubleTextEqual() { var v1 = new ExtendedVersion("1.1a"); var v2 = new ExtendedVersion("1.1a"); Assert.IsTrue(v1 == v2); }
public void LessSingleDoubleGreater() { var v1 = new ExtendedVersion("2.0"); var v2 = new ExtendedVersion("1"); Assert.IsFalse(v1 < v2); }
public void CompareOpEqual2() { var v1 = new ExtendedVersion("1.2.3"); Assert.IsTrue(v1.Compare("=1.2.3"), "Without space"); }
public void CompareDoubleGreater() { var v1 = new ExtendedVersion("1.2"); var v2 = new ExtendedVersion("1.1"); Assert.IsFalse(v1 == v2); }
public void CompareSingle() { var v1 = new ExtendedVersion("1"); var v2 = new ExtendedVersion("1"); Assert.IsTrue(v1 == v2); }
public void LessSingleTextGreater() { var v1 = new ExtendedVersion("2a"); var v2 = new ExtendedVersion("1a"); Assert.IsFalse(v1 < v2); }
public void CompareSingleText() { var v1 = new ExtendedVersion("1"); var v2 = new ExtendedVersion("1a"); Assert.IsFalse(v1 == v2); }
public void ParseTwoNumbers() { var v = new ExtendedVersion("1.2"); Assert.AreEqual("1.2", v.ToString()); }
public void GreaterSingleDoubleLess() { var v1 = new ExtendedVersion("1"); var v2 = new ExtendedVersion("2.0"); Assert.IsFalse(v1 > v2); }
public DedicationManager() { // Get the embedded resource stream. Type type = GetType(); Assembly assembly = type.Assembly; Stream stream = assembly.GetManifestResourceStream(type, "Dedication.xml"); if (stream == null) { throw new InvalidOperationException( "Cannot load Dedication.xml from the assembly to load dedications."); } // Load the XML from the given stream. using (XmlReader reader = XmlReader.Create(stream)) { // Loop through the reader. Dedications = new List<Dedication>(); Dedication dedication = null; while (reader.Read()) { // If we have a "dedication", we are either starting or // finishing one. if (reader.LocalName == "dedication") { if (reader.NodeType == XmlNodeType.Element) { dedication = new Dedication(); } else { Dedications.Add(dedication); dedication = null; } } if (reader.NodeType != XmlNodeType.Element || dedication == null) { continue; } // For the remaining tags, we just need to pull out the text. switch (reader.LocalName) { case "author": string author = reader.ReadString(); dedication.Author = author; break; case "version": string version = reader.ReadString(); var assemblyVersion = new ExtendedVersion(version); dedication.Version = assemblyVersion; break; case "dedicator": string dedicator = reader.ReadString(); dedication.Dedicator = dedicator; break; case "p": string p = reader.ReadOuterXml(); dedication.Html += p; break; } } // Finish up the stream. reader.Close(); } }