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