Click here to Skip to main content
15,895,667 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralProject Progress Update Pin
Brisingr Aerowing30-Dec-12 10:06
professionalBrisingr Aerowing30-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):

VB
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
        Get
            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
        Get
            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
        Get
            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
        Get
            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: 2.0.82.7292 SP6a


modified 30-Dec-12 16:44pm.

GeneralRe: Project Progress Update Pin
NtonguemyA30-Dec-12 16:35
NtonguemyA30-Dec-12 16:35 
GeneralRe: Project Progress Update Pin
Brisingr Aerowing31-Dec-12 7:25
professionalBrisingr Aerowing31-Dec-12 7:25 
GeneralRe: Project Progress Update Pin
JimmyRopes30-Dec-12 19:46
professionalJimmyRopes30-Dec-12 19:46 
GeneralRe: Project Progress Update Pin
Brisingr Aerowing31-Dec-12 7:21
professionalBrisingr Aerowing31-Dec-12 7:21 
GeneralRe: Project Progress Update Pin
Gary R. Wheeler30-Dec-12 23:47
Gary 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.