Ejemplo n.º 1
0
        public bool UpdateNameReference(ConfuserContext context, INameService service)
        {
            string name   = sig.ReflectionName;
            string prefix = xmlnsCtx.GetPrefix(sig.ReflectionNamespace, sig.ToBasicTypeDefOrRef().ResolveTypeDefThrow().Module.Assembly);

            if (!string.IsNullOrEmpty(prefix))
            {
                name = prefix + ":" + name;
            }

            if (propRec != null)
            {
                if (string.Equals(propRec.Value, name, StringComparison.Ordinal))
                {
                    return(false);
                }
                propRec.Value = name;
            }
            else
            {
                if (string.Equals(textRec.Value, name, StringComparison.Ordinal))
                {
                    return(false);
                }
                textRec.Value = name;
            }

            return(true);
        }
        public bool UpdateNameReference(DotProtectContext context, INameService service)
        {
            string typeName = sig.ReflectionName;
            string prefix   = xmlnsCtx.GetPrefix(sig.ReflectionNamespace, sig.ToBasicTypeDefOrRef().ResolveTypeDefThrow().Module.Assembly);

            if (!string.IsNullOrEmpty(prefix))
            {
                typeName = prefix + ":" + typeName;
            }
            rec.Value = typeName + "." + member.Name;
            return(true);
        }
Ejemplo n.º 3
0
        public bool UpdateNameReference(ConfuserContext context, INameService service)
        {
            string typeName = sig.ReflectionName;
            string prefix   = xmlnsCtx.GetPrefix(sig.ReflectionNamespace, sig.ToBasicTypeDefOrRef().ResolveTypeDefThrow().Module.Assembly);

            if (!string.IsNullOrEmpty(prefix))
            {
                typeName = prefix + ":" + typeName;
            }
            var newValue = typeName + "." + member.Name;

            if (string.Equals(rec.Value, newValue, StringComparison.Ordinal))
            {
                return(false);
            }
            rec.Value = newValue;
            return(true);
        }
Ejemplo n.º 4
0
        public bool UpdateNameReference(DotProtectContext context, INameService service)
        {
            string name   = sig.ReflectionName;
            string prefix = xmlnsCtx.GetPrefix(sig.ReflectionNamespace, sig.ToBasicTypeDefOrRef().ResolveTypeDefThrow().Module.Assembly);

            if (!string.IsNullOrEmpty(prefix))
            {
                name = prefix + ":" + name;
            }
            if (propRec != null)
            {
                propRec.Value = name;
            }
            else
            {
                textRec.Value = name;
            }
            return(true);
        }
        public bool UpdateNameReference(ConfuserContext context, INameService service)
        {
            string name   = sig.ReflectionName;
            string prefix = xmlnsCtx.GetPrefix(sig.ReflectionNamespace, sig.ToBasicTypeDefOrRef().ResolveTypeDefThrow().Module.Assembly);

            if (!string.IsNullOrEmpty(prefix))
            {
                name = prefix + ":" + name;
            }
            if (indexer != null)
            {
                indexer.Type = name;
            }
            else
            {
                attachedDP.ExtractAttachedDP(out string oldType, out string property);
                attachedDP.Name = string.Format("({0}.{1})", name, property);
            }
            return(true);
        }