コード例 #1
0
        public void Init()
        {
            FormStateHelper.Init(this, Common.Core.Configuration.ResourceManager.Instance.AppSettingsFolder, "6ms", false).LoadState();

            Text = AppManager.Instance.FormCaption;

            var userName = Environment.UserName;

            ribbonBarHomeOverview.Text   = userName;
            buttonItemHomeOverview.Image = Resources.RibbonLogo;
            ribbonBarHomeOverview.RecalcLayout();
            ribbonPanelHome.PerformLayout();

            ribbonTabItemSlides.Text   = ribbonTabItemSlides.Text;
            buttonItemSlidesLogo.Image = Resources.RibbonLogo;
            ribbonBarSlidesLogo.RecalcLayout();
            ribbonPanelSlides.PerformLayout();

            buttonItemSlidesPowerPoint.Click += TabSlidesMainPage.Instance.buttonItemSlidesPowerPoint_Click;

            ribbonControl.SelectedRibbonTabItem = ribbonTabItemHome;
            ribbonControl_SelectedRibbonTabChanged(ribbonControl, EventArgs.Empty);
            ribbonControl.SelectedRibbonTabChanged += ribbonControl_SelectedRibbonTabChanged;

            buttonItemSlideSettings.Visible =
                MasterWizardManager.Instance.MasterWizards.Count > 1 ||
                (MasterWizardManager.Instance.MasterWizards.Count == 1 && SlideSettings.GetAvailableConfigurations().Count(MasterWizardManager.Instance.MasterWizards.First().Value.HasSlideConfiguration) > 1);
        }
コード例 #2
0
        public void Init()
        {
            FormStateHelper.Init(this, ResourceManager.Instance.AppSettingsFolder, "add slides", false).LoadState();

            Text = AppManager.Instance.FormCaption;
            Icon = AppManager.Instance.ImageResourcesManager.MainAppIcon ?? Icon;

            ribbonTabItemSlides.Text  = AppManager.Instance.TextResourcesManager.RibbonTabTitle ?? ribbonTabItemSlides.Text;
            ribbonBarSlidesLogo.Text  = Environment.UserName;
            labelItemSlidesLogo.Image = AppManager.Instance.ImageResourcesManager.MainAppRibbonLogo ?? Resources.AddSlidesLogo;
            labelItemAppTitle.Text    = AppManager.Instance.TextResourcesManager.RibbonTabTitle ?? labelItemAppTitle.Text;
            itemContainerStatusBarMainInfo.RecalcSize();
            barBottom.RecalcLayout();

            buttonItemSlidesPowerPoint.Image =
                AppManager.Instance.ImageResourcesManager.RibbonOutputImage ?? buttonItemSlidesPowerPoint.Image;
            buttonItemSlidesPowerPoint.Click += TabSlidesMainPage.Instance.buttonItemSlidesPowerPoint_Click;

            buttonItemApplicationMenuSlideSettings.Image = AppManager.Instance.ImageResourcesManager.MainMenuSlideSettingsImage ??
                                                           buttonItemApplicationMenuSlideSettings.Image;
            buttonItemApplicationMenuHelp.Image = AppManager.Instance.ImageResourcesManager.MainMenuHelpImage ??
                                                  buttonItemApplicationMenuHelp.Image;
            buttonItemApplicationMenuExit.Image = AppManager.Instance.ImageResourcesManager.MainMenuExitImage ??
                                                  buttonItemApplicationMenuExit.Image;


            buttonItemQatFloater.Image = AppManager.Instance.ImageResourcesManager.QatFloaterImage ??
                                         buttonItemQatFloater.Image;
            buttonItemQatHelp.Image = AppManager.Instance.ImageResourcesManager.QatHelpImage ??
                                      buttonItemQatHelp.Image;

            buttonItemApplicationMenuSlideSettings.Visible =
                MasterWizardManager.Instance.MasterWizards.Count > 1 ||
                (MasterWizardManager.Instance.MasterWizards.Count == 1 && SlideSettings.GetAvailableConfigurations().Count(MasterWizardManager.Instance.MasterWizards.First().Value.HasSlideConfiguration) > 1);

            if (AppManager.Instance.FormStyleManager.Style.AccentColor.HasValue)
            {
                styleManager.MetroColorParameters = new MetroColorGeneratorParameters(
                    styleManager.MetroColorParameters.CanvasColor,
                    AppManager.Instance.FormStyleManager.Style.AccentColor.Value);
            }

            if (AppManager.Instance.FormStyleManager.Style.StatusBarTextColor.HasValue)
            {
                labelItemAppTitle.ForeColor  = AppManager.Instance.FormStyleManager.Style.StatusBarTextColor.Value;
                labelItemSlideSize.ForeColor = AppManager.Instance.FormStyleManager.Style.StatusBarTextColor.Value;
            }

            SlideSettingsManager.Instance.SettingsChanged += OnSlideSettingsChanged;
            OnSlideSettingsChanged(null, EventArgs.Empty);
        }
コード例 #3
0
    /// <summary>
    /// Error handling.
    /// </summary>
    protected override void OnError(EventArgs e)
    {
        base.OnError(e);

        // Delete the saved state
        SavedFormState state = FormStateHelper.GetSavedState();

        if (state != null)
        {
            state.Delete();
        }

        // Redirect to the same page
        Response.Redirect(URLRewriter.RawUrl);
    }
