本文整理汇总了C#中System.Array.OfType方法的典型用法代码示例。如果您正苦于以下问题:C# Array.OfType方法的具体用法?C# Array.OfType怎么用?C# Array.OfType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Array
的用法示例。
在下文中一共展示了Array.OfType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ArrayExtension
public ArrayExtension (Array elements)
{
if (elements == null)
throw new ArgumentNullException ("elements");
Type = elements.GetType ().GetElementType ();
items = new List<object> (elements.OfType<object>());
}
示例2: AreKeysDown
public bool AreKeysDown(Array arr)
{
return AreKeysDown(arr.OfType<Key>());
}
示例3: CopyTo
public override void CopyTo(Array array, int index)
{
_list.CopyTo(array.OfType<ODataParameter>().ToArray(), index);
}
示例4: AddRange
public override void AddRange(Array values)
{
_list.AddRange(values.OfType<ODataParameter>());
}
示例5: AddRange
/// <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());
}
示例6: EncodeToNumber
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)));
}
示例7: EncodeContactSourceNumbers
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)));
}