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); }
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; }
internal CodeReturn (CodeBuilder codeBuilder) { this.codeBuilder = codeBuilder; }
internal CodeReturn (CodeBuilder codeBuilder, CodeExpression retValue) { this.codeBuilder = codeBuilder; this.retValue = retValue; }
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)); }
private CodeBuilder GetClassInitBuilder () { if (classInit != null) return classInit; classInit = new CodeBuilder (this); return classInit; }
private CodeBuilder GetInstanceInitBuilder () { if (instanceInit != null) return instanceInit; instanceInit = new CodeBuilder (this); return instanceInit; }
internal CodeReturn(CodeBuilder codeBuilder) { this.codeBuilder = codeBuilder; }
internal CodeReturn(CodeBuilder codeBuilder, CodeExpression retValue) { this.codeBuilder = codeBuilder; this.retValue = retValue; }