Esempio n. 1
0
        public static T GetCurrentUrlSegment <T>(string name, T defaultValue, bool throwError = false)
        {
            if (!Portal.CurrentUrlMatchedGroups.ContainsKey(name) && throwError)
            {
                throw new Exception(string.Format(Localization.GetLocalization(LocalizationType.Exception, "UrlGroupNotFound.Error", "The url for this template was expected to have a segment with {{{0}:datatype}} in it", "Core"), name));
            }

            return(CurrentUrlMatchedGroups.GetSetting <T>(name, defaultValue));
        }
 public void SendMessage(Dictionary<string, object> args)
 {
     Clients.All.serverMessage(args.GetSetting("clientId", ""), args.GetSetting("message", ""));
 }
 public void ExpireItemCache(Dictionary<string, object> args)
 {
     Clients.Others.expireItemCache(args.GetSetting("cacheName", ""), args.GetSetting("key", ""), args.GetSetting("itemKey", ""));
 }
Esempio n. 4
0
        public static string GetIdMap <T>(string id, Dictionary <string, string> map)
        {
            var key = string.Format("{0}~{1}", typeof(T).ToString(), id);

            return(map.GetSetting <string>(key, null));
        }