A wrapper around string designed to reduced bugs introduced by losing track of the encoded/unencoded state of a string. It does this by requiring users to specify what they are putting in/getting out, and it keeps track.
Exemple #1
0
 protected bool Equals(UrlPathString other)
 {
     return(string.Equals(_notEncoded, other._notEncoded));
 }
 protected bool Equals(UrlPathString other)
 {
     throw new NotImplementedException();
 }
Exemple #3
0
        public static string GetPleaseClickHereForHelpMessage(string pathToProblemFile)
        {
            var template2 = LocalizationManager.GetString("Common.ClickHereForHelp",
                                                          "Please click [here] to get help from the Bloom support team.",
                                                          "[here] will become a link. Keep the brackets to mark the translated text that should form the link.");

            var pattern = new Regex(@"\[(.*)\]");

            if (!pattern.IsMatch(template2))
            {
                // If the translator messed up and didn't mark the bit that should be the hot link, we'll make the whole sentence hot.
                // So it will be something like "Please click here to get help from the Bloom support team", and you can click anywhere
                // on the sentence.
                template2 = "[" + template2 + "]";
            }

            // If we leave backslashes in here, json will fail to parse it later. It works fine with forward slashes, even on Windows.
            pathToProblemFile = pathToProblemFile.Replace("\\", "/");
            var part2 = pattern.Replace(template2,
                                        $"<a href='/bloom/api/teamCollection/reportBadZip?file={UrlPathString.CreateFromUnencodedString(pathToProblemFile).UrlEncoded}'>$1</a>");

            return(part2);
        }
 protected bool Equals(UrlPathString other)
 {
     return string.Equals(_notEncoded, other._notEncoded);
 }
 protected bool Equals(UrlPathString other)
 {
     throw new NotImplementedException();
 }