The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I have objA and objB, both derived from the same class. how do i copy the contents of b into a? i don't want to do this:
objA = objB
because that sets a's reference to b. this is something that has to be very simple to do, but i'm at a loss.
thanks!
SHStefan Hoenig Syncfusion Team September 21, 2002 12:07 PM UTC
You have to write such a function yourself. If you call it for example "CopyTo" you could then do
objB.CopyTo(obja)
If on the other side you want to create a new object that is an exact copy of your object, you should provide a Clone method. See the following methods and interfaces in the SDK Class Referecne for more information: ICloneable, Clone, MemeberwiseClone.
Stefan
> I have objA and objB, both derived from the same class. how do i copy the contents of b into a? i don't want to do this:
>
> objA = objB
>
> because that sets a's reference to b. this is something that has to be very simple to do, but i'm at a loss.
>
> thanks!