예제 #1
0
        public void Add(MessageQuery key, TItem value)
        {
            if (key == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("key");
            }

            Type queryType = key.GetType();
            MessageQueryCollection collection;

            if (!this.collectionsByType.TryGetValue(queryType, out collection))
            {
                collection = key.CreateMessageQueryCollection();

                if (collection == null)
                {
                    collection = new SequentialMessageQueryCollection();
                }

                this.collectionsByType.Add(queryType, collection);
            }

            collection.Add(key);
            this.dictionary.Add(key, value);
        }
 public TItem this [MessageQuery key]
 {
     get
     {
         return(default(TItem));
     }
     set
     {
     }
 }
예제 #3
0
 public TItem this[MessageQuery key]
 {
     get
     {
         return(this.dictionary[key]);
     }
     set
     {
         this.Add(key, value);
     }
 }
예제 #4
0
        protected override void SetItem(int index, MessageQuery item)
        {
            if (!(item is XPathMessageQuery))
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("item");
            }
            this.matcher.Remove((XPathMessageQuery) base[index]);
            XPathMessageQuery query = (XPathMessageQuery)item;

            base.SetItem(index, item);
            this.matcher.Add(query.Expression, query.Namespaces, query, false);
        }
예제 #5
0
        protected override void InsertItem(int index, MessageQuery item)
        {
            if (item == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("item");
            }
            if (!(item is XPathMessageQuery))
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("item");
            }
            base.InsertItem(index, item);
            XPathMessageQuery query = (XPathMessageQuery)item;

            this.matcher.Add(query.Expression, query.Namespaces, query, false);
        }
예제 #6
0
        public bool Remove(MessageQuery key)
        {
            if (!this.dictionary.Remove(key))
            {
                return(false);
            }
            System.Type            type   = key.GetType();
            MessageQueryCollection querys = this.collectionsByType[type];

            querys.Remove(key);
            if (querys.Count == 0)
            {
                this.collectionsByType.Remove(type);
            }
            return(true);
        }
예제 #7
0
        public void Add(MessageQuery key, TItem value)
        {
            MessageQueryCollection querys;

            if (key == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("key");
            }
            System.Type type = key.GetType();
            if (!this.collectionsByType.TryGetValue(type, out querys))
            {
                querys = key.CreateMessageQueryCollection();
                if (querys == null)
                {
                    querys = new SequentialMessageQueryCollection <TItem>();
                }
                this.collectionsByType.Add(type, querys);
            }
            querys.Add(key);
            this.dictionary.Add(key, value);
        }
예제 #8
0
        public bool Remove(MessageQuery key)
        {
            if (this.dictionary.Remove(key))
            {
                MessageQueryCollection collection;
                Type queryType = key.GetType();

                collection = this.collectionsByType[queryType];
                collection.Remove(key);

                if (collection.Count == 0)
                {
                    this.collectionsByType.Remove(queryType);
                }

                return(true);
            }
            else
            {
                return(false);
            }
        }
 public bool Remove(MessageQuery key)
 {
     return(default(bool));
 }
예제 #10
0
 protected override TResult Evaluate(MessageQuery query)
 {
     return(query.Evaluate <TResult>(this.Source));
 }
예제 #11
0
 protected abstract TResult Evaluate(MessageQuery query);
예제 #12
0
 public bool TryGetValue(MessageQuery key, out TItem value)
 {
     return(this.dictionary.TryGetValue(key, out value));
 }
예제 #13
0
 public bool ContainsKey(MessageQuery key)
 {
     return(this.dictionary.ContainsKey(key));
 }
예제 #14
0
 protected override void SetItem(int index, MessageQuery item)
 {
 }
 public bool ContainsKey(MessageQuery key)
 {
     return(default(bool));
 }
 public void Add(MessageQuery key, TItem value)
 {
 }
        public bool TryGetValue(MessageQuery key, out TItem value)
        {
            value = default(TItem);

            return(default(bool));
        }