-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#10 Support for Dictionary, List and HashSet derivations
- Loading branch information
1 parent
4ad84af
commit b3e3059
Showing
12 changed files
with
236 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System.Collections.Generic; | ||
using DeepCopy; | ||
|
||
namespace AssemblyToProcess | ||
{ | ||
[AddDeepCopyConstructor] | ||
public class DictionaryClass : Dictionary<string, SomeObject> | ||
{ | ||
public SomeObject SomeProperty { get; set; } | ||
} | ||
|
||
[AddDeepCopyConstructor] | ||
public class ListClass : List<SomeObject> | ||
{ | ||
public SomeObject SomeProperty { get; set; } | ||
} | ||
|
||
[AddDeepCopyConstructor] | ||
public class SetClass : HashSet<SomeObject> | ||
{ | ||
public SomeObject SomeProperty { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Fody; | ||
using Mono.Cecil; | ||
|
||
namespace DeepCopy.Fody | ||
{ | ||
public class NotSupportedException : DeepCopyException | ||
{ | ||
public NotSupportedException(MemberReference type) | ||
: base($"{type.FullName} is not supported") { } | ||
} | ||
|
||
public class NoCopyConstructorFoundException : DeepCopyException | ||
{ | ||
public NoCopyConstructorFoundException(MemberReference type) | ||
: base($"No copy constructor for {type.FullName} found") { } | ||
} | ||
|
||
public abstract class DeepCopyException : WeavingException | ||
{ | ||
protected DeepCopyException(string message) : base(message) { } | ||
|
||
public MemberReference ProcessingType { private get; set; } | ||
|
||
public override string Message => (ProcessingType == null ? "" : $"{ProcessingType.FullName} -> ") + base.Message; | ||
} | ||
} |
Oops, something went wrong.