Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interface ICopyable<T> where T : class
- {
- void CopyTo(T dst);
- void CopyFrom(T src);
- }
- interface IMyCopyable : ICopyable<IMyCopyable>
- {
- int MyProp { get; set; }
- }
- class MyCopyableClass : IMyCopyable
- {
- public int MyProp { get; set; }
- public void CopyFrom(IMyCopyable src)
- {
- src.CopyTo(this);
- }
- public void CopyTo(IMyCopyable dst)
- {
- dst.CopyFrom(this);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement