Partilhar via


SPMeeting.IsMeetingWorkspaceWeb Method

Determines whether the specified Web site was created by using a Meeting Workspace template.

Namespace:  Microsoft.SharePoint.Meetings
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Shared Function IsMeetingWorkspaceWeb ( _
    web As SPWeb _
) As Boolean
'Usage
Dim web As SPWeb
Dim returnValue As Boolean

returnValue = SPMeeting.IsMeetingWorkspaceWeb(web)
public static bool IsMeetingWorkspaceWeb(
    SPWeb web
)

Parameters

Return Value

Type: System.Boolean
true if the specified Web site was created by using a Meeting Workspace template; otherwise false.

Remarks

You can use the static method IsMeetingWorkspaceWeb to determine whether a specified Web site is defined as a Meeting Workspace site. For example, you might iterate through a collection of Web sites and call IsMeetingWorkspaceWeb against each site in the collection before deciding whether to perform some operation on the site.

Examples

The following example is a console application that iterates through a collection of Web sites and determines which ones are Meeting Workspace sites. The application then prints the URL and the number of meetings associated with each workspace that it finds.

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();
      }
   }
}

See Also

Reference

SPMeeting Class

SPMeeting Members

Microsoft.SharePoint.Meetings Namespace

GetWorkspacesToLinkTo