📄 orderexpressioncollection.cs
字号:
using System;
using Microsoft.Crm.Sandbox.Mobile.CrmServiceSdk;
namespace Microsoft.Crm.Sandbox.Mobile.Helpers.Collection
{
public class OrderExpressionCollection : System.Collections.CollectionBase
{
#region Properties
/// <summary>
/// Provides access to the underlying collection of OrderExpressions
/// </summary>
public OrderExpression this[int index]
{
get
{
return (OrderExpression)List[index];
}
}
#endregion
#region Methods
/// <summary>
/// Adds an order to the collection
/// </summary>
/// <param name="attributeName">The name of the attribute where an order will be applied for the query</param>
/// <param name="orderType">An OrderType enum that specifies what kind of ordering to apply on the attribute</param>
public void Add(string attributeName, OrderType orderType)
{
OrderExpression order = new OrderExpression();
order.AttributeName = attributeName;
order.OrderType = orderType;
List.Add(order);
}
internal OrderExpression[] ToArray()
{
// initialize the string array to the number of orders in the internal list
OrderExpression[] returnArray = new OrderExpression[List.Count];
// populate the array
for (int index = 0; index < returnArray.Length; index++)
{
returnArray[index] = (OrderExpression)List[index];
}
return returnArray;
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -