Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Activator.cs « System « corlib « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6cd2808026821dac006d48c0cd7fc15ff410a87c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
//
// System.Activator.cs
//
// Author:
//   Nick Drochak II (ndrochak@gol.com)
//
// (C) 2001 Nick Drochak II
//

using System.Runtime.Remoting;
using System.Reflection;
using System.Globalization;
using System.Security.Policy;

namespace System 
{
	// FIXME: This class is just stubs to get System.dll to compile
	public sealed class Activator
	{
		private Activator () {}

		[MonoTODO]
		public static ObjectHandle CreateComInstanceFrom(string assemblyName, 
			string typeName) { 
			throw new NotImplementedException(); 
		}

		[MonoTODO]
		public static ObjectHandle CreateInstanceFrom(string assemblyFile, 
			string typeName) { 
			throw new NotImplementedException(); 
		}

		[MonoTODO]
		public static ObjectHandle CreateInstanceFrom(string assemblyFile, 
			string typeName, object[] activationAttributes) { 
			throw new NotImplementedException(); 
		}
		
		[MonoTODO]
		public static ObjectHandle CreateInstanceFrom(string assemblyFile, 
			string typeName, bool ignoreCase, BindingFlags bindingAttr, 
			Binder binder, object[] args, CultureInfo culture, object[] activationAttributes, 
			Evidence securityInfo) { 
			throw new NotImplementedException(); 
		}
		
		[MonoTODO]
		public static ObjectHandle CreateInstance(string assemblyName, 
			string typeName) { 
			throw new NotImplementedException(); 
		}
		
		[MonoTODO]
		public static ObjectHandle CreateInstance(string assemblyName, 
			string typeName, object[] activationAttributes) { 
			throw new NotImplementedException(); 
		}
		
		[MonoTODO]
		public static ObjectHandle CreateInstance(string assemblyName, 
			string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, 
			object[] args, CultureInfo culture, object[] activationAttributes, 
			Evidence securityInfo) { 
			throw new NotImplementedException(); 
		}
		
		public static object CreateInstance(Type type) {
			return CreateInstance (type, false);
		}
		
		public static object CreateInstance(Type type, object[] args) {
			return CreateInstance (type, args, new object [0]);
		}

		[MonoTODO]
		public static object CreateInstance(Type type, object[] args, object[] activationAttributes) {
			Type[] atypes = new Type [args.Length];
			for (int i = 0; i < args.Length; ++i) {
				atypes [i] = args [i].GetType ();
			}
			ConstructorInfo ctor = type.GetConstructor (atypes);
			return ctor.Invoke (args);

		}

		[MonoTODO]
		public static object CreateInstance(Type type, 
			BindingFlags bindingAttr, Binder binder, object[] args, 
			CultureInfo culture) { 
			return CreateInstance (type, bindingAttr, binder, args, culture, new object [0]);
		}

		[MonoTODO]
		public static object CreateInstance(Type type, 
				BindingFlags bindingAttr, Binder binder, object[] args, 
				CultureInfo culture, object[] activationAttributes) { 
			Type[] atypes = new Type [args.Length];
			for (int i = 0; i < args.Length; ++i) {
				atypes [i] = args [i].GetType ();
			}
			ConstructorInfo ctor = type.GetConstructor (bindingAttr, binder, atypes, null);
			return ctor.Invoke (args, bindingAttr, binder, args, culture);
		}

		[MonoTODO]
		public static object CreateInstance(Type type, bool nonPublic) { 
			ConstructorInfo ctor = type.GetConstructor (Type.EmptyTypes);
			return ctor.Invoke (null);
		}

		[MonoTODO]
		public static object GetObject(Type type, 
			string url) { 
			throw new NotImplementedException(); 
		}

		[MonoTODO]
		public static object GetObject(Type type, 
			string url, object state) { 
			throw new NotImplementedException(); 
		}
	}
}