public void AddElement(OutageTopologyElement newElement)
 {
     if (!OutageTopology.ContainsKey(newElement.Id))
     {
         OutageTopology.Add(newElement.Id, newElement);
     }
 }
 public bool GetElementByGid(long gid, out OutageTopologyElement topologyElement)
 {
     bool success = false;
     if (OutageTopology.TryGetValue(gid, out topologyElement))
     {
         success = true;
     }
     else
     {
         topologyElement = null;
     }
     return success;
 }
        public bool GetElementByGidFirstEnd(long gid, out OutageTopologyElement topologyElement)
        {
            bool success = GetElementByGid(gid, out topologyElement);
            if (success)
            {
                success = GetElementByGid(topologyElement.FirstEnd, out topologyElement);
                if (!success) topologyElement = null;
            }
            else
            {
                topologyElement = null;
            }
            return success;

        }