Skip to content

Commit

Permalink
New release v1.1
Browse files Browse the repository at this point in the history
New release v1.1
  • Loading branch information
ElektroStudios committed May 30, 2019
1 parent 8ca5d66 commit 40e5ec5
Show file tree
Hide file tree
Showing 30 changed files with 2,905 additions and 142 deletions.
Binary file modified Preview/Easy Link File Viewer 01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Preview/Easy Link File Viewer 02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Preview/Easy Link File Viewer 03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ It is an alternative to the built-in shell-extension in **Windows** operating sy

![](Preview/Easy%20Link%20File%20Viewer%2002.png)

![](Preview/Easy%20Link%20File%20Viewer%2003.png)

### 3rd party resources:

PNG images included in this repository are from <a href="https://www.microsoft.com/en-us/download/details.aspx?id=35825" target="_blank">Visual Studio 2017 Image Library</a>.
Expand Down
3 changes: 3 additions & 0 deletions src/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
<setting name="VisualThemeIndex" serializeAs="String">
<value>0</value>
</setting>
<setting name="FontSize" serializeAs="String">
<value>10</value>
</setting>
</My.MySettings>
</userSettings>
</configuration>
127 changes: 127 additions & 0 deletions src/DevCase/FileOrFolderNameEditor.vb
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
' This source-code is freely distributed as part of "DevCase for .NET Framework".
'
' Maybe you would like to consider to buy this powerful set of libraries to support me.
' You can do loads of things with my apis for a big amount of diverse thematics.
'
' Here is a link to the purchase page:
' https://codecanyon.net/item/elektrokit-class-library-for-net/19260282
'
' Thank you.

#Region " Option Statements "

Option Strict On
Option Explicit On
Option Infer Off

#End Region

#Region " Imports "

Imports System.ComponentModel
Imports System.Drawing.Design
Imports System.IO
Imports System.Text
Imports System.Windows.Forms.Design
Imports DevCase.UserControls.Controls

#End Region

#Region " FileOrFolderNameEditor "

Namespace DevCase.Core.Design

''' ----------------------------------------------------------------------------------------------------
''' <summary>
''' Provides a user interface for selecting a file or folder name.
''' </summary>
''' ----------------------------------------------------------------------------------------------------
''' <seealso cref="UITypeEditor"/>
''' ----------------------------------------------------------------------------------------------------
Friend Class FileOrFolderNameEditor : Inherits UITypeEditor

#Region " Constructors "

''' ----------------------------------------------------------------------------------------------------
''' <summary>
''' Initializes a new instance of the <see cref="FileOrFolderNameEditor"/> class.
''' </summary>
''' ----------------------------------------------------------------------------------------------------
Public Sub New()
MyBase.New()
End Sub

#End Region

#Region " Public Methods "

''' ----------------------------------------------------------------------------------------------------
''' <summary>
''' Gets the editor style used by the <see cref="UITypeEditor.EditValue(IServiceProvider, Object)"/> method.
''' </summary>
''' ----------------------------------------------------------------------------------------------------
''' <param name="context">
''' An <see cref="ITypeDescriptorContext"/> that can be used to gain additional context information.
''' </param>
''' ----------------------------------------------------------------------------------------------------
''' <returns>
''' A <see cref="UITypeEditorEditStyle"/> value that indicates the style of editor used
''' by the <see cref="UITypeEditor.EditValue(IServiceProvider, Object)"/> method.
''' <para></para>
''' If the <see cref="UITypeEditor"/> does not support this method,
''' then <see cref="UITypeEditor.GetEditStyle"/> will return <see cref="UITypeEditorEditStyle.None"/>.
''' </returns>
''' ----------------------------------------------------------------------------------------------------
Public Overrides Function GetEditStyle(ByVal context As ITypeDescriptorContext) As UITypeEditorEditStyle
Return UITypeEditorEditStyle.Modal
End Function

''' ----------------------------------------------------------------------------------------------------
''' <summary>
''' Edits the specified object's value using the editor style indicated by the <see cref="UITypeEditor.GetEditStyle"/> method.
''' </summary>
''' ----------------------------------------------------------------------------------------------------
''' <param name="context">
''' An <see cref="ITypeDescriptorContext"/> that can be used to gain additional context information.
''' </param>
'''
''' <param name="provider">
''' An <see cref="IServiceProvider"/> that this editor can use to obtain services.
''' </param>
'''
''' <param name="value">
''' The object to edit.
''' </param>
''' ----------------------------------------------------------------------------------------------------
''' <returns>
''' The new value of the object.
''' <para></para>
''' If the value of the object has not changed, this should return the same object it was passed.
''' </returns>
''' ----------------------------------------------------------------------------------------------------
Public Overrides Function EditValue(ByVal context As ITypeDescriptorContext, ByVal provider As IServiceProvider, ByVal value As Object) As Object

Using dlg As New OpenFileOrFolderDialog() With {
.Title = "Select a file or folder...",
.AutoUpgradeEnabled = True,
.DereferenceLinks = True,
.RestoreDirectory = True,
.ShowHelp = False
}

If (dlg.ShowDialog = DialogResult.OK) Then
Return dlg.ItemName
End If
End Using

Return MyBase.EditValue(context, provider, value)

End Function

#End Region

End Class

End Namespace

#End Region
189 changes: 189 additions & 0 deletions src/DevCase/FileSizeConverter.vb
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
' This source-code is freely distributed as part of "DevCase for .NET Framework".
'
' Maybe you would like to consider to buy this powerful set of libraries to support me.
' You can do loads of things with my apis for a big amount of diverse thematics.
'
' Here is a link to the purchase page:
' https://codecanyon.net/item/elektrokit-class-library-for-net/19260282
'
' Thank you.

