if (canIUse('SystemCapability.AuthenticationServices.HuaweiID.MinorsProtection')) {
const minorsProtectionInfo: minorsProtection.MinorsProtectionInfo =
minorsProtection.getMinorsProtectionInfoSync();
// 获取未成年人模式开启状态
const minorsProtectionMode: boolean = minorsProtectionInfo.minorsProtectionMode;
hilog.info(0x0000, 'testTag', 'Succeeded in getting minorsProtectionMode is: %{public}s',
minorsProtectionMode.valueOf());
// 未成年人模式已开启,获取年龄段信息
if (minorsProtectionMode) {
const ageGroup: minorsProtection.AgeGroup | undefined = minorsProtectionInfo.ageGroup;
if (ageGroup) {
hilog.info(0x0000, 'testTag', 'Succeeded in getting lowerAge is: %{public}s', ageGroup.lowerAge.toString());
hilog.info(0x0000, 'testTag', 'Succeeded in getting upperAge is: %{public}s', ageGroup.upperAge.toString());
}
} else {
// 未成年人模式未开启,建议应用跟随系统未成年人模式,展示正常内容
}
} else {
hilog.info(0x0000, 'testTag',
'The current device does not support the invoking of the getMinorsProtectionInfoSync interface.');
}
if (canIUse('SystemCapability.AuthenticationServices.HuaweiID.MinorsProtection')) {
minorsProtection.verifyMinorsProtectionCredential(getContext(this))
.then((result: boolean) => {
hilog.info(0x0000, 'testTag', 'Succeeded in getting verify result is: %{public}s', result.valueOf());
// 使用结果判断验密是否通过,执行后续流程
})
.catch((error: BusinessError) => {
this.dealVerifyAllError(error);
});
} else {
hilog.info(0x0000, 'testTag',
'The current device does not support the invoking of the verifyMinorsProtectionCredential interface.');
}
dealVerifyAllError(error: BusinessError): void {
hilog.error(0x0000, 'testTag', `Failed to verify. Code: ${error.code}, message: ${error.message}`);
}
ArcgisEngine实现对地图的放大、缩小和平移:
个人觉得是平移,不过网上的都是漫游,通俗的说就是把一个地图对象从一边拉到另一边而已。就看人说话吧.
具体实现:
一、引入命名空间
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Controls;
二、代码实现.
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.
You should preserve the original relative order of th