IWMSOnDemandPublishingPoint.AllowContentCaching (Visual Basic .NET)

banner art

Previous Next

IWMSOnDemandPublishingPoint.AllowContentCaching (Visual Basic .NET)

The AllowContentCaching property specifies and retrieves a Boolean value that indicates whether content from the publishing point can be cached.

Syntax

  IWMSOnDemandPublishingPoint
  .AllowContentCaching = Boolean
Boolean = IWMSOnDemandPublishingPoint.AllowContentCaching

Property Value

A Boolean that indicates whether content can be cached.

If this property fails, it returns an error number.

Number Description
0x80070057 newVal is an invalid argument.
0xC00D145AL The publishing point has already been removed.

Remarks

By default, the property defaults to True.

Example Code

Imports Microsoft.WindowsMediaServices.Interop
Imports System.Runtime.InteropServices

Private Sub EnableCaching()

    ' Declare variables.
    Dim Server As WMSServer
    Dim PubPoints As IWMSPublishingPoints
    Dim PubPoint As IWMSPublishingPoint
    Dim ODPubPoint As IWMSOnDemandPublishingPoint
    Dim bVal As Boolean

Try
    ' Create the WMSServer object.
    Server = New WMSServer()

    ' Retrieve the IWMSPublishingPoints object.
    PubPoints = Server.PublishingPoints

    ' Retrieve each publishing point and retrieve the
    ' IWMSOnDemandPublishingPoint object.
    For Each PubPoint In PubPoints

        If PubPoint.Type = WMS_PUBLISHING_POINT_TYPE.WMS_PUBLISHING_POINT_TYPE_ON_DEMAND Then
            ODPubPoint = PubPoint
            Exit For
        End If

    Next

    ' Retrieve a Boolean value that indicates whether the
    ' client is allowed to cache content.
    bVal = ODPubPoint.AllowContentCaching

    ' Set a Boolean value that indicates that the
    ' client is allowed to cache content.
    ODPubPoint.AllowContentCaching = True

Catch excCom As COMException
    ' TODO: Handle COM exceptions.
Catch exc As Exception
    ' TODO: Handle errors.
Finally
    ' TODO: Clean-up code goes here.
End Try

End Sub

Requirements

Reference: Add a reference to Microsoft.WindowsMediaServices

Namespace: Microsoft.WindowsMediaServices.Interop

Assembly: Microsoft.WindowsMediaServices.dll

Library: WMSServerTypeLib.dll

Platform: Windows Server 2003 family, Windows Server 2008 family.

See Also

Previous Next