Example #1
0
        public void Analyze(IDnlibDef def)
        {
            if (analyze == null)
            {
                analyze = context.Pipeline.FindPhase <AnalyzePhase>();
            }

            SetOriginalName(def, def.Name);
            if (def is TypeDef)
            {
                GetVTables().GetVTable((TypeDef)def);
                SetOriginalNamespace(def, ((TypeDef)def).Namespace);
            }
            analyze.Analyze(this, context, ProtectionParameters.Empty, def, true);
        }
Example #2
0
        public bool CanRename(object obj)
        {
            if (obj is IDnlibDef)
            {
                if (analyze == null)
                {
                    analyze = context.Pipeline.FindPhase <AnalyzePhase>();
                }

                var prot = (NameProtection)analyze.Parent;
                ProtectionSettings parameters = ProtectionParameters.GetParameters(context, (IDnlibDef)obj);
                if (parameters == null || !parameters.ContainsKey(prot))
                {
                    return(false);
                }
                return(context.Annotations.Get(obj, CanRenameKey, true));
            }
            return(false);
        }