コード例 #1
0
        public async Task SearchOnline()
        {
            mAlliances.Clear();
            mCharacters.Clear();
            mCorporations.Clear();
            mMailinglists.Clear();

            if (mText == null)
            {
                mItems.Clear();
                mCancelRunningTask = null;
                return;
            }

            IsLoading = true;

            Task <EntityInfo[]> task;

            mRunningTask = task = EntityLookupAsync.Search(mText, SearchOptions.Online);

            var result = await task;

            IsLoading = false;

            LoadResults(result);
        }
コード例 #2
0
        private async Task LoadOffline()
        {
            mAlliances.Clear();
            mCharacters.Clear();
            mCorporations.Clear();
            mMailinglists.Clear();

            if (mText == null)
            {
                mItems.Clear();
                mCancelRunningTask = null;
                return;
            }

            //IsLoading = true;

            var result = await EntityLookupAsync.Search(mText, SearchOptions.Offline, mCancelRunningTask.Token);

            //IsLoading = false;

            LoadResults(result);

            mCancelRunningTask = null;
        }
コード例 #3
0
        private async void mEditor_Selected(object sender, SelectedSuggestionEventArgs e)
        {
            if (e.InfoSelected == null)
            {
                EntityInfo[] list = await EntityLookupAsync.Search(e.TextSelected, SearchOptions.Offline | SearchOptions.ExactMatch);

                if (list.Length == 1)
                {
                    e.InfoSelected = list[0];
                }
                else
                {
                    e.InfoSelected = new EntityInfo()
                    {
                        EntityID   = -1,
                        EntityType = Common.EntityType.Character,
                        Name       = e.TextSelected
                    };
                }

                e.TextSelected = null;
            }
            SelectItem(e.InfoSelected);
        }