PageRenderTime 63ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/Visual Studio 2008/VBSL3OOB/VBSL3OOB.Web/My Project/MyExtensions/MyWebExtension.vb

#
Visual Basic | 73 lines | 52 code | 2 blank | 19 comment | 0 complexity | 7e19172fcc7c0dd1e2ed0439e2dbb300 MD5 | raw file
  1. #If _MyType <> "Empty" Then
  2. Namespace My
  3. ''' <summary>
  4. ''' Module used to define the properties that are available in the My Namespace for Web projects.
  5. ''' </summary>
  6. ''' <remarks></remarks>
  7. <Global.Microsoft.VisualBasic.HideModuleName()> _
  8. Module MyWebExtension
  9. Private s_Computer As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Devices.ServerComputer)
  10. Private s_User As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.WebUser)
  11. Private s_Log As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.AspLog)
  12. ''' <summary>
  13. ''' Returns information about the host computer.
  14. ''' </summary>
  15. <Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
  16. Friend ReadOnly Property Computer() As Global.Microsoft.VisualBasic.Devices.ServerComputer
  17. Get
  18. Return s_Computer.GetInstance()
  19. End Get
  20. End Property
  21. ''' <summary>
  22. ''' Returns information for the current Web user.
  23. ''' </summary>
  24. <Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
  25. Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.WebUser
  26. Get
  27. Return s_User.GetInstance()
  28. End Get
  29. End Property
  30. ''' <summary>
  31. ''' Returns Request object.
  32. ''' </summary>
  33. <Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
  34. <Global.System.ComponentModel.Design.HelpKeyword("My.Request")> _
  35. Friend ReadOnly Property Request() As Global.System.Web.HttpRequest
  36. <Global.System.Diagnostics.DebuggerHidden()> _
  37. Get
  38. Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current
  39. If CurrentContext IsNot Nothing Then
  40. Return CurrentContext.Request
  41. End If
  42. Return Nothing
  43. End Get
  44. End Property
  45. ''' <summary>
  46. ''' Returns Response object.
  47. ''' </summary>
  48. <Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
  49. <Global.System.ComponentModel.Design.HelpKeyword("My.Response")> _
  50. Friend ReadOnly Property Response() As Global.System.Web.HttpResponse
  51. <Global.System.Diagnostics.DebuggerHidden()> _
  52. Get
  53. Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current
  54. If CurrentContext IsNot Nothing Then
  55. Return CurrentContext.Response
  56. End If
  57. Return Nothing
  58. End Get
  59. End Property
  60. ''' <summary>
  61. ''' Returns the Asp log object.
  62. ''' </summary>
  63. <Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
  64. Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.AspLog
  65. Get
  66. Return s_Log.GetInstance()
  67. End Get
  68. End Property
  69. End Module
  70. End Namespace
  71. #End If