#Region " Usage Examples "

'<TypeConverter(GetType(FileSizeConverter))>
'<Browsable(True)>
'Public ReadOnly Property FileSize As Long = 2048 ' Bytes

'<TypeConverter(GetType(FileSizeConverter))>
'<Browsable(True)>
'Public ReadOnly Property FileSize As New Filesize(2048, SizeUnits.Byte)

#End Region

#Region " Option Statements "

Option Strict On
Option Explicit On
Option Infer Off

#End Region

#Region " Imports "

Imports System.ComponentModel
Imports System.ComponentModel.Design.Serialization
Imports System.Globalization

Imports DevCase.Core.IO

#End Region

#Region " FileSizeConverter "

Namespace DevCase.Core.Design

''' ----------------------------------------------------------------------------------------------------
''' <summary>
''' Provides a type converter to convert from a file size specified in bytes,
''' to a rounded file size string using the most approximated unit of size.
''' <para></para>
''' Conversion examples:
''' <para></para>
''' Input value -> Result string
''' <para></para>
''' 793 -> 793 Bytes
''' <para></para>
''' 1533 -> 1,49 KB
''' <para></para>
''' 2049 -> 2,00 KB
''' </summary>
''' ----------------------------------------------------------------------------------------------------
''' <example> This is a code example.
''' <code>
''' &lt;TypeConverter(GetType(FileSizeConverter))&gt;
''' &lt;Browsable(True)&gt;
''' Public ReadOnly Property FileSize As Long = 2048 ' Bytes
'''
''' &lt;TypeConverter(GetType(FileSizeConverter))&gt;
''' &lt;Browsable(True)&gt;
''' Public ReadOnly Property FileSize As New Filesize(2048, SizeUnits.Byte)
''' </code>
''' </example>
''' ----------------------------------------------------------------------------------------------------
Friend Class FileSizeConverter : Inherits TypeConverter

#Region " Constructors "

''' ----------------------------------------------------------------------------------------------------
''' <summary>
''' Initializes a new instance of the <see cref="FileSizeConverter"/> class.
''' </summary>
''' ----------------------------------------------------------------------------------------------------
Public Sub New()
MyBase.New()
End Sub

#End Region

#Region " Public Methods "

''' ----------------------------------------------------------------------------------------------------
''' <summary>
''' Determines if this converter can convert an object in the given source type to the native type of the converter.
''' </summary>
''' ----------------------------------------------------------------------------------------------------
''' <param name="context">
''' An <see cref="ITypeDescriptorContext" /> that provides a format context.
''' </param>
'''
''' <param name="sourceType">
''' A <see cref="Type" /> that represents the type from which you want to convert.
''' </param>
''' ----------------------------------------------------------------------------------------------------
''' <returns>
''' <see langword="true" /> if this converter can perform the operation; otherwise, <see langword="false" />.
''' </returns>
''' ----------------------------------------------------------------------------------------------------
Public Overrides Function CanConvertFrom(ByVal context As ITypeDescriptorContext, ByVal sourceType As Type) As Boolean

Return False

End Function

''' ----------------------------------------------------------------------------------------------------
''' <summary>
''' Returns whether this converter can convert the object to the specified type, using the specified context.
''' </summary>
''' ----------------------------------------------------------------------------------------------------
''' <param name="context">
''' An <see cref="ITypeDescriptorContext"/> that provides a format context.
''' </param>
'''
''' <param name="destinationType">
''' A <see cref="Type"/> that represents the type you want to convert to.
''' </param>
''' ----------------------------------------------------------------------------------------------------
''' <returns>
''' <see langword="True"/> if this converter can perform the conversion; otherwise, <see langword="False"/>.
''' </returns>
''' ----------------------------------------------------------------------------------------------------
Public Overloads Overrides Function CanConvertTo(ByVal context As ITypeDescriptorContext, ByVal destinationType As Type) As Boolean

If (destinationType = GetType(InstanceDescriptor)) Then
Return True
End If

Return MyBase.CanConvertTo(context, destinationType)

End Function

''' ----------------------------------------------------------------------------------------------------
''' <summary>
''' Converts the specified object to another type.
''' </summary>
''' ----------------------------------------------------------------------------------------------------
''' <param name="context">
''' An <see cref="ITypeDescriptorContext"/> that provides a format context.
''' </param>
'''
''' <param name="culture">
''' A <see cref="CultureInfo"/> that specifies the culture to represent the number.
''' </param>
'''
''' <param name="value">
''' The object to convert.
''' </param>
'''
''' <param name="destinationType">
''' The type to convert the object to.
''' </param>
''' ----------------------------------------------------------------------------------------------------
''' <returns>
''' An <see cref="Object"/> that represents the converted value.
''' </returns>
''' ----------------------------------------------------------------------------------------------------
Public Overrides Function ConvertTo(ByVal context As ITypeDescriptorContext, ByVal culture As CultureInfo, ByVal value As Object, ByVal destinationType As Type) As Object

If (destinationType Is Nothing) Then
Throw New ArgumentNullException("destinationType")
End If

If (destinationType Is GetType(String)) Then
If (TypeOf value Is Filesize) Then
Return DirectCast(value, Filesize).ToString()
End If

Return New Filesize(CType(value, Double), SizeUnits.Byte).ToString()
End If

Return MyBase.ConvertTo(context, culture, value, destinationType)

End Function

#End Region

End Class

End Namespace

#End Region
Loading

0 comments on commit 40e5ec5

Please sign in to comment.