public Reflector(string assemblyPath) { AppDomainSetup setup = new AppDomainSetup(); setup.ApplicationBase = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); this.assemblyPath = assemblyPath; this.reflectingDomain = AppDomain.CreateDomain(assemblyPath + " reflecting domain", null, setup); try { object remote_object = this.reflectingDomain.CreateInstanceAndUnwrap( Assembly.GetExecutingAssembly().FullName, typeof(RemoteReflector).FullName, false, BindingFlags.Default, null, new object[] { assemblyPath }, null, null, null); this.remoteReflector = (RemoteReflector)remote_object; } catch (Exception) { Dispose(); throw; } }
public MethodDescriptor(RemoteReflector reflector, MethodInfo info, TypeDescriptor declaringType, Guid id) : base(reflector, id) { this.DeclaringType = declaringType; this.MethodName = info.Name; this.MethodAttributes = info.Attributes; // signature is null - will be created when first needed StringBuilder sb = new StringBuilder(); TypeToString(sb, info.ReturnType); sb.Append('('); ParameterInfo[] parameters = info.GetParameters(); for (int i = 0; i < parameters.Length; i++) { if (i > 0) { sb.Append(','); } TypeToString(sb, parameters[i].ParameterType); } sb.Append(')'); this.MethodSigString = sb.ToString(); }
public readonly TypeDescriptor DeclaringType; // non-null for nested types only #endregion #region Construction public TypeDescriptor(RemoteReflector reflector, TypeDescriptor declaringType, Type type, Guid id) : base(reflector, id) { this.DeclaringType = declaringType; this.TypeName = type.FullName; this.IsValueType = type.IsValueType; this.IsDelegate = typeof(Delegate).IsAssignableFrom(type); this.TypeAttributes = type.Attributes; }
public readonly string MethodSigString; // return type : (parameter types) #endregion Fields #region Constructors public MethodDescriptor(RemoteReflector reflector, MethodInfo info, TypeDescriptor declaringType, Guid id) : base(reflector, id) { this.DeclaringType = declaringType; this.MethodName = info.Name; this.MethodAttributes = info.Attributes; // signature is null - will be created when first needed var sb = new StringBuilder(); TypeToString(sb, info.ReturnType); sb.Append('('); ParameterInfo[] parameters = info.GetParameters(); for (int i = 0; i < parameters.Length; i++) { if (i > 0) sb.Append(','); TypeToString(sb, parameters[i].ParameterType); } sb.Append(')'); this.MethodSigString = sb.ToString(); }
public TypeDescriptor(RemoteReflector reflector, Type type, Guid id) : this(reflector, null, type, id) { }
public TypeDescriptor(RemoteReflector reflector, TypeDescriptor declaringType, Type type, Guid id) : base(reflector, id) { this.DeclaringType = declaringType; this.TypeName = type.FullName; this.IsValueType = type.IsValueType; this.IsDelegate = typeof(Delegate).IsAssignableFrom(type); this.TypeAttributes = type.Attributes; }
public ItemDescriptor(RemoteReflector reflector, Guid id) { this.reflector = reflector; this.id = id; }
public Reflector(string assemblyPath) { var setup = new AppDomainSetup(); setup.ApplicationBase = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); this.assemblyPath = assemblyPath; this.reflectingDomain = AppDomain.CreateDomain(assemblyPath + " reflecting domain", null, setup); try { object remote_object = this.reflectingDomain.CreateInstanceAndUnwrap( Assembly.GetExecutingAssembly().FullName, typeof(RemoteReflector).FullName, false, BindingFlags.Default, null, new object[] { assemblyPath }, null, null, null); this.remoteReflector = (RemoteReflector)remote_object; } catch (Exception) { Dispose(); throw; } }