|
-
Interface question
I have several classes implementing the same interface, let's call it "IMyData".
In the following method I want to copy the IMyData data from an object to
a new object of different type but implementing the same common interface
(IMyData).
The rest of the question is inline in the following function example:
Public Sub AddObjectToControl(ByVal Data As IMyData)
Dim MLI As New MyListItem()
Now I wan't to assign all the properties in IMyData
to CType(MLI,IMyData). Is there some better (shorter) way to do
this than assigning each property separately like this?
MLI.Property1 = Data.Property1
MLI.Property2 = Data.Property2
a.s.o.
??
Me.ListItems.Add(FItem)
End Sub
Thanks,
Micki
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks