本文整理汇总了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();
}
示例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]);
}
}
}
示例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;
}
示例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.
}
示例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();
}