Пример #1
0
        void Analyze(NameService service, ConfuserContext context, ProtectionParameters parameters, PropertyDef property)
        {
            if (IsVisibleOutside(context, parameters, property.DeclaringType) &&
                (property.IsFamily() || property.IsFamilyOrAssembly() || property.IsPublic()) &&
                IsVisibleOutside(context, parameters, property))
            {
                service.SetCanRename(property, false);
            }

            else if (property.IsRuntimeSpecialName)
            {
                service.SetCanRename(property, false);
            }

            else if (parameters.GetParameter(context, property, "forceRen", false))
            {
                return;
            }

            else if (property.DeclaringType.Implements("System.ComponentModel.INotifyPropertyChanged"))
            {
                service.SetCanRename(property, false);
            }

            else if (property.DeclaringType.Name.String.Contains("AnonymousType"))
            {
                service.SetCanRename(property, false);
            }
        }
Пример #2
0
        void Analyze(NameService service, ConfuserContext context, ProtectionParameters parameters, PropertyDef property)
        {
            bool setRename = service.CanRename(property.SetMethod);
            bool getRename = service.CanRename(property.GetMethod);

            if ((!setRename || !getRename) &&
                parameters.GetParameter(context, property, "dontRenImpls", false))
            {
                service.SetCanRename(property, false);
            }

            else if (IsVisibleOutside(context, parameters, property.DeclaringType) &&
                     property.IsPublic() &&
                     IsVisibleOutside(context, parameters, property))
            {
                service.SetCanRename(property, false);
            }

            else if (property.IsRuntimeSpecialName)
            {
                service.SetCanRename(property, false);
            }

            else if (parameters.GetParameter(context, property, "forceRen", false))
            {
                return;
            }

            else if (property.DeclaringType.Implements("System.ComponentModel.INotifyPropertyChanged"))
            {
                service.SetCanRename(property, false);
            }

            else if (property.DeclaringType.Name.String.Contains("AnonymousType"))
            {
                service.SetCanRename(property, false);
            }
        }