Telerik® JustDecompile™ by Progress

This class provides a push notification to all of the clients subscribers, when programming language has been changed in JustDecompile.

Event base notification is dispatched to all of the subscribers.

Syntax:

CopyC#
public class SelectedLanguageChangedEvent : CompositePresentationEvent<ILanguage>
{
}

public interface ILanguage
{
   Languages SelectedLanguage { get; }
}

public enum Languages
{
   VisualBasic,
   CSharp,
   MSIL
}
CopyVB.NET
 Public Class SelectedLanguageChangedEvent
      Inherits CompositePresentationEvent(Of ILanguage)
 End Class

 Public Interface ILanguage
    ReadOnly Property SelectedLanguage() As Languages
 End Interface

 Public Enum Languages
    VisualBasic
    CSharp
    MSIL
End Enum

Example:

You can subscribe to this event using the following code:

CopyC#
public void OnImportsSatisfied()
{
   this.eventAggregator.GetEvent<SelectedLanguageChangedEvent>().Subscribe(OnLanguageChanged);
}

private void OnLanguageChanged(ILanguage language)
{
    switch (language.SelectedLanguage)
    {
        case Languages.VisualBasic:
           break;

        case Languages.CSharp:
           break;

        case Languages.MSIL:
           break;

        default:
           break;
    }
}
CopyVB.NET
Public Sub OnImportsSatisfied()
   Me.eventAggregator.GetEvent(Of SelectedLanguageChangedEvent)().Subscribe(New Action(Of ITreeViewItem)(AddressOf OnLanguageChanged))
End Sub

Private Sub OnLanguageChanged(language As ILanguage)
    Select Case language.SelectedLanguage
        Case Languages.VisualBasic
           Exit Select

        Case Languages.CSharp
           Exit Select

        Case Languages.MSIL
           Exit Select

        Case Else
        Exit Select
    End Select
End Sub

An ILanguage instance is provided by JustDecompile to all of the event subscribers. It contains the currently selected programming language in the application.