private void Ports_InsertElement(object sender, ElementsEventArgs e) { //Sets the shape of the port Port port = (Port)e.Value; port.SetParent(this); port.SetLayer(Layer); port.ElementInvalid += new EventHandler(Port_ElementInvalid); port.SetContainer(Container); port.SetOrder(mPorts.Count - 1); //Locate if not deserializing if (port.Location.IsEmpty) { LocatePort(port); } }
private void Ports_InsertElement(object sender, ElementsEventArgs e) { //Sets the shape of the port Port port = (Port)e.Value; port.SetParent(this); port.SetLayer(Layer); port.ElementInvalid += new EventHandler(Port_ElementInvalid); port.SetContainer(Container); port.SetOrder(mPorts.Count - 1); //If not deserializing then locate port if (port.Location.IsEmpty) { LocatePort(port); } //Else just set orientation and offset else { port.Orientation = GetPortOrientation(port, port.Location); port.SetOffset(port.CalculateOffset()); } }