Esempio n. 1
0
        protected override void AddInterceptor(object o)
        {
            if (o == null)
            {
                throw new ArgumentException(string.Format("Unable to instantiate CommandInterceptor", new object[0]));
            }
            if (!(o is BaseCommandInterceptor))
            {
                throw new InvalidOperationException(string.Format(Resources.TypeIsNotCommandInterceptor, o.GetType()));
            }
            BaseCommandInterceptor baseCommandInterceptor = o as BaseCommandInterceptor;

            baseCommandInterceptor.Init(this.connection);
            this.interceptors.Insert(0, (BaseCommandInterceptor)o);
        }
Esempio n. 2
0
        protected override void AddInterceptor(object o)
        {
            if (o == null)
            {
                throw new ArgumentException(String.Format("Unable to instantiate CommandInterceptor"));
            }

            if (!(o is BaseCommandInterceptor))
            {
                throw new InvalidOperationException(String.Format("Resources.TypeIsNotCommandInterceptor",
                                                                  o.GetType()));
            }
            BaseCommandInterceptor ie = o as BaseCommandInterceptor;

            ie.Init(connection);
            interceptors.Insert(0, (BaseCommandInterceptor)o);
        }