Click here to Skip to main content
12,634,030 members (24,255 online)
Click here to Skip to main content
Articles » Languages » C# » General » Downloads

Stats

87.4K views
889 downloads
32 bookmarked
Posted

Deep copy of objects in C#

, 18 Jul 2009 CPOL
How to do a deep copy of objects using System.Reflection.
HCloner
HCloner
bin
Debug
HCloner.dll
Properties
HClonerTest
bin
Debug
HCloner.dll
HClonerTest.dll
nunit.framework.dll
HClonerTest.csproj.user
Properties
TestObjects
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HAKGERSoft;
using NUnit.Framework;

namespace HAKGERSoft {

    [HClonerTestObject]
    public class SimpleTestObject {

        public int PubInt=5;
        private int PrivInt=3;

        public string StrProp {
            get;
            set;
        }

        private string _StrProp2="teststring";
        public string StrProp2 {
            get {
                return _StrProp2;
            }
            set {
                _StrProp2=value;
            }
        }

        public StringBuilder StrBuilder=new StringBuilder();

        public int Method(string arg) {
            return PrivInt;
        }



    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Hakger
Software Developer (Senior)
Poland Poland
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161208.2 | Last Updated 18 Jul 2009
Article Copyright 2009 by Hakger
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid