columnscollection.cs

来自「CRM的移动平台代码」· CS 代码 · 共 51 行

CS
51
字号
using System;

namespace Microsoft.Crm.Sandbox.Mobile.Helpers.Collection
{
	/// <summary>
	/// Used by the ColumnSetHelper class to keep track of the columns
	/// </summary>
	/// <remarks>Unlike the other collection classes, this class is used internally</remarks>
	public class ColumnsCollection : System.Collections.CollectionBase
	{
		#region Properties

		internal string this[int index]
		{
			get
			{
				return (string)List[index];
			}
		}

		#endregion

		#region Methods

		internal void AddColumn(string attributeName)
		{
			// add only if the attribute does not already exist in the list
			if (!List.Contains(attributeName))
			{
				List.Add(attributeName);
			}
		}

		internal string[] ToStringArray()
		{
			// initialize an array to the number of columns in the columns collection
			string[] returnArray = new string[List.Count];

			// populate the array
			for (int index = 0; index < returnArray.Length; index++)
			{
				returnArray[index] = (string)List[index];
			}

			return returnArray;
		}

		#endregion
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?