Esempio n. 1
0
        private void HandleFormClosing()
        {
            if (DataSourceAdapter != null)
            {
                IEnumerable <IConfigurationData> config = DataSourceAdapter.GetConfiguration();

                if (WindowState != FormWindowState.Minimized) //too many problems when the form is minimized, not supported
                {
                    UpdateConfig(config, AppConfiguration.SplitTopBottomName, splitTopBottom.SplitterDistance.ToString());
                    UpdateConfig(config, AppConfiguration.SplitLeftRightName, splitLeftRight.SplitterDistance.ToString());
                    UpdateConfig(config, AppConfiguration.SplitTagSelectName, splitTagSelect.SplitterDistance.ToString());

                    UpdateConfig(config, AppConfiguration.AppWidthName, Size.Width.ToString());
                    UpdateConfig(config, AppConfiguration.AppHeightName, Size.Height.ToString());
                    UpdateConfig(config, AppConfiguration.AppXName, Location.X.ToString());
                    UpdateConfig(config, AppConfiguration.AppYName, Location.Y.ToString());
                    UpdateConfig(config, AppConfiguration.WindowStateName, WindowState.ToString());
                }

                UpdateConfig(config, AppConfiguration.ColumnConfigName, BuildColumnConfig());
                UpdateConfig(config, ConfigType.AutoSearch.ToString("g"), chkAutoSearch.Checked.ToString());
                UpdateConfig(config, AppConfiguration.ItemsPerPageName, AppConfiguration.ItemsPerPage.ToString());
                UpdateConfig(config, AppConfiguration.LastSelectedTabIndexName, tabControl.SelectedIndex.ToString());
                UpdateConfig(config, AppConfiguration.TagSelectPinnedName, m_tagSelectControl.Pinned.ToString());
            }
        }
Esempio n. 2
0
        private void Refresh(bool throwErrors)
        {
            try
            {
                IEnumerable <IConfigurationData> config = DataSourceAdapter.GetConfiguration();

                IdGamesUrl = GetValue(config, "IdGamesUrl");
                ApiPage    = GetValue(config, "ApiPage");
                MirrorUrl  = GetValue(config, "MirrorUrl");
                CleanTemp  = Convert.ToBoolean(GetValue(config, "CleanTemp"));

                SetChildDirectories(config);
                SplitTopBottom        = Convert.ToInt32(GetValue(config, "SplitTopBottom"));
                SplitLeftRight        = Convert.ToInt32(GetValue(config, "SplitLeftRight"));
                AppWidth              = Convert.ToInt32(GetValue(config, "AppWidth"));
                AppHeight             = Convert.ToInt32(GetValue(config, "AppHeight"));
                AppX                  = Convert.ToInt32(GetValue(config, "AppX"));
                AppY                  = Convert.ToInt32(GetValue(config, "AppY"));
                WindowState           = (FormWindowState)Enum.Parse(typeof(FormWindowState), GetValue(config, "WindowState"));
                ColumnConfig          = GetValue(config, "ColumnConfig");
                ScreenshotPreviewSize = Convert.ToInt32(GetValue(config, "ScreenshotPreviewSize"));

                DateParseFormats             = Util.SplitString(GetValue(config, "DateParseFormats"));
                ScreenshotCaptureDirectories = Util.SplitString(GetValue(config, "ScreenshotCaptureDirectories"));
            }
            catch (Exception)
            {
                if (throwErrors)
                {
                    throw;
                }
            }
            VerifyPaths(throwErrors);
        }
        private void HandleFormClosing()
        {
            if (DataSourceAdapter != null)
            {
                IEnumerable <IConfigurationData> config = DataSourceAdapter.GetConfiguration();

                if (WindowState != FormWindowState.Minimized) //too many problems when the form is minimized, not supported
                {
                    UpdateConfig(config, AppConfiguration.SplitTopBottomName, splitTopBottom.SplitterDistance.ToString());
                    UpdateConfig(config, AppConfiguration.SplitLeftRightName, splitLeftRight.SplitterDistance.ToString());

                    UpdateConfig(config, AppConfiguration.AppWidthName, Size.Width.ToString());
                    UpdateConfig(config, AppConfiguration.AppHeightName, Size.Height.ToString());
                    UpdateConfig(config, AppConfiguration.AppXName, Location.X.ToString());
                    UpdateConfig(config, AppConfiguration.AppYName, Location.Y.ToString());
                    UpdateConfig(config, AppConfiguration.WindowStateName, WindowState.ToString());
                }

                if (GameFileViewFactory.IsUsingColumnView)
                {
                    UpdateConfig(config, AppConfiguration.ColumnConfigName, BuildColumnConfig());
                }
                else
                {
                    UpdateConfig(config, AppConfiguration.ColumnConfigName, BuildTileColumnConfig());
                }

                UpdateConfig(config, ConfigType.AutoSearch.ToString("g"), chkAutoSearch.Checked.ToString());
                UpdateConfig(config, AppConfiguration.ItemsPerPageName, AppConfiguration.ItemsPerPage.ToString());
            }
        }
Esempio n. 4
0
        public string GetConfigValue(ConfigType ct)
        {
            IConfigurationData config = DataSourceAdapter.GetConfiguration().FirstOrDefault(x => x.Name == ct.ToString("g"));

            if (config != null)
            {
                return(config.Value);
            }

            return(null);
        }
        public void EnableCopySaveFiles()
        {
            CopySaveFiles = true;
            IConfigurationData config = DataSourceAdapter.GetConfiguration().FirstOrDefault(x => x.Name == CopySaveFilesName);

            if (config != null)
            {
                config.Value = "true";
                DataSourceAdapter.UpdateConfiguration(config);
            }
        }
        private void Refresh(bool throwErrors)
        {
            try
            {
                IEnumerable <IConfigurationData> config = DataSourceAdapter.GetConfiguration();

                IdGamesUrl = GetValue(config, "IdGamesUrl");
                ApiPage    = GetValue(config, "ApiPage");
                MirrorUrl  = GetValue(config, "MirrorUrl");
                CleanTemp  = Convert.ToBoolean(GetValue(config, "CleanTemp"));

                SetChildDirectories(config);
                SplitTopBottom               = Convert.ToInt32(GetValue(config, SplitTopBottomName));
                SplitLeftRight               = Convert.ToInt32(GetValue(config, SplitLeftRightName));
                SplitTagSelect               = Convert.ToInt32(GetValue(config, SplitTagSelectName));
                AppWidth                     = Convert.ToInt32(GetValue(config, AppWidthName));
                AppHeight                    = Convert.ToInt32(GetValue(config, AppHeightName));
                AppX                         = Convert.ToInt32(GetValue(config, AppXName));
                AppY                         = Convert.ToInt32(GetValue(config, AppYName));
                WindowState                  = (FormWindowState)Enum.Parse(typeof(FormWindowState), GetValue(config, WindowStateName));
                ColumnConfig                 = GetValue(config, ColumnConfigName);
                ScreenshotPreviewSize        = Convert.ToInt32(GetValue(config, ScreenshotPreviewSizeName));
                FileManagement               = (FileManagement)Enum.Parse(typeof(FileManagement), GetValue(config, "FileManagement"));
                ItemsPerPage                 = Convert.ToInt32(GetValue(config, ItemsPerPageName));
                DeleteScreenshotsAfterImport = Convert.ToBoolean(GetValue(config, "DeleteScreenshotsAfterImport"));
                LastSelectedTabIndex         = Convert.ToInt32(GetValue(config, LastSelectedTabIndexName));
                TagSelectPinned              = Convert.ToBoolean(GetValue(config, TagSelectPinnedName));
                ShowTabHeaders               = Convert.ToBoolean(GetValue(config, ShowTabHeadersName));
                CopySaveFiles                = Convert.ToBoolean(GetValue(config, CopySaveFilesName));

                var newType = (GameFileViewType)Enum.Parse(typeof(GameFileViewType), GetValue(config, "GameFileViewType"));
                if (newType != GameFileViewType)
                {
                    GameFileViewType = newType;
                    GameFileViewTypeChanged?.Invoke(this, EventArgs.Empty);
                }

                DateParseFormats             = Util.SplitString(GetValue(config, "DateParseFormats"));
                ScreenshotCaptureDirectories = Util.SplitString(GetValue(config, "ScreenshotCaptureDirectories"));
            }
            catch
            {
                if (throwErrors)
                {
                    throw;
                }
            }

            VerifyPaths(throwErrors);
        }
Esempio n. 7
0
        private void HandleFormClosing()
        {
            if (DataSourceAdapter != null)
            {
                IEnumerable <IConfigurationData> config = DataSourceAdapter.GetConfiguration();

                if (WindowState != FormWindowState.Minimized) //too many problems when the form is minimized, not supported
                {
                    UpdateConfig(config, "SplitTopBottom", splitTopBottom.SplitterDistance.ToString());
                    UpdateConfig(config, "SplitLeftRight", splitLeftRight.SplitterDistance.ToString());

                    UpdateConfig(config, "AppWidth", Size.Width.ToString());
                    UpdateConfig(config, "AppHeight", Size.Height.ToString());
                    UpdateConfig(config, "AppX", Location.X.ToString());
                    UpdateConfig(config, "AppY", Location.Y.ToString());
                    UpdateConfig(config, "WindowState", WindowState.ToString());
                }

                UpdateConfig(config, "ColumnConfig", BuildColumnConfig());
                UpdateConfig(config, ConfigType.AutoSearch.ToString("g"), chkAutoSearch.Checked.ToString());
            }
        }
Esempio n. 8
0
        public void RefreshColumnConfig()
        {
            IEnumerable <IConfigurationData> config = DataSourceAdapter.GetConfiguration();

            ColumnConfig = GetValue(config, ColumnConfigName);
        }
Esempio n. 9
0
        private void UpdateColumnConfig()
        {
            IEnumerable <IConfigurationData> config = DataSourceAdapter.GetConfiguration();

            UpdateConfig(config, AppConfiguration.ColumnConfigName, BuildColumnConfig());
        }