コード例 #1
0
ファイル: CodeDecorators.cs プロジェクト: willianhy/WSCF.blue
 /// <summary>
 /// Invokes all ICodeDecorator(s) in the decorators collection.
 /// </summary>
 public void ApplyDecorations(ExtendedCodeDomTree code, CustomCodeGenerationOptions options)
 {
     foreach (ICodeDecorator decorator in decorators)
     {
         decorator.Decorate(code, options);
     }
 }
コード例 #2
0
 /// <summary>
 /// Invokes all ICodeDecorator(s) in the decorators collection.
 /// </summary>
 public void ApplyDecorations(ExtendedCodeDomTree code, CustomCodeGenerationOptions options)
 {
     foreach (ICodeDecorator decorator in decorators)
     {
         decorator.Decorate(code, options);
     }
 }
コード例 #3
0
        /// <summary>
        /// Invokes all ICodeDecorator(s) in the decorators collection.
        /// </summary>
        public void ApplyDecorations(ExtendedCodeDomTree code, CustomCodeGenerationOptions options)
        {
            //string fileName = "C:\\Users\\rs239\\Documents\\NIEM\\temp\\Decorators.txt";
            //StringWriter stringWriter = new StringWriter();

            //stringWriter.WriteLine("Namespace = " + codeNamespace.Name);

            //stringWriter.WriteLine("___________________________________________");
            //stringWriter.WriteLine(ctd.Name);

            //FileStream fs = File.Open(fileName, FileMode.Create, FileAccess.Write, FileShare.None);
            //StreamWriter writer = new StreamWriter(fs);
            //writer.Write(stringWriter);
            //writer.Flush();
            
            foreach (ICodeDecorator decorator in decorators)
            {
                IMetadata metadataDecorator = decorator as IMetadata;
                if (metadataDecorator != null)
                {
                    metadataDecorator.MetadataSet = this.metadataSet;
                }

                decorator.Decorate(code, options);
            }
        }
 public void Decorate(ExtendedCodeDomTree code, CustomCodeGenerationOptions options)
 {
     if (options.GenerateCollections)
     {
         CollectionTypeGenerator generator = new CollectionTypeGenerator(new CollectionTypeProvider(), code);
         generator.Execute();
     }
 }
コード例 #5
0
 public void Decorate(ExtendedCodeDomTree code, CustomCodeGenerationOptions options)
 {
     if (options.GenerateTypedLists)
     {
         CollectionTypeGenerator generator = new CollectionTypeGenerator(new ListTypeProvider(), code);
         generator.Execute();
     }
 }
 public InternalCodeGenerationOptions(MetadataResolverOptions metadataResolverOptions, PrimaryCodeGenerationOptions primaryOptions, CustomCodeGenerationOptions customOptions, CodeWriterOptions writerOptions, CodeGenerationOptions allOptions)
 {
     this.metadataResolverOptions = metadataResolverOptions;
     this.primaryOptions = primaryOptions;
     this.customOptions = customOptions;
     this.writerOptions = writerOptions;
     this.allOptions = allOptions;
 }
コード例 #7
0
 public InternalCodeGenerationOptions(MetadataResolverOptions metadataResolverOptions, PrimaryCodeGenerationOptions primaryOptions, CustomCodeGenerationOptions customOptions, CodeWriterOptions writerOptions, CodeGenerationOptions allOptions)
 {
     this.metadataResolverOptions = metadataResolverOptions;
     this.primaryOptions          = primaryOptions;
     this.customOptions           = customOptions;
     this.writerOptions           = writerOptions;
     this.allOptions = allOptions;
 }
コード例 #8
0
        /// <summary>
        /// Parses the code generation options specified by options parameter and returns an instance of
        /// InternalCodeGenearationOptions type.
        /// </summary>
        public static InternalCodeGenerationOptions ParseCodeGenerationOptions(CodeGenerationOptions options)
        {
            MetadataResolverOptions      resolverOptions = GetMetadataResolverOptions(options);
            PrimaryCodeGenerationOptions primaryOptions  = GetPrimaryCodeGenerationOptions(options);
            CustomCodeGenerationOptions  customOptions   = GetCustomCodeGenerationOptions(options);
            CodeWriterOptions            writerOptions   = GetCodeWriterOptions(options);

            InternalCodeGenerationOptions icgo = new InternalCodeGenerationOptions(resolverOptions, primaryOptions, customOptions, writerOptions, options);

            return(icgo);
        }
        public void Decorate(ExtendedCodeDomTree code, CustomCodeGenerationOptions options)
        {
            // Some validations to make debugging easier.
            Debug.Assert(code != null, "code parameter could not be null.");
            Debug.Assert(options != null, "options parameter could not be null.");

            // We execute this decorator only if we are generating the service side code.
            if (options.GenerateService)
            {
                // Initialize the state.
                this.code = code;
                this.options = options;
                CreateServiceType();                
            }
        }
