Пример #1
0
        internal void RegisterExtensionProperty(Type targetType, string name, MethodInfo method)
        {
            //TODO:判断重复注册

            //Regex regex = new Regex("^(" + name + ")$", RegexOptions.IgnoreCase);

            //m_ExtensionProperties.Add(new KeyValuePair<Regex, RuntimeTypeHandle>(regex, targetType.TypeHandle), method.MethodHandle);

            TemplateExtensionMember extension = new TemplateExtensionMember();

            extension.Name             = name;
            extension.TargetTypeHandle = targetType.TypeHandle;
            extension.Method           = method.MethodHandle;

            m_ExtensionProperties.Add(extension);
        }
Пример #2
0
        internal void RegisterExtensionProperty(Type targetType, string name, MethodInfo method)
        {
            //TODO:判断重复注册

            //Regex regex = new Regex("^(" + name + ")$", RegexOptions.IgnoreCase);

            //m_ExtensionProperties.Add(new KeyValuePair<Regex, RuntimeTypeHandle>(regex, targetType.TypeHandle), method.MethodHandle);

            TemplateExtensionMember extension = new TemplateExtensionMember();
            extension.Name = name;
            extension.TargetTypeHandle = targetType.TypeHandle;
            extension.Method = method.MethodHandle;

            m_ExtensionProperties.Add(extension);

        }