예제 #1
0
 public void WriteXml(System.Xml.XmlWriter w, DateTime?Date)
 {
     w.WriteStartElement("Resources");
     if (Date.HasValue)
     {
         w.WriteAttributeString("Date", Date.Value.ToString(System.Globalization.CultureInfo.InvariantCulture));
     }
     w.WriteElementString("Wood", Wood.ToString());
     w.WriteElementString("Clay", Clay.ToString());
     w.WriteElementString("Iron", Iron.ToString());
     w.WriteEndElement();
 }
예제 #2
0
 public override string ToString()
 {
     if (Set)
     {
         return(string.Format("W{0}, C{1}, I{2}", Wood.ToString("#,0"), Clay.ToString("#,0"), Iron.ToString("#,0")));
     }
     return("Nothing");
 }