示例#1
0
        internal static Type ToAspectArgumentImpl(this IAspectDefinition aspectDefinition)
        {
            IPropertyAspectDefinition propertyAspectDefinition = null;
            var methodAspectDefinition = aspectDefinition as IMethodAspectDefinition;

            if (methodAspectDefinition.IsNotNull())
            {
                return(methodAspectDefinition.ToAspectArgumentImpl());
            }

            propertyAspectDefinition = aspectDefinition as IPropertyAspectDefinition;

            if (propertyAspectDefinition.IsNotNull())
            {
                return(propertyAspectDefinition.ToAspectArgumentImpl());
            }

            return(((IEventAspectDefinition)aspectDefinition).ToAspectArgumentImpl());
        }
示例#2
0
        internal static BindingSettings ToBindingSettings(this IAspectDefinition aspectDefinition)
        {
            IPropertyAspectDefinition propertyAspectDefinition = null;
            var methodAspectDefinition = aspectDefinition as IMethodAspectDefinition;

            if (methodAspectDefinition.IsNotNull())
            {
                return(methodAspectDefinition.ToMethodBindingSettings());
            }

            propertyAspectDefinition = aspectDefinition as IPropertyAspectDefinition;

            if (propertyAspectDefinition.IsNotNull())
            {
                return(propertyAspectDefinition.ToPropertyBindingSettings());
            }

            return(((IEventAspectDefinition)aspectDefinition).ToEventBindingSettings());
        }