private static bool IsValid(ICredentialsAdapter adapter)
        {
            CredentialsAdapterAttribute attribute = adapter.GetType().GetCustomAttributes(typeof(CredentialsAdapterAttribute), false).FirstOrDefault() as CredentialsAdapterAttribute;

            if (attribute == null)
            {
                return(false);
            }
            return(attribute.Id.Equals(GitManager.Settings.CredentialsManager, StringComparison.InvariantCultureIgnoreCase));
        }
        private static string GetAdapterId(ICredentialsAdapter adapter)
        {
            CredentialsAdapterAttribute attribute = adapter.GetType().GetCustomAttributes(typeof(CredentialsAdapterAttribute), false).FirstOrDefault() as CredentialsAdapterAttribute;

            if (attribute == null)
            {
                return("");
            }
            return(attribute.Id);
        }
Exemple #3
0
        private string GetAdapterName(ICredentialsAdapter adapter)
        {
            if (adapter == null)
            {
                return("None");
            }
            CredentialsAdapterAttribute attribute = adapter.GetType().GetCustomAttributes(typeof(CredentialsAdapterAttribute), false).FirstOrDefault() as CredentialsAdapterAttribute;

            if (attribute == null)
            {
                return("");
            }
            return(attribute.Name);
        }