RatedContentRestrictions
RatedContentRestrictions
RatedContentRestrictions
RatedContentRestrictions
Class
Definition
Contains all behavior and functionality related to a user's Family Safety content settings.
public : sealed class RatedContentRestrictions : IRatedContentRestrictionspublic sealed class RatedContentRestrictions : IRatedContentRestrictionsPublic NotInheritable Class RatedContentRestrictions Implements IRatedContentRestrictions// You can use this class in JavaScript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Constructors
RatedContentRestrictions() RatedContentRestrictions() RatedContentRestrictions() RatedContentRestrictions()
Initializes a new instance of the RatedContentRestrictions class.
public : RatedContentRestrictions()public RatedContentRestrictions()Public Sub New()// You can use this method in JavaScript.
- See Also
RatedContentRestrictions(UInt32) RatedContentRestrictions(UInt32) RatedContentRestrictions(UInt32) RatedContentRestrictions(UInt32)
Initializes a new instance of the RatedContentRestrictions class, with the specified age rating the app uses, to restrict content usage.
public : RatedContentRestrictions(unsigned int maxAgeRating)public RatedContentRestrictions(UInt32 maxAgeRating)Public Sub New(maxAgeRating As UInt32)// You can use this method in JavaScript.
- maxAgeRating
- unsigned int UInt32 UInt32 UInt32
The max age rating.
Remarks
Restrictions are enforced based on the minimum user’s overall Family Safety age rating (expressed by PreferredAgeRating ), and the app-specific age rating value used in this constructor.
Methods
GetBrowsePolicyAsync() GetBrowsePolicyAsync() GetBrowsePolicyAsync() GetBrowsePolicyAsync()
Gets information that is used filter an app's content catalog.
public : IAsyncOperation<ContentRestrictionsBrowsePolicy> GetBrowsePolicyAsync()public IAsyncOperation<ContentRestrictionsBrowsePolicy> GetBrowsePolicyAsync()Public Function GetBrowsePolicyAsync() As IAsyncOperation( Of ContentRestrictionsBrowsePolicy )// You can use this method in JavaScript.
GetRestrictionLevelAsync(RatedContentDescription) GetRestrictionLevelAsync(RatedContentDescription) GetRestrictionLevelAsync(RatedContentDescription) GetRestrictionLevelAsync(RatedContentDescription)
Gets the policy that applies to a piece of content, for content browsing and consumption.
public : IAsyncOperation<ContentAccessRestrictionLevel> GetRestrictionLevelAsync(RatedContentDescription RatedContentDescription)public IAsyncOperation<ContentAccessRestrictionLevel> GetRestrictionLevelAsync(RatedContentDescription RatedContentDescription)Public Function GetRestrictionLevelAsync(RatedContentDescription As RatedContentDescription) As IAsyncOperation( Of ContentAccessRestrictionLevel )// You can use this method in JavaScript.
- RatedContentDescription
- RatedContentDescription RatedContentDescription RatedContentDescription RatedContentDescription
The rated content info.
This method returns these values:
- Allow– The content can be shown in the app's catalog, and is allowed for consumption by RequestContentAccessAsync.
- Block– The content can be shown in the app’s catalog, but it’s consumption is not allowed by RequestContentAccessAsync.
- Hide– The content can’t be shown in the catalog, since its rating is higher than MaxBrowsableAgeRating.
RequestContentAccessAsync(RatedContentDescription) RequestContentAccessAsync(RatedContentDescription) RequestContentAccessAsync(RatedContentDescription) RequestContentAccessAsync(RatedContentDescription)
Determines whether the user is allowed to consume a piece of content.
public : IAsyncOperation<PlatForm::Boolean> RequestContentAccessAsync(RatedContentDescription RatedContentDescription)public IAsyncOperation<bool> RequestContentAccessAsync(RatedContentDescription RatedContentDescription)Public Function RequestContentAccessAsync(RatedContentDescription As RatedContentDescription) As IAsyncOperation( Of bool )// You can use this method in JavaScript.
- RatedContentDescription
- RatedContentDescription RatedContentDescription RatedContentDescription RatedContentDescription
The rated content info.
Returns true, if the user can consume the content. Otherwise, returns false.
Remarks
If the content is not allowed, this method will display a Content blocked by Family Safety dialog with options to request a parental override. Apps are expected to take no action if this method returns false.
Events
RestrictionsChanged RestrictionsChanged RestrictionsChanged RestrictionsChanged
An event handler to notify apps when there are changes to the user's content settings.
public : event EventHandler RestrictionsChanged<object>public event EventHandler RestrictionsChanged<object>Public Event RestrictionsChanged<object>// You can use this event in JavaScript.