Solved

Convert the following to from VB .NET to C#

Posted on 2009-07-11
2
185 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Is setting this variable making a duplicate in memory 4 31
Linq Help 1 35
Connection String 16 43
C# guarantee sql connection close 6 32
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

867 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