/// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public static CacheNotifySettings GetConfig()
        {
            CacheNotifySettings result = (CacheNotifySettings)ConfigurationBroker.GetSection("cacheNotifySettings");

            if (result == null)
            {
                result = new CacheNotifySettings();
            }

            return(result);
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="groupName"></param>
        /// <param name="notifyType"></param>
        /// <returns></returns>
        public static CacheNotifyData[] FromSettings(string groupName, CacheNotifyType notifyType)
        {
            IEnumerable <string> queueNames = CacheNotifySettings.GetConfig().GetQueueNamesInGroup(groupName);

            List <CacheNotifyData> data = new List <CacheNotifyData>();

            foreach (string queueName in queueNames)
            {
                CacheNotifyData nd = new CacheNotifyData();
                nd.CacheQueueTypeDesp = queueName;
                nd.NotifyType         = notifyType;

                data.Add(nd);
            }

            return(data.ToArray());
        }