public ConnectionInfo(Core core, NormalDevice device, DevicePin devicePin, string conductorName, string type)
 {
     this.conductorName = conductorName;
     signal = String.Intern(core.SignalName);
     int startPinId = core.StartPinId;
     int endPinId = core.EndPinId;
     devicePin.Id = startPinId;
     devicePin.Id = startPinId;
     assignmentFrom = String.Intern(device.Assignment);  // интернируем строку, поскольку 1) часто повторяется 2) нужно будет много сравнивать
     locationFrom = device.Location;
     deviceFrom = device.Name;
     pinFrom = String.Intern(devicePin.Name);
     device.Id = endPinId;
     devicePin.Id = endPinId;
     assignmentTo = String.Intern(device.Assignment);
     locationTo = device.Location;
     deviceTo = device.Name;
     pinTo = String.Intern(devicePin.Name);
     this.type = String.Intern(type);
 }
 public DeviceSymbol(NormalDevice device, DevicePin pin )
 {
     id = device.Id;
     Assignment = String.Intern(device.Assignment);
     if (String.IsNullOrEmpty(Assignment) && device.GetAttributeValue("IncludeInOWS").Equals("1"))
         Assignment = String.Intern("AssignmentForConnectingBox");
     Name = device.Name;
     isTerminal = device.IsTerminal();
     if (isTerminal)
     {
        pin.Id = device.PinIds.First();
        Name += ":" + pin.Name;
     }
     ConnectionIds = new List<int>();
     bigFont = new E3Font(alignment: Alignment.Left);
     smallFont = new E3Font(height: 2.5, alignment: Alignment.Left);
     gridStep = 4;
     halfGridStep = gridStep / 2;
     skewLineOffset = gridStep;
 }
 public ConnectionInfo(int startPinId, int endPinId, string signal, NormalDevice device, DevicePin devicePin, Core core, WireCore wire)
 {
     devicePin.Id = startPinId;
     pinFrom = String.Intern(devicePin.Name);
     this.signal = signal;
     List<int> startPinCoreIds = devicePin.CoreIds;
     device.Id = startPinId;
     deviceFrom = device.Name;
     assignmentFrom = String.Intern(device.Assignment);
     locationFrom = device.Location;
     devicePin.Id = endPinId;
     pinTo = String.Intern(devicePin.Name);
     List<int> endPinCoreIds = devicePin.CoreIds;
     device.Id = endPinId;
     deviceTo = device.Name;
     assignmentTo = String.Intern(device.Assignment);
     locationTo = device.Location;
     conductorName = String.Empty;
     type = String.Empty;
     if (startPinCoreIds.Count > 0 && endPinCoreIds.Count > 0)
     {
         List<int> intersection = startPinCoreIds.Intersect<int>(endPinCoreIds).ToList<int>();
         if (intersection.Count == 1)
         {
             core.Id = intersection[0];
             device.Id = intersection[0];
             if (device.IsCable())
             {
                 conductorName = device.Name;
                 type = String.Intern(device.ComponentName);
             }
             if (device.IsWireGroup())
             {
                 wire.Id = intersection[0];
                 conductorName = wire.Name;
                 type = String.Intern(wire.WireType);
             }
         }
     }
 }