public void ReadXml(XmlReader reader) { bool keepGoing = true; bool inhibitNextRead = false; while (keepGoing) { String xmlName = reader.Name.ToLower(); if (xmlName == "linechains" && reader.NodeType == XmlNodeType.EndElement) keepGoing = false; if (xmlName == "id" && reader.NodeType == XmlNodeType.Element) { serial = new lineChainGuid(reader.ReadElementContentAsString()); inhibitNextRead = true; } if (xmlName == "start" && reader.NodeType == XmlNodeType.Element) { start = reader.ReadContentAsPoint(); inhibitNextRead = true; } if (xmlName == "end" && reader.NodeType == XmlNodeType.Element) { end = reader.ReadContentAsPoint(); inhibitNextRead = true; } if (xmlName == "col" && reader.NodeType == XmlNodeType.Element) { col = reader.ReadContentAsColor(); inhibitNextRead = true; } if (xmlName == "points" && reader.NodeType == XmlNodeType.Element) { midPoints = reader.ReadContentAsPointsCollection(); } if (xmlName == "deleted" && reader.NodeType == XmlNodeType.Element) { isDeleted = bool.Parse(reader.GetAttribute("value")); } if (xmlName == "isdrawnbackwards" && reader.NodeType == XmlNodeType.Element) { isdrawnbackwards = bool.Parse(reader.GetAttribute("value")); } if (keepGoing && !inhibitNextRead) keepGoing = reader.Read(); inhibitNextRead = false; } }
public void connectTo(lineChainGuid newTargetChain, pin newTargetPin) { parentLineChain.id = newTargetChain.id; linkedTo.id = newTargetPin.serial.id; // Only wire up events on input pins, since data progresses from outputs to inputs. if (newTargetPin.direction == pinDirection.input) { if (newTargetPin.dynamic) { newTargetPin.valueType = valueType; newTargetPin.recreateValue(); } OnPinChange += newTargetPin.stateChanged; } }
public lineChain GetLineChainFromGuid(lineChainGuid connection) { return (lineChains[connection.id.ToString()]); }
public bool Equals(lineChainGuid other) { if (ReferenceEquals(null , other)) return false; if (ReferenceEquals(this , other)) return true; return other.id.Equals(id); }