public void OnAddLargeAttachmentClicked(object sender, RibbonControlEventArgs e) { var analyticsListener = new WsAnalyticsListener(); analyticsListener.SendEventStatistic("Add Large Attachment clicked"); try { using (var inspector = new WsInspector((Inspector) e.Control.Context)) { WsMailItem mailItem = inspector.CurrentItem; var ofd = new OpenFileDialog(); ofd.CheckFileExists = true; ofd.CheckPathExists = true; ofd.Multiselect = false; ofd.Title = "Select Attachment"; DialogResult dr = ofd.ShowDialog(new WindowWrapper(Process.GetCurrentProcess().MainWindowHandle)); if (dr == DialogResult.OK) { _model.AddAttachment(mailItem, ofd.FileName); analyticsListener.SendEventStatistic("Add Large Attachment Dialog-OK"); } else { analyticsListener.SendEventStatistic("Add Large Attachment Dialog-Cancel"); } } } catch (Exception ex) { Logger.LogError(ex); WsMessage.ShowMessage(IntPtr.Zero, ex.Message, MessageButtons.WsOK, MessageBranding.WsProtect); } }
//[Test] public void SendProfessionalInstallStatistic() { int numberOfEvents = 1; var analyticsListener = new WsAnalyticsListener(); for (int i = 0; i != numberOfEvents; ++i) { Assert.True(analyticsListener.SendProfessionalInstallStatistic()); } }
//[Test] public void SendOutlookEventStatistic() { for (int i = 0; i != 10; ++i) { var analyticsListener = new WsAnalyticsListener(); for (int j = 0; j != 10; ++j) { analyticsListener.SendEventStatistic("Test"); } Thread.Sleep(5000); } }
public void RaiseEvent() { try { var listener = new WsAnalyticsListener(); if (EventProperties != null && EventProperties.Count > 0) { listener.SendOutlookEventStatistic(EventName, EventProperties); } else { listener.SendEventStatistic(EventName); } } catch(Exception ex) { Logger.LogError(ex); } }
public void OnSendAndProtectClicked(object sender, RibbonControlEventArgs e) { var analyticsListener = new WsAnalyticsListener(); analyticsListener.SendEventStatistic("Send and protect clicked"); try { using (var inspector = new WsInspector((Inspector) e.Control.Context)) { var mailItem = inspector.CurrentItem as WsMailItem; if (mailItem != null) { _model.AddSendAndProtectMapiProperty(mailItem); // This is a port from the C++ code this will not work in all situations ie: Multilingual Keyboard // //SendKeys.Send("%(S)"); mailItem.Send(); } } } catch (Exception ex) { if (ex.Message.Contains("E_ABORT")) return; Logger.LogError(ex); var comEx = ex as COMException; if (comEx != null && comEx.ErrorCode == E_ABORT) { return; } WsMessage.ShowMessage(IntPtr.Zero, ex.Message, MessageButtons.WsOK, MessageBranding.WsProtect); } }
public bool SendInstallEvent() { IWsAnalyticsListener listener = new WsAnalyticsListener(); return listener.SendProfessionalInstallStatistic(); }