Ejemplo n.º 1
0
        public override DataSourceResult GetMods(DataSourceRequest request)
        {
            var modIoConfiguration = ModIoBrowser.GetModIoConfigurationForCurrentGame();
            var titleQuery         = "";
            var categoryQuery      = "";
            var sortQuery          = "title";
            var filters            = request.GetAllFilterDescriptors();
            var titleFilter        = filters.FirstOrDefault(x => x.Member == "Name");

            if (titleFilter != null)
            {
                titleQuery = titleFilter.Value.ToString();
            }

            var categoryFilter = filters.FirstOrDefault(x => x.Member == "Category");

            if (categoryFilter != null)
            {
                categoryQuery = categoryFilter.Value.ToString();
            }

            var mods = MMods.GetModsForGame(modIoConfiguration.SelectedGameId, titleQuery, request.Page, request.PageSize);

            request.Filters = new List <IFilterDescriptor>();
            var dataSourceResult = mods.Data.ToDataSourceResult(request);

            dataSourceResult.Total = mods.ResultTotal;
            dataSourceResult.Data  = mods.Data;
            return(dataSourceResult);
        }
Ejemplo n.º 2
0
        internal Configuration()
        {
            if (Common == null)
            {
                Common = new CCommon();
            }

            if (Path == null)
            {
                Path = new PPath();
            }

            if (Mods == null)
            {
                Mods = new MMods();
            }

            if (Aircraft == null)
            {
                Aircraft = new AAircraft();
            }

            if (Weapon == null)
            {
                Weapon = new WWeapon();
            }

            if (Enemy == null)
            {
                Enemy = new EEnemy();
            }

            if (Other == null)
            {
                Other = new OOther();
            }
        }