Exemple #1
0
        public bool Replace(uint id, Endpoint endpoint)
        {
            if (!_dictionary.ContainsKey(id))
            {
                return(false);
            }

            _dictionary[id] = Defaults.Verify(endpoint);
            return(true);
        }
Exemple #2
0
        public bool Insert(Endpoint endpoint, out uint id)
        {
            id = NextId();
            var verified = Defaults.Verify(endpoint);

            if (!_dictionary.TryAdd(id, verified))
            {
                return(false);
            }

            var methods = verified.Request.Method.Aggregate("", (current, verb) => current + (verb + ",")).TrimEnd(',');

            _sightings.Add(id, 0);
            if (Notify)
            {
                Out.Notice(string.Format(Loaded, methods, verified.Request.Url));
            }
            return(true);
        }