Esempio n. 1
0
 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();
 }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
        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();
        }
Esempio n. 4
0
        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();
        }