Exemplo n.º 1
0
        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);
                }
            }
        }
Exemplo n.º 2
0
 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());
         }
     }
 }
Exemplo n.º 3
0
 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));
     }
 }
Exemplo n.º 4
0
 protected void ExportVersionRange(XmlTextWriter xmlWriter)
 {
     xmlWriter.WriteAttributeString("minimumVersion", MinimumVersion.ToString(2));
     xmlWriter.WriteAttributeString("maximumVersion", MaximumVersion.ToString(2));
 }
Exemplo n.º 5
0
 public override string ToString() => $"{(MinimumInclusive ? "[" : "(")}{MinimumVersion?.ToString(false) ?? ""},{MaximumVersion?.ToString(false) ?? ""}{(MaximumInclusive ? "]" : ")")}";