// Token: 0x060010F9 RID: 4345 RVA: 0x00040868 File Offset: 0x0003EA68
 protected void AddSimpleTypeToArray(OwaEventParameterAttribute paramInfo, ArrayList itemArray, string value)
 {
     if (paramInfo.Type == typeof(string))
     {
         this.AddItemToArray(itemArray, value);
     }
 }
Exemplo n.º 2
0
        protected override Hashtable ParseParameters()
        {
            NameValueCollection queryString = base.EventHandler.HttpContext.Request.QueryString;

            if (queryString.Count == 0)
            {
                return(base.ParameterTable);
            }
            for (int i = 0; i < queryString.Count; i++)
            {
                string key = queryString.GetKey(i);
                if (string.IsNullOrEmpty(key))
                {
                    this.ThrowParserException("Parameter name is empty.");
                }
                if (string.CompareOrdinal(key, "ns") != 0 && string.CompareOrdinal(key, "ev") != 0 && string.CompareOrdinal(key, "oeh2") != 0)
                {
                    OwaEventParameterAttribute paramInfo = base.GetParamInfo(key);
                    if (paramInfo.IsArray)
                    {
                        this.ThrowParserException("Arrays are not supported in GET requests");
                    }
                    string text = queryString[i];
                    if (text == null)
                    {
                        base.AddEmptyParameter(paramInfo);
                    }
                    else
                    {
                        base.AddSimpleTypeParameter(paramInfo, text);
                    }
                }
            }
            return(base.ParameterTable);
        }
 // Token: 0x060010F8 RID: 4344 RVA: 0x00040842 File Offset: 0x0003EA42
 protected void AddEmptyParameter(OwaEventParameterAttribute paramInfo)
 {
     if (paramInfo.IsArray)
     {
         this.AddArrayParameter(paramInfo, new ArrayList());
         return;
     }
     this.AddSimpleTypeParameter(paramInfo, string.Empty);
 }
        // Token: 0x060010F4 RID: 4340 RVA: 0x0004062C File Offset: 0x0003E82C
        protected OwaEventParameterAttribute GetParamInfo(string name)
        {
            OwaEventParameterAttribute owaEventParameterAttribute = this.EventHandler.EventInfo.FindParameterInfo(name);

            if (owaEventParameterAttribute == null)
            {
                this.ThrowParserException(string.Format(CultureInfo.InvariantCulture, "Parameter '{0}' is unknown.", new object[]
                {
                    name
                }));
            }
            return(owaEventParameterAttribute);
        }
 // Token: 0x060010F5 RID: 4341 RVA: 0x00040670 File Offset: 0x0003E870
 protected void AddParameter(OwaEventParameterAttribute paramInfo, object value)
 {
     if (this.parameterTable.Count >= 64)
     {
         this.ThrowParserException("Reached maximum number of parameters");
     }
     if ((this.setMask & paramInfo.ParameterMask) != 0UL)
     {
         this.ThrowParserException(string.Format(CultureInfo.InvariantCulture, "Parameter '{0}' is found twice", new object[]
         {
             paramInfo.Name
         }));
     }
     this.setMask |= paramInfo.ParameterMask;
     this.parameterTable.Add(paramInfo.Name, value);
 }
        // Token: 0x060010F6 RID: 4342 RVA: 0x000406F4 File Offset: 0x0003E8F4
        protected void AddSimpleTypeParameter(OwaEventParameterAttribute paramInfo, string value)
        {
            object obj = null;

            if (paramInfo.Type == typeof(string))
            {
                obj = value;
            }
            else if (paramInfo.Type == typeof(int))
            {
                obj = int.Parse(value, CultureInfo.InvariantCulture);
            }
            else if (paramInfo.Type == typeof(double))
            {
                obj = double.Parse(value, CultureInfo.InvariantCulture);
            }
            else if (paramInfo.Type == typeof(long))
            {
                obj = long.Parse(value, CultureInfo.InvariantCulture);
            }
            else if (paramInfo.Type == typeof(bool))
            {
                if (string.Equals(value, "0", StringComparison.Ordinal))
                {
                    obj = false;
                }
                else if (string.Equals(value, "1", StringComparison.Ordinal))
                {
                    obj = true;
                }
                else
                {
                    this.ThrowParserException(string.Format(CultureInfo.InvariantCulture, "Failed to parse type. Type = {0}, Value = {1}", new object[]
                    {
                        paramInfo.Type,
                        value
                    }));
                }
            }
            if (obj != null)
            {
                this.AddParameter(paramInfo, obj);
            }
        }
 // Token: 0x060010FA RID: 4346 RVA: 0x00040898 File Offset: 0x0003EA98
 protected void AddEmptyItemToArray(OwaEventParameterAttribute paramInfo, ArrayList itemArray)
 {
     this.AddSimpleTypeParameter(paramInfo, string.Empty);
 }
        // Token: 0x060010F7 RID: 4343 RVA: 0x00040820 File Offset: 0x0003EA20
        protected void AddArrayParameter(OwaEventParameterAttribute paramInfo, ArrayList itemArray)
        {
            Array value = itemArray.ToArray(paramInfo.Type);

            this.AddParameter(paramInfo, value);
        }
Exemplo n.º 9
0
 internal void AddParameterInfo(OwaEventParameterAttribute paramInfo)
 {
     this.paramInfoTable.Add(paramInfo.Name, paramInfo);
 }