|
Home > Archive > Microsoft Content Management Server > August 2005 > C# to VB Conversion
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
C# to VB Conversion
|
|
| Mark Mahacek 2005-08-30, 8:48 pm |
| Please let me know right away if I need to go to another newsgroup for this.
We are coding our MCMS site using VB.NET, as that's what we know best. I
have a book that has some good controls in it, but their code is in C#.
I've been able to convert most of these without a problem, but I'm having
problems with the following snipet:
C# Statement
if(channelItem is Channel)
{ ... }
channelItem is the variable name, and is type ChannelItem.
I tried to convert this to the following in VB:
if channelItem is Channel then
....
end if
However it says that "Channel" is a type and cannot be used as an
expression.
I would go right to a VB or C# group, but this uses MCMS specific object
types
Thanks in advance.
--
Mark Mahacek
Merced County Office of Education
| |
| Patrik Berglund 2005-08-31, 2:51 am |
| Hi!
I'm no expert at VB.NET, but this might work for you:
If TypeOf channelItem Is Channel Then
.....
End If
A colleague of mine suggested using a converter such as
http://www.kamalpatel.net/ConvertCSharp2VB.aspx to convert c# to
VB.Net.
/Patrik
| |
| Stefan [MSFT] 2005-08-31, 7:49 am |
| Hi Mark,
see here:
http://blogs.technet.com/stefan_gos.../06/108512.aspx
Cheers,
Stefan
--
This posting is provided "AS IS" with no warranties, and confers no rights
New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------
"Mark Mahacek" <mmahacek@mcoe.org> wrote in message
news:Ozj6ZmbrFHA.2596@TK2MSFTNGP09.phx.gbl...
> Please let me know right away if I need to go to another newsgroup for
> this.
>
> We are coding our MCMS site using VB.NET, as that's what we know best. I
> have a book that has some good controls in it, but their code is in C#.
> I've been able to convert most of these without a problem, but I'm having
> problems with the following snipet:
>
> C# Statement
> if(channelItem is Channel)
> { ... }
> channelItem is the variable name, and is type ChannelItem.
>
> I tried to convert this to the following in VB:
> if channelItem is Channel then
> ...
> end if
>
> However it says that "Channel" is a type and cannot be used as an
> expression.
>
> I would go right to a VB or C# group, but this uses MCMS specific object
> types
>
> Thanks in advance.
>
> --
> Mark Mahacek
> Merced County Office of Education
>
>
>
| |
| Mark Mahacek 2005-08-31, 5:58 pm |
| To both Patrik and Stefan:
THANK YOU! THANK YOU! THANK YOU!
--
Mark Mahacek
Merced County Office of Education
"Patrik Berglund" <patrik.berglund@gmail.com> wrote in message
news:1125474676.843722.89120@g49g2000cwa.googlegroups.com...
> Hi!
>
> I'm no expert at VB.NET, but this might work for you:
>
> If TypeOf channelItem Is Channel Then
> .....
> End If
>
> A colleague of mine suggested using a converter such as
> http://www.kamalpatel.net/ConvertCSharp2VB.aspx to convert c# to
> VB.Net.
>
> /Patrik
>
|
|
|
|
|