public override void DeclareCodeType(IDLInterface idlIntf) { // Proxy class. typeProxy = new CodeTypeDeclaration(name + "Proxy"); typeProxy.IsClass = true; typeProxy.TypeAttributes = TypeAttributes.Public; eventsDeclarationHolder = new CodeTypeDeferredNamespaceDeclarationHolderEvents(idlIntf); typeProxy.BaseTypes.Add(genInterfaceName); // Interface field. CodeMemberField memberProxy = new CodeMemberField(genInterfaceName, proxyName); memberProxy.Attributes = MemberAttributes.Private; typeProxy.Members.Add(memberProxy); // TODO: Going to need a using or a fully qualified name. // Constructor. CodeConstructor constructor = new CodeConstructor(); constructor.Attributes = MemberAttributes.Public; // TODO - use the actual interface type rather than a string. paramProxy = new CodeParameterDeclarationExpression(genInterfaceName, proxyName); constructor.Parameters.Add(paramProxy); thisProxyFieldRef = new CodeFieldReferenceExpression( new CodeThisReferenceExpression(), proxyName ); assignProxy = new CodeAssignStatement(thisProxyFieldRef, new CodeArgumentReferenceExpression(proxyName)); constructor.Statements.Add(assignProxy); typeProxy.Members.Add(constructor); declarationHolder = new CodeTypeIgnoredNamespaceDeclarationHolderParams(idlIntf); contextDeclarationHolder = declarationHolder; bAddNamespace = false; }