|
-
Feb 2nd, 2007, 05:03 AM
#1
Thread Starter
Fanatic Member
Need help converting from c# to .net???
Last edited by Kimmy4; Feb 2nd, 2007 at 05:10 AM.
If your problem has been solved then please mark the thread [RESOLVED].
If i have helped then please Rate my post 
-
Feb 2nd, 2007, 05:10 AM
#2
Re: Need help converting from c# to .net???
That is a property declaration for a property named Slaves that is a generic List of ViewPort3D objects. The getter tests the _slaves variable to see if it is a null reference and, if it is, creates a new List. It then returns the _slaves variable. The setter simply assigns the new value to the _slaves variable. Now that you know what the code does you can write your own VB code. It's pretty standard stuff for a property declaration.
Having said that, it is rather abnormal to have a setter for a collection property. You would normally make a property like that read-only.
-
Feb 2nd, 2007, 05:19 AM
#3
Thread Starter
Fanatic Member
Re: Need help converting from c# to .net???
Oh....i didn't realise it was a property declaration.
Thanks for your help, i should be able to convert it from here.
Thanks again. 
If your problem has been solved then please mark the thread [RESOLVED].
If i have helped then please Rate my post 
-
Feb 2nd, 2007, 10:17 AM
#4
Re: Need help converting from c# to .net???
The reason you get garbage back from the online converters is that they (still) don't handle generics. Try using the trial/demo version of any commercial C# to VB converter instead.
The equivalent VB code is:
VB Code:
Private Private _slaves As List(Of Viewport3D)
Public Property Slaves() As List(Of Viewport3D)
Get
If _slaves Is Nothing Then
_slaves = New List(Of Viewport3D)()
End If
Return _slaves
End Get
Set
_slaves = Value
End Set
End Property
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
|
Click Here to Expand Forum to Full Width
|