Renci.SshNet.ClientAuthentication.GetOrderedAuthenticationMethods C# (CSharp) Method

GetOrderedAuthenticationMethods() private static method

private static GetOrderedAuthenticationMethods ( AuthenticationState authenticationState, IEnumerable matchingAuthenticationMethods ) : IEnumerable
authenticationState AuthenticationState
matchingAuthenticationMethods IEnumerable
return IEnumerable
        private static IEnumerable<IAuthenticationMethod> GetOrderedAuthenticationMethods(AuthenticationState authenticationState, IEnumerable<IAuthenticationMethod> matchingAuthenticationMethods)
        {
            var skippedAuthenticationMethods = new List<IAuthenticationMethod>();

            foreach (var authenticationMethod in matchingAuthenticationMethods)
            {
                if (authenticationState.ExecutedAuthenticationMethods.Contains(authenticationMethod))
                {
                    skippedAuthenticationMethods.Add(authenticationMethod);
                    continue;
                }

                yield return authenticationMethod;
            }

            foreach (var authenticationMethod in skippedAuthenticationMethods)
                yield return authenticationMethod;
        }