Exemplo n.º 1
0
        /// <summary>
        /// LoadSettings loads the settings from the Database and displays them
        /// </summary>
        public override void LoadSettings()
        {
            try {
                if (!Page.IsPostBack)
                {
                    PopulateSettingOptions();

                    // General
                    if (TabModuleSettings.ContainsKey(Constants.SettingsContentType))
                    {
                        ddlContentType.SelectedValue = TabModuleSettings[Constants.SettingsContentType].ToString();
                    }
                    if (TabModuleSettings.ContainsKey(Constants.SettingsSort))
                    {
                        ddlSort.SelectedValue = TabModuleSettings[Constants.SettingsSort].ToString();
                    }
                    // Appearance
                    if (TabModuleSettings.ContainsKey(Constants.SettingsSkin))
                    {
                        ddlSkin.SelectedValue = TabModuleSettings[Constants.SettingsSkin].ToString();
                    }
                    ntxtbxWidth.Value = TabModuleSettings.ContainsKey(Constants.SettingsWidth) ? Convert.ToInt32(TabModuleSettings[Constants.SettingsWidth]) : Constants.DefaultSettingWidth;
                    rblstRenderWeight.SelectedValue = TabModuleSettings.ContainsKey(Constants.SettingsRenderCount) ? TabModuleSettings[Constants.SettingsRenderCount].ToString() : Constants.DefaultSettingRenderCount;
                    ntxtbxMinWeight.Value           = TabModuleSettings.ContainsKey(Constants.SettingsMinCount) ? Convert.ToInt32(TabModuleSettings[Constants.SettingsMinCount]) : 1;
                    dsMaxTags.Value = TabModuleSettings.ContainsKey(Constants.SettingsMaxTags) ? Convert.ToInt32(TabModuleSettings[Constants.SettingsMaxTags]) : Constants.DefaultSettingMaxTags;
                    // Advanced
                    rblstDistro.SelectedValue  = TabModuleSettings.ContainsKey(Constants.SettingsDistro) ? TabModuleSettings[Constants.SettingsDistro].ToString() : Convert.ToInt32(Telerik.Web.UI.TagCloudDistribution.Linear).ToString();
                    dsFontRange.SelectionStart = TabModuleSettings.ContainsKey(Constants.SettingsMinFontSize) ? Convert.ToDecimal(TabModuleSettings[Constants.SettingsMinFontSize]) : Constants.DefaultSettingMinFontSize;
                    dsFontRange.SelectionEnd   = TabModuleSettings.ContainsKey(Constants.SettingsMaxFontSize) ? Convert.ToDecimal(TabModuleSettings[Constants.SettingsMaxFontSize]) : Constants.DefaultSettingMaxFontSize;
                    if (TabModuleSettings.ContainsKey(Constants.SettingsMinFontColor))
                    {
                        cpMinColor.SelectedColor = ColorTranslator.FromHtml(TabModuleSettings[Constants.SettingsMinFontColor].ToString());
                    }
                    if (TabModuleSettings.ContainsKey(Constants.SettingsMaxFontColor))
                    {
                        cpMaxColor.SelectedColor = ColorTranslator.FromHtml(TabModuleSettings[Constants.SettingsMaxFontColor].ToString());
                    }

                    //SetDemoTagCloud();
                }
            } catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
Exemplo n.º 2
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// LoadSettings loads the settings from the Database and displays them
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        public override void LoadSettings()
        {
            try
            {
                if (Page.IsPostBack == false)
                {
                    rbSortBy.Items.Add(new ListItem(Localization.GetString("SortByDisplayName", LocalResourceFile), "DisplayName"));
                    rbSortBy.Items.Add(new ListItem(Localization.GetString("SortByUserName", LocalResourceFile), "UserName"));
                    rbSortBy.SelectedIndex = 0;


                    if (UserInfo.IsSuperUser)
                    {
                        if (TabModuleSettings.Contains("includeHost"))
                        {
                            this.cbIncludeHostUser.Checked = bool.Parse(System.Convert.ToString(TabModuleSettings["includeHost"].ToString()));
                        }
                    }
                    else
                    {
                        trHostSettings.Visible = false;
                    }
                    if (TabModuleSettings.Contains("useAjax"))
                    {
                        this.cbUseAjax.Checked = bool.Parse(System.Convert.ToString(TabModuleSettings["useAjax"].ToString()));
                    }
                    else
                    {
                        this.cbUseAjax.Checked = true;
                    }

                    if (TabModuleSettings.Contains("sortBy"))
                    {
                        rbSortBy.SelectedValue = System.Convert.ToString(TabModuleSettings["sortBy"].ToString());
                    }
                }
            }
            catch (Exception exc)             //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
Exemplo n.º 3
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// LoadSettings loads the settings from the Database and displays them
        /// </summary>
        /// -----------------------------------------------------------------------------
        public override void LoadSettings()
        {
            try
            {
                if (Page.IsPostBack == false)
                {
                    //Check for existing settings and use those on this page
                    //Settings["SettingName"]

                    if (TabModuleSettings.Contains(SETTING_SHOW_HELP))
                    {
                        cbShowHelp.Checked = Convert.ToBoolean(TabModuleSettings[SETTING_SHOW_HELP]);
                    }
                    else
                    {
                        cbShowHelp.Checked = true;
                    }
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }