/// <summary> /// Creates a new RdlCommandGroup from the specified tagString. /// </summary> /// <param name="tagString">The string containing multiple commands that will become part of the new collection.</param> /// <returns>A new RdlCommandGroup instance containing the parsed commands.</returns> public static RdlCommandGroup FromString(string tagString) { RdlCommandGroup col = new RdlCommandGroup(); using (RdlTagReader reader = new RdlTagReader(tagString)) { RdlTag tag = null; while ((tag = reader.ReadTag()) != null) { if (tag.TagName.Equals(RdlTagName.CMD.ToString())) { col.Add((RdlCommand)tag); } else if (tag.TagName.Equals(RdlTagName.AUTH.ToString())) { col.AuthKey = (tag as RdlAuthKey).Key; col.AuthKeyType = (tag as RdlAuthKey).TypeName; } else { col.Tags.Add(tag); } } } return(col); }
/// <summary> /// Creates a Tag instance from the specified tag string. /// </summary> /// <param name="tagString">The string representation of the tag to create.</param> /// <returns>A new instance of the Tag class containing the information from the tag string or /// Tag.Empty if the tag could not be parsed.</returns> public static RdlTag FromString(string tagString) { using (RdlTagReader reader = new RdlTagReader(tagString)) { return(reader.ReadTag()); } }
/// <summary> /// Creates a new RdlTagCollection from the specified tagString. /// </summary> /// <param name="tagString">The string containing multiple tags that will become part of the new collection.</param> /// <returns>A new RdlTagCollection instance containing the parsed tags.</returns> public static RdlTagCollection FromString(string tagString) { RdlTagCollection col = new RdlTagCollection(); using (RdlTagReader reader = new RdlTagReader(tagString)) { RdlTag tag = null; while ((tag = reader.ReadTag()) != null) { col.Add(tag); } } return(col); }