ATMLCommonLibrary.controls.connector.ConnectorLocationPinListControl.btnAdd_Click C# (CSharp) Method

btnAdd_Click() protected method

protected btnAdd_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        protected override void btnAdd_Click(object sender, EventArgs e)
        {
            var form = new ConnectorLocationPinForm(_connectors);
            //--------------------------------------------------------------------------------------------------------------//
            //--- If there already locations in the list, then lets grab the last connector id and set it on the new pin ---//
            //--------------------------------------------------------------------------------------------------------------//
            var locationPin = new ConnectorLocation();
            if (lvList.Items.Count > 0)
                locationPin.connectorID = ((ConnectorLocation) lvList.Items[lvList.Items.Count - 1].Tag).connectorID;
            form.ConnectorLocation = locationPin;
            if (DialogResult.OK == form.ShowDialog())
            {
                AddConnectorLocation(form.ConnectorLocation);
            }
        }