Advertisement
Guest User

Untitled

a guest
Jun 15th, 2017
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 7.56 KB | None | 0 0
  1. ' ***********************************************************************
  2. ' Author   : Elektro
  3. ' Modified : 25-June-2016
  4. ' ***********************************************************************
  5.  
  6. #Region " Option Statements "
  7.  
  8. Option Strict On
  9. Option Explicit On
  10. Option Infer Off
  11.  
  12. #End Region
  13.  
  14. #Region " Imports "
  15.  
  16. Imports System.ComponentModel
  17.  
  18. #End Region
  19.  
  20. #Region " Aesthetic Object "
  21.  
  22. Namespace Types
  23.  
  24.     ''' ----------------------------------------------------------------------------------------------------
  25.     ''' <summary>
  26.     ''' This is a class to consume for aesthetic purposes.
  27.     ''' <para></para>
  28.     ''' A default (emptyness) class that inherits from <see cref="Object"/>, with these base members hidden:
  29.     ''' <para></para>
  30.     ''' <see cref="System.Object.GetHashCode"/>, <see cref="System.Object.GetType"/>,
  31.     ''' <see cref="System.Object.Equals(Object)"/>, <see cref="System.Object.Equals(Object, Object)"/>,
  32.     ''' <see cref="System.Object.ReferenceEquals(Object, Object)"/>, <see cref="System.Object.ToString()"/>.
  33.     ''' </summary>
  34.     ''' ----------------------------------------------------------------------------------------------------
  35.     Public MustInherit Class AestheticObject : Inherits Object
  36.  
  37. #Region " Hidden Base Members (of Object) "
  38.  
  39.         ''' ----------------------------------------------------------------------------------------------------
  40.         ''' <summary>
  41.         ''' Serves as a hash function for a particular type.
  42.         ''' </summary>
  43.         ''' ----------------------------------------------------------------------------------------------------
  44.         ''' <returns>
  45.         ''' A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
  46.         ''' </returns>
  47.         ''' ----------------------------------------------------------------------------------------------------
  48.         <EditorBrowsable(EditorBrowsableState.Never)>
  49.         <DebuggerNonUserCode>
  50.         Public Overridable Shadows Function GetHashCode() As Integer
  51.             Return MyBase.GetHashCode()
  52.         End Function
  53.  
  54.         ''' ----------------------------------------------------------------------------------------------------
  55.         ''' <summary>
  56.         ''' Gets the <see cref="Type"/> of the current instance.
  57.         ''' </summary>
  58.         ''' ----------------------------------------------------------------------------------------------------
  59.         ''' <returns>
  60.         ''' The exact runtime type of the current instance.
  61.         ''' </returns>
  62.         ''' ----------------------------------------------------------------------------------------------------
  63.         <EditorBrowsable(EditorBrowsableState.Never)>
  64.         <DebuggerNonUserCode>
  65.         Public Overridable Shadows Function [GetType]() As Type
  66.             Return MyBase.GetType()
  67.         End Function
  68.  
  69.         ''' ----------------------------------------------------------------------------------------------------
  70.         ''' <summary>
  71.         ''' Determines whether the specified <see cref="Object"/> is equal to this instance.
  72.         ''' </summary>
  73.         ''' ----------------------------------------------------------------------------------------------------
  74.         ''' <param name="obj">
  75.         ''' Another object to compare to.
  76.         ''' </param>
  77.         ''' ----------------------------------------------------------------------------------------------------
  78.         ''' <returns>
  79.         ''' <see langword="True"/> if the specified <see cref="Object"/> is equal to this instance;
  80.         ''' otherwise, <see langword="False"/>.
  81.         ''' </returns>
  82.         ''' ----------------------------------------------------------------------------------------------------
  83.         <EditorBrowsable(EditorBrowsableState.Never)>
  84.         <DebuggerNonUserCode>
  85.         Public Overridable Shadows Function Equals(ByVal obj As Object) As Boolean
  86.             Return MyBase.Equals(obj)
  87.         End Function
  88.  
  89.         ''' ----------------------------------------------------------------------------------------------------
  90.         ''' <summary>
  91.         ''' Determines whether the specified <see cref="Object"/> instances are considered equal.
  92.         ''' </summary>
  93.         ''' ----------------------------------------------------------------------------------------------------
  94.         ''' <param name="objA">
  95.         ''' The first object to compare.
  96.         ''' </param>
  97.         '''
  98.         ''' <param name="objB">
  99.         ''' The second object to compare.
  100.         ''' </param>
  101.         ''' ----------------------------------------------------------------------------------------------------
  102.         ''' <returns>
  103.         ''' <see langword="True"/> if the objects are considered equal; otherwise, <see langword="False"/>.
  104.         ''' <para></para>
  105.         ''' If both <paramref name="objA"/> and <paramref name="objB"/> are <see langword="Nothing"/>,
  106.         ''' the method returns <see langword="True"/>.
  107.         ''' </returns>
  108.         ''' ----------------------------------------------------------------------------------------------------
  109.         <EditorBrowsable(EditorBrowsableState.Never)>
  110.         <DebuggerNonUserCode>
  111.         Public Shared Shadows Function Equals(ByVal objA As Object, ByVal objB As Object) As Boolean
  112.             Return Object.Equals(objA, objB)
  113.         End Function
  114.  
  115.         ''' ----------------------------------------------------------------------------------------------------
  116.         ''' <summary>
  117.         ''' Determines whether the specified <see cref="Object"/> instances are the same instance.
  118.         ''' </summary>
  119.         ''' ----------------------------------------------------------------------------------------------------
  120.         ''' <param name="objA">
  121.         ''' The first object to compare.
  122.         ''' </param>
  123.         ''' ----------------------------------------------------------------------------------------------------
  124.         ''' <param name="objB">
  125.         ''' The second object to compare.
  126.         ''' </param>
  127.         ''' ----------------------------------------------------------------------------------------------------
  128.         ''' <returns>
  129.         ''' <see langword="True"/> if <paramref name="objA"/> is the same instance as <paramref name="objB"/>
  130.         ''' or if both are <see langword="Nothing"/>; otherwise, <see langword="False"/>.
  131.         ''' </returns>
  132.         ''' ----------------------------------------------------------------------------------------------------
  133.         <EditorBrowsable(EditorBrowsableState.Never)>
  134.         <DebuggerNonUserCode>
  135.         Public Shared Shadows Function ReferenceEquals(ByVal objA As Object, ByVal objB As Object) As Boolean
  136.             Return Object.ReferenceEquals(objA, objB)
  137.         End Function
  138.  
  139.         ''' ----------------------------------------------------------------------------------------------------
  140.         ''' <summary>
  141.         ''' Returns a String that represents the current object.
  142.         ''' </summary>
  143.         ''' ----------------------------------------------------------------------------------------------------
  144.         ''' <returns>
  145.         ''' A string that represents the current object.
  146.         ''' </returns>
  147.         ''' ----------------------------------------------------------------------------------------------------
  148.         <EditorBrowsable(EditorBrowsableState.Never)>
  149.         <DebuggerNonUserCode>
  150.         Public Overrides Function ToString() As String
  151.             Return MyBase.ToString()
  152.         End Function
  153.  
  154. #End Region
  155.  
  156.     End Class
  157.  
  158. End Namespace
  159.  
  160. #End Region
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement