当前位置: 首页>>代码示例>>C#>>正文


C# IValue.SetTypeUsingReflection方法代码示例

本文整理汇总了C#中IValue.SetTypeUsingReflection方法的典型用法代码示例。如果您正苦于以下问题:C# IValue.SetTypeUsingReflection方法的具体用法?C# IValue.SetTypeUsingReflection怎么用?C# IValue.SetTypeUsingReflection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IValue的用法示例。


在下文中一共展示了IValue.SetTypeUsingReflection方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateIdentifierProperty

        private void CreateIdentifierProperty(PersistentClass pclass, IValue identifier, string propName)
        {
            identifier.SetTypeUsingReflection(pclass.MappedClass == null ? null : pclass.MappedClass.AssemblyQualifiedName,
                                              propName, DefaultValues.Accessor);

            var property = new Property(identifier) {
                Name = propName,
                PropertyAccessorName = DefaultValues.Accessor,
                Cascade = mapper.Mappings.DefaultCascade,
                IsUpdateable = true,
                IsInsertable = true,
                IsOptimisticLocked = true,
                Generation = PropertyGeneration.Never
            };

            pclass.IdentifierProperty = property;
        }
开发者ID:osdezwart,项目名称:SolrNet,代码行数:17,代码来源:NHibernateMapper.cs

示例2: CreateProperty

 private static Property CreateProperty(IValue value, PropertyInfo info, string className)
 {
     if (!string.IsNullOrEmpty(className) && value.IsSimpleValue) {
         value.SetTypeUsingReflection(className, info.Name, DefaultValues.Accessor);
     }
     return new Property {Name = info.Name, Value = value};
 }
开发者ID:osdezwart,项目名称:SolrNet,代码行数:7,代码来源:NHibernateMapper.cs

示例3: CreateProperty

        protected Mapping.Property CreateProperty(IValue value, string propertyName, System.Type parentClass,
			XmlNode subnode)
        {
            if (parentClass != null && value.IsSimpleValue)
                value.SetTypeUsingReflection(parentClass.AssemblyQualifiedName, propertyName, PropertyAccess(subnode));

            // This is done here 'cos we might only know the type here (ugly!)
            if (value is ToOne)
            {
                ToOne toOne = (ToOne) value;
                string propertyRef = toOne.ReferencedPropertyName;
                if (propertyRef != null)
                    mappings.AddUniquePropertyReference(toOne.ReferencedEntityName, propertyRef);
            }

            value.CreateForeignKey();
            Mapping.Property prop = new Mapping.Property();
            prop.Value = value;
            BindProperty(subnode, prop);

            return prop;
        }
开发者ID:aistrate,项目名称:TypingPracticeTexts,代码行数:22,代码来源:ClassBinder.cs

示例4: CreateProperty

		private Property CreateProperty(IEntityPropertyMapping propertyMapping, string propertyOwnerClassName, IValue value, IDictionary<string, MetaAttribute> inheritedMetas)
		{
			if (string.IsNullOrEmpty(propertyMapping.Name))
			{
				throw new MappingException("A property mapping must define the name attribute [" + propertyOwnerClassName + "]");
			}

			var propertyAccessorName = GetPropertyAccessorName(propertyMapping.Access);

			if (!string.IsNullOrEmpty(propertyOwnerClassName) && value.IsSimpleValue)
				value.SetTypeUsingReflection(propertyOwnerClassName, propertyMapping.Name, propertyAccessorName);

			var property = new Property
					{
						Name = propertyMapping.Name,
						PropertyAccessorName = propertyAccessorName,
						Value = value,
                        IsLazy = propertyMapping.IsLazyProperty,
						IsOptimisticLocked = propertyMapping.OptimisticLock,
						MetaAttributes = GetMetas(propertyMapping, inheritedMetas)
					};

			return property;
		}
开发者ID:pruiz,项目名称:nhibernate-old,代码行数:24,代码来源:PropertiesBinder.cs

示例5: CreateProperty

		protected Property CreateProperty(IValue value, string propertyName, string className,
			XmlNode subnode, IDictionary<string, MetaAttribute> inheritedMetas)
		{
			if (string.IsNullOrEmpty(propertyName))
			{
				throw new MappingException(subnode.LocalName + " mapping must defined a name attribute [" + className + "]");
			}

			if (!string.IsNullOrEmpty(className) && value.IsSimpleValue)
				value.SetTypeUsingReflection(className, propertyName, PropertyAccess(subnode));

			// This is done here 'cos we might only know the type here (ugly!)
			var toOne = value as ToOne;
			if (toOne != null)
			{
				string propertyRef = toOne.ReferencedPropertyName;
				if (propertyRef != null)
					mappings.AddUniquePropertyReference(toOne.ReferencedEntityName, propertyRef);
			}

			value.CreateForeignKey();
			var prop = new Property {Value = value};
			BindProperty(subnode, prop, inheritedMetas);

			return prop;
		}
开发者ID:nkmajeti,项目名称:nhibernate,代码行数:26,代码来源:ClassBinder.cs


注:本文中的IValue.SetTypeUsingReflection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。