Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Verification on cloning
Message
De
09/12/2014 11:56:58
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Verification on cloning
Versions des environnements
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01612064
Message ID:
01612064
Vues:
88
I would like to verify something on cloning. I have a data provider class which includes this:
Public Class Data
    Implements ICloneable

    Public Function Clone() As Object Implements System.ICloneable.Clone
        Return MyBase.MemberwiseClone()
    End Function
Then, from a client class, I can do this:
    Public oData As Data = New Data(oProcess)
    Public oDataExcel As Data = New Data(oProcess)

            ' Keep a reference to it as we will need to switch it back after the export
            oDataExcel = oData.Clone
This works. However, I just found out that this works only for the cloning of members and not the data itself. For example, in this case, I have a dataset attached to it such as oData.oDataSet. In that case, the data, if changed after the cloning has been done, will not be preserved.

I believe something has to be changed at the Data class level in the Clone() method.

Anyone would know what has to be done in order to assure to everything under the Data class would be cloned properly?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform