Пример #1
0
        internal override void AddOverride(MemberDefinitionBase member)
        {
            ArgumentUtility.CheckNotNull("member", member);

            var method = member as MethodDefinition;

            if (method == null)
            {
                string message = string.Format("Member {0} cannot override method {1} - it is not a method.", member.FullName, FullName);
                throw new ArgumentException(message);
            }

            _overrides.Add(method);
        }
        internal override void AddOverride(MemberDefinitionBase member)
        {
            ArgumentUtility.CheckNotNull("member", member);

            var overrider = member as EventDefinition;

            if (overrider == null)
            {
                string message = string.Format("Member {0} cannot override event {1} - it is not an event.", member.FullName, FullName);
                throw new ArgumentException(message);
            }

            Overrides.Add(overrider);

            AddMethod.AddOverride(overrider.AddMethod);
            RemoveMethod.AddOverride(overrider.RemoveMethod);
        }
        internal override void AddOverride(MemberDefinitionBase member)
        {
            ArgumentUtility.CheckNotNull("member", member);

            var overrider = member as PropertyDefinition;

            if (overrider == null)
            {
                string message = string.Format("Member {0} cannot override property {1} - it is not a property.", member.FullName, FullName);
                throw new ArgumentException(message);
            }

            Overrides.Add(overrider);

            if (GetMethod != null && overrider.GetMethod != null)
            {
                GetMethod.AddOverride(overrider.GetMethod);
            }
            if (SetMethod != null && overrider.SetMethod != null)
            {
                SetMethod.AddOverride(overrider.SetMethod);
            }
        }