paulus-nxstudio
3/19/2020 - 3:05 PM

Change Current Theme

/**
 * Used in Desktop.cs, switches when user select from a MenuItem
 * Gizmox.WebGUI.Forms.Themes choices:
 * Analytics Android AndroidMobile Default FaceBook Gmail Graphite iOS iOSMobile iOS7 LiveOffice Office 2010 Vista
 */
        private void amsMain_MenuClick(object objSource, MenuItemEventArgs objArgs)
        {
            MenuItemEventArgs oArg = (MenuItemEventArgs)objArgs;
            string strAction = oArg.MenuItem.Tag as string;
            if (strAction != null)
            {
                switch (strAction)
                {
                    case "amsFileExit":
                        Shutdown();
                        break;
                    case "Print":
                        //MessageBox.Show(((Gizmox.WebGUI.Common.Interfaces.ISessionRegistry)this.Context.Session).Count.ToString());
                        break;
                    case "amsViewEn":   // English
//                        VWGContext.Current.CurrentUICulture = new System.Globalization.CultureInfo("en-US");
                        System.Web.HttpContext.Current.Session["UserLanguage"] = "en-US";
                        VWGContext.Current.Transfer(new Desktop());
                        break;
                    case "amsViewChs":  // Simplified Chinese
//                        VWGContext.Current.CurrentUICulture = new System.Globalization.CultureInfo("zh-CHS");
                        System.Web.HttpContext.Current.Session["UserLanguage"] = "zh-CHS";
                        VWGContext.Current.Transfer(new Desktop());
                        break;
                    case "amsViewCht":  // Tradictional Chinese
//                        VWGContext.Current.CurrentUICulture = new System.Globalization.CultureInfo("zh-CHT");
                        System.Web.HttpContext.Current.Session["UserLanguage"] = "zh-CHT";
                        VWGContext.Current.Transfer(new Desktop());
                        break;
                    case "amsViewWinXP":
                        this.Context.CurrentTheme = "iOS";
                        xPort5.Controls.Utility.Default.TopPanelBackgroundColor = Color.FromName("#97B9CB");
                        xPort5.Controls.Utility.Default.CurrentTheme = "iOS";
                        break;
                    case "amsViewVista":
                        this.Context.CurrentTheme = "Vista";
                        xPort5.Controls.Utility.Default.TopPanelBackgroundColor = Color.FromName("#ACC0E9");
                        xPort5.Controls.Utility.Default.CurrentTheme = "Vista";
                        break;
                    case "amsViewBlack":
                        this.Context.CurrentTheme = "Graphite";
                        xPort5.Controls.Utility.Default.TopPanelBackgroundColor = Color.FromName("#333333");
                        xPort5.Controls.Utility.Default.CurrentTheme = "Graphite";
                        break;
                    case "amsHelpAbout":
                        Help.About oAbout = new xPort5.Help.About();
                        oAbout.ShowDialog();
                        break;
                    default:
                        //                        MessageBox.Show(strAction);
                        break;
                }
            }
        }