1. 101.
    0
    if (idea == null) return;
    using (var writer = XmlWriter. Create(String. Format(@"C:ProjectsCakeOramaCustomerData{0}.xml", idea. CustomerName)))
    {
    writer. WriteStartDocument();
    writer. WriteStartElement("customer");
    writer. WriteAttributeString("name", idea. CustomerName);
    writer. WriteAttributeString("phone", idea. PhoneNumber);
    writer. WriteAttributeString("email", idea. Email);

    writer. WriteStartElement("eventDate");
    writer. WriteValue(idea. EventDate);
    writer. WriteEndElement();

    writer. WriteStartElement("strokes");

    if (idea. Strokes != null && idea. Strokes.Length > 0)
    foreach (var stroke in idea. Strokes)
    {
    writer. WriteStartElement("stroke");
    writer. WriteAttributeString("Width", stroke. Width.ToString());
    writer. WriteAttributeString("Height", stroke. Height.ToString());
    writer. WriteStartElement("color");
    writer. WriteAttributeString("a", stroke. Color[0].ToString());
    writer. WriteAttributeString("r", stroke. Color[1].ToString());
    writer. WriteAttributeString("g", stroke. Color[2].ToString());
    writer. WriteAttributeString("b", stroke. Color[3].ToString());

    writer. WriteEndDocument();

    writer. WriteStartElement("outlineColor");
    writer. WriteAttributeString("a", stroke. OutlineColor[0].ToString());
    writer. WriteAttributeString("r", stroke. OutlineColor[1].ToString());
    writer. WriteAttributeString("g", stroke. OutlineColor[2].ToString());
    writer. WriteAttributeString("b", stroke. OutlineColor[3].ToString());

    if (stroke. Points != null && stroke. Points.Length > 0)
    {
    foreach (var point in stroke. Points)
    {
    writer. WriteStartElement("point");
    writer. WriteAttributeString("X", point.X.ToString());
    writer. WriteAttributeString("Y", point.Y.ToString());
    writer. WriteEndElement();

    }
    writer. WriteEndElement();
    }
    writer. WriteEndElement();
    }
    writer. WriteEndElement();
    writer. WriteEndElement();
    writer. WriteEndElement();

    }

    }
    Tümünü Göster
    ···
   tümünü göster