本文整理汇总了VB.NET中System.Web.Hosting.ApplicationManager.CreateObject方法的典型用法代码示例。如果您正苦于以下问题:VB.NET ApplicationManager.CreateObject方法的具体用法?VB.NET ApplicationManager.CreateObject怎么用?VB.NET ApplicationManager.CreateObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。
在下文中一共展示了ApplicationManager.CreateObject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: Start
' 导入命名空间
Imports System.Web.Hosting
Public Class SampleComponentFactory
Implements IRegisteredObject
Dim components As ArrayList = New ArrayList()
Public Sub Start()
HostingEnvironment.RegisterObject(Me)
End Sub
Public Sub [Stop](ByVal immediate As Boolean) Implements System.Web.Hosting.IRegisteredObject.Stop
For Each c As SampleComponent In components
CType(c, IRegisteredObject).Stop(immediate)
Next
HostingEnvironment.UnregisterObject(Me)
End Sub
Public Function CreateComponent() As SampleComponent
Dim newComponent As SampleComponent
newComponent = New SampleComponent
newComponent.Initialize()
components.Add(newComponent)
Return newComponent
End Function
End Class
Public Class SampleComponent
Implements IRegisteredObject
Sub [Stop](ByVal immediate As Boolean) Implements System.Web.Hosting.IRegisteredObject.Stop
' Clean up component resources here.
End Sub
Public Sub Initialize()
' Initialize component here.
End Sub
End Class