public IEnumerable <IGameProfile> GetGameProfiles(int gameFileID)
        {
            DataTable dt = DataAccess.ExecuteSelect(string.Format("select * from GameProfiles where GameFileID = {0}", gameFileID)).Tables[0];

            return(Util.TableToStructure(dt, typeof(GameProfile)).Cast <IGameProfile>());
        }
        public IEnumerable <IStatsData> GetStats()
        {
            DataTable dt = DataAccess.ExecuteSelect("select * from Stats").Tables[0];

            return(Util.TableToStructure(dt, typeof(StatsData)).Cast <StatsData>().ToList());
        }
        public IEnumerable <IStatsData> GetStats(int gameFileID)
        {
            DataTable dt = DataAccess.ExecuteSelect(string.Format("select * from Stats where GameFileID = {0}", gameFileID)).Tables[0];

            return(Util.TableToStructure(dt, typeof(StatsData)).Cast <StatsData>().ToList());
        }
        public IEnumerable <ITagMapping> GetTagMappings()
        {
            DataTable dt = DataAccess.ExecuteSelect("select * from TagMapping").Tables[0];

            return(Util.TableToStructure(dt, typeof(TagMapping)).Cast <TagMapping>().ToList());
        }
        public IEnumerable <ITagMapping> GetTagMappings(int gameFileID)
        {
            DataTable dt = DataAccess.ExecuteSelect(string.Format("select * from TagMapping where FileID = {0}", gameFileID)).Tables[0];

            return(Util.TableToStructure(dt, typeof(TagMapping)).Cast <TagMapping>().ToList());
        }
        public IEnumerable <IConfigurationData> GetConfiguration()
        {
            DataTable dt = DataAccess.ExecuteSelect("select * from Configuration").Tables[0];

            return(Util.TableToStructure(dt, typeof(ConfigurationData)).Cast <ConfigurationData>().ToList());
        }
        public IEnumerable <IGameFile> GetGameFiles()
        {
            DataTable dt = DataAccess.ExecuteSelect("select * from GameFiles").Tables[0];

            return(Util.TableToStructure(dt, typeof(GameFile)).Cast <IGameFile>());
        }
        public IEnumerable <IFileData> GetFiles(IGameFile gameFile, FileType fileTypeID)
        {
            DataTable dt = DataAccess.ExecuteSelect(string.Format("select * from Files where GameFileID = {0} and FileTypeID = {1} order by FileOrder, FileID", gameFile.GameFileID.Value, (int)fileTypeID)).Tables[0];

            return(Util.TableToStructure(dt, typeof(FileData)).Cast <FileData>().ToList());
        }
        public IEnumerable <IFileData> GetFiles(FileType fileTypeID)
        {
            DataTable dt = DataAccess.ExecuteSelect(string.Format("select * from Files where FileTypeID = {0} order by GameFileID, FileOrder desc", (int)fileTypeID)).Tables[0];

            return(Util.TableToStructure(dt, typeof(FileData)).Cast <FileData>().ToList());
        }
        public IIWadData GetIWad(int gameFileID)
        {
            DataTable dt = DataAccess.ExecuteSelect(string.Format("select * from IWads where GameFileID = {0} order by Name collate nocase", gameFileID)).Tables[0];

            return(Util.TableToStructure(dt, typeof(IWadData)).Cast <IWadData>().FirstOrDefault());
        }
        public IEnumerable <IFileData> GetFiles()
        {
            DataTable dt = DataAccess.ExecuteSelect("select * from Files").Tables[0];

            return(Util.TableToStructure(dt, typeof(FileData)).Cast <FileData>().ToList());
        }
        public IEnumerable <IIWadData> GetIWads()
        {
            DataTable dt = DataAccess.ExecuteSelect("select * from IWads order by Name collate nocase").Tables[0];

            return(Util.TableToStructure(dt, typeof(IWadData)).Cast <IWadData>().ToList());
        }
        public IEnumerable <IGameFile> GetGameFileIWads()
        {
            DataTable dt = DataAccess.ExecuteSelect("select GameFiles.* from GameFiles join IWads on IWads.GameFileID = GameFiles.GameFileID").Tables[0];

            return(Util.TableToStructure(dt, typeof(GameFile)).Cast <GameFile>());
        }
        public IEnumerable <IGameFile> GetUntaggedGameFiles()
        {
            DataTable dt = DataAccess.ExecuteSelect("select GameFiles.* from GameFiles left join TagMapping on GameFiles.GameFileID = TagMapping.FileID where FileID is null").Tables[0];

            return(Util.TableToStructure(dt, typeof(GameFile)).Cast <IGameFile>());
        }
예제 #15
0
        public void SetGameProfile(IGameProfile gameProfile)
        {
            SetIwadInfoLabel();

            UnregisterEvents();
            m_handler = new FileLoadHandler(m_adapter, GameFile, gameProfile);

            SetDefaultSelections();
            GameProfile.ApplyDefaultsToProfile(gameProfile, m_appConfig);
            cmbProfiles.SelectedValue = gameProfile.GameProfileID;

            if (GameFile != null)
            {
                chkSaveStats.Checked = gameProfile.SettingsStat;

                IIWadData iwad = m_adapter.GetIWad(gameProfile.GameFileID.Value);

                if (iwad != null)
                {
                    SelectedIWad = GameFile;
                }

                if (gameProfile.SourcePortID.HasValue)
                {
                    SelectedSourcePort = m_adapter.GetSourcePort(gameProfile.SourcePortID.Value);
                }

                if (gameProfile.IWadID.HasValue)
                {
                    SelectedIWad = GameFile;
                    SelectedIWad = m_adapter.GetGameFileIWads().FirstOrDefault(x => x.IWadID == gameProfile.IWadID);
                }

                if (!string.IsNullOrEmpty(gameProfile.SettingsMap))
                {
                    SelectedMap = gameProfile.SettingsMap;
                }
                if (!string.IsNullOrEmpty(gameProfile.SettingsSkill))
                {
                    SelectedSkill = gameProfile.SettingsSkill;
                }
                if (!string.IsNullOrEmpty(gameProfile.SettingsExtraParams))
                {
                    ExtraParameters = gameProfile.SettingsExtraParams;
                }
                if (!string.IsNullOrEmpty(gameProfile.SettingsSpecificFiles))
                {
                    SpecificFiles = Util.SplitString(gameProfile.SettingsSpecificFiles);
                }
            }

            bool reset = ShouldRecalculateAdditionalFiles();

            HandleSourcePortSelectionChange(reset);
            HandleIwadSelectionChanged(reset);
            SetAdditionalFiles(reset);
            HandleDemoChange();
            RegisterEvents();

            if (SelectedIWad != null && SelectedIWad.Equals(GameFile))
            {
                cmbIwad.Enabled = false;
            }
        }
예제 #16
0
 private void SetupSearchFilters()
 {
     Util.SetDefaultSearchFields(ctrlSearch);
 }