コード例 #1
0
        private void UpdateIdGamesView_Worker(object sender, DoWorkEventArgs e)
        {
            try
            {
                IEnumerable <GameFileSearchField> searchFields = e.Argument as IEnumerable <GameFileSearchField>;

                if (searchFields == null || !searchFields.Any())
                {
                    IdGamesDataSource = Adapter.GetGameFiles();
                }
                else
                {
                    IEnumerable <IGameFile> ret = new IGameFile[0];

                    foreach (GameFileSearchField sf in searchFields)
                    {
                        ret = ret.Union(Adapter.GetGameFiles(new GameFileGetOptions(sf)));
                    }

                    IdGamesDataSource = ret;
                }
            }
            catch
            {
                IdGamesDataSource = new IGameFile[0];
            }
        }
コード例 #2
0
        public override void SetGameFiles(IEnumerable <GameFileSearchField> searchFields)
        {
            if (Options != null)
            {
                GameFileGetOptions options = new GameFileGetOptions();
                options.Limit        = 25;
                options.OrderBy      = OrderType.Desc;
                options.OrderField   = GameFileFieldType.Downloaded;
                options.SelectFields = base.m_selectFields;

                if (searchFields != null && searchFields.Any())
                {
                    IEnumerable <IGameFile> items = new IGameFile[0];

                    foreach (GameFileSearchField sf in searchFields)
                    {
                        options.SearchField = sf;
                        items = items.Union(Adapter.GetGameFiles(options));
                    }

                    base.SetDataSource(items);
                }
                else
                {
                    base.SetDataSource(Adapter.GetGameFiles(options));
                }
            }
            else
            {
                base.SetGameFiles(searchFields);
            }
        }
コード例 #3
0
        public override void SetGameFiles(IEnumerable <GameFileSearchField> searchFields)
        {
            IEnumerable <IGameFile> items = new IGameFile[0];

            foreach (GameFileSearchField sf in searchFields)
            {
                items = items.Union(m_tagAdapter.GetGameFiles(new GameFileGetOptions(m_selectFields, sf), TagDataSource));
            }

            base.SetDataSource(items);
        }
コード例 #4
0
        public virtual void SetGameFiles(IEnumerable <GameFileSearchField> searchFields)
        {
            IEnumerable <IGameFile> items = new IGameFile[0];

            foreach (GameFileSearchField sf in searchFields)
            {
                items = items.Union(Adapter.GetGameFiles(new GameFileGetOptions(m_selectFields, sf)));
            }

            SetDataSource(items);
        }
コード例 #5
0
        public override void SetGameFiles(IEnumerable <GameFileSearchField> searchFields)
        {
            IEnumerable <IGameFile> items = new IGameFile[0];
            var untaggedFiles             = Adapter.GetUntaggedGameFiles();

            foreach (GameFileSearchField sf in searchFields)
            {
                var search = Adapter.GetGameFiles(new GameFileGetOptions(m_selectFields, sf));
                items = items.Union(untaggedFiles.Intersect(search));
            }

            SetDataSource(items);
        }