本文整理汇总了C#中MemberTypes类的典型用法代码示例。如果您正苦于以下问题:C# MemberTypes类的具体用法?C# MemberTypes怎么用?C# MemberTypes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MemberTypes类属于命名空间,在下文中一共展示了MemberTypes类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:labeuze,项目名称:source,代码行数:31,代码来源:TypeReflection.cs
示例2: WiredToAttribute
public WiredToAttribute(MemberTypes memberType, string name, Type typeWiredTo)
{
WiredMemberType = memberType;
WiredMemberName = name;
TypeWiredTo = typeWiredTo;
}
开发者ID:HelloKitty,项目名称:Testity,代码行数:7,代码来源:WiredToAttribute.cs
示例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;
}
开发者ID:devworker55,项目名称:Mammatus,代码行数:7,代码来源:MapCallInfo.cs
示例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)
{
}
开发者ID:jango2015,项目名称:buildtools,代码行数:7,代码来源:Thinner.cs
示例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;
}
开发者ID:nobled,项目名称:mono,代码行数:7,代码来源:PermissionMember.cs
示例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);
}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:28,代码来源:MemberInfoSerializationHolder.cs
示例7: SetMainMember
public void SetMainMember(IField field)
{
this.Member = field;
this.MemberType = MemberTypes.Field;
this.SubMemberType = this.MemberType;
this.SubMember = this.Member;
}
开发者ID:afrog33k,项目名称:csnative,代码行数:7,代码来源:MemberLocationInfo.cs
示例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);
}
开发者ID:runefs,项目名称:Marvin,代码行数:28,代码来源:MemberInfoSerializationHolder.cs
示例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);
}
开发者ID:matthiaskaiser,项目名称:ExploitRemotingService,代码行数:35,代码来源:FakeMethod.cs
示例10: NodeInfo
public NodeInfo(Type type, string name, MemberTypes mtype, ParameterInfo[] parameters)
{
this.NodeType = type;
this.Name = name;
this.MemberType = mtype;
this.Parameters = parameters;
}
开发者ID:nguyenhuuhuy,项目名称:mygeneration,代码行数:7,代码来源:AutoCompleteHelper.cs
示例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[]));
}
开发者ID:kouvel,项目名称:coreclr,代码行数:25,代码来源:MemberInfoSerializationHolder.cs
示例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;
}
开发者ID:lewurm,项目名称:benchmarker,代码行数:8,代码来源:linq.cs
示例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();
}
开发者ID:MetaMicrocode,项目名称:Veil,代码行数:8,代码来源:HandlebarsExpressionParser.cs
示例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;
}
开发者ID:nuxleus,项目名称:ajaxmin,代码行数:8,代码来源:jspredefinedfield.cs
示例15: AbstractEmitter
protected AbstractEmitter(Type targetType, BindingFlags bindingFlags, MemberTypes memberTypes, Type[] parameterTypes, MemberInfo memberInfo)
{
_targetType = targetType;
_bindingFlags = bindingFlags;
_memberTypes = memberTypes;
_parameterTypes = parameterTypes;
_memberInfo = memberInfo;
}
开发者ID:mstaessen,项目名称:fluorinefx,代码行数:8,代码来源:AbstractEmitter.cs
示例16: InvokeStaticMember
private object InvokeStaticMember(object[] arguments, MemberTypes memberTypes, string memberName = null)
{
var clazz = this.Class;
var candidates = new List<MethodBase>();
if ((memberTypes & MemberTypes.Constructor) != 0) {
candidates.AddRange(clazz.GetConstructors(BindingFlags.Public | BindingFlags.Instance));
}
if ((memberTypes & MemberTypes.Method) != 0) {
candidates.AddRange(
clazz.GetMethods(BindingFlags.Static | BindingFlags.Public)
.Where(mi => mi.Name == memberName));
}
if ((memberTypes & MemberTypes.Property) != 0) {
candidates.AddRange(
clazz.GetProperties(BindingFlags.Static | BindingFlags.Public)
.Where(pi => pi.Name == memberName)
.SelectMany(pi => new MethodInfo[] { pi.GetGetMethod(), pi.GetSetMethod() })
.Where(mi => mi != null));
}
candidates = candidates.FindAll(mi => mi.GetParameters().Length == arguments.Length);
foreach (var mi in candidates) {
var pis = mi.GetParameters();
bool accepted = true;
for(int i = 0; i < pis.Length; i++) {
var pi = pis[i];
var arg = arguments[i];
if (!pi.ParameterType.IsAssignableFrom(arg.GetType())) {
accepted = false;
break;
}
}
if (accepted) { // we found a good candidate
if (mi is ConstructorInfo)
return ((ConstructorInfo)mi).Invoke(arguments);
else
return mi.Invoke(null, arguments);
}
}
// if we've reached this point but we still have a partially matching method,
// just try to forcefully cast the args to what the method expects
if (candidates.Count > 0) {
var mi = candidates[0];
var miParams = mi.GetParameters();
var newArgs = (object[])arguments.Clone();
for (int i = 0; i < arguments.Length; i++) {
newArgs[i] = Convert.ChangeType(arguments[i], miParams[i].ParameterType);
}
return mi.Invoke(null, newArgs);
}
throw new MissingMemberException(String.Format("Could not find a compatible member named '{0}' in class '{1}'", memberName, this.Class));
}
开发者ID:eugen,项目名称:Bonsai,代码行数:58,代码来源:BonsaiClrClassFunction.cs
示例17: AddMappingFromDocumentWithHeaders
public MappingDefinition AddMappingFromDocumentWithHeaders(Document doc,MemberTypes memberType=MemberTypes.Property)
{
if(!doc.HaveHeader) throw new InvalidDataException("document does not have headers");
foreach (var header in doc.Header)
{
AddFieldMapping(header, header, memberType);
}
return this;
}
开发者ID:JonasSyrstad,项目名称:Stardust,代码行数:9,代码来源:MappingDefinition.cs
示例18: LazyMemberInfo
public LazyMemberInfo(MemberTypes memberType, Func<MemberInfo[]> accessorsCreator)
{
EnsureSupportedMemberType(memberType, "memberType");
Requires.NotNull(accessorsCreator, "accessorsCreator");
this._memberType = memberType;
this._accessors = null;
this._accessorsCreator = accessorsCreator;
}
开发者ID:nlhepler,项目名称:mono,代码行数:9,代码来源:LazyMemberInfo.cs
示例19: Test_SerializedMemberParser_Should_Find_No_Members
public static void Test_SerializedMemberParser_Should_Find_No_Members(MemberTypes memberInfoType, Type typeToParse)
{
//arranges
IEnumerable objects = new SerializedMemberParser().Parse(memberInfoType, typeToParse);
//assert
//It should be empty but non-null
Assert.IsNotNull(objects);
Assert.IsEmpty(objects);
}
开发者ID:HelloKitty,项目名称:Testity,代码行数:10,代码来源:SerializedMemberParserTests.cs
示例20: NamedIdMemberConvention
/// <summary>
/// Initializes a new instance of the <see cref="NamedIdMemberConvention" /> class.
/// </summary>
/// <param name="names">The names.</param>
/// <param name="memberTypes">The member types.</param>
/// <param name="bindingFlags">The binding flags.</param>
/// <exception cref="System.ArgumentNullException"></exception>
public NamedIdMemberConvention(IEnumerable<string> names, MemberTypes memberTypes, BindingFlags bindingFlags)
{
if (names == null)
{
throw new ArgumentNullException("names");
}
_names = names;
_memberTypes = memberTypes;
_bindingFlags = bindingFlags | BindingFlags.DeclaredOnly;
}
开发者ID:CloudMetal,项目名称:mongo-csharp-driver,代码行数:18,代码来源:NamedIdMemberConvention.cs
注:本文中的MemberTypes类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论