示例#1
0
        /// <summary>
        /// This will check with some analyzers if it's possible to rename a member def { TypeDef, PropertyDef, MethodDef, EventDef, FieldDef, Parameter (NOT DEF) }.
        /// </summary>
        /// <param name="obj">The determinate to check.</param>
        /// <returns>If the determinate can be renamed.</returns>
        public static bool CanRename(object obj)
        {
            DefAnalyzer analyze;

            if (obj is MethodDef)
            {
                analyze = new MethodDefAnalyzer();
            }
            else if (obj is PropertyDef)
            {
                analyze = new PropertyDefAnalyzer();
            }
            else if (obj is EventDef)
            {
                analyze = new EventDefAnalyzer();
            }
            else if (obj is FieldDef)
            {
                analyze = new FieldDefAnalyzer();
            }
            else if (obj is Parameter)
            {
                analyze = new ParameterAnalyzer();
            }
            else
            {
                return(false);
            }
            return(analyze.Execute(obj));
        }
示例#2
0
        public static bool CanRename(object obj)
        {
            iAnalyze analyze = null;

            if (obj is TypeDef)
            {
                analyze = new TypeDefAnalyzer();
            }
            else if (obj is MethodDef)
            {
                analyze = new MethodDefAnalyzer();
            }
            else if (obj is EventDef)
            {
                analyze = new EventDefAnalyzer();
            }
            else if (obj is FieldDef)
            {
                analyze = new FieldDefAnalyzer();
            }
            if (analyze == null)
            {
                return(false);
            }
            return(analyze.Execute(obj));
        }