Click or drag to resize
PMDayTimeRestriction Class
Represents an instance of a maximum cost per job
Inheritance Hierarchy
SystemObject
  PM90SettingsAPI.RestrictionsPMRestriction
    PM90SettingsAPI.RestrictionsPMDayTimeRestriction

Namespace: PM90SettingsAPI.Restrictions
Assembly: PM90SettingsAPI (in PM90SettingsAPI.dll) Version: 9.0.23.534 (9.0.23.534)
Syntax
C#
public class PMDayTimeRestriction : PMRestriction

The PMDayTimeRestriction type exposes the following members.

Methods
  NameDescription
Public methodDisable
Deactivates restriction, and any associated actions or messages
(Inherited from PMRestriction.)
Public methodEnable
Enables this restriction
Public methodStatic memberSetDefaultRestriction
Sets the default restriction for this action
Top
Properties
  NameDescription
Public propertyDefaultAction
Gets the default action for this restriction type
(Inherited from PMRestriction.)
Public propertyStatic memberDefaultRestrictionAction
Retrieves the default action for this restriction
Public propertyEnabled
true if restriction is set on this object
(Inherited from PMRestriction.)
Public propertyFriday
Allowed times for Friday
Public propertyMonday
Allowed times for Monday
Public propertyOverrideAction
The action applied by this restriction, on its specific object (i.e. user, etc...) Value is null when using default action
(Inherited from PMRestriction.)
Public propertyOverridingDefaultAction
Indicates if the restriction has a custom action set for this object
(Inherited from PMRestriction.)
Public propertySaturday
Allowed times for Saturday
Public propertySunday
Allowed times for Sunday
Public propertyThursday
Allowed times for Thursday
Public propertyTuesday
Allowed times for Tuesday
Public propertyType
Indicates which restriction this object represents
(Inherited from PMRestriction.)
Public propertyWednesday
Allowed times for Wednesday
Top
Remarks
When using pages balance, using Page Count restriction may be recommended.
Examples
Enabling day time restriction on a user
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
}
See Also