A couple of more points. I've only tried it on a couple of VB methods, C# needs a break; for each switch/case statement, and VB's With keyword could be easily adapted to C# which has no With keyword, just repeat the object.property for everything within the With. I'm a C#er who has to work on a large VB solution and just find C# much quicker to read and write. And after a conversion it's very easy to spot anything that didn't quite convert right. All in all this extension is a god send, well done!!
-Terrible product, even worse execution. a) Even though this extension is relatively simple it is not intuitive at all. Which is fine, but if something is not intuitive it would be helpfull if you had INSTRUCTIONS. b) Since I do not have instructions on how to get stuff done, I apparently overwrote an entire project by loading in a folder. Thank Heaven I have enough experience to save off a copy of my project and to work on that instead of my mainline project. I also have my code versioned on a server so I would never lose my last check in, but what if I was working on a project. I would be hyper-pissed if I lost two hours of work just because this thing doesn't give you any pop-up boxes or any instructions on how it works or on how best to use it. My recomendation, avoid at all costs and wait for a developer who is doing something more than a college project (and getting an F on it btw) to translate your VB PROJECTS into C#. Just looked into the folder, I didn't over write but instead added. Still documentation would be very helpfull.
Conversion stops on the CoerceIsChatVisible2 function and the region is not converted on version 1.5:
Private Shared Overloads Function CoerceIsChatVisible2(ByVal sender As DependencyObject, ByVal OrigVal As Object) As Object Dim X As P2PChatControl = CType(sender, P2PChatControl) ' Put validation or user interface code in here ' The original value is returned here ' Change code below to do the coersion Dim val as Boolean val = Ctype(OrigVal, Boolean) #End Region
Some problem areas I ran into immediately when converting a file with around 1000 lines of code from VB to C#: (1) Namespace qualifiers (2) Public methods than implement and interface in VB are incorrectly converted to explicit interfaces in C#. (3) Call-by-reference in C# requires an explicit qualifier, it doesn't in VB. (4) VB default methods on an object are incorrectly converted into method calls, instead of index properties. (5) The VB Like operator. Currently this just produces an error comment. (6) Strips doc comments. (7) Typecasts. They need to be parenthesized when converting. For instance, "CInt(5 + someDouble)" should convert to "(int) (5 + someDouble)", not "(int) 5 + someDouble" -- in the latter, someDouble isn't converted and the expression is evaluated as a double. Also, VB's type coercion is more powerful than a simple typecast, but the plug-in makes no distinction. (8) The "When Not" clause in Catch statements is completely dropped in the conversion, with no comment description. This isn't caught by the compiler, and it's bad news.
I just hacked the install info so that it'll install into Visual Studio 2013. I haven't tested it yet to see if it causes any sort of incompatibility issues though.