本文整理汇总了C#中MemberTypes类的典型用法代码示例。如果您正苦于以下问题:C# MemberTypes类的具体用法?C# MemberTypes怎么用?C# MemberTypes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MemberTypes类属于命名空间,在下文中一共展示了MemberTypes类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TypeValueInfo
public Module Module; // ex RunCode_00002.dll
public TypeValueInfo(Type sourceType, MemberInfo memberInfo)
{
SourceType = sourceType;
Name = memberInfo.Name;
TreeName = memberInfo.Name;
ParentName = null;
Type valueType = memberInfo.zGetValueType();
Type enumerableType = null;
if (valueType != typeof(string))
enumerableType = zReflection.GetEnumerableType(valueType);
if (enumerableType != null)
{
ValueType = enumerableType;
IsEnumerable = true;
}
else
{
ValueType = valueType;
IsEnumerable = false;
}
IsValueType = TypeReflection.IsValueType(ValueType);
DeclaringType = memberInfo.DeclaringType;
ReflectedType = memberInfo.ReflectedType;
MemberTypes = memberInfo.MemberType;
MetadataToken = memberInfo.MetadataToken;
Module = memberInfo.Module;
}
示例2: WiredToAttribute
public WiredToAttribute(MemberTypes memberType, string name, Type typeWiredTo)
{
WiredMemberType = memberType;
WiredMemberName = name;
TypeWiredTo = typeWiredTo;
}
示例3: MapCallInfo
public MapCallInfo(Type targetType, Type[] genericTypes, Flags bindingFlags, MemberTypes memberTypes, string name, Type[] parameterTypes, MemberInfo memberInfo, bool isReadOperation, Type sourceType, MemberTypes sourceMemberTypes, MemberTypes targetMemberTypes, string[] names) : base(targetType, genericTypes, bindingFlags, memberTypes, name, parameterTypes, memberInfo, isReadOperation)
{
SourceType = sourceType;
SourceMemberTypes = sourceMemberTypes;
TargetMemberTypes = targetMemberTypes;
Names = names;
}
示例4: ThinMember
public ThinMember(ThinType declaringType, string memberName, string returnType, MemberTypes memberType,
IncludeStatus includeStatus, ITypeDefinitionMember memberNode, VisibilityOverride visibility)
: this(declaringType, memberName, returnType, memberType,
includeStatus, memberNode, visibility, SecurityTransparencyStatus.Transparent)
{
}
示例5: PermissionMember
public PermissionMember (MemberTypes member_type, BaseTypeRef type_ref, string name, object value)
{
this.member_type = member_type;
this.type_ref = type_ref;
this.name = name;
this.value = value;
}
示例6: MemberInfoSerializationHolder
// Constructor.
public MemberInfoSerializationHolder(SerializationInfo info,
StreamingContext context)
{
if(info == null)
{
throw new ArgumentNullException("info");
}
memberType = (MemberTypes)(info.GetInt32("MemberType"));
name = info.GetString("Name");
signature = info.GetString("Signature");
String assemblyName = info.GetString("AssemblyName");
String className = info.GetString("ClassName");
if(assemblyName == null || className == null)
{
throw new SerializationException
(_("Serialize_StateMissing"));
}
Assembly assembly = FormatterServices.GetAssemblyByName
(assemblyName);
if(assembly == null)
{
throw new SerializationException
(_("Serialize_StateMissing"));
}
containingType = FormatterServices.GetTypeFromAssembly
(assembly, className);
}
示例7: SetMainMember
public void SetMainMember(IField field)
{
this.Member = field;
this.MemberType = MemberTypes.Field;
this.SubMemberType = this.MemberType;
this.SubMember = this.Member;
}
示例8: MemberInfoSerializationHolder
MemberInfoSerializationHolder(SerializationInfo info, StreamingContext ctx)
{
string assemblyName;
string typeName;
assemblyName = info.GetString("AssemblyName");
typeName = info.GetString("ClassName");
_memberName = info.GetString("Name");
_memberSignature = info.GetString("Signature");
_memberType = (MemberTypes) info.GetInt32("MemberType");
#if NET_2_0
try {
_genericArguments = null;
// FIXME: this doesn't work at present. It seems that
// ObjectManager doesn't cope with nested IObjectReferences.
// _genericArguments = (Type[]) info.GetValue("GenericArguments", typeof(Type[]));
} catch (SerializationException) {
// expected (old NET_1_0 protocol)
}
#endif
// Load type
Assembly asm = Assembly.Load(assemblyName);
_reflectedType = asm.GetType(typeName, true, true);
}
示例9: GetSerializationInfo
private void GetSerializationInfo(SerializationInfo info, string name, Type reflectedClass, string signature, MemberTypes type, Type[] genericArguments)
{
if (info == null)
{
throw new ArgumentNullException("info");
}
AssemblyName asmname = reflectedClass.Assembly.GetName();
asmname.Version = new Version(_version, 0, 0, 0);
string fullName = asmname.ToString();
string str2 = reflectedClass.FullName;
Type t = typeof(int).Assembly.GetType("System.Reflection.MemberInfoSerializationHolder");
info.SetType(t);
for (int i = 0; i < genericArguments.Length; ++i)
{
genericArguments[i] = new FakeType(genericArguments[i], _version);
}
// This is here to prevent a de-serialization bug
if (genericArguments.Length > 0)
{
info.AddValue("DUMMY", genericArguments[0]);
}
info.AddValue("GenericArguments", genericArguments, typeof(Type[]));
info.AddValue("Name", name, typeof(string));
info.AddValue("AssemblyName", fullName, typeof(string));
info.AddValue("ClassName", str2, typeof(string));
info.AddValue("Signature", signature, typeof(string));
info.AddValue("MemberType", (int)type);
}
示例10: NodeInfo
public NodeInfo(Type type, string name, MemberTypes mtype, ParameterInfo[] parameters)
{
this.NodeType = type;
this.Name = name;
this.MemberType = mtype;
this.Parameters = parameters;
}
示例11: GetSerializationInfo
public static void GetSerializationInfo(
SerializationInfo info,
String name,
RuntimeType reflectedClass,
String signature,
String signature2,
MemberTypes type,
Type[] genericArguments)
{
if (info == null)
throw new ArgumentNullException(nameof(info));
Contract.EndContractBlock();
String assemblyName = reflectedClass.Module.Assembly.FullName;
String typeName = reflectedClass.FullName;
info.SetType(typeof(MemberInfoSerializationHolder));
info.AddValue("Name", name, typeof(String));
info.AddValue("AssemblyName", assemblyName, typeof(String));
info.AddValue("ClassName", typeName, typeof(String));
info.AddValue("Signature", signature, typeof(String));
info.AddValue("Signature2", signature2, typeof(String));
info.AddValue("MemberType", (int)type);
info.AddValue("GenericArguments", genericArguments, typeof(Type[]));
}
示例12: Error_MemberLookupFailed
protected override Expression Error_MemberLookupFailed (Type container_type, Type qualifier_type,
Type queried_type, string name, string class_name, MemberTypes mt, BindingFlags bf)
{
Report.Error (1935, loc, "An implementation of `{0}' query expression pattern could not be found. " +
"Are you missing `System.Linq' using directive or `System.Core.dll' assembly reference?",
name);
return null;
}
示例13: FindMember
private static MemberInfo FindMember(Type t, string name, MemberTypes types)
{
return t
.FindMembers(types, BindingFlags.Instance | BindingFlags.Public, Type.FilterNameIgnoreCase, name)
.OrderByDescending(x => x.Name == name)
.ThenByDescending(x => x.MemberType == MemberTypes.Property)
.FirstOrDefault();
}
示例14: JSPredefinedField
internal JSPredefinedField(string name, MemberTypes memberType, GlobalObjectInstance globalObject)
: base(name, 0, null)
{
m_memberType = memberType;
m_globalObject = globalObject;
// predefined fields cannot be crunched
CanCrunch = false;
}
示例15: AbstractEmitter
protected AbstractEmitter(Type targetType, BindingFlags bindingFlags, MemberTypes memberTypes, Type[] parameterTypes, MemberInfo memberInfo)
{
_targetType = targetType;
_bindingFlags = bindingFlags;
_memberTypes = memberTypes;
_parameterTypes = parameterTypes;
_memberInfo = memberInfo;
}