Solved

Convert the following to from VB .NET to C#

Posted on 2009-07-11
2
184 Views
Last Modified: 2012-05-07
I need to convert the following to C#.

Public Structure PageCrumb

   Private _level As Short
   Private _url As String
   Private _linkName As String

   //We are setting all the properties at the time of construction

   Public Sub New(ByVal level As Short, ByVal url As String,
          ByVal linkName As String)

      _level = level
      _url = url
      _linkName = linkName
   End Sub

   //We are making all the properties as read-only.
   //We are not expecting it to change once it is set.
   Public ReadOnly Property Level() As Short
   Get
      Return _level
   End Get
   End Property

   Public ReadOnly Property Url() As String
   Get
      Return _url
   End Get
   End Property

   Public ReadOnly Property LinkName() As String
   Get
      Return _linkName
   End Get
   End Property
End Structure
0
Comment
Question by:mathieu_cupryk
2 Comments
 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
ID: 24833136
Online conversion tool for reference:
http://www.developerfusion.com/tools/convert/vb-to-csharp/

There are few more you can just google.
public struct PageCrumb

{

    

    private short _level;

    private string _url;

    private string _linkName;

    

    //We are setting all the properties at the time of construction

    

    public PageCrumb(short level, string url, string linkName)

    {

        

        _level = level;

        _url = url;

        _linkName = LinkName;

    }

    

    //We are making all the properties as read-only.

    //We are not expecting it to change once it is set.

    public short Level {

        get { return _level; }

    }

    

    public string Url {

        get { return _url; }

    }

    

    public string LinkName {

        get { return _linkName; }

    }

}

Open in new window

0
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 24833161
Hi mathieu_cupryk;

Here you go.

public struct PageCrumb
{
    private short _level;
    private string _url;
    private string _linkName;

    public PageCrumb(short level, string url, string linkName)
    {
        _level = level;
        _url = url;
        _linkName = linkName;
    }

    public short Level
    {
        get { return _level; }
    }

    public string Url
    {
        get { return _url; }
    }

    public string LinkName
    {
        get { return _linkName; }
    }
}


Fernando
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now