示例#1
0
        public override int GetHashCode()
        {
            // ensure initialization before accessing MixinData
            Initialize();

            var result = Hook != null?Hook.GetType().GetHashCode() : 0;

            result = 29 * result + (Selector != null ? 1 : 0);
            result = 29 * result + MixinData.GetHashCode();
            result = 29 * result + (BaseTypeForInterfaceProxy != null ? BaseTypeForInterfaceProxy.GetHashCode() : 0);
            return(result);
        }
示例#2
0
 public void Initialize()
 {
     if (mixinData == null)
     {
         try
         {
             mixinData = new MixinData(mixins);
         }
         catch (ArgumentException ex)
         {
             throw new InvalidMixinConfigurationException(
                       "There is a problem with the mixins added to this ProxyGenerationOptions: " + ex.Message, ex);
         }
     }
 }
示例#3
0
        public void AddMixinInstance(object instance)
        {
            if (instance == null)
            {
                throw new ArgumentNullException("instance");
            }

            if (mixins == null)
            {
                mixins = new List <object>();
            }

            mixins.Add(instance);
            mixinData = null;
        }