Thinktecture.Tools.Web.Services.CodeGeneration.PascalCaseConverterFactory.GetPascalCaseConverter C# (CSharp) Method

GetPascalCaseConverter() public static method

public static GetPascalCaseConverter ( CodeTypeExtension typeExtension, ExtendedCodeDomTree code ) : PascalCaseConverterBase
typeExtension CodeTypeExtension
code ExtendedCodeDomTree
return PascalCaseConverterBase
        public static PascalCaseConverterBase GetPascalCaseConverter(CodeTypeExtension typeExtension, ExtendedCodeDomTree code)
        {
            switch (typeExtension.Kind)
            {
                case CodeTypeKind.DataContract:
                    return new DataContractConverter(typeExtension, code);
                case CodeTypeKind.MessageContract:
                    return new MessageContractConverter(typeExtension, code);
                case CodeTypeKind.ServiceContract:
                    return new ServiceContractConverter(typeExtension, code);
                case CodeTypeKind.ClientType:
                    return new ClientTypeConverter(typeExtension, code);
                default:
                    return null;
            }
        }

Usage Example

Esempio n. 1
0
 /// <summary>
 /// Contains the core logic of pascal case conversion.
 /// </summary>
 private void DecorateCore(FilteredTypes types)
 {
     // Perform this action for all extensions (ext) in the data contracts list.
     foreach (CodeTypeExtension typeExtension in types)
     {
         // Get the converter for this type.
         PascalCaseConverterBase converter = PascalCaseConverterFactory.GetPascalCaseConverter(typeExtension, code);
         // Execute the converter.
         string oldName;
         string newName = converter.Convert(out oldName);
         UpdateTypeReferences(oldName, newName);
     }
 }
PascalCaseConverterFactory