public void Can_Map_Provisioning_API_NotificationInfoType_To_ApMax_VoicemailV5_NotificationInfoType() { //*** Arrange *** var notificationInfoTypes = new NotificationInfoType { Address = "12234 my address", Center = 2, Enabled = true }; //*** Act *** var result = ObjectFactory.CreateInstanceAndMap <NotificationInfoType, Common.VoicemailV5.NotificationInfoType>(_commonMapper, notificationInfoTypes); Assert.IsNotNull(result); }
public void CreateInformative(NotificationInfoType infoType, string account, string from) { try { var accountObj = Frontend.Accounts[account]; if (accountObj == null) { return; } var fromJID = new JID(from); var contact = accountObj.Roster[fromJID.Bare]; if (contact == null) { return; } var notification = new Notification(); notification.Account = account; notification.Type = NotificationType.Request; switch (infoType) { case NotificationInfoType.Subscribed: // Notify that he now sends you updates to his status notification.Message = fromJID.Bare + " " + Helper.Translate("SubscriptionAllowed"); break; case NotificationInfoType.Unsubscribed: // Notify that he dosn't send you updates to his status anymore notification.Message = fromJID.Bare + " " + Helper.Translate("SubscriptionRevoked"); break; case NotificationInfoType.Unsubscribe: // Notify that he dosn't want to see your updates anymore notification.Message = fromJID.Bare + " " + Helper.Translate("SubscriptionUnsubscribed"); break; } notification.Action = FlyoutType.Subscription; notification.Data = contact; AddNotification(notification); } catch (Exception uiEx) { Frontend.UIError(uiEx); } }
public void CreateInformative(NotificationInfoType infoType, string account, string from) { try { var accountObj = Frontend.Accounts[account]; if (accountObj == null) return; var fromJID = new JID(from); var contact = accountObj.Roster[fromJID.Bare]; if (contact == null) return; var notification = new Notification(); notification.Account = account; notification.Type = NotificationType.Request; switch (infoType) { case NotificationInfoType.Subscribed: // Notify that he now sends you updates to his status notification.Message = fromJID.Bare + " " + Helper.Translate("SubscriptionAllowed"); break; case NotificationInfoType.Unsubscribed: // Notify that he dosn't send you updates to his status anymore notification.Message = fromJID.Bare + " " + Helper.Translate("SubscriptionRevoked"); break; case NotificationInfoType.Unsubscribe: // Notify that he dosn't want to see your updates anymore notification.Message = fromJID.Bare + " " + Helper.Translate("SubscriptionUnsubscribed"); break; } notification.Action = FlyoutType.Subscription; notification.Data = contact; AddNotification(notification); } catch (Exception uiEx) { Frontend.UIError(uiEx); } }