public TypeRenamerState() { existingNames = new ExistingNames(); namespaceToNewName = new Dictionary<string, string>(StringComparer.Ordinal); createNamespaceName = new NameCreator("ns"); globalTypeNameCreator = new GlobalTypeNameCreator(existingNames); internalTypeNameCreator = new TypeNameCreator(existingNames); }
INameCreator insertTypeName(string fullName, string newName) { newName = fixName(newName); var name2 = " " + newName; INameCreator nc; if (!typeNames.TryGetValue(name2, out nc)) typeNames[name2] = nc = new NameCreator(newName + "_"); typeNames[fullName] = nc; return nc; }
public TypeNameCreator(ExistingNames existingNames) { this.existingNames = existingNames; createUnknownTypeName = createNameCreator("Type"); createEnumName = createNameCreator("Enum"); createStructName = createNameCreator("Struct"); createDelegateName = createNameCreator("Delegate"); createClassName = createNameCreator("Class"); createInterfaceName = createNameCreator("Interface"); var names = new string[] { "Exception", "EventArgs", "Attribute", "Form", "Dialog", "Control", }; foreach (var name in names) nameInfos.add(name, createNameCreator(name)); }
public NameInfo(string name, NameCreator nameCreator) { this.name = name; this.nameCreator = nameCreator; }
public void add(string name, NameCreator nameCreator) { nameInfos.Add(new NameInfo(name, nameCreator)); }
protected INameCreator addTypeName(string fullName, string newName, string prefix = "") { newName = fixName(prefix, newName); var name2 = " " + newName; NameCreator nc; if (!typeNames.TryGetValue(name2, out nc)) typeNames[name2] = nc = new NameCreator(newName + "_"); typeNames[fullName] = nc; return nc; }