Example #1
0
            //-------------------------------------------------------------------------------------------------------------------------------------------------

            protected override IDisposable CreateTemplateScope(PropertyInfo property)
            {
                var parameterTypes    = property.GetIndexParameters().Select(p => p.ParameterType).ToArray();
                var templateTypePairs = new Type[2 * (1 + parameterTypes.Length)];

                templateTypePairs[0] = typeof(TypeTemplate.TProperty);
                templateTypePairs[1] = property.PropertyType;

                if (parameterTypes.Length > 0)
                {
                    TypeTemplate.BuildArgumentsTypePairs(parameterTypes, templateTypePairs, arrayStartIndex: 2);
                }

                return(TypeTemplate.CreateScope(templateTypePairs));
            }