Exemplo n.º 1
0
        private void FetchFromKeywordsNode(XmlReader reader, BaseItem item)
        {
            reader.MoveToContent();

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

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

                    default:
                        reader.Skip();
                        break;
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void FetchFromKeywordsNode(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 "PlotKeyword":
                    {
                        var tag = reader.ReadElementContentAsString();

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

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