Пример #1
0
		protected static Type CreateProxyTypeOperations (Type crtype, CodeClass c, ContractDescription cd)
		{
			// member implementation
			BindingFlags bf = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;
			foreach (OperationDescription od in cd.Operations) {
				// FIXME: handle properties and events.
#if !NET_2_1
				if (od.SyncMethod != null)
					GenerateMethodImpl (c, crtype.GetMethod ("Process", bf), od.Name, od.SyncMethod);
#endif
				if (od.BeginMethod != null)
					GenerateBeginMethodImpl (c, crtype.GetMethod ("BeginProcess", bf), od.Name, od.BeginMethod);
				if (od.EndMethod != null)
					GenerateEndMethodImpl (c, crtype.GetMethod ("EndProcess", bf), od.Name, od.EndMethod);
			}

			Type ret = c.CreateType ();
			return ret;
		}
		protected static Type CreateProxyTypeOperations (Type crtype, CodeClass c, ContractDescription cd)
		{
			// member implementation
			BindingFlags bf = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;
			foreach (OperationDescription od in cd.Operations) {
				// FIXME: handle properties and events.
#if !NET_2_1
				if (od.SyncMethod != null)
					GenerateMethodImpl (c, crtype.GetMethod ("Process", bf), od.Name, od.SyncMethod);
#endif
				if (od.BeginMethod != null)
					GenerateBeginMethodImpl (c, crtype.GetMethod ("BeginProcess", bf), od.Name, od.BeginMethod);
				if (od.EndMethod != null)
					GenerateEndMethodImpl (c, crtype.GetMethod ("EndProcess", bf), od.Name, od.EndMethod);
			}

			//Type zzz = c.CreateType ();
			//((System.Reflection.Emit.AssemblyBuilder) zzz.Assembly).Save (modname + ".dll");
			//return zzz;
			return c.CreateType ();
		}