public void Start(string currentUserName, string notificationId, bool suppressInsignificantNotifications) { _notification = GetNotification(currentUserName, notificationId); _suppressInsignificantNotifications = suppressInsignificantNotifications; _isCanceled = false; _totalCountMap = new Dictionary <string, long>(); _processedCountMap = new Dictionary <string, long>(); }
public static IndexProgressPushNotification CreateNotification(string currentUserName, string notificationId) { var notification = new IndexProgressPushNotification(currentUserName ?? nameof(IndexingJobs)) { Title = "Indexation process", Description = "Starting indexation...", }; if (!string.IsNullOrEmpty(notificationId)) { notification.Id = notificationId; } return(notification); }
private IndexProgressPushNotification GetNotification(string currentUserName, string notificationId) { IndexProgressPushNotification notification = null; if (!string.IsNullOrEmpty(notificationId)) { var searchCriteria = new PushNotificationSearchCriteria { Ids = new[] { notificationId } }; var searchResult = _pushNotificationManager.SearchNotifies(currentUserName, searchCriteria); notification = searchResult?.NotifyEvents.OfType <IndexProgressPushNotification>().FirstOrDefault(); } var result = notification ?? CreateNotification(currentUserName, notificationId); return(result); }