Exemple #1
0
 /// <summary>
 /// Adds a <see cref="Label">Label</see> object to the 
 /// <see cref="Labels">Labels</see> collection.</summary>
 /// <param name="l"><see cref="Label">Label</see> object to add to the collection.</param>
 public void Add(Label l)
 {
     _labels.Add(l);
 }
Exemple #2
0
        /// <summary>
        /// Reads Xml when the <see cref="Labels">Labels</see> is to be deserialized 
        /// from a stream.</summary>
        /// <param name="reader">The stream from which the object will be deserialized.</param>
        void System.Xml.Serialization.IXmlSerializable.ReadXml(System.Xml.XmlReader reader)
        {
            // Advance until the first Label node is recognized.
            if (!reader.IsEmptyElement) {
                while (reader.Read()) {
                    if (reader.NodeType == System.Xml.XmlNodeType.EndElement) {
                        reader.Read();
                        break;
                    }

                    // Found a Label node. Deserialize it into a new Label object.
                    GSharp.XConsole.ConsoleBrowserObjects.Label      label     = new Label();

                    ((IXmlSerializable)label).ReadXml(reader);
                    _labels.Add(label);

                    // Move to the next node.
                    reader.Read();
                }
            } else  // The reader is empty.  Advance to the next node in anticipation
                    // of finding a Textboxes node.
                reader.Read();
        }