├── _config.yml
├── image
└── logo1.jpg
├── article
├── README.md
└── DesignDraft.md
├── src
└── DeepClone
│ ├── Extension
│ └── TypeExtension.cs
│ ├── Model
│ ├── ICloneTemplate.cs
│ └── NeedCtorAttribute.cs
│ ├── Builder
│ ├── ObjectCloneBuilder.cs
│ └── CloneBuilder.cs
│ ├── Template
│ ├── CloneTemplate.cs
│ ├── List
│ │ └── CloneListTemplate.cs
│ ├── Dictionary
│ │ └── CloneDictTemplate.cs
│ ├── Class
│ │ ├── CtorTempalte.cs
│ │ └── CloneClassTemplate.cs
│ └── Array
│ │ └── CloneArrayTemplate.cs
│ ├── DeepClone.csproj
│ ├── CloneOperator.cs
│ └── ObjectCloneOperator.cs
├── Directory.Build.props
├── test
└── DeepCloneUT
│ ├── Prepare.cs
│ ├── OnceType
│ └── Enums.cs
│ ├── Model
│ ├── ReverserTestModel.cs
│ ├── OopTestModel.cs
│ ├── RemoteTestModel.cs
│ ├── StaticTestModel.cs
│ ├── ProxyStandard.cs
│ └── CloneTestModel.cs
│ ├── DeepCloneUT.csproj
│ ├── DictionaryTest.cs
│ ├── ObjectTest.cs
│ ├── EqualityComparer
│ ├── MemberArrayEqualityComparer.cs
│ ├── ListArrayEqualityComparer.cs
│ └── DictArrayEqualityComparer.cs
│ ├── TestFromMoney.cs
│ ├── ListTest.cs
│ ├── ComplexType
│ └── Member.cs
│ ├── SubclassTest.cs
│ ├── ClassTest.cs
│ ├── Mocker.cs
│ ├── NatashaUtTest.cs
│ └── ArrayTest.cs
├── samples
└── DeepCloneSelfTest
│ ├── DeepCloneSelfTest.csproj
│ ├── Test.cs
│ ├── Program.cs
│ └── Model
│ └── Member.cs
├── .travis.yml
├── LICENSE
├── appveyor.yml
├── .github
└── workflows
│ └── dotnetcore.yml
├── azure-pipelines.yml
├── DeepClone.sln
├── README.md
└── .gitignore
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-minimal
--------------------------------------------------------------------------------
/image/logo1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/night-moon-studio/DeepClone/HEAD/image/logo1.jpg
--------------------------------------------------------------------------------
/article/README.md:
--------------------------------------------------------------------------------
1 | # DeepClone 系列文章
2 |
3 | ## [设计草稿](https://github.com/night-moon-studio/DeepClone/blob/master/article/DesignDraft.md)
4 |
--------------------------------------------------------------------------------
/src/DeepClone/Extension/TypeExtension.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace DeepClone.Extension
6 | {
7 | public class TypeExtension
8 | {
9 |
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/DeepClone/Model/ICloneTemplate.cs:
--------------------------------------------------------------------------------
1 | using Natasha;
2 | using System;
3 |
4 | namespace DeepClone.Model
5 | {
6 | public interface ICloneTemplate
7 | {
8 |
9 | Delegate TypeRouter(NBuildInfo info);
10 |
11 | bool MatchType(Type type);
12 |
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Directory.Build.props:
--------------------------------------------------------------------------------
1 |
2 |
3 | copyright © .NET Core Community
4 | DeepClone
5 | .NET Core Community
6 | All Members
7 | All Members
8 |
9 |
--------------------------------------------------------------------------------
/test/DeepCloneUT/Prepare.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace DeepCloneUT
6 | {
7 | public class Prepare
8 | {
9 | static Prepare()
10 | {
11 | NatashaInitializer.InitializeAndPreheating();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/DeepClone/Model/NeedCtorAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace DeepClone
4 | {
5 |
6 | public class NeedCtorAttribute:Attribute
7 | {
8 | public string Name;
9 | public NeedCtorAttribute()
10 | {
11 |
12 | }
13 | public NeedCtorAttribute(string name)
14 | {
15 | Name = name;
16 | }
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/test/DeepCloneUT/OnceType/Enums.cs:
--------------------------------------------------------------------------------
1 | namespace DeepCloneUT
2 | {
3 | ///
4 | /// Gender Enum
5 | ///
6 | public enum GenderEnum
7 | {
8 | Secrecy = 0,
9 | Male,
10 | Female
11 | }
12 |
13 | ///
14 | /// Member Type
15 | ///
16 | public enum MemberType
17 | {
18 | Student = 0,
19 | Teacher
20 | }
21 | }
--------------------------------------------------------------------------------
/samples/DeepCloneSelfTest/DeepCloneSelfTest.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp2.2
6 | true
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/samples/DeepCloneSelfTest/Test.cs:
--------------------------------------------------------------------------------
1 | using Natasha;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace DeepCloneSelfTest
7 | {
8 | public class Test
9 | {
10 | public string Name;
11 | public string Age
12 | {
13 | get;
14 | }
15 |
16 | public void Clone()
17 | {
18 |
19 |
20 |
21 |
22 |
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/test/DeepCloneUT/Model/ReverserTestModel.cs:
--------------------------------------------------------------------------------
1 | namespace NatashaUT.Model
2 | {
3 | public class ReverserTestModel
4 | {
5 | public void Test1(in Rsm rsm) { }
6 | public void Test2(out Rsm[]> rsm) { rsm = new Rsm[]>(); }
7 | public void Test3(ref Rsm[]>[] rsm) { }
8 | }
9 |
10 | public class Rsm {
11 |
12 | }
13 |
14 | public class GRsm
15 | {
16 |
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/test/DeepCloneUT/Model/OopTestModel.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace NatashaUT.Model
4 | {
5 | class OopTestModel
6 | {
7 |
8 | public void ReWrite1()
9 | {
10 |
11 | }
12 | public async Task ReWrite2()
13 | {
14 | return this;
15 | }
16 |
17 | public virtual void ReWrite3(ref int i, string temp)
18 | {
19 |
20 | }
21 |
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/DeepClone/Builder/ObjectCloneBuilder.cs:
--------------------------------------------------------------------------------
1 | using Natasha;
2 | using Natasha.CSharp;
3 | using System;
4 |
5 | namespace DeepClone.Builder
6 | {
7 |
8 | public static class ObjectCloneBuilder
9 | {
10 |
11 | public static Func