Share via


CalendarConstants.CalendarRecurrenceDays enumeration

Represents the days of the week for recurring calendar exceptions.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

Namespace:  Microsoft.Office.Project.Server.Library
Assembly:  Microsoft.Office.Project.Server.Library (in Microsoft.Office.Project.Server.Library.dll)

Syntax

'Declaration
<FlagsAttribute> _
Public Enumeration CalendarRecurrenceDays
'Usage
Dim instance As CalendarConstants.CalendarRecurrenceDays
[FlagsAttribute]
public enum CalendarRecurrenceDays

Members

Member name Description
Sunday Value=1. Sunday.
Monday Value=2. Monday.
Tuesday Value=4. Tuesday.
Wednesday Value=8. Wednesday.
Thursday Value=16. Thursday.
Friday Value=32. Friday.
Saturday Value=64. Saturday.

Remarks

This is a binary flag integer that represents the days of the week on which a calendar exception is effective.

Enumeration Value

Sunday

Monday

Tuesday

Wednesday

Thursday

Friday

Saturday

Binary Value

0000001

0000010

0000010

0000100

0010000

0100000

1000000

Decimal Value

1

2

4

8

16

32

64

Examples

The CalendarConstants.CalendarRecurrenceDays type is used in the RecurrenceDays property.

Following is a brief example that demonstrates how to use these flag values.

Please see Prerequisites for ASMX-based code samples in Project 2013 for information about how to run this code sample.

using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using PSLibrary = Microsoft.Office.Project.Server.Library;

namespace BitArrayTest
{
   class Program
   {
      static void Main(string[] args)
      {

         int myDays = (int)PSLibrary.CalendarConstants.CalendarRecurrenceDays.Monday + 
             (int)PSLibrary.CalendarConstants.CalendarRecurrenceDays.Wednesday +
             (int)PSLibrary.CalendarConstants.CalendarRecurrenceDays.Friday
            ;

         Console.WriteLine("My exception days occur on: ");

         if ((myDays &(int) PSLibrary.CalendarConstants.CalendarRecurrenceDays.Monday)>0)
            Console.WriteLine("Monday ({0}) "  , (int)PSLibrary.CalendarConstants.CalendarRecurrenceDays.Monday);

         if ((myDays & (int)PSLibrary.CalendarConstants.CalendarRecurrenceDays.Tuesday) > 0)
            Console.WriteLine("Tuesday ({0}) "  , (int)PSLibrary.CalendarConstants.CalendarRecurrenceDays.Tuesday);

         if ((myDays & (int)PSLibrary.CalendarConstants.CalendarRecurrenceDays.Wednesday) > 0)
            Console.WriteLine("Wednesday ({0}) "  , (int)PSLibrary.CalendarConstants.CalendarRecurrenceDays.Wednesday);
         
         if ((myDays & (int)PSLibrary.CalendarConstants.CalendarRecurrenceDays.Thursday) > 0)
            Console.WriteLine("Thursday ({0}) "  , (int)PSLibrary.CalendarConstants.CalendarRecurrenceDays.Thursday);

         if ((myDays & (int)PSLibrary.CalendarConstants.CalendarRecurrenceDays.Friday) > 0)
            Console.WriteLine("Friday ({0}) "  , (int)PSLibrary.CalendarConstants.CalendarRecurrenceDays.Friday);

         if ((myDays & (int)PSLibrary.CalendarConstants.CalendarRecurrenceDays.Saturday) > 0)
            Console.WriteLine("Saturday ({0}) "  , (int)PSLibrary.CalendarConstants.CalendarRecurrenceDays.Saturday);
        
         if ((myDays & (int)PSLibrary.CalendarConstants.CalendarRecurrenceDays.Sunday) > 0)
            Console.WriteLine("Sunday ({0}) "  , (int)PSLibrary.CalendarConstants.CalendarRecurrenceDays.Sunday);
         
         Console.WriteLine("\r\n\r\nPress any key...");
         Console.ReadKey();

      }
   }
}

See also

Reference

Microsoft.Office.Project.Server.Library namespace