コード例 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        titleElem.TitleText  = GetString("RestorePostback.Header");
        titleElem.TitleImage = GetImageUrl("Others/Messages/info.png");

        lblInfo.Text = GetString("RestorePostback.Info");

        okText     = GetString("General.OK");
        cancelText = GetString("General.Cancel");

        // Add the state fields
        SavedFormState state = FormStateHelper.GetSavedState();

        if (state != null)
        {
            // Render the hidden fields for the form items
            NameValueCollection form = state.Form;
            foreach (string name in form.Keys)
            {
                ltlValues.Text += "<input type=\"hidden\" name=\"" + name + "\" value=\"" + HttpUtility.HtmlEncode(form[name]) + "\" />\n";
            }

            state.Delete();
        }
        else
        {
            lblInfo.Text = GetString("RestorePostback.InfoNotSaved");

            if (Request.RawUrl.IndexOfCSafe("/RestorePostback.aspx", true) < 0)
            {
                mBodyParams = "onload=\"document.location.replace(document.location.href); return false;\"";
            }

            plcOK.Visible = false;
            cancelText    = GetString("General.OK");
        }
    }
コード例 #5
0
    void Login1_LoggedIn(object sender, EventArgs e)
    {
        // Ensure response cookie
        CookieHelper.EnsureResponseCookie(FormsAuthentication.FormsCookieName);

        // Set cookie expiration
        if (Login1.RememberMeSet)
        {
            CookieHelper.ChangeCookieExpiration(FormsAuthentication.FormsCookieName, DateTime.Now.AddYears(1), false);
        }
        else
        {
            // Extend the expiration of the authentication cookie if required
            if (!UserInfoProvider.UseSessionCookies && (HttpContext.Current != null) && (HttpContext.Current.Session != null))
            {
                CookieHelper.ChangeCookieExpiration(FormsAuthentication.FormsCookieName, DateTime.Now.AddMinutes(Session.Timeout), false);
            }
        }

        // Current username
        string userName = Login1.UserName;

        // Get info on the authenticated user
        UserInfo ui = UserInfoProvider.GetUserInfo(userName);

        // Check whether safe user name is required and if so get safe username
        if (RequestHelper.IsMixedAuthentication() && UserInfoProvider.UseSafeUserName && (ui == null))
        {
            userName = ValidationHelper.GetSafeUserName(this.Login1.UserName, CMSContext.CurrentSiteName);
            CMSContext.AuthenticateUser(userName, this.Login1.RememberMeSet);
        }

        // Set culture
        DropDownList drpCulture = (DropDownList)Login1.FindControl("drpCulture");

        if (drpCulture != null)
        {
            string selectedCulture = drpCulture.SelectedValue;

            // Not the default culture
            if (selectedCulture != "")
            {
                // Update the user
                ui.PreferredUICultureCode = selectedCulture;
                UserInfoProvider.SetUserInfo(ui);

                // Update current user
                CMSContext.CurrentUser.PreferredUICultureCode = selectedCulture;
            }
        }

        // Splash screen handling
        bool           splashScreenEnabled = false;
        LicenseKeyInfo lki = LicenseKeyInfoProvider.GetLicenseKeyInfo(URLHelper.GetCurrentDomain());

        if ((lki != null) && lki.IsTrial && ui.UserSettings.UserShowSplashScreen)
        {
            if (lki.ExpirationDate != DateTimeHelper.ZERO_TIME)
            {
                // Display splash screen only if using trial license
                splashScreenEnabled = true;
            }
        }

        // Splash screen
        string returnUrl = ReturnUrl;

        // Return url is not specified or is relative path or hash is valid
        if (string.IsNullOrEmpty(returnUrl) || returnUrl.StartsWith("~") || returnUrl.StartsWith("/") || QueryHelper.ValidateHash("hash"))
        {
            if (splashScreenEnabled && ui.UserSettings.UserShowSplashScreen && SettingsKeyProvider.GetBoolValue(CMSContext.CurrentSiteName + ".CMSShowSplashScreen"))
            {
                if ((!String.IsNullOrEmpty(CMSContext.CurrentSiteName)) && (returnUrl.Contains("cmsdesk") || IsSiteManager))
                {
                    URLHelper.Redirect(ResolveUrl("~/CMSSiteManager/SplashScreen.aspx?continueurl=" + returnUrl));
                }
            }

            // Destination page URL
            if (returnUrl.Contains("restorepost"))
            {
                // Delete the saved state
                SavedFormState state = FormStateHelper.GetSavedState();
                if (state != null)
                {
                    state.Delete();
                }

                returnUrl = URLHelper.RemoveParameterFromUrl(returnUrl, "restorepost");
                URLHelper.Redirect(ResolveUrl(returnUrl));
            }
        }
        else
        {
            URLHelper.Redirect(ResolveUrl("~/CMSMessages/Error.aspx?title=" + ResHelper.GetString("general.badhashtitle") + "&text=" + ResHelper.GetString("general.badhashtext")));
        }
    }
コード例 #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SetBrowserClass();
        AddNoCacheTag();

        // Ensure the refresh script
        bool   sameWindow       = (FormStateHelper.PreservePostbackValuesOnLogin && (FormStateHelper.GetSavedState() != null));
        string defaultCondition = "((top.frames['cmsheader'] != null) || (top.frames['propheader'] != null))";

        if (sameWindow)
        {
            ScriptHelper.RegisterStartupScript(this, typeof(string), "TopWindow", ScriptHelper.GetScript("if (((document.body.clientWidth < 510) || (document.body.clientHeight < 300)) && " + defaultCondition + ") { var loginUrl = top.window.location.href.replace(/\\/\\(\\w\\([^\\)]+\\)\\)/g, ''); if (loginUrl.indexOf('restorepost=0') < 0) { if (loginUrl.indexOf('?') >= 0) { loginUrl = loginUrl + '&restorepost=0'; } else { loginUrl = loginUrl + '?restorepost=0'; } } top.window.location.replace(loginUrl); }"));
        }
        else
        {
            ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "TopWindow", ScriptHelper.GetScript("if " + defaultCondition + " { top.window.location.replace(top.window.location.href.replace(/\\/\\(\\w\\([^\\)]+\\)\\)/g, '')); }"));
        }

        // Enable caps lock check
        if (ValidationHelper.GetBoolean(SettingsHelper.AppSettings["CMSUseCapsLockNotification"], true))
        {
            RegisterCAPSLOCKScript();
            TextBox txtPassword = (TextBox)Login1.FindControl("Password");
            if (txtPassword != null)
            {
                txtPassword.Attributes.Add("onkeypress", "CheckCapsLock(event)");
            }
        }

        // Site manager prefix
        string smPrefix = IsSiteManager ? "SM/" : null;

        // Initialize help
        CMSAdminControls_UI_PageElements_Help ucHelp = (CMSAdminControls_UI_PageElements_Help)Login1.FindControl("ucHelp");

        ucHelp.Tooltip   = GetString("logon.helptooltip");
        ucHelp.IconUrl   = GetImageUrl("Others/LogonForm/" + smPrefix + "HelpButton.png");
        ucHelp.TopicName = "LogonTroubleshooting";

        LocalizedLabel lblItem = (LocalizedLabel)Login1.FindControl("lblUserName");

        if (lblItem != null)
        {
            lblItem.Text = "{$LogonForm.UserName$}";
        }
        lblItem = (LocalizedLabel)Login1.FindControl("lblPassword");
        if (lblItem != null)
        {
            lblItem.Text = "{$LogonForm.Password$}";
        }

        // Display culture link due to value of the key stored in the web.config file
        bool showCultureSelector = ValidationHelper.GetBoolean(SettingsHelper.AppSettings["CMSShowLogonCultureSelector"], true);

        if (showCultureSelector)
        {
            ImageButton lnkLanguage = (ImageButton)Login1.FindControl("lnkLanguage");
            if (lnkLanguage != null)
            {
                lnkLanguage.Visible = true;

                // Ensure language selection panel functionality
                HtmlGenericControl pnlLanguage = (HtmlGenericControl)Login1.FindControl("pnlLanguage");
                if (pnlLanguage != null)
                {
                    lnkLanguage.ImageUrl      = GetImageUrl("Others/LogonForm/" + smPrefix + "LanguageButton.png");
                    lnkLanguage.AlternateText = GetString("LogonForm.SelectLanguage");
                    lnkLanguage.ToolTip       = GetString("LogonForm.SelectLanguage");

                    this.ltlScript.Text = ScriptHelper.GetScript("function ShowLanguage(id){var panel=document.getElementById(id);if(panel!=null){panel.style.display=(panel.style.display == 'block')?'none':'block';}}");
                    lnkLanguage.Attributes.Add("onclick", "ShowLanguage('" + pnlLanguage.ClientID + "'); return false;");
                }
            }
        }

        // Set up forgotten password link
        if (ShowForgottenPassword)
        {
            ImageButton lnkPassword = (ImageButton)Login1.FindControl("lnkPassword");
            if (lnkPassword != null)
            {
                lnkPassword.Visible       = true;
                lnkPassword.ImageUrl      = GetImageUrl("Others/LogonForm/" + smPrefix + "ForgottenPassword.png");
                lnkPassword.AlternateText = GetString("LogonForm.ForgottenPassword");
                lnkPassword.ToolTip       = GetString("LogonForm.ForgottenPassword");
                lnkPassword.Click        += new ImageClickEventHandler(lnkPassword_Click);
            }
        }

        LocalizedCheckBox chkItem = (LocalizedCheckBox)Login1.FindControl("chkRememberMe");

        if (chkItem != null)
        {
            chkItem.Text = "{$LogonForm.RememberMe$}";
        }

        LocalizedButton btnItem = (LocalizedButton)Login1.FindControl("LoginButton");

        if (btnItem != null)
        {
            btnItem.Text   = "{$LogonForm.LogOnButton$}";
            btnItem.Click += new EventHandler(btnItem_Click);
        }

        RequiredFieldValidator rfvUserName = (RequiredFieldValidator)Login1.FindControl("rfvUserNameRequired");

        if (rfvUserName != null)
        {
            rfvUserName.ToolTip      = GetString("LogonForm.NameRequired");
            rfvUserName.ErrorMessage = GetString("LogonForm.NameRequired");
        }

        // Load UI cultures for the dropdown list
        if (!RequestHelper.IsPostBack())
        {
            LoadCultures();
        }

        Label lblVersion = (Label)this.FindControl("lblVersion");

        if (lblVersion != null)
        {
            // Show version only if right key is inserted
            string versionKey = QueryHelper.GetString("versionkey", string.Empty);
            if (EncryptionHelper.VerifyVersionRSA(versionKey))
            {
                lblVersion.Text = ResHelper.GetString("Footer.Version") + "&nbsp;" + CMSContext.GetFriendlySystemVersion(true);
            }
        }

        Login1.LoggingIn  += new LoginCancelEventHandler(Login1_LoggingIn);
        Login1.LoggedIn   += new EventHandler(Login1_LoggedIn);
        Login1.LoginError += new EventHandler(Login1_LoginError);

        if (!RequestHelper.IsPostBack())
        {
            Login1.UserName = QueryHelper.GetString("username", String.Empty);
        }

        // Ensure username textbox focus
        TextBox txtUserName = (TextBox)Login1.FindControl("UserName");

        if (txtUserName != null)
        {
            ScriptHelper.RegisterStartupScript(this, GetType(), "SetFocus", ScriptHelper.GetScript("var txt=document.getElementById('" + txtUserName.ClientID + "');if(txt!=null){txt.focus();}"));
        }

        // Ensure different class for Site Manager
        if (IsSiteManager)
        {
            pnlMainContainer.CssClass += " SM";
        }

        if (QueryHelper.GetBoolean("forgottenpassword", false))
        {
            SetForgottenPasswordMode();
        }
    }
コード例 #7
0
        public void Init()
        {
            FormStateHelper.Init(this,
                                 Common.Core.Configuration.ResourceManager.Instance.AppSettingsFolder,
                                 MediaMetaData.Instance.DataTypeString,
                                 false)
            .LoadState();

            Icon = BusinessObjects.Instance.ImageResourcesManager.MainAppIcon ?? Icon;

            buttonItemApplicationMenuNew.Image = BusinessObjects.Instance.ImageResourcesManager.MainMenuNewImage ??
                                                 buttonItemApplicationMenuNew.Image;
            buttonItemApplicationMenuOpen.Image = BusinessObjects.Instance.ImageResourcesManager.MainMenuOpenImage ??
                                                  buttonItemApplicationMenuOpen.Image;
            buttonItemApplicationMenuSave.Image = BusinessObjects.Instance.ImageResourcesManager.MainMenuSaveImage ??
                                                  buttonItemApplicationMenuSave.Image;
            buttonItemApplicationMenuSaveAs.Image = BusinessObjects.Instance.ImageResourcesManager.MainMenuSaveAsImage ??
                                                    buttonItemApplicationMenuSaveAs.Image;
            buttonItemApplicationMenuOutputPdf.Image = BusinessObjects.Instance.ImageResourcesManager.MainMenuOutputPdfImage ??
                                                       buttonItemApplicationMenuOutputPdf.Image;
            buttonItemApplicationMenuEmail.Image = BusinessObjects.Instance.ImageResourcesManager.MainMenuEmailImage ??
                                                   buttonItemApplicationMenuEmail.Image;
            buttonItemApplicationMenuSlideSettings.Image = BusinessObjects.Instance.ImageResourcesManager.MainMenuSlideSettingsImage ??
                                                           buttonItemApplicationMenuSlideSettings.Image;
            buttonItemApplicationMenuHelp.Image = BusinessObjects.Instance.ImageResourcesManager.MainMenuHelpImage ??
                                                  buttonItemApplicationMenuHelp.Image;
            buttonItemApplicationMenuExit.Image = BusinessObjects.Instance.ImageResourcesManager.MainMenuExitImage ??
                                                  buttonItemApplicationMenuExit.Image;

            buttonItemApplicationMenuMediaSettings.Visible = FileStorageManager.Instance.SubStorages.Count > 1;

            buttonItemQatSave.Image = BusinessObjects.Instance.ImageResourcesManager.QatSaveImage ??
                                      buttonItemQatSave.Image;
            buttonItemQatSaveAs.Image = BusinessObjects.Instance.ImageResourcesManager.QatSaveAsImage ??
                                        buttonItemQatSaveAs.Image;
            buttonItemQatFloater.Image = BusinessObjects.Instance.ImageResourcesManager.QatFloaterImage ??
                                         buttonItemQatFloater.Image;
            buttonItemQatHelp.Image = BusinessObjects.Instance.ImageResourcesManager.QatHelpImage ??
                                      buttonItemQatHelp.Image;

            if (BusinessObjects.Instance.ImageResourcesManager.HomeDateStartImage != null)
            {
                labelItemHomeFlightDatesStartTitle.Image  = BusinessObjects.Instance.ImageResourcesManager.HomeDateStartImage;
                labelItemHomeFlightDatesStartTitle.Width +=
                    BusinessObjects.Instance.ImageResourcesManager.HomeDateStartImage.Width - 24;
            }
            if (BusinessObjects.Instance.ImageResourcesManager.HomeDateEndImage != null)
            {
                labelItemHomeFlightDatesEndTitle.Image  = BusinessObjects.Instance.ImageResourcesManager.HomeDateEndImage;
                labelItemHomeFlightDatesEndTitle.Width +=
                    BusinessObjects.Instance.ImageResourcesManager.HomeDateEndImage.Width - 24;
            }
            ribbonBarHomeFlightDates.RecalcLayout();
            buttonItemHomeSettings.Image = BusinessObjects.Instance.ImageResourcesManager.RibbonSettingsImage ?? buttonItemHomeSettings.Image;
            ribbonBarHomeSettings.RecalcLayout();
            ribbonPanelHome.PerformLayout();

            if (BusinessObjects.Instance.ImageResourcesManager.ProgramScheduleRibbonLogo != null)
            {
                buttonItemProgramScheduleNew.Image = BusinessObjects.Instance.ImageResourcesManager.ProgramScheduleRibbonLogo;
                ribbonBarProgramScheduleNew.RecalcLayout();
            }
            buttonItemProgramSchedulePowerPoint.Image = BusinessObjects.Instance.ImageResourcesManager.RibbonOutputImage ?? buttonItemProgramSchedulePowerPoint.Image;
            ribbonBarProgramSchedulePowerPoint.RecalcLayout();
            buttonItemProgramScheduleSettings.Image = BusinessObjects.Instance.ImageResourcesManager.RibbonSettingsImage ?? buttonItemProgramScheduleSettings.Image;
            ribbonBarProgramScheduleSettings.RecalcLayout();
            ribbonPanelProgramSchedule.PerformLayout();

            if (BusinessObjects.Instance.ImageResourcesManager.SnapshotsRibbonLogo != null)
            {
                buttonItemSnapshotNew.Image = BusinessObjects.Instance.ImageResourcesManager.SnapshotsRibbonLogo;
                ribbonBarSnapshotNew.RecalcLayout();
            }
            buttonItemSnapshotPowerPoint.Image = BusinessObjects.Instance.ImageResourcesManager.RibbonOutputImage ?? buttonItemSnapshotPowerPoint.Image;
            ribbonBarSnapshotPowerPoint.RecalcLayout();
            buttonItemSnapshotSettings.Image = BusinessObjects.Instance.ImageResourcesManager.RibbonSettingsImage ?? buttonItemSnapshotSettings.Image;
            ribbonBarSnapshotSettings.RecalcLayout();
            ribbonPanelSnapshot.PerformLayout();

            if (BusinessObjects.Instance.ImageResourcesManager.OptionsRibbonLogo != null)
            {
                buttonItemOptionsNew.Image = BusinessObjects.Instance.ImageResourcesManager.OptionsRibbonLogo;
                ribbonBarOptionsNew.RecalcLayout();
            }
            buttonItemOptionsPowerPoint.Image = BusinessObjects.Instance.ImageResourcesManager.RibbonOutputImage ?? buttonItemOptionsPowerPoint.Image;
            ribbonBarOptionsPowerPoint.RecalcLayout();
            buttonItemOptionsSettings.Image = BusinessObjects.Instance.ImageResourcesManager.RibbonSettingsImage ?? buttonItemOptionsSettings.Image;
            ribbonBarOptionsSettings.RecalcLayout();
            ribbonPanelOptions.PerformLayout();

            if (BusinessObjects.Instance.ImageResourcesManager.DigitalProductsRibbonLogo != null)
            {
                buttonItemDigitalScheduleLogo.Image = BusinessObjects.Instance.ImageResourcesManager.DigitalProductsRibbonLogo;
                ribbonBarDigitalScheduleLogo.RecalcLayout();
            }
            buttonItemDigitalSchedulePowerPoint.Image = BusinessObjects.Instance.ImageResourcesManager.RibbonOutputImage ?? buttonItemDigitalSchedulePowerPoint.Image;
            ribbonBarDigitalSchedulePowerPoint.RecalcLayout();
            ribbonPanelDigitalSchedule.PerformLayout();

            buttonItemCalendar1DataSourceSchedule.Image = BusinessObjects.Instance.ImageResourcesManager.CalendarDataSourceScheduleImage ?? buttonItemCalendar1DataSourceSchedule.Image;
            ribbonBarCalendar1DataSourceSchedule.RecalcLayout();
            buttonItemCalendar1DataSourceSnapshots.Image = BusinessObjects.Instance.ImageResourcesManager.CalendarDataSourceSnapshotsImage ?? buttonItemCalendar1DataSourceSnapshots.Image;
            ribbonBarCalendar1DataSourceSnapshots.RecalcLayout();
            buttonItemCalendar1DataSourceEmpty.Image = BusinessObjects.Instance.ImageResourcesManager.CalendarDataSourceEmptyImage ?? buttonItemCalendar1DataSourceEmpty.Image;
            ribbonBarCalendar1DataSourceEmpty.RecalcLayout();
            buttonItemCalendar1Reset.Image = BusinessObjects.Instance.ImageResourcesManager.CalendarResetImage ?? buttonItemCalendar1Reset.Image;
            ribbonBarCalendar1Reset.RecalcLayout();
            buttonItemCalendar1Copy.Image  = BusinessObjects.Instance.ImageResourcesManager.CalendarDataCopyImage ?? buttonItemCalendar1Copy.Image;
            buttonItemCalendar1Paste.Image = BusinessObjects.Instance.ImageResourcesManager.CalendarDataPasteImage ?? buttonItemCalendar1Paste.Image;
            buttonItemCalendar1Clone.Image = BusinessObjects.Instance.ImageResourcesManager.CalendarDataCloneImage ?? buttonItemCalendar1Clone.Image;
            ribbonBarCalendar1Edit.RecalcLayout();
            buttonItemCalendar1PowerPoint.Image = BusinessObjects.Instance.ImageResourcesManager.RibbonOutputImage ?? buttonItemCalendar1PowerPoint.Image;
            ribbonBarCalendar1PowerPoint.RecalcLayout();
            ribbonPanelCalendar1.PerformLayout();

            buttonItemCalendar2Reset.Image = BusinessObjects.Instance.ImageResourcesManager.CalendarResetImage ?? buttonItemCalendar2Reset.Image;
            ribbonBarCalendar2Reset.RecalcLayout();
            buttonItemCalendar2Copy.Image  = BusinessObjects.Instance.ImageResourcesManager.CalendarDataCopyImage ?? buttonItemCalendar2Copy.Image;
            buttonItemCalendar2Paste.Image = BusinessObjects.Instance.ImageResourcesManager.CalendarDataPasteImage ?? buttonItemCalendar2Paste.Image;
            buttonItemCalendar2Clone.Image = BusinessObjects.Instance.ImageResourcesManager.CalendarDataCloneImage ?? buttonItemCalendar2Clone.Image;
            ribbonBarCalendar2Edit.RecalcLayout();
            buttonItemCalendar2PowerPoint.Image = BusinessObjects.Instance.ImageResourcesManager.RibbonOutputImage ?? buttonItemCalendar2PowerPoint.Image;
            ribbonBarCalendar2PowerPoint.RecalcLayout();
            ribbonPanelCalendar2.PerformLayout();

            buttonItemSolutionsPowerPoint.Image = BusinessObjects.Instance.ImageResourcesManager.RibbonOutputImage ?? buttonItemSolutionsPowerPoint.Image;
            ribbonBarSolutionsPowerPoint.RecalcLayout();
            ribbonPanelSolutions.PerformLayout();

            buttonItemSlidesPowerPoint.Image = BusinessObjects.Instance.ImageResourcesManager.RibbonOutputImage ?? buttonItemSlidesPowerPoint.Image;
            ribbonBarSlidesPowerPoint.RecalcLayout();
            ribbonPanelSlides.PerformLayout();

            if (BusinessObjects.Instance.FormStyleManager.Style.AccentColor.HasValue)
            {
                styleManager.MetroColorParameters = new MetroColorGeneratorParameters(
                    styleManager.MetroColorParameters.CanvasColor,
                    BusinessObjects.Instance.FormStyleManager.Style.AccentColor.Value);
            }

            if (BusinessObjects.Instance.ImageResourcesManager.ToggleSwitchSkinElement != null)
            {
                var element = SkinManager.GetSkinElement(SkinProductId.Editors, UserLookAndFeel.Default, "ToggleSwitch");
                element.Image.SetImage(BusinessObjects.Instance.ImageResourcesManager.ToggleSwitchSkinElement, Color.Transparent);
                LookAndFeelHelper.ForceDefaultLookAndFeelChanged();
            }

            Controller.Instance.FormMain           = this;
            Controller.Instance.MainPanelContainer = layoutControlGroupContainer;
            Controller.Instance.MainPanel          = layoutControlItemMainContainer;
            Controller.Instance.EmptyPanel         = emptySpaceItem;
            Controller.Instance.SuperTip           = superTooltip;
            Controller.Instance.Ribbon             = ribbonControl;
            Controller.Instance.TabHome            = ribbonTabItemHome;
            Controller.Instance.TabProgramSchedule = ribbonTabItemProgramSchedule;
            Controller.Instance.TabDigitalProduct  = ribbonTabItemDigitalSchedule;
            Controller.Instance.TabCalendar1       = ribbonTabItemCalendar1;
            Controller.Instance.TabCalendar2       = ribbonTabItemCalendar2;
            Controller.Instance.TabGallery1        = ribbonTabItemGallery1;
            Controller.Instance.TabGallery2        = ribbonTabItemGallery2;
            Controller.Instance.TabRateCard        = ribbonTabItemRateCard;
            Controller.Instance.TabOptions         = ribbonTabItemOptions;
            Controller.Instance.TabSnapshot        = ribbonTabItemSnapshot;
            Controller.Instance.TabSolutions       = ribbonTabItemSolutions;
            Controller.Instance.TabSlides          = ribbonTabItemSlides;

            ContentStatusBarManager.Instance.StatusBar = barBottom;
            ContentStatusBarManager.Instance.StatusBarMainItemsContainer       = itemContainerStatusBarMainContentInfo;
            ContentStatusBarManager.Instance.StatusBarAdditionalItemsContainer = itemContainerStatusBarAdditionalContentInfo;
            ContentStatusBarManager.Instance.TextColor = BusinessObjects.Instance.FormStyleManager.Style.StatusBarTextColor;

            FormProgress.Init(this);

            #region Command Controls
            Controller.Instance.QatSaveButton   = buttonItemQatSave;
            Controller.Instance.QatSaveAsButton = buttonItemQatSaveAs;
            Controller.Instance.QatHelpButton   = buttonItemQatHelp;

            Controller.Instance.MenuButtonMain          = applicationButtonApplicationMenu;
            Controller.Instance.MenuSaveButton          = buttonItemApplicationMenuSave;
            Controller.Instance.MenuSaveAsButton        = buttonItemApplicationMenuSaveAs;
            Controller.Instance.MenuOutputPdfButton     = buttonItemApplicationMenuOutputPdf;
            Controller.Instance.MenuEmailButton         = buttonItemApplicationMenuEmail;
            Controller.Instance.MenuSlideSettingsButton = buttonItemApplicationMenuSlideSettings;
            Controller.Instance.MenuHelpButton          = buttonItemApplicationMenuHelp;

            Controller.Instance.RibbonCollapseButton = buttonItemCollapse;
            Controller.Instance.RibbonExpandButton   = buttonItemExpand;
            Controller.Instance.RibbonPinButton      = buttonItemPin;

            Controller.Instance.ScheduleInfoContainer   = layoutControlGroupHeader;
            Controller.Instance.ScheduleInfoAdvertiser  = simpleLabelItemAdvertiser;
            Controller.Instance.ScheduleInfoFlightDates = simpleLabelItemFlightDates;

            #region Home
            Controller.Instance.HomePanel                 = ribbonPanelHome;
            Controller.Instance.HomeSpecialButtons        = ribbonBarHomeSpecialButtons;
            Controller.Instance.HomeBusinessName          = comboBoxEditBusinessName;
            Controller.Instance.HomeDecisionMaker         = comboBoxEditDecisionMaker;
            Controller.Instance.HomePresentationDate      = dateEditPresentationDate;
            Controller.Instance.HomeFlightDates           = ribbonBarHomeFlightDates;
            Controller.Instance.HomeFlightDatesStartTitle = labelItemHomeFlightDatesStartTitle;
            Controller.Instance.HomeFlightDatesStartValue = labelItemHomeFlightDatesStartValue;
            Controller.Instance.HomeFlightDatesEndTitle   = labelItemHomeFlightDatesEndTitle;
            Controller.Instance.HomeFlightDatesEndValue   = labelItemHomeFlightDatesEndValue;
            Controller.Instance.HomeSettings              = buttonItemHomeSettings;
            #endregion

            #region Program Schedule
            Controller.Instance.ProgramSchedulePanel             = ribbonPanelProgramSchedule;
            Controller.Instance.ProgramScheduleThemeBar          = ribbonBarProgramScheduleTheme;
            Controller.Instance.ProgramScheduleSpecialButtons    = ribbonBarProgramScheduleSpecialButtons;
            Controller.Instance.ProgramSchedulePowerPoint        = buttonItemProgramSchedulePowerPoint;
            Controller.Instance.ProgramSchedulePowerPointCurrent = buttonItemProgramSchedulePowerPointCurrent;
            Controller.Instance.ProgramSchedulePowerPointAll     = buttonItemProgramSchedulePowerPointAll;
            Controller.Instance.ProgramScheduleTheme             = buttonItemProgramScheduleTheme;
            Controller.Instance.ProgramScheduleNew           = buttonItemProgramScheduleNew;
            Controller.Instance.ProgramScheduleProgramAdd    = buttonItemProgramScheduleProgramAdd;
            Controller.Instance.ProgramScheduleProgramDelete = buttonItemProgramScheduleProgramDelete;
            Controller.Instance.ProgramScheduleSettings      = buttonItemProgramScheduleSettings;
            #endregion

            #region Digital Product
            Controller.Instance.DigitalProductPanel          = ribbonPanelDigitalSchedule;
            Controller.Instance.DigitalProductLogoBar        = ribbonBarDigitalScheduleLogo;
            Controller.Instance.DigitalProductThemeBar       = ribbonBarDigitalScheduleTheme;
            Controller.Instance.DigitalProductSpecialButtons = ribbonBarDigitalScheduleSpecialButtons;
            Controller.Instance.DigitalProductPowerPoint     = buttonItemDigitalSchedulePowerPoint;
            Controller.Instance.DigitalProductTheme          = buttonItemDigitalScheduleTheme;
            Controller.Instance.DigitalProductAdd            = buttonItemDigitalScheduleProductAdd;
            Controller.Instance.DigitalProductClone          = buttonItemDigitalScheduleProductClone;
            Controller.Instance.DigitalProductDelete         = buttonItemDigitalScheduleProductDelete;
            #endregion

            #region Calendar 1
            Controller.Instance.Calendar1Panel               = ribbonPanelCalendar1;
            Controller.Instance.Calendar1SpecialButtons      = ribbonBarCalendar1SpecialButtons;
            Controller.Instance.Calendar1Copy                = buttonItemCalendar1Copy;
            Controller.Instance.Calendar1Paste               = buttonItemCalendar1Paste;
            Controller.Instance.Calendar1Clone               = buttonItemCalendar1Clone;
            Controller.Instance.Calendar1PowerPoint          = buttonItemCalendar1PowerPoint;
            Controller.Instance.Calendar1DataSourceSchedule  = buttonItemCalendar1DataSourceSchedule;
            Controller.Instance.Calendar1DataSourceSnapshots = buttonItemCalendar1DataSourceSnapshots;
            Controller.Instance.Calendar1DataSourceEmpty     = buttonItemCalendar1DataSourceEmpty;
            Controller.Instance.Calendar1Reset               = buttonItemCalendar1Reset;
            #endregion

            #region Calendar 2
            Controller.Instance.Calendar2Panel          = ribbonPanelCalendar2;
            Controller.Instance.Calendar2SpecialButtons = ribbonBarCalendar2SpecialButtons;
            Controller.Instance.Calendar2Copy           = buttonItemCalendar2Copy;
            Controller.Instance.Calendar2Paste          = buttonItemCalendar2Paste;
            Controller.Instance.Calendar2Clone          = buttonItemCalendar2Clone;
            Controller.Instance.Calendar2PowerPoint     = buttonItemCalendar2PowerPoint;
            Controller.Instance.Calendar2Reset          = buttonItemCalendar2Reset;
            #endregion

            #region Snapshot
            Controller.Instance.SnapshotPanel             = ribbonPanelSnapshot;
            Controller.Instance.SnapshotThemeBar          = ribbonBarSnapshotTheme;
            Controller.Instance.SnapshotSpecialButtons    = ribbonBarSnapshotSpecialButtons;
            Controller.Instance.SnapshotPowerPoint        = buttonItemSnapshotPowerPoint;
            Controller.Instance.SnapshotPowerPointCurrent = buttonItemSnapshotPowerPointCurrent;
            Controller.Instance.SnapshotPowerPointAll     = buttonItemSnapshotPowerPointAll;
            Controller.Instance.SnapshotTheme             = buttonItemSnapshotTheme;
            Controller.Instance.SnapshotNew           = buttonItemSnapshotNew;
            Controller.Instance.SnapshotProgramAdd    = buttonItemSnapshotProgramAdd;
            Controller.Instance.SnapshotProgramDelete = buttonItemSnapshotProgramDelete;
            Controller.Instance.SnapshotSettings      = buttonItemSnapshotSettings;
            #endregion

            #region Options
            Controller.Instance.OptionsPanel             = ribbonPanelOptions;
            Controller.Instance.OptionsThemeBar          = ribbonBarOptionsTheme;
            Controller.Instance.OptionsSpecialButtons    = ribbonBarOptionsSpecialButtons;
            Controller.Instance.OptionsPowerPoint        = buttonItemOptionsPowerPoint;
            Controller.Instance.OptionsPowerPointCurrent = buttonItemOptionsPowerPointCurrent;
            Controller.Instance.OptionsPowerPointAll     = buttonItemOptionsPowerPointAll;
            Controller.Instance.OptionsTheme             = buttonItemOptionsTheme;
            Controller.Instance.OptionsNew           = buttonItemOptionsNew;
            Controller.Instance.OptionsProgramAdd    = buttonItemOptionsProgramAdd;
            Controller.Instance.OptionsProgramDelete = buttonItemOptionsProgramDelete;
            Controller.Instance.OptionsSettings      = buttonItemOptionsSettings;
            #endregion

            #region Solutions
            Controller.Instance.SolutionsPanel             = ribbonPanelSolutions;
            Controller.Instance.SolutionsThemeBar          = ribbonBarSolutionsTheme;
            Controller.Instance.SolutionsSpecialButtons    = ribbonBarSolutionsSpecialButtons;
            Controller.Instance.SolutionsPowerPoint        = buttonItemSolutionsPowerPoint;
            Controller.Instance.SolutionsPowerPointCurrent = buttonItemSolutionsPowerPointCurrent;
            Controller.Instance.SolutionsPowerPointAll     = buttonItemSolutionsPowerPointAll;
            Controller.Instance.SolutionsTheme             = buttonItemSolutionsTheme;
            #endregion

            #region Slides
            Controller.Instance.SlidesPanel          = ribbonPanelSlides;
            Controller.Instance.SlidesLogoBar        = ribbonBarSlidesLogo;
            Controller.Instance.SlidesSpecialButtons = ribbonBarSlidesSpecialButtons;
            Controller.Instance.SlidesLogoLabel      = labelItemSlideHome;
            Controller.Instance.SlidesPowerPoint     = buttonItemSlidesPowerPoint;
            #endregion

            #region Gallery 1
            Controller.Instance.Gallery1Panel               = ribbonPanelGallery1;
            Controller.Instance.Gallery1SpecialButtons      = ribbonBarGallery1SpecialButtons;
            Controller.Instance.Gallery1BrowseBar           = ribbonBarGallery1Browse;
            Controller.Instance.Gallery1ImageBar            = ribbonBarGallery1Image;
            Controller.Instance.Gallery1ZoomBar             = ribbonBarGallery1Zoom;
            Controller.Instance.Gallery1CopyBar             = ribbonBarGallery1Copy;
            Controller.Instance.Gallery1BrowseModeContainer = itemContainerGallery1BrowseContentType;
            Controller.Instance.Gallery1View        = buttonItemGallery1View;
            Controller.Instance.Gallery1Edit        = buttonItemGallery1Edit;
            Controller.Instance.Gallery1ImageSelect = buttonItemGallery1ImageSelect;
            Controller.Instance.Gallery1ImageCrop   = buttonItemGallery1ImageCrop;
            Controller.Instance.Gallery1ZoomIn      = buttonItemGallery1ZoomIn;
            Controller.Instance.Gallery1ZoomOut     = buttonItemGallery1ZoomOut;
            Controller.Instance.Gallery1Copy        = buttonItemGallery1Copy;
            Controller.Instance.Gallery1Sections    = comboBoxEditGallery1Sections;
            Controller.Instance.Gallery1Groups      = comboBoxEditGallery1Groups;
            #endregion

            #region Gallery 2
            Controller.Instance.Gallery2Panel               = ribbonPanelGallery2;
            Controller.Instance.Gallery2SpecialButtons      = ribbonBarGallery2SpecialButtons;
            Controller.Instance.Gallery2BrowseBar           = ribbonBarGallery2Browse;
            Controller.Instance.Gallery2ImageBar            = ribbonBarGallery2Image;
            Controller.Instance.Gallery2ZoomBar             = ribbonBarGallery2Zoom;
            Controller.Instance.Gallery2CopyBar             = ribbonBarGallery2Copy;
            Controller.Instance.Gallery2BrowseModeContainer = itemContainerGallery2BrowseContentType;
            Controller.Instance.Gallery2View        = buttonItemGallery2View;
            Controller.Instance.Gallery2Edit        = buttonItemGallery2Edit;
            Controller.Instance.Gallery2ImageSelect = buttonItemGallery2ImageSelect;
            Controller.Instance.Gallery2ImageCrop   = buttonItemGallery2ImageCrop;
            Controller.Instance.Gallery2ZoomIn      = buttonItemGallery2ZoomIn;
            Controller.Instance.Gallery2ZoomOut     = buttonItemGallery2ZoomOut;
            Controller.Instance.Gallery2Copy        = buttonItemGallery2Copy;
            Controller.Instance.Gallery2Sections    = comboBoxEditGallery2Sections;
            Controller.Instance.Gallery2Groups      = comboBoxEditGallery2Groups;
            #endregion

            #region Rate Card
            Controller.Instance.RateCardPanel          = ribbonPanelRateCard;
            Controller.Instance.RateCardSpecialButtons = ribbonBarRateCardSpecialButtons;
            Controller.Instance.RateCardCombo          = comboBoxEditRateCards;
            #endregion

            #endregion

            ribbonControl.SelectedRibbonTabChanged += OnRibbonTabChanged;

            BusinessObjects.Instance.ScheduleManager.ScheduleOpened      += (o, e) => UpdateFormTitle();
            BusinessObjects.Instance.ScheduleManager.ScheduleNameChanged += (o, e) => UpdateFormTitle();
            Controller.Instance.FloaterRequested += (o, e) => AppManager.Instance.ShowFloater(this, e);
        }