DataHubServicesAddin.Dialogs.ConfigureLocatorForm.GetListOfLocatorsFromHub C# (CSharp) Method

GetListOfLocatorsFromHub() private method

Gets the list of locators from hub.
private GetListOfLocatorsFromHub ( ) : BindingList
return BindingList
        private BindingList<RemoteLocator> GetListOfLocatorsFromHub()
        {
            string url = cboUrl.Text;
            string username = null;
            string password = null;
            AuthenticationMode authentication = AuthenticationMode.None;

            if (radAuthWindows.Checked)
            {
                if (chkUseCurrentCredntials.Checked)
                {
                    authentication = AuthenticationMode.CurrentWindows;
                }
                else
                {
                    authentication = AuthenticationMode.Windows;
                    username = txtUsername.Text;
                    password = txtPassword.Text;
                }
            }
            else if (radAuthToken.Checked)
            {
                authentication =  AuthenticationMode.Token;
                username = txtUsername.Text;
                password = txtPassword.Text;

            }

            LocatorHub.LocatorHub locatorHubClient = LocatorManager.CreateClient(url, username, password, authentication, null);

            return new BindingList<RemoteLocator>(locatorHubClient.ListLocators());
        }