Exemplo n.º 1
0
 public LevelSetCursor(
     ILevelBrowser browser,
     Guid desiredSelection,
     ILevelSetQuery query,
     LevelSetCursorShifted shiftCallback,
     LevelSetCursorJumped jumpCallback,
     LevelSetCursorAddition additionCallback,
     LevelSetCursorRemoval removalCallback,
     int size)
 {
     Query                 = query;
     this.Browser          = browser;
     this.desiredSelection = desiredSelection;
     this.shiftCallback    = shiftCallback;
     this.jumpCallback     = jumpCallback;
     this.additionCallback = additionCallback;
     this.removalCallback  = removalCallback;
     this.size             = size;
 }
        public ILevelSetCursor OpenCursor(
            Guid desiredSelection,
            ILevelSetSorter sorter,
            ILevelSetFilter filter,
            LevelSetQueryEvent notifyFetchingCallback,
            LevelSetQueryEvent notifyFetchCompleteCallback,
            LevelSetCursorShifted shiftCallback,
            LevelSetCursorJumped jumpCallback,
            LevelSetCursorAddition additionCallback,
            LevelSetCursorRemoval removalCallback,
            int size)
        {
            LevelSetCursor cursor;

            lock (Synch)
            {
                ILevelSetQuery query = new LevelSetQuery(
                    sorter,
                    filter,
                    this,
                    notifyFetchingCallback,
                    notifyFetchCompleteCallback);

                queries.Add(query);

                cursor = new LevelSetCursor(
                    this,
                    desiredSelection,
                    query,
                    shiftCallback,
                    jumpCallback,
                    additionCallback,
                    removalCallback,
                    size);

                query.AddCursor(cursor);
            }

            return(cursor);
        }