Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Convert the following to from VB .NET to C#

Posted on 2009-07-11
2
Medium Priority
?
192 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 41

Accepted Solution

by:
guru_sami earned 2000 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 64

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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

636 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