PMDayTimeRestriction Class |
Namespace: PM90SettingsAPI.Restrictions
public class PMDayTimeRestriction : PMRestriction
The PMDayTimeRestriction type exposes the following members.
Name | Description | |
---|---|---|
Disable |
Deactivates restriction, and any associated actions or messages
(Inherited from PMRestriction.) | |
Enable |
Enables this restriction
| |
SetDefaultRestriction |
Sets the default restriction for this action
|
Name | Description | |
---|---|---|
DefaultAction |
Gets the default action for this restriction type
(Inherited from PMRestriction.) | |
DefaultRestrictionAction |
Retrieves the default action for this restriction
| |
Enabled |
true if restriction is set on this object
(Inherited from PMRestriction.) | |
Friday |
Allowed times for Friday
| |
Monday |
Allowed times for Monday
| |
OverrideAction |
The action applied by this restriction, on its specific object (i.e. user, etc...)
Value is null when using default action
(Inherited from PMRestriction.) | |
OverridingDefaultAction |
Indicates if the restriction has a custom action set for this object
(Inherited from PMRestriction.) | |
Saturday |
Allowed times for Saturday
| |
Sunday |
Allowed times for Sunday
| |
Thursday |
Allowed times for Thursday
| |
Tuesday |
Allowed times for Tuesday
| |
Type |
Indicates which restriction this object represents
(Inherited from PMRestriction.) | |
Wednesday |
Allowed times for Wednesday
|
try { //Get user object PMUser user = PMUser.LookupUser("Administrator", "domain.local"); if (user != null) { //Set a DayTime restriction on this user //create a day time range from 8AM - 6PM that will be used for Monday through Friday DayTimeRange Allowed_8AM_to_6PM_Example = new DayTimeRange(true, new DateTime(1, 1, 1, 8, 0, 0) /* 0800 Time (Date Ignored) */ , new DateTime(1, 1, 1, 18, 0, 0) /* 1800 (Date Ignored) */); //create a day time range from 10AM - 4PM that will be used for Saturday DayTimeRange Allowed_10AM_to_4PM_Example = new DayTimeRange(true, new DateTime(1, 1, 1, 10, 0, 0) /* 1000 Time (Date Ignored) */ , new DateTime(1, 1, 1, 16, 0, 0) /* 1600 (Date Ignored) */ ); //create a day time range that does not allowing any printing for Sunday DayTimeRange NotAllowed_Example = new DayTimeRange(false, null, null); //Set the daytime ranges on this user user.DayTimeRestriction.Enable(Allowed_8AM_to_6PM_Example, //Monday Allowed_8AM_to_6PM_Example, //Tuesday Allowed_8AM_to_6PM_Example, //Wednesday Allowed_8AM_to_6PM_Example, //Thursday Allowed_8AM_to_6PM_Example, //Friday Allowed_10AM_to_4PM_Example, //Saturday NotAllowed_Example); //Sunday } } catch { //Error handling - See PM90SettingsAPI.Exceptions }