コード例 #10
0
ファイル: PascalCaseConverter.cs プロジェクト: notes2c/WSCF
        public void Decorate(ExtendedCodeDomTree code, CustomCodeGenerationOptions options)
        {
            // Notify if we get any null references.
            Debug.Assert(code != null, "code parameter could not be null.");
            Debug.Assert(options != null, "options parameter could not be null.");

            // We apply this decorator only if this option is turned on.
            if (options.AdjustCasing)
            {
                // Initialize the state.
                this.code    = code;
                this.options = options;
                DecorateInternal();
            }
        }
        public void Decorate(ExtendedCodeDomTree code, CustomCodeGenerationOptions options)
        {
            // Notify if we get any null references.
            Debug.Assert(code != null, "code parameter could not be null.");
            Debug.Assert(options != null, "options parameter could not be null.");

            // We apply this decorator only if this option is turned on.
            if (options.AdjustCasing)
            {
                // Initialize the state.
                this.code = code;
                this.options = options;
                DecorateInternal();
            }
        }
コード例 #12
0
        public void Decorate(ExtendedCodeDomTree code, CustomCodeGenerationOptions options)
        {
            // Some validations to make debugging easier.
            Debug.Assert(code != null, "code parameter could not be null.");
            Debug.Assert(options != null, "options parameter could not be null.");

            // We execute this decorator only if we are generating the service side code.
            if (options.GenerateService)
            {
                // Initialize the state.
                this.code    = code;
                this.options = options;
                CreateServiceType();
            }
        }
コード例 #13
0
        public void Decorate(ExtendedCodeDomTree code, CustomCodeGenerationOptions options)
        {
            this.code          = code;
            this.options       = options;
            this.configuration = code.Configuration;

            // Are we on the service side code gen?
            if (options.GenerateService)
            {
                // Then generate the service side configuration.
                GenerateServiceConfiguration();

                // Do we have to enable metadata endpoint?
                if (options.EnableWsdlEndpoint)
                {
                    AddMetadataServiceBehavior();
                }
            }
        }
        // Filters the custom code generation options.
        private static CustomCodeGenerationOptions GetCustomCodeGenerationOptions(CodeGenerationOptions options)
        {
            CustomCodeGenerationOptions customOptions = new CustomCodeGenerationOptions();
        	customOptions.FormatSoapActions = options.FormatSoapActions;
            customOptions.AdjustCasing = options.AdjustCasing;
            customOptions.GenerateCollections = options.GenerateCollections;
            customOptions.GenerateService = options.GenerateService;
            customOptions.GenerateTypedLists = options.GenerateTypedLists;
            customOptions.ClrNamespace = options.ClrNamespace;
            customOptions.EnableWsdlEndpoint = options.EnableWsdlEndpoint;
        	customOptions.GenerateSvcFile = options.GenerateSvcFile;
            customOptions.MetadataLocation = options.MetadataLocation;
        	customOptions.ConcurrencyMode = options.ConcurrencyMode;
        	customOptions.InstanceContextMode = options.InstanceContextMode;
        	customOptions.UseSynchronizationContext = options.UseSynchronizationContext;
			customOptions.MethodImplementation = options.MethodImplementation;

            return customOptions;
        }
コード例 #15
0
ファイル: ConfigurationDecorator.cs プロジェクト: WSCF/WSCF
        public void Decorate(ExtendedCodeDomTree code, CustomCodeGenerationOptions options)
        {
            this.code = code;
            this.options = options;
            this.configuration = code.Configuration;

            // Are we on the service side code gen?
            if (options.GenerateService)
            {
                // Then generate the service side configuration.
                GenerateServiceConfiguration();

                // Do we have to enable metadata endpoint?
                if (options.EnableWsdlEndpoint)
                {
                    AddMetadataServiceBehavior();
                }
            }
        }
コード例 #16
0
        // Filters the custom code generation options.
        private static CustomCodeGenerationOptions GetCustomCodeGenerationOptions(CodeGenerationOptions options)
        {
            CustomCodeGenerationOptions customOptions = new CustomCodeGenerationOptions();

            customOptions.FormatSoapActions         = options.FormatSoapActions;
            customOptions.AdjustCasing              = options.AdjustCasing;
            customOptions.GenerateCollections       = options.GenerateCollections;
            customOptions.GenerateService           = options.GenerateService;
            customOptions.GenerateTypedLists        = options.GenerateTypedLists;
            customOptions.ClrNamespace              = options.ClrNamespace;
            customOptions.EnableWsdlEndpoint        = options.EnableWsdlEndpoint;
            customOptions.GenerateSvcFile           = options.GenerateSvcFile;
            customOptions.MetadataLocation          = options.MetadataLocation;
            customOptions.ConcurrencyMode           = options.ConcurrencyMode;
            customOptions.InstanceContextMode       = options.InstanceContextMode;
            customOptions.UseSynchronizationContext = options.UseSynchronizationContext;
            customOptions.MethodImplementation      = options.MethodImplementation;

            return(customOptions);
        }