Share via


SystemUpdateManager.TrySetUserActiveHours(TimeSpan, TimeSpan) Method

Definition

Try to set the user defined Active Hours during which automatic reboots for update will not be allowed.

public:
 static bool TrySetUserActiveHours(TimeSpan start, TimeSpan end);
 static bool TrySetUserActiveHours(TimeSpan const& start, TimeSpan const& end);
public static bool TrySetUserActiveHours(System.TimeSpan start, System.TimeSpan end);
function trySetUserActiveHours(start, end)
Public Shared Function TrySetUserActiveHours (start As TimeSpan, end As TimeSpan) As Boolean

Parameters

start
TimeSpan TimeSpan

Start time of active hours.

end
TimeSpan TimeSpan

End time of active hours.

Returns

Boolean

bool

Returns true if active hours were set. Returns false otherwise.

Remarks

The maximum number of hours allowed between start time and end time can be retrieved using Windows.System.Update.SystemUpdateManager.UserActiveHoursMax

Applies to