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


C# IReflectClass.GetSuperclass方法代码示例

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


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

示例1: MapSuperclass

		private ClassInfo MapSuperclass(IReflectClass claxx)
		{
			IReflectClass superClass = claxx.GetSuperclass();
			if (superClass != null)
			{
				return GetClassMeta(superClass);
			}
			return null;
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:9,代码来源:ClassInfoHelper.cs

示例2: TraverseSuperclass

		private void TraverseSuperclass(object @object, IReflectClass claxx)
		{
			IReflectClass superclass = claxx.GetSuperclass();
			if (superclass == null)
			{
				return;
			}
			TraverseAllFields(@object, superclass);
		}
开发者ID:erdincay,项目名称:db4o,代码行数:9,代码来源:GenericTraverser.cs

示例3: ForEachField

		public static void ForEachField(IReflectClass claxx, IProcedure4 procedure)
		{
			while (claxx != null)
			{
				IReflectField[] declaredFields = claxx.GetDeclaredFields();
				for (int reflectFieldIndex = 0; reflectFieldIndex < declaredFields.Length; ++reflectFieldIndex)
				{
					IReflectField reflectField = declaredFields[reflectFieldIndex];
					procedure.Apply(reflectField);
				}
				claxx = claxx.GetSuperclass();
			}
		}
开发者ID:erdincay,项目名称:db4o,代码行数:13,代码来源:ReflectorUtils.cs

示例4: Field

		public static IReflectField Field(IReflectClass claxx, string name)
		{
			while (claxx != null)
			{
				try
				{
					return claxx.GetDeclaredField(name);
				}
				catch (Exception)
				{
				}
				claxx = claxx.GetSuperclass();
			}
			return null;
		}
开发者ID:erdincay,项目名称:db4o,代码行数:15,代码来源:ReflectorUtils.cs

示例5: GetDeclaredFieldInHeirarchy

        public static IReflectField GetDeclaredFieldInHeirarchy(IReflectClass aClass, string attribute)
        {
            try
            {
                while (aClass != null)
                {
					IReflectField refField = GetDeclaredField(aClass, attribute);
                    if (refField != null)
                        return refField;

                    aClass = aClass.GetSuperclass();
                }
            }
            catch (Exception e)
            {
                LoggingHelper.HandleException(e);
            }
            return null;

        }
开发者ID:erdincay,项目名称:db4o,代码行数:20,代码来源:DataLayerCommon.cs

示例6: CallConstructorSpecialized

		private TernaryBool CallConstructorSpecialized(IReflectClass clazz)
		{
			Config4Class clazzConfig = _config.ConfigClass(clazz.GetName());
			if (clazzConfig != null)
			{
				TernaryBool res = clazzConfig.CallConstructor();
				if (!res.IsUnspecified())
				{
					return res;
				}
			}
			if (Platform4.IsEnum(_config.Reflector(), clazz))
			{
				return TernaryBool.No;
			}
			IReflectClass ancestor = clazz.GetSuperclass();
			if (ancestor != null)
			{
				return CallConstructorSpecialized(ancestor);
			}
			return TernaryBool.Unspecified;
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:22,代码来源:ReflectorConfigurationImpl.cs

示例7: SetFieldsToNull

		private void SetFieldsToNull(object @object, IReflectClass claxx)
		{
			IReflectField[] fields;
			fields = claxx.GetDeclaredFields();
			for (int i = 0; i < fields.Length; i++)
			{
				IReflectField field = fields[i];
				if (field.IsStatic())
				{
					continue;
				}
				if (field.IsTransient())
				{
					continue;
				}
				field.Set(@object, null);
			}
			IReflectClass superclass = claxx.GetSuperclass();
			if (superclass == null)
			{
				return;
			}
			SetFieldsToNull(@object, superclass);
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:24,代码来源:R0to4Runner.cs

示例8: CreateClassMetadata

		internal bool CreateClassMetadata(ClassMetadata clazz, IReflectClass reflectClazz
			)
		{
			bool result = false;
			_classMetadataCreationDepth++;
			try
			{
				IReflectClass parentReflectClazz = reflectClazz.GetSuperclass();
				ClassMetadata parentClazz = null;
				if (parentReflectClazz != null && !parentReflectClazz.Equals(Container()._handlers
					.IclassObject))
				{
					parentClazz = ProduceClassMetadata(parentReflectClazz);
				}
				result = Container().CreateClassMetadata(clazz, reflectClazz, parentClazz);
			}
			finally
			{
				_classMetadataCreationDepth--;
			}
			InitClassMetadataOnUp();
			return result;
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:23,代码来源:ClassMetadataRepository.cs

示例9: CopyFieldValuesAcross

		private void CopyFieldValuesAcross(object src, object dest, IReflectClass claxx, 
			IReplicationProviderInside sourceProvider, IReplicationProviderInside targetProvider
			)
		{
			if (dest == null)
			{
				throw new InvalidOperationException("Dest cannot be null: src=" + src + ", class="
					 + claxx + ", source=" + sourceProvider.GetName() + ", target=" + targetProvider
					.GetName());
			}
			IEnumerator fields = FieldIterators.PersistentFields(claxx);
			while (fields.MoveNext())
			{
				IReflectField field = (IReflectField)fields.Current;
				object value = field.Get(src);
				field.Set(dest, FindCounterpart(value, sourceProvider, targetProvider));
			}
			IReflectClass superclass = claxx.GetSuperclass();
			if (superclass == null)
			{
				return;
			}
			CopyFieldValuesAcross(src, dest, superclass, sourceProvider, targetProvider);
		}
开发者ID:erdincay,项目名称:db4o,代码行数:24,代码来源:GenericReplicationSession.cs

示例10: IsAssignableFrom

		public virtual bool IsAssignableFrom(IReflectClass subclassCandidate)
		{
			if (subclassCandidate == null)
			{
				return false;
			}
			if (Equals(subclassCandidate))
			{
				return true;
			}
			if (_delegate != null)
			{
				if (subclassCandidate is Db4objects.Db4o.Reflect.Generic.GenericClass)
				{
					subclassCandidate = ((Db4objects.Db4o.Reflect.Generic.GenericClass)subclassCandidate
						).GetDelegate();
				}
				return _delegate.IsAssignableFrom(subclassCandidate);
			}
			if (!(subclassCandidate is Db4objects.Db4o.Reflect.Generic.GenericClass))
			{
				return false;
			}
			return IsAssignableFrom(subclassCandidate.GetSuperclass());
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:25,代码来源:GenericClass.cs

示例11: GetFieldList

        public static List<IReflectField> GetFieldList(IReflectClass aClass)
        {
            try
            {
                if (aClass == null)
                    return null;

                List<IReflectField> ret = NonVirtualFieldsFor(aClass);
                IReflectClass parent = aClass.GetSuperclass();
                if (parent != null && !(parent.GetName().StartsWith("System.")))
                    ret.AddRange(GetFieldList(parent));

                return ret;
            }
            catch (Exception e)
            {
                LoggingHelper.HandleException(e);
            }
            return null;
        }
开发者ID:Galigator,项目名称:db4o,代码行数:20,代码来源:DataLayerCommon.cs

示例12: CopyFieldValuesAcross

		private void CopyFieldValuesAcross(object src, object dest, IReflectClass claxx, 
			IReplicationProviderInside sourceProvider, IReplicationProviderInside targetProvider
			)
		{
			IEnumerator fields = FieldIterators.PersistentFields(claxx);
			while (fields.MoveNext())
			{
				IReflectField field = (IReflectField)fields.Current;
				object value = field.Get(src);
				field.Set(dest, FindCounterpart(value, sourceProvider, targetProvider));
			}
			IReflectClass superclass = claxx.GetSuperclass();
			if (superclass == null)
			{
				return;
			}
			CopyFieldValuesAcross(src, dest, superclass, sourceProvider, targetProvider);
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:18,代码来源:GenericReplicationSession.cs

示例13: CreateType

 private ITypeDescription CreateType(TypeName name,
     IReflectClass classInfo,
     Func<TypeName, Maybe<IReflectClass>> classLookup,
     IDictionary<string, ITypeDescription> knownTypes)
 {
     var knownType = typeResolver(name)
         .Otherwise(() => typeResolver(name.GetGenericTypeDefinition()));
     if (knownType.HasValue)
     {
         var systemType = KnownType.Create(knownType.Value,
                                           name.GenericArguments.Select(
                                               t => GetOrCreateTypeByName(t.Value, classLookup, knownTypes)).
                                               ToList(), IndexLookUp);
         knownTypes[name.FullName] = systemType;
         return systemType;
     }
     return SimpleClassDescription.Create(name,
                                          classInfo.GetSuperclass().AsMaybe().Convert(sc=>GetOrCreateType(sc, classLookup,
                                                                     knownTypes)),
                                          t =>
                                              {
                                                  knownTypes[name.FullName] = t;
                                                  return ExtractFields(name, classInfo,
                                                                       typeName =>
                                                                       GetOrCreateType(typeName, classLookup,
                                                                                       knownTypes));
                                              });
 }
开发者ID:gamlerhart,项目名称:db4opad,代码行数:28,代码来源:MetaDataReader.cs


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