// using System; // using System.Collections; // namespace BCG // { // internal class ForeignJoinCollectionEnumerator : IEnumerator // { // protected LightForeignJoinRowList.LightForeignJoinRowListEnumerator myListEnum; // protected IDictionaryEnumerator myDictEnum; // protected IDictionary myJoinColMap; // protected LightForeignJoinSchema mySchema; // public ForeignJoinCollectionEnumerator (IDictionary joinColMap, LightForeignJoinSchema schema) // { // mySchema = schema; // myJoinColMap = joinColMap; // } // #region IEnumerator Members // public void Reset() // { // myListEnum = null; // myDictEnum = null; // } // public virtual object Current // { // get // { // return new LightForeignJoinRow (myListEnum.list.referencedRow, myListEnum.Current as IBlueRow, mySchema); // } // } // /// // /// Gets the ILightForeignJoinRowList corresponding to the current position of the 'MyDictEnum', and moves // /// the 'myListEnum' to the correct position, ie first referencing/left row. If the list does not have any such // /// rows a false is returned // /// // /// // protected virtual bool myMoveListEnumToRightPos () // { // myListEnum = (myDictEnum.Value as ILightForeignJoinRowList).GetEnumerator () // as LightForeignJoinRowList.LightForeignJoinRowListEnumerator; // if (myListEnum.list.count > 1 && myListEnum.list.referencedRow != null) // { // myListEnum.MoveNext (); // return myListEnum.MoveNext (); // } // return false; // } // public virtual bool MoveNext() // { // if (myDictEnum == null) //never been traversed // { // myDictEnum = myJoinColMap.GetEnumerator (); // while (myDictEnum.MoveNext ()) // if (myMoveListEnumToRightPos ()) // return true; // return false; // } // else // { // if (myListEnum.MoveNext()) // return true; // else // while (myDictEnum.MoveNext()) // if (myMoveListEnumToRightPos ()) // return true; // } // return false; // } // #endregion // } // }