コード例 #1
0
 public DlgGame( GameData data, Game game = null )
     : this()
 {
     this.Data = data;
     Game = game;
     editMode = Game != null;
 }
コード例 #2
0
        public CDlgDataScrape( Queue<int> jobs, GameData data, bool fullGenre )
            : base(GlobalStrings.CDlgScrape_ScrapingGameInfo, true)
        {
            scrapeResults = new Dictionary<int, string>();
            this.data = data;
            this.jobs = jobs;
            this.totalJobs = jobs.Count;

            this.fullGenre = fullGenre;
        }
コード例 #3
0
        public FormMain()
        {
            gameData = new GameData();
            InitializeComponent();
            // jpodadera. Changed combo to checkbox to set favorite value
            //combFavorite.SelectedIndex = 0;
            chkFavorite.Checked = false;

            listSorter.AddIntCol( 1 );
            lstGames.ListViewItemSorter = listSorter;
            // jpodadera. Save width of category column
            originalCatColumnWidth = lstGames.Columns[2].Width;
            colCategoryPointer = lstGames.Columns[2];

            FillCategoryList();
        }
コード例 #4
0
        public FormMain() {
            gameData = new GameData();
            InitializeComponent();

            chkFavorite.Checked = false;
            chkGroupCategory.Checked = Settings.Instance().GroupView;

            // Set up list sorting
            listSorter.AddIntCol( 0 );
            listSorter.AddRevCol( 3 );
            listSorter.SetSortCol( 1, 1 );
            lstGames.ListViewItemSorter = listSorter;
            lstGames.SetSortIcon( listSorter.GetSortCol(), ( listSorter.GetSortDir() == 1 ) ? SortOrder.Ascending : SortOrder.Descending );

            // jpodadera. Save width of category column
            originalCatColumnWidth = lstGames.Columns[2].Width;
            colCategoryPointer = lstGames.Columns[2];

            FullListRefresh();
        }
コード例 #5
0
        public CDlgUpdateProfile( GameData data, string customUrl, bool overwrite, SortedSet<int> ignore, bool ignoreDlc, bool ignoreExternal )
            : base(GlobalStrings.CDlgUpdateProfile_UpdatingGameList, true)
        {
            custom = true;
            this.customUrl = customUrl;

            Added = 0;
            Fetched = 0;
            UseHtml = false;
            Failover = false;

            this.data = data;

            this.overwrite = overwrite;
            this.ignore = ignore;
            this.ignoreDlc = ignoreDlc;

            //jpodadera. Non-Steam games
            this.ignoreExternal = ignoreExternal;

            SetText(GlobalStrings.CDlgFetch_DownloadingGameList);
        }
コード例 #6
0
        /// <summary>
        /// Prompts user to create a new profile.
        /// </summary>
        void CreateProfile()
        {
            DlgProfile dlg = new DlgProfile();
            DialogResult res = dlg.ShowDialog();
            if( res == System.Windows.Forms.DialogResult.OK ) {
                Cursor = Cursors.WaitCursor;
                currentProfile = dlg.Profile;
                gameData = currentProfile.GameData;
                AddStatus(GlobalStrings.MainForm_ProfileCreated);
                if( dlg.DownloadNow ) {
                    UpdateProfileDownload( false );
                }

                if( dlg.ImportNow ) {
                    UpdateProfileImport( false );
                }
                if( dlg.SetStartup ) {
                    settings.StartupAction = StartupAction.Load;
                    settings.ProfileToLoad = currentProfile.FilePath;
                    settings.Save();
                }

                FillCategoryList();
                FillGameList();
                Cursor = Cursors.Default;
            }
            UpdateEnableStatesForProfileChange();
        }
コード例 #7
0
 /// <summary>
 /// Gets a category based on a name. Creates the category if necessary. Displays error message on error.
 /// </summary>
 /// <param name="name">Name of the category to get</param>
 /// <param name="data">Game data object we're referencing</param>
 /// <param name="cat">Resulting category</param>
 /// <returns>True if successful, false otherwise</returns>
 public static bool StringToCategory( string name, GameData data, out Category cat )
 {
     cat = null;
     if( string.IsNullOrWhiteSpace( name ) ) {
         return true;
     }
     if( name == CAT_FAV_NAME || name == CAT_ALL_NAME ) {
         MessageBox.Show(string.Format(GlobalStrings.MainForm_CategoryNameReserved, name), GlobalStrings.DBEditDlg_Warning, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         return false;
     }
     if( name != CAT_UNC_NAME ) {
         cat = data.GetCategory( name );
     }
     return true;
 }
コード例 #8
0
        /// <summary>
        /// Unloads the current profile or game list, making sure the user gets the option to save any changes.
        /// </summary>
        /// <param name="updateUI">If true, will redraw the UI. Otherwise, will leave it up to the caller to do so.</param>
        /// <returns>True if there is now no loaded profile, false otherwise.</returns>
        void Unload( bool updateUI = true )
        {
            if( !CheckForUnsaved() ) {
                return;
            }

            AddStatus(GlobalStrings.MainForm_ClearedData);
            currentProfile = null;
            gameData = new GameData();
            MakeChange( false );
            UpdateEnableStatesForProfileChange();
            if( updateUI ) {
                FillCategoryList();
                FillGameList();
            }
        }
コード例 #9
0
        /// <summary>
        /// Loads the given profile file.
        /// </summary>
        /// <param name="path"></param>
        /// <param name="checkForChanges"></param>
        void LoadProfile( string path, bool checkForChanges = true )
        {
            if( checkForChanges && !CheckForUnsaved() ) return;

            try {
                currentProfile = Profile.Load( path );
                AddStatus(GlobalStrings.MainForm_ProfileLoaded);
            } catch( ApplicationException e ) {
                MessageBox.Show(e.Message, GlobalStrings.MainForm_ErrorLoadingProfile, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                AddStatus(GlobalStrings.MainForm_FailedLoadProfile);
                return;
            }

            gameData = currentProfile.GameData;

            if( currentProfile.AutoDownload ) {
                UpdateProfileDownload();
            }
            if( currentProfile.AutoImport ) {
                UpdateProfileImport();
            }

            FillCategoryList();
            FillGameList();
            UpdateEnableStatesForProfileChange();
        }
コード例 #10
0
 /// <summary>
 /// Gets a category based on a name. Creates the category if necessary. Displays error message on error.
 /// </summary>
 /// <param name="name">Name of the category to get</param>
 /// <param name="data">Game data object we're referencing</param>
 /// <param name="cat">Resulting category</param>
 /// <returns>True if successful, false otherwise</returns>
 public static bool StringToCategory( string name, GameData data, out Category cat ) {
     cat = null;
     if( string.IsNullOrWhiteSpace( name ) ) {
         return true;
     }
     if( name != GlobalStrings.MainForm_Uncategorized ) {
         cat = data.GetCategory( name );
     }
     return true;
 }
コード例 #11
0
ファイル: Profile.cs プロジェクト: DevSplash/Depressurizer
 public int ImportSteamData()
 {
     return(GameData.ImportSteamConfig(SteamID64, IgnoreList, IncludeShortcuts));
 }
コード例 #12
0
ファイル: Profile.cs プロジェクト: DevSplash/Depressurizer
 public void ExportSteamData()
 {
     GameData.ExportSteamConfig(SteamID64, ExportDiscard, IncludeShortcuts);
 }