private void UpdateTypeReferencesInternal(FilteredTypes types, string oldName, string newName) { foreach (CodeTypeExtension ext in types) { CodeRefactoringAgent updater = new CodeRefactoringAgent(); updater.Refactor(ext, oldName, newName); } }
/// <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); } }
/// <summary> /// Creates a new instance of GeneratedCode class. /// </summary> /// <param name="codeNamespace">The <see cref="codeNamespace"/> containing the code to be wrapped.</param> /// <param name="codeLanguage">The language the code was generated for.</param> /// <param name="configuration">The configuration associated with the generated code.</param> /// <remarks> /// This class can only be initialized by CodeFactory. /// Therefore this constructor is marked as internal. /// </remarks> internal ExtendedCodeDomTree(CodeNamespace codeNamespace, CodeLanguage codeLanguage, Configuration configuration) { this.codeNamespace = codeNamespace; CodeLanguauge = codeLanguage; Configuration = configuration; ServiceContracts = new FilteredTypes(codeNamespace); ServiceTypes = new FilteredTypes(codeNamespace); ClientTypes = new FilteredTypes(codeNamespace); DataContracts = new FilteredTypes(codeNamespace); MessageContracts = new FilteredTypes(codeNamespace); UnfilteredTypes = new FilteredTypes(codeNamespace); TextFiles = new List <TextFile>(); ParseAndFilterCodeNamespace(); }
private void RunConverter(FilteredTypes collection) { // Get the initial count in the collection. int icount = collection.Count; // Do this for each type found in the filtered type collection. for (int i = 0; i < icount; i++) { CodeTypeExtension typeExtension = collection[i]; // Send the fields to members converter ConvertMembers(typeExtension.Fields); // Send the properties to the members converter. ConvertMembers(typeExtension.Properties); // Send the methods to the members converter. ConvertMembers(typeExtension.Methods); // Send the constructors to the members converter. ConvertMembers(typeExtension.Constructors); } }