internal void SaveAsElement(XmlWriter writer) { writer.WriteStartElement("SupportedFramework"); if (MaximumVersion != NoMaximumVersion) { writer.WriteAttributeString("MaximumVersion", MaximumVersion.ToString()); } if (MinimumVersion != NoMinimumVersion) { writer.WriteAttributeString("MinimumVersion", MinimumVersion.ToString()); } WriteNonEmptyAttribute("Profile", Profile); WriteNonEmptyAttribute("Identifier", Identifier); WriteNonEmptyAttribute("DisplayName", DisplayName); WriteNonEmptyAttribute("MinimumVersionDisplayName", MinimumVersionDisplayName); WriteNonEmptyAttribute("MonoSpecificVersion", MonoSpecificVersion); WriteNonEmptyAttribute("MonoSpecificVersionDisplayName", MonoSpecificVersionDisplayName); writer.WriteEndElement(); void WriteNonEmptyAttribute(string name, string val) { if (!string.IsNullOrEmpty(val)) { writer.WriteAttributeString(name, val); } } }
public override string ToString() { if (MinimumVersion.ToString() == "0.0.0.0") { if (MaximumVersion.Major == int.MaxValue) { return(Name); } else { return(Name + ", version <" + MaximumVersion.ToString()); } } else { if (MaximumVersion.Major == int.MaxValue) { return(Name + ", version >" + MinimumVersion.ToString()); } else if (MinimumVersion == MaximumVersion) { return(Name + ", version " + MinimumVersion.ToString()); } else { return(Name + ", version " + MinimumVersion.ToString() + "-" + MaximumVersion.ToString()); } } }
protected void ExportVersionRange(XmlTextWriter xmlWriter, HasVersionRange defaults) { if (MinimumVersion > defaults.MinimumVersion) { xmlWriter.WriteAttributeString("minimumVersion", MinimumVersion.ToString(2)); } if (MaximumVersion < defaults.MaximumVersion) { xmlWriter.WriteAttributeString("maximumVersion", MaximumVersion.ToString(2)); } }
protected void ExportVersionRange(XmlTextWriter xmlWriter) { xmlWriter.WriteAttributeString("minimumVersion", MinimumVersion.ToString(2)); xmlWriter.WriteAttributeString("maximumVersion", MaximumVersion.ToString(2)); }
public override string ToString() => $"{(MinimumInclusive ? "[" : "(")}{MinimumVersion?.ToString(false) ?? ""},{MaximumVersion?.ToString(false) ?? ""}{(MaximumInclusive ? "]" : ")")}";