Example #1
0
		public ArrayExtension (Array elements)
		{
			if (elements == null)
				throw new ArgumentNullException ("elements");
			Type = elements.GetType ().GetElementType ();
			items = new List<object> (elements.OfType<object>());
		}
 public bool AreKeysDown(Array arr)
 {
     return AreKeysDown(arr.OfType<Key>());
 }
 public override void CopyTo(Array array, int index)
 {
     _list.CopyTo(array.OfType<ODataParameter>().ToArray(), index);
 }
 public override void AddRange(Array values)
 {
     _list.AddRange(values.OfType<ODataParameter>());
 }
 /// <summary>
 /// Adds an array of values to the current collection.
 /// </summary>
 /// <param name="values">an array of BigQueryParameter objects.</param>
 public override void AddRange(Array values)
 {
     innerList.AddRange(values.OfType<BigQueryParameter>().ToArray());
 }
        private static void EncodeToNumber(List<KeyValuePair<string, string>> result, Array array)
        {
            var arrayValue = string.Join(" ", array.OfType<ToNumber>().Select(e => e.Value).ToArray());
            result.Add(new KeyValuePair<string, string>("To", HttpUtility.UrlEncode(arrayValue)));

            var arrayData = string.Join(" ", array.OfType<ToNumber>().Select(e => e.ClientData).ToArray());
            result.Add(new KeyValuePair<string, string>("ToNumber[ClientData]", HttpUtility.UrlEncode(arrayData)));
        }
        private static void EncodeContactSourceNumbers(List<KeyValuePair<string, string>> result, Array array, string elementName)
        {
            var arrayValue = string.Join(" ",
                array.OfType<ContactSourceNumbers>().Select(e => string.Join(" ", e.Text)).ToArray());
            result.Add(new KeyValuePair<string, string>(string.Format("{0}", elementName), HttpUtility.UrlEncode(arrayValue)));

            var arrayData = string.Join(" ", array.OfType<ContactSourceNumbers>().Select(e => e.fieldName).ToArray());
            result.Add(new KeyValuePair<string, string>(string.Format("{0}[fieldName]", elementName),
                HttpUtility.UrlEncode(arrayData)));
        }