本文整理汇总了C#中System.Reflection.RuntimeFieldInfo.GetRuntimeModule方法的典型用法代码示例。如果您正苦于以下问题:C# RuntimeFieldInfo.GetRuntimeModule方法的具体用法?C# RuntimeFieldInfo.GetRuntimeModule怎么用?C# RuntimeFieldInfo.GetRuntimeModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection.RuntimeFieldInfo
的用法示例。
在下文中一共展示了RuntimeFieldInfo.GetRuntimeModule方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCustomAttribute
internal static Attribute GetCustomAttribute(RuntimeFieldInfo field)
{
int num;
if ((field.DeclaringType != null) && field.GetRuntimeModule().MetadataImport.GetFieldOffset(field.DeclaringType.MetadataToken, field.MetadataToken, out num))
{
return new FieldOffsetAttribute(num);
}
return null;
}
示例2: GetCustomAttributesInternal
internal static IList<CustomAttributeData> GetCustomAttributesInternal(RuntimeFieldInfo target)
{
IList<CustomAttributeData> customAttributes = GetCustomAttributes(target.GetRuntimeModule(), target.MetadataToken);
int count = 0;
Attribute[] attributeArray = PseudoCustomAttribute.GetCustomAttributes(target, typeof(object) as RuntimeType, out count);
if (count == 0)
{
return customAttributes;
}
CustomAttributeData[] array = new CustomAttributeData[customAttributes.Count + count];
customAttributes.CopyTo(array, count);
for (int i = 0; i < count; i++)
{
array[i] = new CustomAttributeData(attributeArray[i]);
}
return Array.AsReadOnly<CustomAttributeData>(array);
}
示例3: GetCustomAttribute
[System.Security.SecurityCritical] // auto-generated
internal static Attribute GetCustomAttribute(RuntimeFieldInfo field)
{
int fieldOffset;
if (field.DeclaringType != null &&
#if MONO
(fieldOffset = field.GetFieldOffset ()) >= 0)
#else
field.GetRuntimeModule().MetadataImport.GetFieldOffset(field.DeclaringType.MetadataToken, field.MetadataToken, out fieldOffset))
#endif
return new FieldOffsetAttribute(fieldOffset);
return null;
}
示例4: GetCustomAttributesInternal
[System.Security.SecuritySafeCritical] // auto-generated
internal static IList<CustomAttributeData> GetCustomAttributesInternal(RuntimeFieldInfo target)
{
Contract.Assert(target != null);
IList<CustomAttributeData> cad = GetCustomAttributes(target.GetRuntimeModule(), target.MetadataToken);
int pcaCount = 0;
Attribute[] a = PseudoCustomAttribute.GetCustomAttributes((RuntimeFieldInfo)target, typeof(object) as RuntimeType, out pcaCount);
if (pcaCount == 0)
return cad;
CustomAttributeData[] pca = new CustomAttributeData[cad.Count + pcaCount];
cad.CopyTo(pca, pcaCount);
for (int i = 0; i < pcaCount; i++)
{
pca[i] = new CustomAttributeData(a[i]);
}
return Array.AsReadOnly(pca);
}
示例5: GetCustomAttributes
[System.Security.SecuritySafeCritical] // auto-generated
internal static Object[] GetCustomAttributes(RuntimeFieldInfo field, RuntimeType caType)
{
Contract.Requires(field != null);
Contract.Requires(caType != null);
int pcaCount = 0;
Attribute[] pca = PseudoCustomAttribute.GetCustomAttributes(field, caType, out pcaCount);
object[] attributes = GetCustomAttributes(field.GetRuntimeModule(), field.MetadataToken, pcaCount, caType, !AllowCriticalCustomAttributes(field));
if (pcaCount > 0) Array.Copy(pca, 0, attributes, attributes.Length - pcaCount, pcaCount);
return attributes;
}
示例6: IsDefined
[System.Security.SecurityCritical] // auto-generated
internal static bool IsDefined(RuntimeFieldInfo field, RuntimeType caType)
{
Contract.Requires(field != null);
Contract.Requires(caType != null);
if (PseudoCustomAttribute.IsDefined(field, caType))
return true;
return IsCustomAttributeDefined(field.GetRuntimeModule(), field.MetadataToken, caType);
}
示例7: IsDefined
[System.Security.SecurityCritical] // auto-generated
internal static bool IsDefined(RuntimeFieldInfo field, RuntimeType caType)
{
Contract.Requires(field != null);
Contract.Requires(caType != null);
#if !FEATURE_CORECLR
if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && caType != null)
{
FrameworkEventSource.Log.QueryAttributeIsDefined(caType.GetFullNameForEtw());
}
#endif
if (PseudoCustomAttribute.IsDefined(field, caType))
return true;
return IsCustomAttributeDefined(field.GetRuntimeModule(), field.MetadataToken, caType);
}
示例8: IsDefined
internal static bool IsDefined(RuntimeFieldInfo field, RuntimeType caType)
{
return (PseudoCustomAttribute.IsDefined(field, caType) || IsCustomAttributeDefined(field.GetRuntimeModule(), field.MetadataToken, caType));
}
示例9: GetCustomAttributes
internal static object[] GetCustomAttributes(RuntimeFieldInfo field, RuntimeType caType)
{
int count = 0;
Attribute[] sourceArray = PseudoCustomAttribute.GetCustomAttributes(field, caType, out count);
object[] destinationArray = GetCustomAttributes(field.GetRuntimeModule(), field.MetadataToken, count, caType, !AllowCriticalCustomAttributes(field));
if (count > 0)
{
Array.Copy(sourceArray, 0, destinationArray, destinationArray.Length - count, count);
}
return destinationArray;
}