protected override string?PropertyValidation(PropertyInfo pi)
        {
            if (LoginWithWindowsAuthenticator || LoginWithActiveDirectoryRegistry)
            {
                if (pi.Name == nameof(DomainName) && !DomainName.HasText())
                {
                    return(ValidationMessage._0IsNotSet.NiceToString(pi.NiceName()));
                }

                if (pi.Name == nameof(DomainServer) && !DomainServer.HasText())
                {
                    return(ValidationMessage._0IsNotSet.NiceToString(pi.NiceName()));
                }
            }

            if (LoginWithAzureAD)
            {
                if (pi.Name == nameof(Azure_ApplicationID) && !Azure_ApplicationID.HasText())
                {
                    return(ValidationMessage._0IsNotSet.NiceToString(pi.NiceName()));
                }

                if (pi.Name == nameof(Azure_DirectoryID) && !Azure_DirectoryID.HasText())
                {
                    return(ValidationMessage._0IsNotSet.NiceToString(pi.NiceName()));
                }
            }

            return(base.PropertyValidation(pi));
        }
Пример #2
0
        protected override string?PropertyValidation(PropertyInfo pi)
        {
            if (!UseActiveDirectoryConfiguration)
            {
                if (pi.Name == nameof(Azure_ApplicationID) && !Azure_ApplicationID.HasText())
                {
                    return(ValidationMessage._0IsNotSet.NiceToString(pi.NiceName()));
                }

                if (pi.Name == nameof(Azure_DirectoryID) && !Azure_DirectoryID.HasText())
                {
                    return(ValidationMessage._0IsNotSet.NiceToString(pi.NiceName()));
                }

                if (pi.Name == nameof(Azure_ClientSecret) && !Azure_ClientSecret.HasText())
                {
                    return(ValidationMessage._0IsNotSet.NiceToString(pi.NiceName()));
                }
            }

            return(base.PropertyValidation(pi));
        }
    protected override string?PropertyValidation(PropertyInfo pi)
    {
        if (LoginWithWindowsAuthenticator || LoginWithActiveDirectoryRegistry)
        {
            if (pi.Name == nameof(DomainName) && !DomainName.HasText())
            {
                return(ValidationMessage._0IsNotSet.NiceToString(pi.NiceName()));
            }

            if (pi.Name == nameof(DomainServer) && !DomainServer.HasText())
            {
                return(ValidationMessage._0IsNotSet.NiceToString(pi.NiceName()));
            }

            if (pi.Name == nameof(DirectoryRegistry_Username) && DirectoryRegistry_Username != null)
            {
                if (DirectoryRegistry_Username.Contains("@") || DirectoryRegistry_Username.Contains("\\") || DirectoryRegistry_Username.Contains("/"))
                {
                    return(ValidationMessage._0DoesNotHaveAValid1Format.NiceToString(pi.NiceName(), "Simple Username"));
                }
            }
        }

        if (LoginWithAzureAD)
        {
            if (pi.Name == nameof(Azure_ApplicationID) && !Azure_ApplicationID.HasText())
            {
                return(ValidationMessage._0IsNotSet.NiceToString(pi.NiceName()));
            }

            if (pi.Name == nameof(Azure_DirectoryID) && !Azure_DirectoryID.HasText())
            {
                return(ValidationMessage._0IsNotSet.NiceToString(pi.NiceName()));
            }
        }

        return(base.PropertyValidation(pi));
    }