Esempio n. 1
0
		CodeMethod (CodeClass cls, MethodAttributes attributes, Type[] parameterTypes) 
		{
			this.cls = cls;
			this.typeBuilder = cls.TypeBuilder;
			this.attributes = attributes;
			this.parameterTypes = parameterTypes;
			this.name = typeBuilder.Name;
		
			methodBase = typeBuilder.DefineConstructor (attributes, CallingConventions.Standard, parameterTypes);
			builder = new CodeBuilder (cls);
		}
Esempio n. 2
0
		internal CodeMethod (CodeClass cls, string name, MethodAttributes attributes, Type returnType, Type[] parameterTypes) 
		{
			this.cls = cls;
			this.typeBuilder = cls.TypeBuilder;
			this.name = name;
			this.attributes = attributes;
			this.returnType = returnType;
			this.parameterTypes = parameterTypes;
		
			methodBase = typeBuilder.DefineMethod (name, attributes, returnType, parameterTypes);
			builder = new CodeBuilder (cls);
		}
		internal CodeProperty (CodeClass cls, string name, PropertyAttributes attributes, MethodAttributes methodAttributes, Type returnType, Type[] parameterTypes) 
		{
			this.cls = cls;
			this.typeBuilder = cls.TypeBuilder;
			this.name = name;
			this.attributes = attributes;
			this.methodAttributes = methodAttributes;
			this.returnType = returnType;
			this.parameterTypes = parameterTypes;
		
			PropertyBuilder pb = typeBuilder.DefineProperty (name, attributes, returnType, parameterTypes);
			pb.SetGetMethod (typeBuilder.DefineMethod ("get_" + name, methodAttributes, CallingConventions.Standard, returnType, Type.EmptyTypes));
			pb.SetSetMethod (typeBuilder.DefineMethod ("set_" + name, methodAttributes, CallingConventions.Standard, typeof (void), new Type [] {returnType}));
			get_builder = new CodeBuilder (cls);
			set_builder = new CodeBuilder (cls);
			propertyInfo = pb;
		}
Esempio n. 4
0
		internal CodeReturn (CodeBuilder codeBuilder)
		{
			this.codeBuilder = codeBuilder;
		}
Esempio n. 5
0
		internal CodeReturn (CodeBuilder codeBuilder, CodeExpression retValue)
		{
			this.codeBuilder = codeBuilder;
			this.retValue = retValue;
		}
Esempio n. 6
0
		static CodePropertyReference GetOperationMethod (CodeMethod m, CodeBuilder b, string name, string methodPropertyName)
		{
			return new CodePropertyReference (
				b.CallFunc (
					// this.Contract.Operations
					new CodePropertyReference (
						new CodePropertyReference (
							m.GetThis (),
							typeof (ClientRuntimeChannel).GetProperty ("Contract")),
						typeof (ContractDescription).GetProperty ("Operations")),
					// .Find (name)
					typeof (OperationDescriptionCollection).GetMethod ("Find"),
					new CodeLiteral (name)),
				// .SyncMethod
				typeof (OperationDescription).GetProperty (methodPropertyName));
		}
Esempio n. 7
0
		private CodeBuilder GetClassInitBuilder ()
		{
			if (classInit != null) return classInit;
			classInit = new CodeBuilder (this);
			return classInit;
		}
Esempio n. 8
0
		private CodeBuilder GetInstanceInitBuilder ()
		{
			if (instanceInit != null) return instanceInit;
			instanceInit = new CodeBuilder (this);
			return instanceInit;
		}
Esempio n. 9
0
 internal CodeReturn(CodeBuilder codeBuilder)
 {
     this.codeBuilder = codeBuilder;
 }
Esempio n. 10
0
 internal CodeReturn(CodeBuilder codeBuilder, CodeExpression retValue)
 {
     this.codeBuilder = codeBuilder;
     this.retValue    = retValue;
 }