Export (0) Print
Expand All
Expand Minimize

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)

[FlagsAttribute]
public enum CalendarRecurrenceDays

Member nameDescription
SundayValue=1. Sunday.
MondayValue=2. Monday.
TuesdayValue=4. Tuesday.
WednesdayValue=8. Wednesday.
ThursdayValue=16. Thursday.
FridayValue=32. Friday.
SaturdayValue=64. Saturday.

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

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

      }
   }
}
Show:
© 2015 Microsoft