Beispiel #1
0
        // For two MixinData objects being regarded equal, only the sorted mixin types are considered, not the actual instances.
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            MixinData other = obj as MixinData;

            if (object.ReferenceEquals(other, null))
            {
                return(false);
            }

            if (mixinsImpl.Count != other.mixinsImpl.Count)
            {
                return(false);
            }

            for (int i = 0; i < mixinsImpl.Count; ++i)
            {
                if (mixinsImpl[i].GetType() != other.mixinsImpl[i].GetType())
                {
                    return(false);
                }
            }

            return(true);
        }
Beispiel #2
0
        private void AddMixinImpl(object instanceOrType)
        {
            if (mixins == null)
            {
                mixins = new List <object>();
            }

            mixins.Add(instanceOrType);
            mixinData = null;
        }
        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);
        }
        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);
            result = 29 * result + Core.Internal.CollectionExtensions.GetContentsHashCode(AdditionalAttributes);
            return(result);
        }
		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);
				}
			}
		}
 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);
         }
     }
 }
 public void Initialize()
 {
     if (mixinData == null)
     {
         try
         {
             mixinData = new MixinData(mixins);
         }
         catch (ArgumentException ex)
         {
             throw new InvalidOperationException(
                       "There is a problem with the mixins added to this ProxyGenerationOptions. See the inner exception for details.", ex);
         }
     }
 }
        public void AddMixinInstance(object instance)
        {
            if (instance == null)
            {
                throw new ArgumentNullException("instance");
            }

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

            mixins.Add(instance);
            mixinData = null;
        }
		public void Initialize ()
		{
			if (mixinData == null)
				mixinData = new MixinData (mixins);
		}
		public void AddMixinInstance(object instance)
		{
			if (instance == null)
			{
				throw new ArgumentNullException("instance");
			}

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

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