Welcome to the Lounge
The Lounge is rated PG. If you're about to post something you wouldn't want your
kid sister to read then don't post it. No flame wars, no abusive conduct, no programming
questions and please don't post ads.
|Well, I am still working on the Windows 7 version of my Rich Text Editor project, and still have a lot more work to do.
I am completely redesigning the API, and adding a lot of new functionality, such as the ability for AddIns to add new toolbar themes.
The Windows 7 Task Dialogs and Open/Save file dialogs have been implemented with some difficultly, explained in my 'The Windows API Code Pack' message below.
As this is mostly a straight port from the original VB version into C#, I was using some online code converters to cut down on the amount of typing. All of the converters I have tried use NRefactory, and it seems that NRefactory cannot handle inline functions in VB. All I could get is an 'Invalid Expression' error.
EDIT: NRefactory cannot convert the following class (Where in bold):
Public Class DefaultOptionPanelDescriptor
Private _id As String = String.Empty
Private _optionPanelDescriptors As List(Of IOptionPanelDescriptor) = Nothing
Private _optionPanel As IOptionPanel = Nothing
Public ReadOnly Property ID As String Implements IOptionPanelDescriptor.ID
Public Property Label As String Implements IOptionPanelDescriptor.Label
Public ReadOnly Property ChildOptionPanelDescriptors As IEnumerable(Of IOptionPanelDescriptor) Implements IOptionPanelDescriptor.ChildOptionPanelDescriptors
Private _addIn As AddIn
Private _owner As Object
Private _optionPanelPath As String
Public ReadOnly Property OptionPanel As IOptionPanel Implements IOptionPanelDescriptor.OptionPanel
If _optionPanelPath <> Nothing Then
If _optionPanel Is Nothing Then
_optionPanel = CType(_addIn.CreateObject(_optionPanelPath), IOptionPanel)
If _optionPanel IsNot Nothing Then
_optionPanel.Owner = _owner
_optionPanelPath = Nothing
_addIn = Nothing
Public ReadOnly Property HasOptionPanel As Boolean Implements IOptionPanelDescriptor.HasOptionPanel
Return _optionPanelPath <> Nothing
Public Sub New(ByVal id As String, ByVal label As String)
_id = id
Me.Label = label
Public Sub New(ByVal id As String, ByVal label As String, ByVal dialogPanelDescriptors As List(Of IOptionPanelDescriptor))
Me._optionPanelDescriptors = dialogPanelDescriptors
Public Sub New(ByVal id As String, ByVal label As String, ByVal addIn As AddIn, ByVal owner As Object, ByVal optionPanelPath As String)
_addIn = addIn
_owner = owner
_optionPanelPath = optionPanelPath
NRefactory Said:CONVERSION ERROR: Code could not be converted. Details:
-- line 16 col 12: "Get" expected
Please check for any errors in the original code and try again.
So it wants
Public Get ReadOnly.....
EDIT2: The error occurred because of the Auto-Implemented property above the error line.
Stupid error message.
I think it will be faster to rewrite it by hand!
On a side note, it seems Visual Studio 2012 tries to run code after importing it from another project. I found this out when I imported a control from one project that used a static property from another class to create a full path, and VS gave me a 'Path Cannot Be Null' error on that line, and crashed the designer. When I switched that line to use another property that gave the same path (the first property was initialized with the value of the second [the first property is in a port of the ICSharpCode.Core PropertyService class]), the designer worked fine. VS2010 did the same thing, so I think it is a goof in the Intellisense parser system.
Bob DoleThe internet is a great way to get on the net.
modified 30-Dec-12 16:44pm.
General News Suggestion Question Bug Answer Joke Praise Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.