Esempio n. 1
0
        public BCFTopic(XElement node)
        {
            DocumentReferences = new List <BCFDocumentReference>();
            RelatedTopics      = new List <BCFRelatedTopic>();

            this.Guid      = Guid.Parse((String)node.Attribute("Guid") ?? "");
            Title          = CreateDefaultIfTitleEmpty((String)node.Element("Title"));
            TopicType      = (String)node.Attribute("TopicType") ?? "";
            ReferenceLink  = (String)node.Element("ReferenceLink") ?? "";
            Description    = (String)node.Element("Description") ?? "";
            Priority       = (String)node.Element("Priority") ?? "";
            Index          = (int?)node.Element("Index") ?? null;
            CreationDate   = ParseDateTimeFromXMLNodeElement(node, "CreationDate");
            CreationAuthor = (String)node.Element("CreationAuthor") ?? "";
            ModifiedDate   = ParseDateTimeFromXMLNodeElement(node, "ModifiedDate");
            ModifiedAuthor = (String)node.Element("ModifiedAuthor") ?? "";
            AssignedTo     = (String)node.Element("AssignedTo") ?? "";
            TopicStatus    = (String)node.Element("TopicStatus") ?? "";
            DueDate        = ParseDateTimeFromXMLNodeElement(node, "DueDate");

            var bimSnippet = node.Elements("BimSnippet").FirstOrDefault();

            if (bimSnippet != null)
            {
                BimSnippet = new BCFBimSnippet(bimSnippet);
            }

            var docRefs = node.Elements("DocumentReferences").FirstOrDefault();

            if (docRefs != null)
            {
                foreach (var dref in node.Elements("DocumentReferences"))
                {
                    DocumentReferences.Add(new BCFDocumentReference(dref));
                }
            }

            var relTopics = node.Elements("RelatedTopics").FirstOrDefault();

            if (relTopics != null)
            {
                foreach (var rt in node.Elements("RelatedTopics"))
                {
                    RelatedTopics.Add(new BCFRelatedTopic(rt));
                }
            }
        }
Esempio n. 2
0
        public BCFTopic(XElement node)
        {
            DocumentReferences = new List<BCFDocumentReference>();
            RelatedTopics = new List<BCFRelatedTopic>();

            this.Guid = Guid.Parse((String)node.Attribute("Guid") ?? "");
            Title = (String)node.Element("Title") ?? "";
            TopicType = (String)node.Attribute("TopicType") ?? "";
            ReferenceLink = (String)node.Element("ReferenceLink") ?? "";
            Description = (String)node.Element("Description") ?? "";
            Priority = (String)node.Element("Priority") ?? "";
            Index = (int?)node.Element("Index") ?? null;
            CreationDate = (DateTime?)node.Element("CreationDate") ?? null;
            CreationAuthor = (String)node.Element("CreationAuthor") ?? "";
            ModifiedDate = (DateTime?)node.Element("ModifiedDate") ?? null;
            ModifiedAuthor = (String)node.Element("ModifiedAuthor") ?? "";
            AssignedTo = (String)node.Element("AssignedTo") ?? "";
            TopicStatus = (String)node.Element("TopicStatus") ?? "";

            var bimSnippet = node.Elements("BimSnippet").FirstOrDefault();
            if (bimSnippet != null)
            {
                BimSnippet = new BCFBimSnippet(bimSnippet);
            }

            var docRefs = node.Elements("DocumentReferences").FirstOrDefault();
            if (docRefs != null)
            {
                foreach (var dref in node.Elements("DocumentReferences"))
                {
                    DocumentReferences.Add(new BCFDocumentReference(dref));
                }
            }

            var relTopics = node.Elements("RelatedTopics").FirstOrDefault();
            if (relTopics != null)
            {
                foreach (var rt in node.Elements("RelatedTopics"))
                {
                    RelatedTopics.Add(new BCFRelatedTopic(rt));
                }
            }
        }