Пример #1
0
        //const string serviceInfo = "/RW+Wzq8wasJP6LuHZcAbT2ShAvheOdnptsr/RI8zeCCfF6a+zXeWOhG0STFbxoLDjpzWj49DMTp0KZXufp4gz45nsSUwhcnrJC280vWliI=";
        protected void ReportToDevExpressCore(string uniqueUserId, string lastExceptionReportFileName, Assembly asm, IDictionary <string, string> customData)
        {
            IExceptionReportSender sender = ExceptionLoggerFactory.Instance.PlatformReportSender;

            if (sender != null && sender.CanSendExceptionReport())
            {
                return;
            }

            IExceptionReportSender reportSender = CreateExceptionReportSender();

            CompositeExceptionReportSender compositeSender = reportSender as CompositeExceptionReportSender;

            if (compositeSender == null)
            {
                compositeSender = new CompositeExceptionReportSender();
                compositeSender.Senders.Add(reportSender);
            }

            /*if (!String.IsNullOrEmpty(lastExceptionReportFileName)) {
             *  FileExceptionReportSender fileSender = new FileExceptionReportSender();
             *  fileSender.FileName = lastExceptionReportFileName;
             *  compositeSender.Senders.Add(fileSender);
             * }*/
            string[] info = GetServiceInfo(asm);
            if (info != null && info.Length == 2)
            {
                this.ServiceUrl = info[0]; // "http://logify.devexpress.com";
                this.ApiKey     = info[1]; // "12345678FEE1DEADBEEF4B1DBABEFACE";
                //if (this.ServiceUrl.StartsWith("http://", StringComparison.InvariantCultureIgnoreCase)) {
                if (CultureInfo.InvariantCulture.CompareInfo.IsPrefix(this.ServiceUrl, "http://", CompareOptions.IgnoreCase))
                {
                    this.ServiceUrl = "https://" + this.ServiceUrl.Substring("http://".Length);
                }
            }
            //this.MiniDumpServiceUrl = "http://logifydump.devexpress.com/";
            compositeSender.ServiceUrl = this.ServiceUrl;
            //compositeSender.ApiKey = "dx$" + logId;
            compositeSender.ApiKey = this.ApiKey;
            //compositeSender.MiniDumpServiceUrl = this.MiniDumpServiceUrl;
            this.AppName                = "DevExpress Demo or Design Time";
            this.AppVersion             = DetectDevExpressVersion(asm);
            this.UserId                 = uniqueUserId;
            this.ConfirmSendReport      = false;
            this.CollectBreadcrumbsCore = false;
            if (customData != null)
            {
                this.customData = customData;
            }

            //TODO:
            Config.CollectMiniDump = true;

            //apply values to config

            ExceptionLoggerFactory.Instance.PlatformReportSender = CreateBackgroundExceptionReportSender(compositeSender);
        }
Пример #2
0
 public override bool CanSendExceptionReport()
 {
     return(innerSender != null && innerSender.CanSendExceptionReport());
 }