public LinkView(Guid mapUid, IGlymaRelationship relationship, XmlDocument doc, XmlElement parent, LinkType linkType) : this(doc, parent, linkType) { AddAttributeByKeyValue("id", mapUid.ToLongString()); AddAttributeByKeyValue("created", relationship.Created); AddAttributeByKeyValue("lastModified", relationship.LastModified); }
public void AddRelationship(IGlymaRelationship relationship) { if (!Relationships.Contains(relationship)) { Relationships.Add(relationship); } }
private LinkType GetLinkType(IGlymaRelationship relationship) { LinkType linkType = LinkType.RespondsTo; if (relationship != null && relationship.NodeFrom != null && relationship.NodeFrom.NodeType != null) { switch (relationship.NodeFrom.NodeType.Name) { case "CompendiumDecisionNode": linkType = LinkType.Resolves; break; case "CompendiumReferenceNode": // not currently part of our schema of node types, but this is the correct LinkType linkType = LinkType.Specializes; break; case "CompendiumNoteNode": linkType = LinkType.ExpandsOn; break; case "CompendiumConNode": linkType = LinkType.ObjectsTo; break; case "CompendiumProNode": linkType = LinkType.Supports; break; case "CompendiumArgumentNode": //not currently part of our schema of node types, but this is the correct LinkType linkType = LinkType.Challenges; break; case "CompendiumIdeaNode": linkType = LinkType.RespondsTo; break; case "CompendiumMapNode": linkType = LinkType.RespondsTo; break; case "CompendiumQuestionNode": linkType = LinkType.RespondsTo; break; case "CompendiumListNode": // not currently part of our schema of node types, but this is the correct LinkType linkType = LinkType.RespondsTo; break; default: linkType = LinkType.RespondsTo; break; } } return(linkType); }
public void AddLink(Guid mapId, IGlymaRelationship relationship) { if (!IsRelationshipExist(relationship)) { var xmlLink = new Link(mapId, relationship, Doc, _xmlElementLinks); xmlLink.CreateElement(); Relationships.Add(relationship); } }
public Link(Guid mapId, IGlymaRelationship relationship, XmlDocument doc, XmlElement parent) : base(doc, relationship, parent) { _mapId = mapId; _relationship = relationship; AddAttributeByKeyValue("id", _relationship.Id.ToLongString()); AddAttributeByKeyValue("created", _relationship.Created); AddAttributeByKeyValue("lastModified", _relationship.LastModified); AddAttributeByKeyValue("author", "Glyma"); AddAttributeByKeyValue("from", _relationship.From.ToLongString()); AddAttributeByKeyValue("to", _relationship.To.ToLongString()); }
public LinkBase(XmlDocument doc, IGlymaRelationship relationship, XmlElement parent) : base(doc, parent) { if (this is ReferenceLink) { LinkType = LinkType.About; //reference links are About, note this is different to a CompendiumReferenceNode } else { LinkType = GetLinkType(relationship); } int linkTypeNum = (int)LinkType; AddAttributeByKeyValue("type", linkTypeNum.ToString()); AddAttributeByKeyValue("label", ""); AddAttributeByKeyValue("originalid", ""); }
private LinkType GetLinkType(IGlymaRelationship relationship) { LinkType linkType = LinkType.RespondsTo; if (relationship != null && relationship.NodeFrom != null && relationship.NodeFrom.NodeType != null) { switch (relationship.NodeFrom.NodeType.Name) { case "CompendiumDecisionNode": linkType = LinkType.Resolves; break; case "CompendiumReferenceNode": // not currently part of our schema of node types, but this is the correct LinkType linkType = LinkType.Specializes; break; case "CompendiumNoteNode": linkType = LinkType.ExpandsOn; break; case "CompendiumConNode": linkType = LinkType.ObjectsTo; break; case "CompendiumProNode": linkType = LinkType.Supports; break; case "CompendiumArgumentNode": //not currently part of our schema of node types, but this is the correct LinkType linkType = LinkType.Challenges; break; case "CompendiumIdeaNode": linkType = LinkType.RespondsTo; break; case "CompendiumMapNode": linkType = LinkType.RespondsTo; break; case "CompendiumQuestionNode": linkType = LinkType.RespondsTo; break; case "CompendiumListNode": // not currently part of our schema of node types, but this is the correct LinkType linkType = LinkType.RespondsTo; break; default: linkType = LinkType.RespondsTo; break; } } return linkType; }
private bool IsRelationshipExist(IGlymaRelationship relationship) { return Relationships.Any(q => q.ProxyRelationship.Id == relationship.ProxyRelationship.Id); }
private bool IsRelationshipExist(IGlymaRelationship relationship) { return(Relationships.Any(q => q.ProxyRelationship.Id == relationship.ProxyRelationship.Id)); }