I need help please
-
Can somebody translate this vb.net code to its c# equivalent. :) Public Class ColorRange Private _high As Color = Nothing Private _low As Color = Nothing Public Property Low() As Color Get Return _low End Get Set(ByVal Value As Color) _low = Value End Set End Property Public Property High() As Color Get Return _high End Get Set(ByVal Value As Color) _high = Value End Set End Property Public Sub New() End Sub Public Sub New(ByVal low As Color, ByVal high As Color) _low = low _high = high End Sub Public Shadows Function ToString() As String Return String.Format("{0}, {1}", _low, _high) End Function End Class
-
Can somebody translate this vb.net code to its c# equivalent. :) Public Class ColorRange Private _high As Color = Nothing Private _low As Color = Nothing Public Property Low() As Color Get Return _low End Get Set(ByVal Value As Color) _low = Value End Set End Property Public Property High() As Color Get Return _high End Get Set(ByVal Value As Color) _high = Value End Set End Property Public Sub New() End Sub Public Sub New(ByVal low As Color, ByVal high As Color) _low = low _high = high End Sub Public Shadows Function ToString() As String Return String.Format("{0}, {1}", _low, _high) End Function End Class
-
Can somebody translate this vb.net code to its c# equivalent. :) Public Class ColorRange Private _high As Color = Nothing Private _low As Color = Nothing Public Property Low() As Color Get Return _low End Get Set(ByVal Value As Color) _low = Value End Set End Property Public Property High() As Color Get Return _high End Get Set(ByVal Value As Color) _high = Value End Set End Property Public Sub New() End Sub Public Sub New(ByVal low As Color, ByVal high As Color) _low = low _high = high End Sub Public Shadows Function ToString() As String Return String.Format("{0}, {1}", _low, _high) End Function End Class
I've never worked with VB.NET but after a quick glance at the code I think I could easily translate this within a few minutes. So why don't you feel able to do this? Don't be that lazy!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
-
Can somebody translate this vb.net code to its c# equivalent. :) Public Class ColorRange Private _high As Color = Nothing Private _low As Color = Nothing Public Property Low() As Color Get Return _low End Get Set(ByVal Value As Color) _low = Value End Set End Property Public Property High() As Color Get Return _high End Get Set(ByVal Value As Color) _high = Value End Set End Property Public Sub New() End Sub Public Sub New(ByVal low As Color, ByVal high As Color) _low = low _high = high End Sub Public Shadows Function ToString() As String Return String.Format("{0}, {1}", _low, _high) End Function End Class
public class ColorRange { private Color _high = Color.Empty; private Color _low = Color.Empty; public Color Low { get { return low; } set { _low = value; } } public Color High { get { return high; } set { _high = value; } } public void New() { // } public void New(Color low, Color high) { _low = low; _high = high; } public override string ToString() { return String.Formt("{0},{1}",_low,_high); } }
By the way I don't even know VB but figured the C# code out easily. So you could do it. Don't be lazy and give a try next time ;).:: Something is Wrong ::.
-
Hi, check this link. its really usefull. http://www.developerfusion.co.uk/utilities/convertcsharptovb.aspx[^] Hope This Works For You. Nitin...
That converter is based on a several years old version of the SharpDevelop converter. It doesn't even preserve comments when converting. The new version of the SharpDevelop converter is at http://developer.sharpdevelop.net/codeconvert.net/Convert.aspx[^]
-
public class ColorRange { private Color _high = Color.Empty; private Color _low = Color.Empty; public Color Low { get { return low; } set { _low = value; } } public Color High { get { return high; } set { _high = value; } } public void New() { // } public void New(Color low, Color high) { _low = low; _high = high; } public override string ToString() { return String.Formt("{0},{1}",_low,_high); } }
By the way I don't even know VB but figured the C# code out easily. So you could do it. Don't be lazy and give a try next time ;).:: Something is Wrong ::.
thanks guys. I just started using c# from vb6. I have tried to convert it already. i just want to double check it if what i have done was right :) thanks :)