本文整理汇总了TypeScript中@core/user/providers/user-delegate.CoreUserDelegate类的典型用法代码示例。如果您正苦于以下问题:TypeScript CoreUserDelegate类的具体用法?TypeScript CoreUserDelegate怎么用?TypeScript CoreUserDelegate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CoreUserDelegate类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(mainMenuDelegate: CoreMainMenuDelegate, mainMenuHandler: AddonCompetencyMainMenuHandler,
courseOptionsDelegate: CoreCourseOptionsDelegate, courseOptionHandler: AddonCompetencyCourseOptionHandler,
userDelegate: CoreUserDelegate, userHandler: AddonCompetencyUserHandler) {
mainMenuDelegate.registerHandler(mainMenuHandler);
courseOptionsDelegate.registerHandler(courseOptionHandler);
userDelegate.registerHandler(userHandler);
}
示例2: constructor
constructor(userDelegate: CoreUserDelegate, userHandler: AddonBadgesUserHandler,
contentLinksDelegate: CoreContentLinksDelegate, myBadgesLinkHandler: AddonBadgesMyBadgesLinkHandler,
badgeLinkHandler: AddonBadgesBadgeLinkHandler) {
userDelegate.registerHandler(userHandler);
contentLinksDelegate.registerHandler(myBadgesLinkHandler);
contentLinksDelegate.registerHandler(badgeLinkHandler);
}
示例3: constructor
constructor(mainMenuDelegate: CoreMainMenuDelegate, menuHandler: AddonBlogMainMenuHandler,
userHandler: AddonBlogUserHandler, userDelegate: CoreUserDelegate,
courseOptionHandler: AddonBlogCourseOptionHandler, courseOptionsDelegate: CoreCourseOptionsDelegate,
linkHandler: AddonBlogIndexLinkHandler, contentLinksDelegate: CoreContentLinksDelegate) {
mainMenuDelegate.registerHandler(menuHandler);
userDelegate.registerHandler(userHandler);
courseOptionsDelegate.registerHandler(courseOptionHandler);
contentLinksDelegate.registerHandler(linkHandler);
}
示例4: constructor
constructor(courseOptionsDelegate: CoreCourseOptionsDelegate, courseOptionHandler: AddonNotesCourseOptionHandler,
userDelegate: CoreUserDelegate, userHandler: AddonNotesUserHandler,
cronDelegate: CoreCronDelegate, syncHandler: AddonNotesSyncCronHandler, updateManager: CoreUpdateManagerProvider) {
// Register handlers.
courseOptionsDelegate.registerHandler(courseOptionHandler);
userDelegate.registerHandler(userHandler);
cronDelegate.register(syncHandler);
// Allow migrating the tables from the old app to the new schema.
updateManager.registerSiteTableMigration({
name: 'mma_notes_offline_notes',
newName: AddonNotesOfflineProvider.NOTES_TABLE
});
}
示例5: constructor
constructor(mainMenuDelegate: CoreMainMenuDelegate, gradesMenuHandler: CoreGradesMainMenuHandler,
courseOptionHandler: CoreGradesCourseOptionHandler, courseOptionsDelegate: CoreCourseOptionsDelegate,
contentLinksDelegate: CoreContentLinksDelegate, userLinkHandler: CoreGradesUserLinkHandler,
overviewLinkHandler: CoreGradesOverviewLinkHandler, userHandler: CoreGradesUserHandler,
userDelegate: CoreUserDelegate, eventsProvider: CoreEventsProvider, sitesProvider: CoreSitesProvider) {
// Register handlers.
mainMenuDelegate.registerHandler(gradesMenuHandler);
courseOptionsDelegate.registerHandler(courseOptionHandler);
contentLinksDelegate.registerHandler(userLinkHandler);
contentLinksDelegate.registerHandler(overviewLinkHandler);
userDelegate.registerHandler(userHandler);
// Clear user profile handler cache.
eventsProvider.on(CoreUserProvider.PROFILE_REFRESHED, (data) => {
userHandler.clearViewGradesCache(data.courseId, data.userId);
}, sitesProvider.getCurrentSiteId());
eventsProvider.on(CoreEventsProvider.LOGOUT, () => {
userHandler.clearViewGradesCache();
}, sitesProvider.getCurrentSiteId());
}
示例6: constructor
constructor(mainMenuDelegate: CoreMainMenuDelegate, mainmenuHandler: AddonMessagesMainMenuHandler,
contentLinksDelegate: CoreContentLinksDelegate, indexLinkHandler: AddonMessagesIndexLinkHandler,
discussionLinkHandler: AddonMessagesDiscussionLinkHandler, sendMessageHandler: AddonMessagesSendMessageUserHandler,
userDelegate: CoreUserDelegate, cronDelegate: CoreCronDelegate, syncHandler: AddonMessagesSyncCronHandler,
network: Network, zone: NgZone, messagesSync: AddonMessagesSyncProvider, appProvider: CoreAppProvider,
localNotifications: CoreLocalNotificationsProvider, messagesProvider: AddonMessagesProvider,
sitesProvider: CoreSitesProvider, linkHelper: CoreContentLinksHelperProvider, updateManager: CoreUpdateManagerProvider,
settingsHandler: AddonMessagesSettingsHandler, settingsDelegate: CoreSettingsDelegate,
pushNotificationsDelegate: AddonPushNotificationsDelegate, utils: CoreUtilsProvider,
addContactHandler: AddonMessagesAddContactUserHandler, blockContactHandler: AddonMessagesBlockContactUserHandler) {
// Register handlers.
mainMenuDelegate.registerHandler(mainmenuHandler);
contentLinksDelegate.registerHandler(indexLinkHandler);
contentLinksDelegate.registerHandler(discussionLinkHandler);
userDelegate.registerHandler(sendMessageHandler);
userDelegate.registerHandler(addContactHandler);
userDelegate.registerHandler(blockContactHandler);
cronDelegate.register(syncHandler);
cronDelegate.register(mainmenuHandler);
settingsDelegate.registerHandler(settingsHandler);
// Sync some discussions when device goes online.
network.onConnect().subscribe(() => {
// Execute the callback in the Angular zone, so change detection doesn't stop working.
zone.run(() => {
messagesSync.syncAllDiscussions(undefined, true);
});
});
const notificationClicked = (notification: any): void => {
messagesProvider.isMessagingEnabledForSite(notification.site).then(() => {
sitesProvider.isFeatureDisabled('CoreMainMenuDelegate_AddonMessages', notification.site).then((disabled) => {
if (disabled) {
// Messages are disabled, stop.
return;
}
messagesProvider.invalidateDiscussionsCache(notification.site).finally(() => {
linkHelper.goInSite(undefined, 'AddonMessagesIndexPage', undefined, notification.site);
});
});
});
};
if (appProvider.isDesktop()) {
// Listen for clicks in simulated push notifications.
localNotifications.registerClick(AddonMessagesProvider.PUSH_SIMULATION_COMPONENT, notificationClicked);
}
// Register push notification clicks.
pushNotificationsDelegate.on('click').subscribe((notification) => {
if (utils.isFalseOrZero(notification.notif)) {
notificationClicked(notification);
return true;
}
});
// Allow migrating the table from the old app to the new schema.
updateManager.registerSiteTableMigration({
name: 'mma_messages_offline_messages',
newName: AddonMessagesOfflineProvider.MESSAGES_TABLE,
fields: [
{
name: 'textformat',
delete: true
}
]
});
// Migrate the component name.
updateManager.registerLocalNotifComponentMigration('mmaMessagesPushSimulation',
AddonMessagesProvider.PUSH_SIMULATION_COMPONENT);
}
示例7: constructor
constructor(courseOptionsDelegate: CoreCourseOptionsDelegate, courseOptionHandler: AddonCourseCompletionCourseOptionHandler,
userDelegate: CoreUserDelegate, userHandler: AddonCourseCompletionUserHandler) {
// Register handlers.
courseOptionsDelegate.registerHandler(courseOptionHandler);
userDelegate.registerHandler(userHandler);
}