예제 #1
0
 public AttachedEventImplementation(string name, MethodInfo addMethod)
 {
     this.name      = name;
     this.addMethod = addMethod;
     ParameterInfo[] parameters = PlatformTypeHelper.GetParameters(this.addMethod);
     if (parameters != null && (int)parameters.Length == 2)
     {
         this.targetType  = parameters[0].ParameterType;
         this.handlerType = parameters[1].ParameterType;
     }
     this.access = PlatformTypeHelper.GetMemberAccess(this.addMethod);
 }
 public LocalEventImplementation(System.Reflection.EventInfo eventInfo)
 {
     this.eventInfo = eventInfo;
     this.addMethod = this.eventInfo.GetAddMethod(true);
     this.access    = (this.addMethod != null ? PlatformTypeHelper.GetMemberAccess(this.addMethod) : MemberAccessType.Private);
 }
예제 #3
0
			public Type GetType(string typeName)
			{
				Type type;
				Type type1 = null;
				if (this.typeNameCache.TryGetValue(typeName, out type1))
				{
					return type1;
				}
				using (IEnumerator<XmlnsDefinitionMap.AssemblyNamespace> enumerator = this.AssemblyNamespaces.GetEnumerator())
				{
					while (enumerator.MoveNext())
					{
						XmlnsDefinitionMap.AssemblyNamespace current = enumerator.Current;
						IAssembly assembly = current.Assembly;
						string str = TypeHelper.CombineNamespaceAndTypeName(current.ClrNamespace, typeName);
						try
						{
							type1 = PlatformTypeHelper.GetType(assembly, str);
							if (type1 != null)
							{
								IType type2 = this.typeResolver.GetType(type1);
								if (!this.typeResolver.PlatformMetadata.IsNullType(type2))
								{
									if (TypeHelper.IsSet((assembly.CompareTo(this.targetAssembly) ? MemberAccessTypes.PublicOrInternal : MemberAccessTypes.Public), PlatformTypeHelper.GetMemberAccess(type1)))
									{
										this.typeNameCache.Add(typeName, type1);
										type = type1;
										return type;
									}
								}
							}
						}
						catch (ArgumentException argumentException)
						{
							type = null;
							return type;
						}
					}
					this.typeNameCache.Add(typeName, null);
					return null;
				}
				return type;
			}