Beispiel #1
0
        public Task <IEnumerable <ISearchResult> > SearchSimilar(string id, int pageSize, int pageIndex, IAbsoluteProgressMonitor monitor, out int?totalNumberOfResults)
        {
            List <ISearchResult> results = new List <ISearchResult>();

            FileSearchResult soundResult = new FileSearchResult(this, AudioSearchResultType.SoundFile, SOUND_RESOURCE_NAME);

            soundResult.Title = "Sound-Datei (" + id + ")";

            FileSearchResult musicResult = new FileSearchResult(this, AudioSearchResultType.MusicFile, MUSIC_RESOURCE_NAME);

            musicResult.Title = "Musik-Datei (" + id + ")";

            ModeElementSearchResult modeResult = new ModeElementSearchResult(this, soundResult, musicResult);

            modeResult.Title = "Szenario (" + id + ")";

            results.Add(soundResult);
            results.Add(musicResult);
            results.Add(modeResult);

            totalNumberOfResults = results.Count;

            var completionSource = new TaskCompletionSource <IEnumerable <ISearchResult> >();

            completionSource.SetResult(results);
            return(completionSource.Task);
        }
Beispiel #2
0
        public ModeElementSearchResult(TestAudioSource audioSource, FileSearchResult soundResource, FileSearchResult musicResource)
            : base(audioSource, AudioSearchResultType.ModeElement)
        {
            this.m_SoundResource = soundResource;
            this.m_MusicResource = musicResource;

            this.FilesToBeDownloaded.Add(m_MusicResource);
            this.FilesToBeDownloaded.Add(m_SoundResource);
        }