Exemple #1
0
 private static void UrlPathEncode(string urlToEncode, bool allowHashParameter, bool encodeUnicodeCharacters, TextWriter output, ref bool invalidUnicode)
 {
     if (urlToEncode != null && urlToEncode.Length != 0 && output != null)
     {
         bool flag = false;
         int  i    = 0;
         int  length;
         for (length = urlToEncode.Length; i < length && urlToEncode[i] == ' '; i++)
         {
         }
         int num  = i;
         int num2 = 0;
         for (; i < length; i++)
         {
             char c = urlToEncode[i];
             if (c == '?')
             {
                 break;
             }
             if (allowHashParameter && c == '#')
             {
                 break;
             }
             if ((c & 0xFFE0) == 0 || c == ' ' || c == '"' || c == '#' || c == '%' || c == '<' || c == '>' || c == '\'' || c == '&')
             {
                 if (num2 > 0)
                 {
                     output.Write(urlToEncode.Substring(num, num2));
                     num2 = 0;
                 }
                 num = i + 1;
                 int num3 = c & 0xFF;
                 if (num3 < 16)
                 {
                     output.Write("%0");
                     output.Write(num3.ToString("X", CultureInfo.InvariantCulture));
                 }
                 else
                 {
                     output.Write('%');
                     output.Write(num3.ToString("X", CultureInfo.InvariantCulture));
                 }
             }
             else if (encodeUnicodeCharacters && c > '\u007f')
             {
                 if (num2 > 0)
                 {
                     output.Write(urlToEncode.Substring(num, num2));
                     num2 = 0;
                 }
                 SPHttpUtility.UrlEncodeUnicodeChar(output, urlToEncode[i], (i < length - 1) ? urlToEncode[i + 1] : '\0', ref invalidUnicode, out flag);
                 if (flag)
                 {
                     i++;
                 }
                 num = i + 1;
             }
             else
             {
                 num2++;
             }
         }
         if (num < length)
         {
             output.Write(urlToEncode.Substring(num));
         }
     }
 }
Exemple #2
0
        public static void UrlPathEncode(string urlToEncode, bool allowHashParameter, bool encodeUnicodeCharacters, TextWriter output)
        {
            bool flag = false;

            SPHttpUtility.UrlPathEncode(urlToEncode, allowHashParameter, encodeUnicodeCharacters, output, ref flag);
        }
Exemple #3
0
 public static string UrlPathEncode(string urlToEncode, bool allowHashParameter)
 {
     return(SPHttpUtility.UrlPathEncode(urlToEncode, allowHashParameter, false));
 }
Exemple #4
0
        public static string UrlPathEncode(string urlToEncode, bool allowHashParameter, bool encodeUnicodeCharacters)
        {
            bool flag = false;

            return(SPHttpUtility.UrlPathEncode(urlToEncode, allowHashParameter, encodeUnicodeCharacters, ref flag));
        }
Exemple #5
0
 protected void Render(TextWriter output)
 {
     output.Write("<div class='ms-rs-calendar-loading' id='LoadingDiv' style='width:100%;height:100%'>");
     //output.Write(LocalizationHelper.Current.CalendarLoading);
     output.Write("</div>");
     if (this._urlCssClass != null)
     {
         string value = "<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"" + SPHttpUtility.HtmlUrlAttributeEncode(this._urlCssClass.ToString()) + "\">";
         output.Write(value);
     }
 }