Example #1
0
 public RenameInfo(Resource resource, TypeInfo typeInfo, string newResourceName)
 {
     this.resource        = resource;
     this.typeInfo        = typeInfo;
     this.newResourceName = newResourceName;
 }
Example #2
0
 public bool TryGetType(MTypeDef t, out TypeInfo info)
 {
     return(allTypeInfos.TryGetValue(t, out info));
 }
Example #3
0
        static bool IsCallingResourceManagerCtor(IList <Instruction> instrs, int ldstrIndex, TypeInfo typeInfo)
        {
            try {
                int index = ldstrIndex + 1;

                var ldtoken = instrs[index++];
                if (ldtoken.OpCode.Code != Code.Ldtoken)
                {
                    return(false);
                }
                if (!new SigComparer().Equals(typeInfo.Type.TypeDef, ldtoken.Operand as ITypeDefOrRef))
                {
                    return(false);
                }

                if (!CheckCalledMethod(instrs[index++], "System.Type", "(System.RuntimeTypeHandle)"))
                {
                    return(false);
                }
                if (!CheckCalledMethod(instrs[index++], "System.Reflection.Assembly", "()"))
                {
                    return(false);
                }

                var newobj = instrs[index++];
                if (newobj.OpCode.Code != Code.Newobj)
                {
                    return(false);
                }
                if (newobj.Operand.ToString() != "System.Void System.Resources.ResourceManager::.ctor(System.String,System.Reflection.Assembly)")
                {
                    return(false);
                }

                return(true);
            }
            catch (ArgumentOutOfRangeException) {
                return(false);
            }
            catch (IndexOutOfRangeException) {
                return(false);
            }
        }