PageRenderTime 54ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/Visual Studio 2008/VBMonitorRegistryChange/RegistryKeyChangeEventArg.vb

#
Visual Basic | 80 lines | 47 code | 9 blank | 24 comment | 0 complexity | 4cc18bad4f5e50eebd807e43944c6221 MD5 | raw file
  1. '*************************** Module Header ******************************\
  2. ' Module Name: RegistryKeyChangeEventArgs.vb
  3. ' Project: VBMonitorRegistryChange
  4. ' Copyright (c) Microsoft Corporation.
  5. '
  6. ' This class derived from EventArgs. It is used to wrap the ManagementBaseObject of
  7. ' EventArrivedEventArgs.
  8. '
  9. ' This source is subject to the Microsoft Public License.
  10. ' See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
  11. ' All other rights reserved.
  12. '
  13. ' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
  14. ' EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
  15. ' WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
  16. '**************************************************************************
  17. Imports System.Management
  18. Friend Class RegistryKeyChangeEventArgs
  19. Inherits EventArgs
  20. Dim _hive As String
  21. Public Property Hive() As String
  22. Get
  23. Return _hive
  24. End Get
  25. Set(ByVal value As String)
  26. _hive = value
  27. End Set
  28. End Property
  29. Dim _keyPath As String
  30. Public Property KeyPath() As String
  31. Get
  32. Return _keyPath
  33. End Get
  34. Set(ByVal value As String)
  35. _keyPath = value
  36. End Set
  37. End Property
  38. Dim _SECURITY_DESCRIPTOR As UInteger()
  39. Public Property SECURITY_DESCRIPTOR() As UInteger()
  40. Get
  41. Return _SECURITY_DESCRIPTOR
  42. End Get
  43. Set(ByVal value As UInteger())
  44. _SECURITY_DESCRIPTOR = value
  45. End Set
  46. End Property
  47. Dim _TIME_CREATED As Date
  48. Public Property TIME_CREATED() As Date
  49. Get
  50. Return _TIME_CREATED
  51. End Get
  52. Set(ByVal value As Date)
  53. _TIME_CREATED = value
  54. End Set
  55. End Property
  56. Public Sub New(ByVal arrivedEvent As ManagementBaseObject)
  57. ' Class RegistryKeyChangeEvent has following properties: Hive, KeyPath,
  58. ' SECURITY_DESCRIPTOR and TIME_CREATED. These properties could get from
  59. ' arrivedEvent.Properties.
  60. Me.Hive = TryCast(arrivedEvent.Properties("Hive").Value, String)
  61. Me.KeyPath = TryCast(arrivedEvent.Properties("KeyPath").Value, String)
  62. ' The property TIME_CREATED is a unique value that indicates the time
  63. ' when an event is generated.
  64. ' This is a 64-bit FILETIME value that represents the number of
  65. ' 100-nanosecond intervals after January 1, 1601. The information is in
  66. ' the Coordinated Universal Time (UTC) format.
  67. Me.TIME_CREATED = New Date( _
  68. CLng(Fix(CULng(arrivedEvent.Properties("TIME_CREATED").Value))), _
  69. DateTimeKind.Utc).AddYears(1600)
  70. End Sub
  71. End Class