private void menu_Tools_Settings_Click( object sender, EventArgs e )
        {
            ClearStatus();
            DlgOptions dlg = new DlgOptions();

            // jpodadera. Save culture of actual language
            CultureInfo actualCulture = Thread.CurrentThread.CurrentUICulture;

            dlg.ShowDialog();

            // jpodadera. If language has been changed, reload resources of main window
            if (actualCulture.Name != Thread.CurrentThread.CurrentUICulture.Name)
            {
                ComponentResourceManager resources = new ComponentResourceManager(typeof(FormMain));
                resources.ApplyResources(this, this.Name, Thread.CurrentThread.CurrentUICulture);

                // jpodadera. Save actual size and recover original size before reload resources of controls
                int actualWidth = this.Width;
                int actualHeight = this.Height;
                this.Width = this.originalWidth;
                this.Height = this.originalHeight;

                changeLanguageControls(this, resources, Thread.CurrentThread.CurrentUICulture);

                // jpodadera. Recover previous size
                this.Width = actualWidth;
                this.Height = actualHeight;

                // reload new strings for status bar
                UpdateSelectedStatusText();
            }

            FlushStatus();
        }
        private void menu_Tools_Settings_Click( object sender, EventArgs e )
        {
            ClearStatus();
            DlgOptions dlg = new DlgOptions();

            // jpodadera. Save culture of actual language
            CultureInfo actualCulture = Thread.CurrentThread.CurrentUICulture;

            dlg.ShowDialog();

            // jpodadera. If language has been changed, reload resources of main window
            if( actualCulture.Name != Thread.CurrentThread.CurrentUICulture.Name ) {
                ComponentResourceManager resources = new ComponentResourceManager( typeof( FormMain ) );
                resources.ApplyResources( this, this.Name, Thread.CurrentThread.CurrentUICulture );

                // If the window is maximized, un-maximize it
                bool maximized = false;
                if( this.WindowState == FormWindowState.Maximized ) {
                    maximized = true;
                    this.WindowState = FormWindowState.Normal;
                }

                // jpodadera. Save actual size and recover original size before reload resources of controls
                int actualWidth = this.Width;
                int actualHeight = this.Height;
                int actualSplitDistanceMain = this.splitContainer.SplitterDistance;
                int actualSplitDistanceSecondary = this.splitGame.SplitterDistance;

                this.Width = this.originalWidth;
                this.Height = this.originalHeight;
                this.splitContainer.SplitterDistance = this.originalSplitDistanceMain;
                this.splitGame.SplitterDistance = this.originalSplitDistanceSecondary;

                changeLanguageControls( this, resources, Thread.CurrentThread.CurrentUICulture );

                // jpodadera. Recover previous size
                this.Width = actualWidth;
                this.Height = actualHeight;
                splitContainer.SplitterDistance = actualSplitDistanceMain;
                splitGame.SplitterDistance = actualSplitDistanceSecondary;

                // Re-maximize if it was maximized before
                if( maximized ) {
                    this.WindowState = FormWindowState.Maximized;
                }

                FullListRefresh();

                // reload new strings for status bar
                UpdateSelectedStatusText();
            }

            FlushStatus();
        }
Beispiel #3
0
        private void menu_Tools_Settings_Click(object sender, EventArgs e)
        {
            ClearStatus();
            DlgOptions dlg = new DlgOptions();

            // jpodadera. Save culture of actual language
            CultureInfo actualCulture = Thread.CurrentThread.CurrentUICulture;

            dlg.ShowDialog();

            // jpodadera. If language has been changed, reload resources of main window
            if (actualCulture.Name != Thread.CurrentThread.CurrentUICulture.Name)
            {
                ComponentResourceManager resources = new ComponentResourceManager(typeof(FormMain));
                resources.ApplyResources(this, this.Name, Thread.CurrentThread.CurrentUICulture);

                // jpodadera. Save actual size and recover original size before reload resources of controls
                int actualSplitDistanceMain = this.splitContainer.SplitterDistance;
                int actualSplitDistanceSecondary = this.splitGame.SplitterDistance;
                int actualSplitDistanceCategories = this.splitCategories.SplitterDistance;
                int actualSplitDistanceBrowser = this.splitBrowser.SplitterDistance;

                changeLanguageControls(this, resources, Thread.CurrentThread.CurrentUICulture);

                // jpodadera. Recover previous size
                splitContainer.SplitterDistance = actualSplitDistanceMain;
                splitGame.SplitterDistance = actualSplitDistanceSecondary;
                splitCategories.SplitterDistance = actualSplitDistanceCategories;
                splitBrowser.SplitterDistance = actualSplitDistanceBrowser;

                FullListRefresh();
            }

            FlushStatus();
        }