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


C# Utilities.CacheItemArgs类代码示例

本文整理汇总了C#中DotNetNuke.Common.Utilities.CacheItemArgs的典型用法代码示例。如果您正苦于以下问题:C# CacheItemArgs类的具体用法?C# CacheItemArgs怎么用?C# CacheItemArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CacheItemArgs类属于DotNetNuke.Common.Utilities命名空间,在下文中一共展示了CacheItemArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetSettingsCallback

        private object GetSettingsCallback(CacheItemArgs cacheItemArgs)
        {
            var moduleId = (int)cacheItemArgs.ParamList[0];
            var tabModuleId = (int)cacheItemArgs.ParamList[1];
            return new Settings(moduleId, tabModuleId);

        }
开发者ID:schotman,项目名称:DNN.Announcements,代码行数:7,代码来源:SettingsController.cs

示例2: GetDesktopModulesInternal

 private static Dictionary<int, DesktopModuleInfo> GetDesktopModulesInternal(int portalID)
 {
     string cacheKey = string.Format(DataCache.DesktopModuleCacheKey, portalID);
     var args = new CacheItemArgs(cacheKey, DataCache.DesktopModuleCacheTimeOut, DataCache.DesktopModuleCachePriority, portalID);
     Dictionary<int, DesktopModuleInfo> desktopModules = (portalID == Null.NullInteger)
                                 ? CBO.GetCachedObject<Dictionary<int, DesktopModuleInfo>>(args, GetDesktopModulesCallBack)
                                 : CBO.GetCachedObject<Dictionary<int, DesktopModuleInfo>>(args, GetDesktopModulesByPortalCallBack);
     return desktopModules;
 }
开发者ID:rrsc,项目名称:Dnn.Platform,代码行数:9,代码来源:DesktopModuleController.cs

示例3: GetSearchTypes

 public IEnumerable<SearchType> GetSearchTypes()
 {
     var cachArg = new CacheItemArgs(SearchTypesCacheKey, 120, CacheItemPriority.Default);
     return CBO.GetCachedObject<IList<SearchType>>(cachArg,
         delegate
         {
             return CBO.FillCollection<SearchType>(DataProvider.Instance().GetAllSearchTypes());
         });
 }
开发者ID:VegasoftTI,项目名称:Dnn.Platform,代码行数:9,代码来源:SearchHelperImpl.cs

示例4: GetStatusDropdownList

 private static List<SelectListItem> GetStatusDropdownList(CacheItemArgs args)
 {
     var locale = (string)args.ParamList[0];
     var res = new List<SelectListItem>();
     foreach (var v in System.Enum.GetValues(typeof(Connect.Conference.Core.Common.SessionStatus)))
     {
         res.Add(new SelectListItem
         {
             Text = Localization.GetString(v.ToString(), SharedResourceFileName),
             Value = ((int)v).ToString()
         });
     }
     return res.OrderBy(i => i.Value).ToList();
 }
开发者ID:EPTamminga,项目名称:Conference,代码行数:14,代码来源:Globals.cs

示例5: GetTemplateCallback

        /// <summary>
        /// Callback method that dynamically loads a type of template, using reflection
        /// </summary>
        /// <param name="cacheItemArgs">Arguments, containing moduleid and tabModuleId </param>
        /// <returns>ITemplate</returns>
        private object GetTemplateCallback(CacheItemArgs cacheItemArgs)
        {
            var moduleId = (int)cacheItemArgs.ParamList[0];
            var tabModuleId = (int)cacheItemArgs.ParamList[1];
            var moduleSettings = new SettingsController().GetModuleSettings(moduleId, tabModuleId);


                Type type = Type.GetType("DotNetNuke.Modules.Announcements.Components.Template." + moduleSettings.TemplateType);
                if (type != null && type.IsClass)
                {
                    var template = Activator.CreateInstance(type,
                        new object[] { moduleId, tabModuleId, moduleSettings.TemplateName });
                    return template;
                }
            return null;

        }
开发者ID:schotman,项目名称:DNN.Announcements,代码行数:22,代码来源:TemplateController.cs

示例6: GetCustomAliasesCallback

        private object GetCustomAliasesCallback(CacheItemArgs cacheItemArgs)
        {
            var portalID = (int)cacheItemArgs.ParamList[0];
            IDataReader dr = DataProvider.Instance().GetTabCustomAliases(portalID);
            var dic = new Dictionary<int, Dictionary<string, string>>();
            try
            {
                while (dr.Read())
                {
                    //fill business object
                    var tabId = (int)dr["TabId"];
                    var customAlias = (string)dr["httpAlias"];
                    var cultureCode = (string)dr["cultureCode"];

                    //add Custom Alias to dictionary
                    if (dic.ContainsKey(tabId))
                    {
                        //Add Custom Alias to Custom Alias Collection already in dictionary for TabId
                        dic[tabId][cultureCode] = customAlias;
                    }
                    else
                    {
                        //Create new Custom Alias Collection for TabId
                        var collection = new Dictionary<string, string> {{cultureCode, customAlias}};

                        //Add Collection to Dictionary
                        dic.Add(tabId, collection);
                    }
                }
            }
            catch (Exception exc)
            {
                Exceptions.LogException(exc);
            }
            finally
            {
                //close datareader
                CBO.CloseDataReader(dr, true);
            }
            return dic;
        }
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:41,代码来源:TabControllerImpl.cs

示例7: GetAliasSkinsCallback

        private object GetAliasSkinsCallback(CacheItemArgs cacheItemArgs)
        {
            var portalID = (int)cacheItemArgs.ParamList[0];
            IDataReader dr = DataProvider.Instance().GetTabAliasSkins(portalID);
            var dic = new Dictionary<int, List<TabAliasSkinInfo>>();
            try
            {
                while (dr.Read())
                {
                    //fill business object
                    var tabAliasSkin = CBO.FillObject<TabAliasSkinInfo>(dr, false);

                    //add Tab Alias Skin to dictionary
                    if (dic.ContainsKey(tabAliasSkin.TabId))
                    {
                        //Add Tab Alias Skin to Tab Alias Skin Collection already in dictionary for TabId
                        dic[tabAliasSkin.TabId].Add(tabAliasSkin);
                    }
                    else
                    {
                        //Create new Tab Alias Skin Collection for TabId
                        var collection = new List<TabAliasSkinInfo> { tabAliasSkin };

                        //Add Collection to Dictionary
                        dic.Add(tabAliasSkin.TabId, collection);
                    }
                }
            }
            catch (Exception exc)
            {
                Exceptions.LogException(exc);
            }
            finally
            {
                //close datareader
                CBO.CloseDataReader(dr, true);
            }
            return dic;
        }
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:39,代码来源:TabControllerImpl.cs

示例8: GetCompiledResourceFileCallBack

        private static object GetCompiledResourceFileCallBack(CacheItemArgs cacheItemArgs)
        {
            string resourceFile = (string)cacheItemArgs.Params[0];
            string locale = (string)cacheItemArgs.Params[1];
            PortalSettings portalSettings = (PortalSettings)cacheItemArgs.Params[2];
            string systemLanguage = DotNetNuke.Services.Localization.Localization.SystemLocale;
            string defaultLanguage = portalSettings.DefaultLanguage;
            string fallbackLanguage = DotNetNuke.Services.Localization.Localization.SystemLocale;
            Locale targetLocale = LocaleController.Instance.GetLocale(locale);
            if (!String.IsNullOrEmpty(targetLocale.Fallback))
            {
                fallbackLanguage = targetLocale.Fallback;
            }

            // get system default and merge the specific ones one by one
            var res = GetResourceFile(resourceFile);
            if (res == null)
            {
                return new Dictionary<string, string>();
            }
            res = MergeResourceFile(res, GetResourceFileName(resourceFile, systemLanguage, portalSettings.PortalId));
            if (defaultLanguage != systemLanguage)
            {
                res = MergeResourceFile(res, GetResourceFileName(resourceFile, defaultLanguage, -1));
                res = MergeResourceFile(res, GetResourceFileName(resourceFile, defaultLanguage, portalSettings.PortalId));
            }
            if (fallbackLanguage != defaultLanguage)
            {
                res = MergeResourceFile(res, GetResourceFileName(resourceFile, fallbackLanguage, -1));
                res = MergeResourceFile(res, GetResourceFileName(resourceFile, fallbackLanguage, portalSettings.PortalId));
            }
            if (locale != fallbackLanguage)
            {
                res = MergeResourceFile(res, GetResourceFileName(resourceFile, locale, -1));
                res = MergeResourceFile(res, GetResourceFileName(resourceFile, locale, portalSettings.PortalId));
            }
            return res;
        }
开发者ID:donker,项目名称:generator-dnn-spa-gulp-react,代码行数:38,代码来源:Localization.cs

示例9: GetMessageTabCallback

        private static object GetMessageTabCallback(CacheItemArgs cacheItemArgs)
        {
            var portalSettings = cacheItemArgs.Params[0] as PortalSettings;

            var profileTab = TabController.Instance.GetTab(portalSettings.UserTabId, portalSettings.PortalId, false);
            if (profileTab != null)
            {
                var childTabs = TabController.Instance.GetTabsByPortal(profileTab.PortalID).DescendentsOf(profileTab.TabID);
                foreach (var tab in childTabs)
                {
                    foreach (var kvp in ModuleController.Instance.GetTabModules(tab.TabID))
                    {
                        var module = kvp.Value;
                        if (module.DesktopModule.FriendlyName == "Message Center")
                        {
                            return tab.TabID;
                        }
                    }
                }
            }

            //default to User Profile Page
            return portalSettings.UserTabId;
        }
开发者ID:VegasoftTI,项目名称:Dnn.Platform,代码行数:24,代码来源:CoreMessagingScheduler.cs

示例10: GetModuleControlsCallBack

 /// -----------------------------------------------------------------------------
 /// <summary>
 /// GetModuleControlsCallBack gets a Dictionary of Module Controls from
 /// the Database.
 /// </summary>
 /// <param name="cacheItemArgs">The CacheItemArgs object that contains the parameters
 /// needed for the database call</param>
 /// <history>
 /// 	[cnurse]	01/14/2008   Created
 /// </history>
 /// -----------------------------------------------------------------------------
 private static object GetModuleControlsCallBack(CacheItemArgs cacheItemArgs)
 {
     return CBO.FillDictionary(key, dataProvider.GetModuleControls(), new Dictionary<int, ModuleControlInfo>());
 }
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:15,代码来源:ModuleControlController.cs

示例11: GetBackgroundFileInfoCallBack

 private IFileInfo GetBackgroundFileInfoCallBack(CacheItemArgs itemArgs)
 {
     return FileManager.Instance.GetFile(PortalSettings.PortalId, PortalSettings.BackgroundFile);
 }
开发者ID:RichardHowells,项目名称:dnnextensions,代码行数:4,代码来源:Default.aspx.cs

示例12: GetModulePermissionsCallBack

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// GetModulePermissionsCallBack gets a Dictionary of ModulePermissionCollections by
        /// Module from the the Database.
        /// </summary>
        /// <param name="cacheItemArgs">The CacheItemArgs object that contains the parameters
        /// needed for the database call</param>
        /// <history>
        /// 	[cnurse]	04/15/2009   Created
        /// </history>
        /// -----------------------------------------------------------------------------
        private object GetModulePermissionsCallBack(CacheItemArgs cacheItemArgs)
        {
            var tabID = (int)cacheItemArgs.ParamList[0];
            IDataReader dr = dataProvider.GetModulePermissionsByTabID(tabID);
            var dic = new Dictionary<int, ModulePermissionCollection>();
            try
            {
                while (dr.Read())
                {
                    //fill business object
                    var modulePermissionInfo = CBO.FillObject<ModulePermissionInfo>(dr, false);

                    //add Module Permission to dictionary
                    if (dic.ContainsKey(modulePermissionInfo.ModuleID))
                    {
                        dic[modulePermissionInfo.ModuleID].Add(modulePermissionInfo);
                    }
                    else
                    {
                        //Create new ModulePermission Collection for ModuleId
                        var collection = new ModulePermissionCollection {modulePermissionInfo};

                        //Add Permission to Collection

                        //Add Collection to Dictionary
                        dic.Add(modulePermissionInfo.ModuleID, collection);
                    }
                }
            }
            catch (Exception exc)
            {
                Exceptions.LogException(exc);
            }
            finally
            {
                //close datareader
                CBO.CloseDataReader(dr, true);
            }
            return dic;
        }
开发者ID:davidsports,项目名称:Dnn.Platform,代码行数:51,代码来源:PermissionProvider.cs

示例13: GetRedirectionsByPortalCallBack

 private IList<IRedirection> GetRedirectionsByPortalCallBack(CacheItemArgs cacheItemArgs)
 {
     int portalId = (int)cacheItemArgs.ParamList[0];
     return CBO.FillCollection<Redirection>(DataProvider.Instance().GetRedirections(portalId)).Cast<IRedirection>().ToList();
 }
开发者ID:kp-xcess,项目名称:Dnn.Platform,代码行数:5,代码来源:RedirectionController.cs

示例14: GetRedirectionsByPortal

		/// <summary>
		/// get a redirection list for portal.
		/// </summary>
		/// <param name="portalId">redirection id.</param>
		/// <returns>List of redirection.</returns>
		public IList<IRedirection> GetRedirectionsByPortal(int portalId)
		{
			string cacheKey = string.Format(DataCache.RedirectionsCacheKey, portalId);
			var cacheArg = new CacheItemArgs(cacheKey, DataCache.RedirectionsCacheTimeOut, DataCache.RedirectionsCachePriority, portalId);
			return CBO.GetCachedObject<IList<IRedirection>>(cacheArg, GetRedirectionsByPortalCallBack);
		}
开发者ID:kp-xcess,项目名称:Dnn.Platform,代码行数:11,代码来源:RedirectionController.cs

示例15: GetSearchResultControllers

 private Dictionary<int, BaseResultController> GetSearchResultControllers()
 {
     var cachArg = new CacheItemArgs(SeacrchContollersCacheKey, 120, CacheItemPriority.Default);
     return CBO.GetCachedObject<Dictionary<int, BaseResultController>>(cachArg, GetSearchResultsControllersCallBack);
 }
开发者ID:paolager,项目名称:Dnn.Platform,代码行数:5,代码来源:SearchControllerImpl.cs


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