当前位置: 首页>>代码示例>>C#>>正文


C# ModuleController.ContainsKey方法代码示例

本文整理汇总了C#中DotNetNuke.Entities.Modules.ModuleController.ContainsKey方法的典型用法代码示例。如果您正苦于以下问题:C# ModuleController.ContainsKey方法的具体用法?C# ModuleController.ContainsKey怎么用?C# ModuleController.ContainsKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DotNetNuke.Entities.Modules.ModuleController的用法示例。


在下文中一共展示了ModuleController.ContainsKey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TryToGetReliableSetting

        public static string TryToGetReliableSetting(ModuleInfo module, string settingName)
        {
            if (module.ModuleSettings.ContainsKey(settingName))
                return module.ModuleSettings[settingName].ToString();

            // if not found, it could be a caching issue
            var settings = new ModuleController().GetModuleSettings(module.ModuleID);
            return settings.ContainsKey(settingName) ? settings[settingName].ToString() : null;
        }
开发者ID:2sic,项目名称:2sxc,代码行数:9,代码来源:DnnStuffToRefactor.cs

示例2: LoadModuleSettings

        /// <summary>
        /// Loads the module settings.
        /// </summary>
        /// <param name="portalSettings">The portal settings.</param>
        /// <param name="currentSettings">The current settings.</param>
        /// <param name="key">The module key.</param>
        /// <param name="moduleId">The module id.</param>
        /// <param name="portalRoles">The portal roles.</param>
        /// <returns>
        /// Returns the filled Module Settings
        /// </returns>
        internal static EditorProviderSettings LoadModuleSettings(PortalSettings portalSettings, EditorProviderSettings currentSettings, string key, int moduleId, ArrayList portalRoles)
        {
            var hshModSet = new ModuleController().GetModuleSettings(moduleId);

            var roleController = new RoleController();

            var roles = new ArrayList();

            // Import all Editor config settings
            foreach (PropertyInfo info in
                GetEditorConfigProperties()
                    .Where(
                        info =>
                        !string.IsNullOrEmpty((string)hshModSet[string.Format("{0}{1}", key, info.Name)])
                        || info.Name.Equals("CodeMirror") || info.Name.Equals("WordCount")))
            {
                switch (info.PropertyType.Name)
                {
                    case "String":
                        info.SetValue(currentSettings.Config, hshModSet[string.Format("{0}{1}", key, info.Name)], null);
                        break;
                    case "Int32":
                        info.SetValue(
                            currentSettings.Config,
                            int.Parse((string)hshModSet[string.Format("{0}{1}", key, info.Name)]),
                            null);
                        break;
                    case "Decimal":
                        info.SetValue(
                            currentSettings.Config,
                            decimal.Parse((string)hshModSet[string.Format("{0}{1}", key, info.Name)]),
                            null);
                        break;
                    case "Boolean":
                        info.SetValue(
                            currentSettings.Config,
                            bool.Parse((string)hshModSet[string.Format("{0}{1}", key, info.Name)]),
                            null);
                        break;
                }

                switch (info.Name)
                {
                    case "ToolbarLocation":
                        info.SetValue(
                            currentSettings.Config,
                            (ToolBarLocation)
                            Enum.Parse(
                                typeof(ToolBarLocation), (string)hshModSet[string.Format("{0}{1}", key, info.Name)]),
                            null);
                        break;
                    case "DefaultLinkType":
                        info.SetValue(
                            currentSettings.Config,
                            (LinkType)
                            Enum.Parse(typeof(LinkType), (string)hshModSet[string.Format("{0}{1}", key, info.Name)]),
                            null);
                        break;
                    case "EnterMode":
                    case "ShiftEnterMode":
                        info.SetValue(
                            currentSettings.Config,
                            (EnterModus)
                            Enum.Parse(typeof(EnterModus), (string)hshModSet[string.Format("{0}{1}", key, info.Name)]),
                            null);
                        break;
                    case "ContentsLangDirection":
                        info.SetValue(
                            currentSettings.Config,
                            (LanguageDirection)
                            Enum.Parse(
                                typeof(LanguageDirection), (string)hshModSet[string.Format("{0}{1}", key, info.Name)]),
                            null);
                        break;
                    case "CodeMirror":
                        foreach (var codeMirrorInfo in
                            typeof(CodeMirror).GetProperties()
                                              .Where(codeMirrorInfo => !codeMirrorInfo.Name.Equals("Theme")))
                        {
                            switch (codeMirrorInfo.PropertyType.Name)
                            {
                                case "String":
                                    if (hshModSet.ContainsKey(string.Format("{0}{1}", key, codeMirrorInfo.Name)))
                                    {
                                        codeMirrorInfo.SetValue(
                                            currentSettings.Config.CodeMirror,
                                            hshModSet[string.Format("{0}{1}", key, codeMirrorInfo.Name)],
                                            null);
                                    }
//.........这里部分代码省略.........
开发者ID:huoxudong125,项目名称:dnnckeditor,代码行数:101,代码来源:SettingsUtil.cs


注:本文中的DotNetNuke.Entities.Modules.ModuleController.ContainsKey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。