示例#1
0
        private void FetchFromTagsNode(XmlReader reader, BaseItem item)
        {
            reader.MoveToContent();

            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    switch (reader.Name)
                    {
                    case "Tag":
                    {
                        var tag = reader.ReadElementContentAsString();

                        if (!string.IsNullOrWhiteSpace(tag))
                        {
                            item.AddTag(tag);
                        }
                        break;
                    }

                    default:
                        reader.Skip();
                        break;
                    }
                }
            }
        }
示例#2
0
        private void FetchFromTagsNode(XmlReader reader, BaseItem item)
        {
            reader.MoveToContent();
            reader.Read();

            // Loop through each element
            while (!reader.EOF && reader.ReadState == ReadState.Interactive)
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    switch (reader.Name)
                    {
                    case "Tag":
                    {
                        var tag = reader.ReadElementContentAsString();

                        if (!string.IsNullOrWhiteSpace(tag))
                        {
                            item.AddTag(tag);
                        }
                        break;
                    }

                    default:
                        reader.Skip();
                        break;
                    }
                }
                else
                {
                    reader.Read();
                }
            }
        }