當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。