Beispiel #1
0
        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;
        }
Beispiel #2
0
        public override void DeclareCodeType(IDLInterface idlIntf)
        {
            this.type                = new CodeTypeDeclaration(CodeBuilderCommon.GetName(idlIntf.Name, new WCFServiceVisitor()));
            this.type.IsClass        = true;
            this.type.TypeAttributes = System.Reflection.TypeAttributes.Public;

            this.BaseTypes(typerefWCFInterface, this.type);
            this.type.CustomAttributes.Add(attribServiceBehavior);

            // DbusServices field.
            this.DbusServiceTargetField(this.typerefDbusInterface, this.typerefDbusMarshal, this.type.Members);

            // Constructor.
            this.Constructor(this.type, this.typerefDbusInterface);

            // Target retrieval method.
            this.methodGetWCFMethodTarget = this.TargetRetrievalMethod(this.typerefDbusInterface, this.typerefDbusMarshal, this.typerefexprDbusMarshal);
            this.type.Members.Add(this.methodGetWCFMethodTarget);

            this.contextDeclarationHolder = new CodeTypeIgnoredNamespaceDeclarationHolderParams(idlIntf);
            this.declarationHolder        = this.contextDeclarationHolder;
        }
Beispiel #3
0
        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;
        }
        public override void DeclareCodeType(IDLInterface idlIntf)
        {
            this.type = new CodeTypeDeclaration(CodeBuilderCommon.GetName(idlIntf.Name, new WCFServiceVisitor()));
            this.type.IsClass = true;
            this.type.TypeAttributes = System.Reflection.TypeAttributes.Public;

            this.BaseTypes(typerefWCFInterface, this.type);
            this.type.CustomAttributes.Add(attribServiceBehavior);

            // DbusServices field.
            this.DbusServiceTargetField(this.typerefDbusInterface, this.typerefDbusMarshal, this.type.Members);

            // Constructor.
            this.Constructor(this.type, this.typerefDbusInterface);

            // Target retrieval method.
            this.methodGetWCFMethodTarget = this.TargetRetrievalMethod(this.typerefDbusInterface, this.typerefDbusMarshal, this.typerefexprDbusMarshal);
            this.type.Members.Add(this.methodGetWCFMethodTarget);

            this.contextDeclarationHolder = new CodeTypeIgnoredNamespaceDeclarationHolderParams(idlIntf);
            this.declarationHolder = this.contextDeclarationHolder;
        }