예제 #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);
 }
예제 #2
0
파일: TypeNames.cs 프로젝트: ostuda/de4dot
        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;
        }
예제 #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));
        }
예제 #4
0
 public NameInfo(string name, NameCreator nameCreator)
 {
     this.name = name;
     this.nameCreator = nameCreator;
 }
예제 #5
0
 public void add(string name, NameCreator nameCreator)
 {
     nameInfos.Add(new NameInfo(name, nameCreator));
 }
예제 #6
0
파일: TypeNames.cs 프로젝트: ldh0227/de4dot
        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;
        }