コード例 #1
0
        public void WriteElement(XmlTextWriter writer)
        {
            writer.WriteStartElement("User");

            writer.WriteAttributeString("Name", Name);
            writer.WriteAttributeString("Color", Color.ToParsableString());
            writer.WriteAttributeString("CanBuild", CanBuild.ToString());
            writer.WriteAttributeString("Prefix", Prefix ?? String.Empty);
            writer.WriteAttributeString("Suffix", Suffix ?? String.Empty);
            writer.WriteAttributeString("ChatSeperator", ChatSeperator ?? String.Empty);

            writer.WriteStartElement("UserGroups");
            foreach (var group in Groups)
                writer.WriteElementAndValue("Name", group.Name);
            writer.WriteEndElement();

            writer.WriteStartElement("Permissions");
            foreach (var permission in Permissions)
                writer.WriteElementAndValue("Permission", permission);
            writer.WriteEndElement();

            writer.WriteStartElement("DenyPermissions");
            foreach (var permission in DenyPermissions)
                writer.WriteElementAndValue("Permission", permission);
            writer.WriteEndElement();

            writer.WriteEndElement();
        }