I am using BinaryFormatter to serialize a class and its variables by condition. For example:
[Serializable]
public class Class1
{
private Class2 B;
...
}
[S
I wrote a rather simple but extensible framework to solve this sort of problem using bindings. Not sure I completely understand but this is possible:
public class Class1
{
[Ignore]
public bool IsRemoting { get; set; }
[SerializeWhen("IsRemoting", true)]
public Class2 B;
}
http://binaryserializer.codeplex.com