public void Connect(string name1, string name2)
    {
        var first  = AllElements.FirstOrDefault(x => x.Name == name1);
        var second = AllElements.FirstOrDefault(x => x.Name == name2);

        if (first == null)
        {
            Debug.LogError("First element's core not found.");
            return;
        }
        if (second == null)
        {
            Debug.LogError("Second element's core not found.");
            return;
        }
        first.Connect(first.NextElement != second ? second : null);
        ApplyPhysics();
        UpdatePointsOfConnections();
    }
示例#2
0
        /// <summary>
        ///     Finds the first element in the entire DICOM structure that has a certain tag
        /// </summary>
        /// <param name="toFind">the tag to be searched</param>
        /// <returns>one single DICOM element that is first occurence of the tag in the structure</returns>
        public IDICOMElement FindFirst(string toFind)
        {
            var found = AllElements.FirstOrDefault(el => el.Tag.CompleteID == toFind);

            return(found);
        }