public HeliosTemplate(HeliosVisual control) { _user = true; _typeIdentifier = control.TypeIdentifier; _name = control.Name; StringWriter templateWriter = new StringWriter(); XmlWriter xmlWriter = new XmlTextWriter(templateWriter); xmlWriter.WriteStartElement("TemplateValues"); control.WriteXml(xmlWriter); xmlWriter.WriteEndElement(); xmlWriter.Close(); templateWriter.Close(); _templateControl = templateWriter.ToString(); }
public HeliosTemplate(HeliosVisual control) { _user = true; _typeIdentifier = control.TypeIdentifier; _name = control.Name; StringWriter templateWriter = new StringWriter(); XmlWriter xmlWriter = new XmlTextWriter(templateWriter); xmlWriter.WriteStartElement("TemplateValues"); control.WriteXml(xmlWriter); xmlWriter.WriteEndElement(); xmlWriter.Close(); templateWriter.Close(); _templateControl = templateWriter.ToString(); }
public void SerializeControl(HeliosVisual control, XmlWriter xmlWriter) { TypeConverter boolConverter = TypeDescriptor.GetConverter(typeof(bool)); xmlWriter.WriteStartElement("Control"); xmlWriter.WriteAttributeString("TypeIdentifier", control.TypeIdentifier); xmlWriter.WriteAttributeString("Name", control.Name); xmlWriter.WriteAttributeString("SnapTarget", boolConverter.ConvertToInvariantString(control.IsSnapTarget)); xmlWriter.WriteAttributeString("Locked", boolConverter.ConvertToInvariantString(control.IsLocked)); control.WriteXml(xmlWriter); if (control.PersistChildren) { SerializeControls(control.Children, xmlWriter); } else { xmlWriter.WriteStartElement("Children"); xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); }
public void SerializeControl(HeliosVisual control, XmlWriter xmlWriter) { TypeConverter boolConverter = TypeDescriptor.GetConverter(typeof(bool)); xmlWriter.WriteStartElement("Control"); xmlWriter.WriteAttributeString("TypeIdentifier", control.TypeIdentifier); xmlWriter.WriteAttributeString("Name", control.Name); xmlWriter.WriteAttributeString("SnapTarget", boolConverter.ConvertToInvariantString(control.IsSnapTarget)); xmlWriter.WriteAttributeString("Locked", boolConverter.ConvertToInvariantString(control.IsLocked)); control.WriteXml(xmlWriter); if (control.PersistChildren) { SerializeControls(control.Children, xmlWriter); } else { xmlWriter.WriteStartElement("Children"); xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); }