Esempio n. 1
0
 public ComplexCustomizeHandler(IIntegratedCustomizeHandler singleHandler)
 {
     this.sortedArray_0 = new SortedArray <int, IIntegratedCustomizeHandler>();
     this.object_0      = new object();
     this.ilist_0       = new List <IIntegratedCustomizeHandler>();
     this.ilist_0       = new List <IIntegratedCustomizeHandler>();
     this.ilist_0.Add(singleHandler);
 }
Esempio n. 2
0
        public byte[] HandleQuery(string sourceUserID, int informationType, byte[] info)
        {
            IIntegratedCustomizeHandler handler = this.method_0(informationType);

            if (handler == null)
            {
                throw new Exception(string.Format("The Information Handler On Type [{0}] is not found !", informationType));
            }
            return(handler.HandleQuery(sourceUserID, informationType, info));
        }
Esempio n. 3
0
 public ComplexCustomizeHandler(params IIntegratedCustomizeHandler[] handler)
 {
     for (int i = 0; i < handler.Length; i++)
     {
         IIntegratedCustomizeHandler item = handler[i];
         if (!this.handlers.Contains(item))
         {
             this.handlers.Add(item);
         }
     }
 }
Esempio n. 4
0
        private IIntegratedCustomizeHandler method_0(int int_0)
        {
            if (this.sortedArray_0.ContainsKey(int_0))
            {
                return(this.sortedArray_0[int_0]);
            }
            IIntegratedCustomizeHandler val = null;

            using (IEnumerator <IIntegratedCustomizeHandler> enumerator = this.ilist_0.GetEnumerator())
            {
                IIntegratedCustomizeHandler current;
                while (enumerator.MoveNext())
                {
                    current = enumerator.Current;
                    if (current.CanHandle(int_0))
                    {
                        goto Label_004F;
                    }
                }
                goto Label_0060;
Label_004F:
                val = current;
            }
Label_0060:
            if (val != null)
            {
                lock (this.object_0)
                {
                    if (!this.sortedArray_0.ContainsKey(int_0))
                    {
                        this.sortedArray_0.Add(int_0, val);
                    }
                }
            }
            return(val);
        }