Files
mRemoteNG/mRemoteV1/Connection/Connection.Icon.vb
Andreas Rehm 7a25e3cc2e Refactoring and even more translations
* removed unneeded Imports
* renamed namespace to mRemoteNG
* changed Logfile path to %USERPROFILE%\AppData\Local\mRemoteNG\mRemoteNG.log
* fixed mRemoteNG.exe.config
* added more ignores to .gitignore
2010-08-01 01:12:36 +08:00

38 lines
1.4 KiB
VB.net

Imports System.ComponentModel
Imports mRemoteNG.App.Runtime
Namespace Connection
Public Class Icon
Inherits StringConverter
Public Shared Icons As String() = New String() {}
Public Overloads Overrides Function GetStandardValues(ByVal context As System.ComponentModel.ITypeDescriptorContext) As System.ComponentModel.TypeConverter.StandardValuesCollection
Return New StandardValuesCollection(Icons)
End Function
Public Overloads Overrides Function GetStandardValuesExclusive(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
Return True
End Function
Public Overloads Overrides Function GetStandardValuesSupported(ByVal context As ITypeDescriptorContext) As Boolean
Return True
End Function
Public Shared Function FromString(ByVal IconName As String) As Drawing.Icon
Try
Dim IconPath As String = My.Application.Info.DirectoryPath & "\Icons\" & IconName & ".ico"
If IO.File.Exists(IconPath) Then
Dim nI As New Drawing.Icon(IconPath)
Return nI
End If
Catch ex As Exception
mC.AddMessage(Messages.MessageClass.ErrorMsg, "Couldn't get Icon from String" & vbNewLine & ex.Message)
End Try
Return Nothing
End Function
End Class
End Namespace