Beispiel #1
0
    private bool ValidateNewSite(out string siteName)
    {
        var isValid = rfvSiteDisplayName.IsValid && rfvDomain.IsValid && rfvSitePresentationUrl.IsValid;

        isValid &= ValidateSiteName(out siteName);

        if (!Uri.IsWellFormedUriString(txtSitePresentationUrl.Text, UriKind.Absolute))
        {
            isValid = rfvSitePresentationUrl.IsValid = false;
        }

        var presentationUrl = PresentationUrlNormalizer.Normalize(txtSitePresentationUrl.Text);

        if (String.Equals(presentationUrl.Url, GetDomainInPresentationUrlFormat(txtDomain.Text).Url, StringComparison.InvariantCultureIgnoreCase))
        {
            rfvDomain.ErrorMessage = GetString("importsite.stepsitedetailscollisiondomain");
            isValid = rfvDomain.IsValid = false;
        }

        return(isValid);
    }
Beispiel #2
0
 private NormalizedPresentationUrl GetDomainInPresentationUrlFormat(string domain)
 {
     // Since the presentation URL is schema agnostic the HTTP schema can be used directly to create a fake presentation URL.
     return(PresentationUrlNormalizer.Normalize($"http://{domain}"));
 }