Example #1
0
        /// <param name="component1"></param>
        /// <param name="component2"></param>
        /// <param name="text"></param>
        public void SetLineMessage(NetworkNode component1, NetworkNode component2, string text)
        {
            DiagramAnalysisNodeMessage messageNode;
            //flag node and put up the message
            //if the message is already there over write with the latest edition
            ComponentPairing pair = (new ComponentPairing()
            {
                Source = component1.ComponentGuid,
                Target = component2.ComponentGuid
            });

            if (dictionaryLineMessages.ContainsKey(pair))
            {
                return;// messageNode = dictionaryNodeMessages[component2.ComponentGuid];
            }

            //
            string appropriateEdgeId = findEdgeId(component1, component2, pair);

            messageNode = new DiagramAnalysisNodeMessage()
            {
                Component   = (NetworkComponent)component1,
                NodeId1     = component1.ID,
                NodeId2     = component2.ID,
                edgeId      = appropriateEdgeId,
                SetMessages = new HashSet <string>()
            };

            dictionaryLineMessages.Add(pair, messageNode);
            IsMessageAdded = true;
            messageNode.AddMessage(text);
        }
Example #2
0
        private string findEdgeId(NetworkNode component1, NetworkNode component2, ComponentPairing pair)
        {
            //if we didn't find it here then it's a connector and we need to walk the tree.
            //We will need to walk the tree and find the node we are looking for
            //printGraph(new List<NetworkComponent>(component1));
            NetworkWalk printer = new NetworkWalk();
            NetworkLink link    = printer.FindNodeEdge(component1, component2);

            return(link.ID);
        }