public bool ShouldSkip(PropertyKey prop, InheritMap map, bool keepPublicApi, bool hidePrivateApi, bool markedOnly, out string message) { if (prop.Property.IsRuntimeSpecialName) { message = "runtime special name"; return true; } var attribute = prop.Property.MarkedToRename (); if (attribute != null) { message = "attribute"; return !attribute.Value; } var parent = prop.DeclaringType.MarkedToRename (); if (parent != null) { message = "type attribute"; return !parent.Value; } if (markedOnly) { message = "MarkedOnly option in configuration"; return true; } if (ShouldForce (prop.TypeKey, TypeAffectFlags.AffectProperty, map)) { message = "type rule in configuration"; return false; } if (forceProperties.IsMatch (prop, map)) { message = "property rule in configuration"; return false; } if (ShouldSkip (prop.TypeKey, TypeAffectFlags.AffectProperty, map)) { message = "type rule in configuration"; return true; } if (skipProperties.IsMatch (prop, map)) { message = "property rule in configuration"; return true; } if (prop.DeclaringType.IsTypePublic () && prop.Property.IsPublic ()) { message = "KeepPublicApi option in configuration"; return keepPublicApi; } message = "HidePrivateApi option in configuration"; return !hidePrivateApi; }
private void DumpProperty( TextWriter writer, PropertyKey key, ObfuscatedThing info ) { if ( info.Status == ObfuscationStatus.Renamed ) writer.WriteLine( "\t{0} {1} -> {2}", key.Type, info.Name, info.StatusText ); else { Debug.Assert( info.Status == ObfuscationStatus.Skipped, "Status is expected to be either Renamed or Skipped." ); writer.WriteLine( "\t{0} {1} skipped: {2}", key.Type, info.Name, info.StatusText ); } }
private void DumpProperty( XmlWriter writer, PropertyKey key, ObfuscatedThing info ) { if (info.Status == ObfuscationStatus.Renamed) { writer.WriteStartElement("renamedProperty"); writer.WriteAttributeString("oldName", info.Name); writer.WriteAttributeString("newName", info.StatusText); writer.WriteEndElement(); writer.WriteString("\r\n"); } else { writer.WriteStartElement("skippedProperty"); writer.WriteAttributeString("name", info.Name); writer.WriteAttributeString("reason", info.StatusText); writer.WriteEndElement(); writer.WriteString("\r\n"); } }
public ObfuscatedThing GetProperty(PropertyKey key) { ObfuscatedClass c = GetClass(key.TypeKey); ObfuscatedThing t; if (!c.Properties.TryGetValue(key, out t)) { t = new ObfuscatedThing(key.ToString()); c.Properties[key] = t; } return t; }
public void UpdateProperty(PropertyKey key, ObfuscationStatus status, string text) { ObfuscatedThing m = GetProperty(key); m.Update(status, text); }
public bool ShouldSkip(PropertyKey prop, InheritMap map) { if (ShouldSkip(prop.TypeKey, TypeSkipFlags.SkipProperty, map)) return true; return skipProperties.IsMatch(prop, map); }
public bool ShouldSkip(PropertyKey prop, InheritMap map, bool keepPublicApi, bool hidePrivateApi, bool markedOnly, out string message) { if (prop.Property.IsRuntimeSpecialName) { message = "runtime special name"; return(true); } var attribute = prop.Property.MarkedToRename(); if (attribute != null) { message = "attribute"; return(!attribute.Value); } var parent = prop.DeclaringType.MarkedToRename(); if (parent != null) { message = "type attribute"; return(!parent.Value); } if (markedOnly) { message = "MarkedOnly option in configuration"; return(true); } if (ShouldForce(prop.TypeKey, TypeAffectFlags.AffectProperty, map)) { message = "type rule in configuration"; return(false); } if (forceProperties.IsMatch(prop, map)) { message = "property rule in configuration"; return(false); } if (ShouldSkip(prop.TypeKey, TypeAffectFlags.AffectProperty, map)) { message = "type rule in configuration"; return(true); } if (skipProperties.IsMatch(prop, map)) { message = "property rule in configuration"; return(true); } if (prop.DeclaringType.IsTypePublic() && prop.Property.IsPublic()) { message = "KeepPublicApi option in configuration"; return(keepPublicApi); } message = "HidePrivateApi option in configuration"; return(!hidePrivateApi); }
public PropertyGroup GetPropertyGroup(PropertyKey propertyKey) { return(propertyGroups.ContainsKey(propertyKey) ? propertyGroups[propertyKey] : null); }
internal bool ShouldSkip(PropertyKey prop) { if (ShouldSkip(prop.TypeKey, TypeSkipFlags.SkipProperty)) return true; return skipProperties.IsMatch( prop ); }