示例#1
0
 public bool Contains(string key)
 {
     using (var site = CreateSite())
     {
         var list = new ConfigurationList(site);
         return(list.ContainsKey(buildKeyFunc(key), this.contextId));
     }
 }
示例#2
0
        public void Remove(string key)
        {
            using (var site = CreateSite())
            {
                site.RootWeb.AllowUnsafeUpdates = true;
                var    list    = new ConfigurationList(site);
                string fullKey = buildKeyFunc(key);

                if (list.ContainsKey(fullKey, this.contextId))
                {
                    list.Remove(fullKey, this.contextId);
                }
                site.RootWeb.AllowUnsafeUpdates = false;
            }
        }