/// <summary> /// Creates an AboutViewModel Object /// </summary> public AboutViewModel(IAppInformation appInformation, IEmailAdapter emailAdapter, IBrowserAdapter browserAdapter, IStoreOperations storeOperations) { this.appInformation = appInformation; this.emailAdapter = emailAdapter; this.browserAdapter = browserAdapter; storeFeatures = storeOperations; }
/// <summary> /// Creates an AboutViewModel Object /// </summary> /// <param name="appInformation">Instance of a <see cref="IAppInformation" /> implementation.</param> /// <param name="composeEmailTask">Instance of a <see cref="IMvxComposeEmailTask" /> implementation.</param> /// <param name="webBrowserTask">Instance of a <see cref="IMvxWebBrowserTask" /> implementation.</param> /// <param name="storeOperations">Instance of a <see cref="IStoreOperations" /> implementation.</param> public AboutViewModel(IAppInformation appInformation, IMvxComposeEmailTask composeEmailTask, IMvxWebBrowserTask webBrowserTask, IStoreOperations storeOperations) { this.appInformation = appInformation; this.composeEmailTask = composeEmailTask; this.webBrowserTask = webBrowserTask; storeFeatures = storeOperations; }
/// <summary> /// Creates an AboutViewModel Object /// </summary> /// <param name="appInformation">Instance of a <see cref="IAppInformation" /> implementation.</param> /// <param name="composeEmailTask">Instance of a <see cref="IMvxComposeEmailTask" /> implementation.</param> /// <param name="webBrowserTask">Instance of a <see cref="IMvxWebBrowserTask" /> implementation.</param> /// <param name="storeOperations">Instance of a <see cref="IStoreOperations" /> implementation.</param> public AboutViewModel(IAppInformation appInformation, IMvxComposeEmailTask composeEmailTask, IMvxWebBrowserTask webBrowserTask, IStoreOperations storeOperations) { this.appInformation = appInformation; this.composeEmailTask = composeEmailTask; this.webBrowserTask = webBrowserTask; storeFeatures = storeOperations; }
/// <summary> /// Creates an AboutViewModel Object /// </summary> /// <param name="appInformation">Instance of a <see cref="IAppInformation" /> implementation.</param> /// <param name="composeEmailTask">Instance of a <see cref="IMvxComposeEmailTask" /> implementation.</param> /// <param name="webBrowserTask">Instance of a <see cref="IMvxWebBrowserTask" /> implementation.</param> /// <param name="storeOperations">Instance of a <see cref="IStoreOperations" /> implementation.</param> public AboutViewModel(IAppInformation appInformation, IMvxComposeEmailTask composeEmailTask, IMvxWebBrowserTask webBrowserTask, IStoreOperations storeOperations, IMvxLogProvider logProvider, IMvxNavigationService navigationService) : base(logProvider, navigationService) { this.appInformation = appInformation; this.composeEmailTask = composeEmailTask; this.webBrowserTask = webBrowserTask; storeFeatures = storeOperations; }
/// <summary> /// Creates an AboutViewModel Object /// </summary> public AboutViewModel(IAppInformation appInformation, IEmailAdapter emailAdapter, IBrowserAdapter browserAdapter, IStoreOperations storeOperations, IMvxLogProvider logProvider, IMvxNavigationService navigationService) : base(logProvider, navigationService) { this.appInformation = appInformation; this.emailAdapter = emailAdapter; this.browserAdapter = browserAdapter; storeFeatures = storeOperations; }
public void RateApp_NoParams_CommandCalled() { IStoreOperations storeFeaturesSetup = Substitute.For <IStoreOperations>(); new AboutViewModel(Substitute.For <IAppInformation>(), Substitute.For <IEmailAdapter>(), Substitute.For <IBrowserAdapter>(), storeFeaturesSetup) .RateAppCommand .Execute(null); storeFeaturesSetup.Received(1).RateApp(); }
internal void ProcessSentItemWrapperMessage(EmailMessage message, string mdbGuid, MessageItem replayItem, IStoreOperations storeOperations, IAgentInfoWriter agentInfo) { if (!this.IsSharedMailboxSentItemMessage(message, agentInfo)) { return; } IPerformanceCounters counterInstance = this.perfCountersFactory.GetCounterInstance(mdbGuid); bool flag = true; try { MessageItem attachedMessageItem = this.GetAttachedMessageItem(replayItem, agentInfo); if (attachedMessageItem == null) { this.logger.TraceDebug(new string[] { "SharedMailboxSentItemsAgent.OnPromotedMessageHandler: Message has the correct header tags but does not contain the original email attachment" }); } else { string text = attachedMessageItem.TryGetProperty(ItemSchema.InternetMessageId) as string; if (text != null && storeOperations.MessageExistsInSentItems(text)) { this.logger.TraceDebug(new string[] { "SharedMailboxSentItemsAgent.OnPromotedMessageHandler: message already exits in the sent items folder. Don't have to copy." }); } else { this.logger.TraceDebug(new string[] { "SharedMailboxSentItemsAgent.OnPromotedMessageHandler: Get the sent items folder Id." }); storeOperations.CopyAttachmentToSentItemsFolder(attachedMessageItem); this.UpdateAverageSentItemCopyTimePerfCounter(attachedMessageItem, counterInstance); counterInstance.IncrementSentItemsMessages(); } } } catch (StorageTransientException ex) { flag = false; counterInstance.IncrementErrors(); this.logger.TraceDebug(new string[] { "SharedMailboxSentItemsAgent.OnPromotedMessageHandler encountered an exception: ", ex.ToString() }); this.logger.LogEvent(MailboxTransportEventLogConstants.Tuple_SharedMailboxSentItemsAgentException, ex); throw new SmtpResponseException(SharedMailboxSentItemsAgent.CopyFailedTransientError); } catch (Exception ex2) { flag = false; counterInstance.IncrementErrors(); if (ex2 is OutOfMemoryException || ex2 is StackOverflowException || ex2 is ThreadAbortException) { throw; } this.logger.TraceDebug(new string[] { "SharedMailboxSentItemsAgent.OnPromotedMessageHandler encountered an exception:", ex2.ToString() }); this.logger.LogEvent(MailboxTransportEventLogConstants.Tuple_SharedMailboxSentItemsAgentException, ex2); throw new SmtpResponseException(SharedMailboxSentItemsAgent.CopyFailedPermanentError); } finally { if (flag) { this.logger.TraceDebug(new string[] { "SharedMailboxSentItemsAgent.OnPromotedMessageHandler: Copy operation complete. Going to raise success exception to inform delivery service to drop this message." }); throw new SmtpResponseException(SharedMailboxSentItemsAgent.SharedMailboxSentItemCopySuccess, "SharedMailboxSentItemsAgent"); } } }