Click here to Skip to main content
13,596,318 members

Welcome to the Lounge


For discussing anything related to a software developer's life. Technical discussions are encouraged, but click here to ask your programming questions.

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.
GeneralProject Progress Update Pin
Zac Greve30-Dec-12 10:06
memberZac Greve30-Dec-12 10:06 
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
    Implements IOptionPanelDescriptor

    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
            Return _id
        End Get
    End Property

    Public Property Label As String Implements IOptionPanelDescriptor.Label

    Public ReadOnly Property ChildOptionPanelDescriptors As IEnumerable(Of IOptionPanelDescriptor) Implements IOptionPanelDescriptor.ChildOptionPanelDescriptors
            Return _optionPanelDescriptors
        End Get
    End Property

    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
                    End If
                End If
                _optionPanelPath = Nothing
                _addIn = Nothing
            End If
            Return _optionPanel
        End Get
    End Property

    Public ReadOnly Property HasOptionPanel As Boolean Implements IOptionPanelDescriptor.HasOptionPanel
            Return _optionPanelPath <> Nothing
        End Get
    End Property

    Public Sub New(ByVal id As String, ByVal label As String)
        _id = id
        Me.Label = label
    End Sub

    Public Sub New(ByVal id As String, ByVal label As String, ByVal dialogPanelDescriptors As List(Of IOptionPanelDescriptor))
        Me.New(id, label)
        Me._optionPanelDescriptors = dialogPanelDescriptors
    End Sub

    Public Sub New(ByVal id As String, ByVal label As String, ByVal addIn As AddIn, ByVal owner As Object, ByVal optionPanelPath As String)
        Me.New(id, label)
        _addIn = addIn
        _owner = owner
        _optionPanelPath = optionPanelPath
    End Sub

End Class

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 Dole
The internet is a great way to get on the net.

D'Oh! | :doh: SP6a

modified 30-Dec-12 16:44pm.

GeneralRe: Project Progress Update Pin
NtonguemyA30-Dec-12 16:35
memberNtonguemyA30-Dec-12 16:35 
GeneralRe: Project Progress Update Pin
Zac Greve31-Dec-12 7:25
memberZac Greve31-Dec-12 7:25 
GeneralRe: Project Progress Update Pin
JimmyRopes30-Dec-12 19:46
memberJimmyRopes30-Dec-12 19:46 
GeneralRe: Project Progress Update Pin
Zac Greve31-Dec-12 7:21
memberZac Greve31-Dec-12 7:21 
GeneralRe: Project Progress Update Pin
Gary R. Wheeler30-Dec-12 23:47
memberGary R. Wheeler30-Dec-12 23:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Advertise | Privacy | Cookies | Terms of Service
Web04-2016 | 2.8.180621.3 | Last Updated 23 Jun 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid