예제 #1
0
        public object BeginLoad(XmlElementReader element)
        {
            switch (element.Attribute("style").Text)
              {
            case "solid":
            default:
              Style = ConnectionStyle.Solid;
              break;
            case "dashed":
              Style = ConnectionStyle.Dashed;
              break;
              }
              switch (element.Attribute("flow").Text)
              {
            case "twoWay":
            default:
              Flow = ConnectionFlow.TwoWay;
              break;
            case "oneWay":
              Flow = ConnectionFlow.OneWay;
              break;
              }
              StartText = element.Attribute("startText").Text;
              MidText = element.Attribute("midText").Text;
              EndText = element.Attribute("endText").Text;
              if (element.Attribute("color").Text != "") { ConnectionColor = ColorTranslator.FromHtml(element.Attribute("color").Text); }

              var vertexElementList = new List<XmlElementReader>();
              vertexElementList.AddRange(element.Children);
              vertexElementList.Sort((a, b) => a.Attribute("index").ToInt().CompareTo(b.Attribute("index").ToInt()));

              foreach (var vertexElement in vertexElementList)
              {
            if (vertexElement.HasName("point"))
            {
              var vertex = new Vertex();
              vertex.Position = new Vector(vertexElement.Attribute("x").ToFloat(), vertexElement.Attribute("y").ToFloat());
              VertexList.Add(vertex);
            }
            else if (vertexElement.HasName("dock"))
            {
              var vertex = new Vertex();
              // temporarily leave this vertex as a positional vertex;
              // we can't safely dock it to a port until EndLoad().
              VertexList.Add(vertex);
            }
              }

              return vertexElementList;
        }
예제 #2
0
 // Added to ignore ID gaps
 public Connection(Project project, Vertex a, Vertex b, int TotalIDs, params Vertex[] args)
     : this(project, a, b, TotalIDs)
 {
     foreach (var vertex in args)
       {
     VertexList.Add(vertex);
       }
 }
예제 #3
0
 public Connection(Project project, Vertex a, Vertex b)
     : this(project)
 {
     VertexList.Add(a);
       VertexList.Add(b);
 }
예제 #4
0
 // Added to ignore ID gaps
 public Connection(Project project, Vertex a, Vertex b, int TotalIDs)
     : this(project, TotalIDs)
 {
     VertexList.Add(a);
       VertexList.Add(b);
 }
예제 #5
0
 public VertexPort(Vertex vertex, Connection connection)
     : base(connection)
 {
     Vertex = vertex;
     Connection = connection;
 }