public override bool Equals(object obj)
        {
            ConceptualTopic other = obj as ConceptualTopic;

            if (other == null)
            {
                return(false);
            }

            return(this.Equals(other));
        }
        private void ReadFile(ConceptualItem parentItem, XmlReader reader)
        {
            XmlNodeType nodeType  = XmlNodeType.None;
            string      nodeName  = null;
            string      fileName  = null;
            string      fileTitle = null;

            while (reader.Read())
            {
                nodeType = reader.NodeType;
                if (nodeType == XmlNodeType.Element)
                {
                    nodeName = reader.Name;
                    if (String.Equals(nodeName, "file"))
                    {
                        fileName  = reader.GetAttribute("name");
                        fileTitle = reader.GetAttribute("title");
                        if (!String.IsNullOrEmpty(fileName) &&
                            !String.IsNullOrEmpty(fileTitle))
                        {
                            string          fullPath = Path.Combine(_contentDir, fileName);
                            ConceptualTopic docItem  = new ConceptualTopic(
                                new BuildFilePath(fullPath),
                                fileTitle, String.Empty);

                            docItem.Content = this;

                            docItem.BeginInit();

                            docItem.EndInit();

                            // handle the sub-item...
                            if (!reader.IsEmptyElement)
                            {
                                ReadFile(docItem, reader);
                            }

                            parentItem.Add(docItem);
                        }
                    }
                }
                else if (nodeType == XmlNodeType.EndElement)
                {
                    nodeName = reader.Name;
                    if (String.Equals(nodeName, "file") ||
                        String.Equals(nodeName, "files"))
                    {
                        break;
                    }
                }
            }
        }
Exemple #3
0
        public bool Equals(ConceptualTopic other)
        {
            if (other == null)
            {
                return(false);
            }
            //if (!String.Equals(this._name, other._name))
            //{
            //    return false;
            //}
            //if (!String.Equals(this._value, other._value))
            //{
            //    return false;
            //}

            return(true);
        }
Exemple #4
0
        private void ReadTopic(XmlReader reader, ConceptualContent content,
                               ConceptualItem parentItem)
        {
            XmlNodeType nodeType  = XmlNodeType.None;
            string      nodeName  = null;
            int         revNumber = 1;

            while (reader.Read())
            {
                nodeType = reader.NodeType;
                if (nodeType == XmlNodeType.Element)
                {
                    nodeName = reader.Name;
                    if (String.Equals(nodeName, "Topic"))
                    {
                        bool isVisible = true;

                        string docId = reader.GetAttribute("id");
                        if (ConceptualUtils.IsValidId(docId))
                        {
                            string textTemp = reader.GetAttribute("visible");
                            if (!String.IsNullOrEmpty(textTemp))
                            {
                                isVisible = Convert.ToBoolean(textTemp);
                            }

                            string docTitle = reader.GetAttribute("title");
                            if (!String.IsNullOrEmpty(docTitle))
                            {
                                string fullPath = Path.Combine(_contentDir,
                                                               docId + ".aml");
                                ConceptualTopic docItem = new ConceptualTopic(
                                    new BuildFilePath(fullPath), docTitle, docId);

                                docItem.Content = content;

                                docItem.BeginInit();

                                docItem.Visible        = isVisible;
                                docItem.TopicRevisions = revNumber;
                                //docItem.IncludesTopicId = true;

                                docItem.EndInit();

                                // handle the sub-item...
                                if (!reader.IsEmptyElement)
                                {
                                    ReadTopic(reader, content, docItem);
                                }

                                parentItem.Add(docItem);
                            }
                        }
                    }
                    else if (String.Equals(nodeName, "HelpKeyword"))
                    {
                        string index = reader.GetAttribute("index");
                        string term  = reader.GetAttribute("term");
                        if (!String.IsNullOrEmpty(index) &&
                            !String.IsNullOrEmpty(term))
                        {
                            KeywordItem keyword = new KeywordItem(
                                KeywordItem.ParseIndex(index), term);

                            parentItem.Keywords.Add(keyword);
                        }
                    }
                }
                else if (nodeType == XmlNodeType.EndElement)
                {
                    if (String.Equals(reader.Name, "Topic"))
                    {
                        break;
                    }
                }
            }
        }
Exemple #5
0
 public ConceptualTopic(ConceptualTopic source)
     : base(source)
 {
     _topicType = source._topicType;
     _listItems = source._listItems;
 }
Exemple #6
0
        public override ConceptualItem Clone()
        {
            ConceptualTopic item = new ConceptualTopic(this);

            return(item);
        }