SPMeeting.IsMeetingWorkspaceWeb method
會決定是否使用會議工作區範本來建立指定的網站。
Namespace: Microsoft.SharePoint.Meetings
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
Public Shared Function IsMeetingWorkspaceWeb ( _
web As SPWeb _
) As Boolean
'用途
Dim web As SPWeb
Dim returnValue As Boolean
returnValue = SPMeeting.IsMeetingWorkspaceWeb(web)
public static bool IsMeetingWorkspaceWeb(
SPWeb web
)
參數
web
Type: Microsoft.SharePoint.SPWeb表示網站有問題的物件。
傳回值
Type: System.Boolean
true如果指定的網站建立使用會議工作區範本 ;否則false。
備註
您可以使用靜態方法IsMeetingWorkspaceWeb來決定是否要將指定的網站定義為會議工作區網站。例如,您可能會逐一查看的網站集合,並呼叫IsMeetingWorkspaceWeb再決定是否要執行某項作業,在網站集合中每個網站。
Examples
下列範例會為主控台應用程式,可逐一查看集合的網站並決定哪些是會議工作區網站。應用程式接著會列印的 URL,而找到的每個工作區相關聯的會議數目。
Imports System
Imports Microsoft.SharePoint
Imports Microsoft.SharePoint.Meetings
Module ConsoleApp
Sub Main()
Using siteCollection As SPSite = New SPSite("https://localhost")
Using rootWeb As SPWeb = siteCollection.RootWeb
Dim web As SPWeb
For Each web In rootWeb.Webs
If SPMeeting.IsMeetingWorkspaceWeb(web) Then
' Get the meeting count.
Dim count As Integer = SPMeeting.GetMeetingInformation(web).MeetingCount
' Print the workspace URL.
Console.WriteLine(web.Url)
' If it is a recurring meeting, say so. Otherwise, print the number of meetings.
Console.WriteLine("MeetingCount: {0}", _
IIf(count = SPMeeting.MeetingCountRecurring, "recurring", count.ToString()))
Console.WriteLine()
End If
web.Dispose()
Next web
End Using
End Using
Console.Write(vbCrLf + "Press ENTER to continue...")
Console.ReadLine()
End Sub
End Module
using System;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Meetings;
namespace Test
{
class ConsoleApp
{
static void Main(string[] args)
{
using (SPSite siteCollection = new SPSite("https://localhost"))
{
using (SPWeb rootWeb = siteCollection.RootWeb)
{
foreach (SPWeb web in rootWeb.Webs)
{
if (SPMeeting.IsMeetingWorkspaceWeb(web))
{
// Get the meeting count.
int count = SPMeeting.GetMeetingInformation(web).MeetingCount;
// Print the workspace URL.
Console.WriteLine(web.Url);
// If it is a recurring meeting, say so. Otherwise, print the number of meetings.
Console.WriteLine("MeetingCount: {0}",
(count == SPMeeting.MeetingCountRecurring) ? "recurring" : count.ToString());
Console.WriteLine();
}
web.Dispose();
}
}
}
Console.Write("\nPress ENTER to continue...");
Console.ReadLine();
}
}
}