当前位置: 首页>>代码示例>>C#>>正文


C# List.Insert方法代码示例

本文整理汇总了C#中XCore.List.Insert方法的典型用法代码示例。如果您正苦于以下问题:C# List.Insert方法的具体用法?C# List.Insert怎么用?C# List.Insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XCore.List的用法示例。


在下文中一共展示了List.Insert方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetMessageTargets

		/// <summary>
		/// return an array of all of the objects which should
		/// 1) be queried when looking for someone to deliver a message to
		/// 2) be potential recipients of a broadcast
		/// </summary>
		/// <returns></returns>
		public IxCoreColleague[] GetMessageTargets()
		{
			CheckDisposed();

			Control first = FirstControl;
			if (first != null && first.FindForm() == null)
				first = null;
			Control second = SecondControl;
			if (second != null && second.FindForm() == null)
				second = null;

			var targets = new List<IxCoreColleague> {this};

			if (m_prioritySecond)
			{
				if (first != null)
					targets.Insert(0, first as IxCoreColleague);
				if (second != null)
					targets.Insert(0, second as IxCoreColleague);
			}
			else
			{
				if (second != null)
					targets.Insert(0, second as IxCoreColleague);
				if (first != null)
					targets.Insert(0, first as IxCoreColleague);
			}

			return targets.ToArray();
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:36,代码来源:MultiPane.cs

示例2: EnsureRealSegmentsForNonTrivialAnalyses

		protected virtual void EnsureRealSegmentsForNonTrivialAnalyses(List<int> segments, int[] segmentsArray, int iseg, List<int> formsInSegment)
		{
			if (m_cache.IsDummyObject(segmentsArray[iseg]) && HasNonTrivialAnalysis(formsInSegment))
			{
				using (SuppressSubTasks supressActionHandler = new SuppressSubTasks(Cache, true))
				{
					// replace the dummy segment with a real one.
					segmentsArray[iseg] = CmBaseAnnotation.ConvertBaseAnnotationToReal(Cache, segmentsArray[iseg]).Hvo;
					segments.RemoveAt(iseg);
					segments.Insert(iseg, segmentsArray[iseg]);
				}
			}
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:13,代码来源:ITextUtils.cs

示例3: AddBefore

		private int AddBefore(List<int> ids, int index, int hvoAdd)
		{
			if (hvoAdd == 0)
				return index; // nothing to add
			if (index == 0 || ids[index - 1] != hvoAdd)
			{
				// Not present, add it.
				ids.Insert(index, hvoAdd);
				return index; // no change, things moved up.
			}
			return index - 1;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:12,代码来源:InterlinMaster.cs

示例4: AddAfter

		private int AddAfter(List<int> ids, int indexAfter, int hvoAdd)
		{
			if (hvoAdd == 0)
				return indexAfter; // nothing to add
			if (indexAfter >= ids.Count - 1 || ids[indexAfter] != hvoAdd)
			{
				// Not already present, add it.
				ids.Insert(indexAfter, hvoAdd);
			}
			return indexAfter + 1; // in either case next text goes after this one.
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:11,代码来源:InterlinMaster.cs

示例5: IndicesOfInvalidSortItems

		/// <summary>
		///
		/// </summary>
		/// <returns>indices of invalid sort items in reverse order, so that the caller can
		/// remove those invalid indices from SortedObjects without affecting the validity of the next invalid index.</returns>
		protected int[] IndicesOfInvalidSortItems()
		{
			List<int> indices = new List<int>();
			for (int i = 0; i < SortedObjects.Count; i++)
			{
				int hvoItem = RootObjectAt(i).Hvo;
				if (!CmObject.IsValidObject(Cache, hvoItem))
				{
					indices.Insert(0, i);
				}
			}
			return indices.ToArray();
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:18,代码来源:RecordList.cs


注:本文中的XCore.List.Insert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。