Exemple #1
0
 public TypeRenamerState()
 {
     existingNames = new ExistingNames();
     namespaceToNewName = new Dictionary<string, string>(StringComparer.Ordinal);
     createNamespaceName = new NameCreator("ns");
     globalTypeNameCreator = new GlobalTypeNameCreator(existingNames);
     internalTypeNameCreator = new TypeNameCreator(existingNames);
 }
Exemple #2
0
        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;
        }
Exemple #3
0
        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));
        }
Exemple #4
0
 public NameInfo(string name, NameCreator nameCreator)
 {
     this.name = name;
     this.nameCreator = nameCreator;
 }
Exemple #5
0
 public void add(string name, NameCreator nameCreator)
 {
     nameInfos.Add(new NameInfo(name, nameCreator));
 }
Exemple #6
0
        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;
        }