Protected Private Visibility

Eazfuscator.NET

Protected Private Visibility

using System;
using System.Xml.Serialization;

// This class is used by System.Xml.Serialization.XmlSerializer.
public class Card
{
    public string ID
    {
        get;
        set;
    }

    protected virtual void Validate()
    {
    }
}

// This class is used by System.Xml.Serialization.XmlSerializer.
public class VerticalCard : Card
{
    public int Height
    {
        get;
        set;
    }

    protected override void Validate()
    {
        if (Height <= 0)
            throw new Exception("Vertical card height should be a positive number greater than zero.");
    }
}
using System;
using System.Xml.Serialization;
using System.Reflection;

// This class is used by System.Xml.Serialization.XmlSerializer.
public class Card
{
    public string ID
    {
        get;
        set;
    }

    [Obfuscation(Feature = "family and assembly visibility", Exclude = false)]
    protected virtual void Validate()
    {
    }
}

// This class is used by System.Xml.Serialization.XmlSerializer.
public class VerticalCard : Card
{
    public int Height
    {
        get;
        set;
    }

    [Obfuscation(Feature = "family and assembly visibility", Exclude = false)]
    protected override void Validate()
    {
        if (Height <= 0)
            throw new Exception("Vertical card height should be a positive number greater than zero.");
    }
}

Instructions on changing visibility to FamANDAssem level for a class member

  1. Open the source code of a class member that should have a visibility change
  2. using System;
    using System.Reflection;
    
    class YourClass
    {
        [Obfuscation(Feature = "family and assembly visibility", Exclude = false)]
        protected void YourMethod()
        {
            ...
        }
    }
    Imports System
    Imports System.Reflection
    
    Class YourClass
    
        <Obfuscation(Feature:="family and assembly visibility", Exclude:=False)> 
        Protected Sub YourMethod()
            ...
        End Sub
        
    End Class
    
[Tip] Tip
[Tip] Tip