public ServiceContractGenerator(CodeCompileUnit targetCompileUnit, Configuration targetConfig)
        {
            this.compileUnit      = targetCompileUnit ?? new CodeCompileUnit();
            this.namespaceManager = new NamespaceHelper(this.compileUnit.Namespaces);

            AddReferencedAssembly(typeof(ServiceContractGenerator).Assembly);
            this.configuration = targetConfig;
            if (targetConfig != null)
            {
                this.configWriter = new ConfigWriter(targetConfig);
            }
            this.generatedTypes      = new Dictionary <ContractDescription, ServiceContractGenerationContext>();
            this.generatedOperations = new Dictionary <OperationDescription, OperationContractGenerationContext>();
            this.referencedTypes     = new Dictionary <ContractDescription, Type>();
        }
示例#2
0
 public ServiceContractGenerator(CodeCompileUnit targetCompileUnit, System.Configuration.Configuration targetConfig)
 {
     this.options          = new OptionsHelper(ServiceContractGenerationOptions.ClientClass | ServiceContractGenerationOptions.ChannelInterface);
     this.errors           = new Collection <MetadataConversionError>();
     this.compileUnit      = targetCompileUnit ?? new CodeCompileUnit();
     this.namespaceManager = new NamespaceHelper(this.compileUnit.Namespaces);
     this.AddReferencedAssembly(typeof(ServiceContractGenerator).Assembly);
     this.configuration = targetConfig;
     if (targetConfig != null)
     {
         this.configWriter = new ConfigWriter(targetConfig);
     }
     this.generatedTypes      = new Dictionary <ContractDescription, ServiceContractGenerationContext>();
     this.generatedOperations = new Dictionary <OperationDescription, OperationContractGenerationContext>();
     this.referencedTypes     = new Dictionary <ContractDescription, System.Type>();
 }