/// <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(); }
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]); } } }
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; }
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. }
/// <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(); }