private void GetPins(Dictionary <int, DeviceConnection> deviceConnectionById, Dictionary <int, DeviceSymbol> deviceSymbolById, E3Text text)
        {
            Dictionary <string, SymbolPin> topPinByName    = new Dictionary <string, SymbolPin>();
            Dictionary <string, SymbolPin> bottomPinByName = new Dictionary <string, SymbolPin>();

            foreach (int connectionId in ConnectionIds)
            {
                DeviceConnection connection = deviceConnectionById[connectionId];
                int    connectedId;
                string pinName;
                if (id == connection.StartDeviceId)
                {
                    connectedId = connection.EndDeviceId;
                    pinName     = connection.StartPinName;
                }
                else
                {
                    connectedId = connection.StartDeviceId;
                    pinName     = connection.EndPinName;
                }
                string connectedAssignment = deviceSymbolById[connectedId].Assignment;
                if (!String.IsNullOrEmpty(Assignment) && String.IsNullOrEmpty(connectedAssignment))
                {
                    if (!topPinByName.ContainsKey(pinName))
                    {
                        SymbolPin pin = new SymbolPin(pinName, connection.Signal, text, smallFont);
                        topPinByName.Add(pinName, pin);
                    }
                    topPinByName[pinName].CableIds.Add(connection.CableId);
                }
                else
                {
                    if (!bottomPinByName.ContainsKey(pinName))
                    {
                        SymbolPin pin = new SymbolPin(pinName, connection.Signal, text, smallFont);
                        bottomPinByName.Add(pinName, pin);
                    }
                    bottomPinByName[pinName].CableIds.Add(connection.CableId);
                }
            }
            topPins    = topPinByName.Values.ToList();
            bottomPins = bottomPinByName.Values.ToList();
            NaturalSortingStringComparer stringComparer = new NaturalSortingStringComparer();

            topPins.Sort((p1, p2) => stringComparer.Compare(p1.Name, p2.Name));
            bottomPins.Sort((p1, p2) => stringComparer.Compare(p1.Name, p2.Name));
        }
        private int DrawSignalAndSetConnectionPoint(SymbolPin pin, Level position, Sheet sheet, E3Text text, int sheetId, double pinBottom, double pinTop, double pinLeft)
        {
            double xSignalText = sheet.MoveRight(pinLeft, 1);
            double ySignalText;
            E3Font font = new E3Font(height: smallFont.height);

            if (position == Level.Top)
            {
                ySignalText    = sheet.MoveUp(pinTop, skewLineOffset);
                font.alignment = Alignment.Left;
            }
            else
            {
                ySignalText    = sheet.MoveDown(pinBottom, skewLineOffset);
                font.alignment = Alignment.Right;
            }
            return(text.CreateVerticalText(sheetId, pin.Signal, xSignalText, ySignalText, font));
        }
 private void GetPins(Dictionary<int, DeviceConnection> deviceConnectionById, Dictionary<int, DeviceSymbol> deviceSymbolById, E3Text text)
 {
     Dictionary<string, SymbolPin> topPinByName = new Dictionary<string, SymbolPin>();
     Dictionary<string, SymbolPin>  bottomPinByName = new Dictionary<string, SymbolPin>();
     foreach (int connectionId in ConnectionIds)
     {
         DeviceConnection connection = deviceConnectionById[connectionId];
         int connectedId;
         string pinName;
         if (id == connection.StartDeviceId)
         {
             connectedId = connection.EndDeviceId;
             pinName = connection.StartPinName;
         }
         else
         {
             connectedId = connection.StartDeviceId;
             pinName = connection.EndPinName;
         }
         string connectedAssignment = deviceSymbolById[connectedId].Assignment;
         if (!String.IsNullOrEmpty(Assignment) && String.IsNullOrEmpty(connectedAssignment))
         {
             if (!topPinByName.ContainsKey(pinName))
             {
                 SymbolPin pin = new SymbolPin(pinName, connection.Signal, text, smallFont);
                 topPinByName.Add(pinName, pin);
             }
             topPinByName[pinName].CableIds.Add(connection.CableId);
         }
         else
         {
             if (!bottomPinByName.ContainsKey(pinName))
             {
                 SymbolPin pin = new SymbolPin(pinName, connection.Signal, text, smallFont);
                 bottomPinByName.Add(pinName, pin);
             }
             bottomPinByName[pinName].CableIds.Add(connection.CableId);
         }
     }
     topPins = topPinByName.Values.ToList();
     bottomPins = bottomPinByName.Values.ToList();
     NaturalSortingStringComparer stringComparer = new NaturalSortingStringComparer();
     topPins.Sort((p1,p2)=>stringComparer.Compare(p1.Name, p2.Name));
     bottomPins.Sort((p1, p2) => stringComparer.Compare(p1.Name, p2.Name));
 }
 private int DrawSignalAndSetConnectionPoint(SymbolPin pin, Level position, Sheet sheet, E3Text text, int sheetId, double pinBottom, double pinTop, double pinLeft)
 {
     double xSignalText = sheet.MoveRight(pinLeft, 1);
     double ySignalText;
     E3Font font = new E3Font(height: smallFont.height);
     if (position == Level.Top)
     {
         ySignalText = sheet.MoveUp(pinTop, skewLineOffset);
         font.alignment = Alignment.Left;
     }
     else
     {
         ySignalText = sheet.MoveDown(pinBottom, skewLineOffset);
         font.alignment = Alignment.Right;
     }
     return text.CreateVerticalText(sheetId, pin.Signal, xSignalText, ySignalText, font);
 }