當前位置: 首頁>>代碼示例>>C#>>正文


C# Exception.ToBugSenseEx方法代碼示例

本文整理匯總了C#中System.Exception.ToBugSenseEx方法的典型用法代碼示例。如果您正苦於以下問題:C# Exception.ToBugSenseEx方法的具體用法?C# Exception.ToBugSenseEx怎麽用?C# Exception.ToBugSenseEx使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Exception的用法示例。


在下文中一共展示了Exception.ToBugSenseEx方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CacheTestHandledException

		private string CacheTestHandledException (string uuid)
		{
			string res = "";
			
			Exception exc1 = new Exception ("Test exception");
			var request = new BugSenseExceptionRequest (exc1.ToBugSenseEx (null, true, "", "_ping|ev1|ev2"),
				BugSenseEnvironment.GetEnvironment ("test", "0.0.0.0", uuid, true),
				new Dictionary<string, string> () {
					{ "k1", "val1"},
					{ "k2", "val2"},
					{ "k3", "val3"}
			});
			
			LogError err = new LogError (request, false);
			Task.Run (async () => {
				res = await err.Execute ();
			}).Wait ();
			
			return res;
		}
開發者ID:JanZeman,項目名稱:BugSense-WP8,代碼行數:20,代碼來源:TestTasks1.cs

示例2: HandleError

 /// <summary>
 /// Make sure to set screen size/orientation before calling this!
 /// </summary>
 public static void HandleError(Exception e, string comment)
 {
     var request = new BugSenseRequest(e.ToBugSenseEx(comment), Instance.GetEnvironment());
     try
     {
         Instance.Send(request);
     }
     catch (Exception ex1)
     {
     }
 }
開發者ID:Aranda,項目名稱:BugSense-Windows-Phone-library,代碼行數:14,代碼來源:BugSenseHandler.cs

示例3: Handle

 private void Handle(Exception e, string comment, NotificationOptions options, bool throwExceptionAfterComplete = false)
 {
     if (DateTime.Now.AddSeconds(-1) < _lastMethodHandledCalledAt) {
         return;
     }
     _lastMethodHandledCalledAt = DateTime.Now;
     if (Debugger.IsAttached && !options.HandleWhileDebugging)//Dont send the error
         return;
     var request = new BugSenseRequest(e.ToBugSenseEx(comment), GetEnvironment());
     if (throwExceptionAfterComplete) {
         LogAndSend(request, true);
         return;
     }
     try {
         switch (options.Type) {
             case enNotificationType.MessageBox:
                 if (!NotificationBox.IsOpen())
                     NotificationBox.Show(options.Title, options.Text, new NotificationBoxCommand(Labels.OkMessage, () => { }));
                 LogAndSend(request);
                 break;
             case enNotificationType.MessageBoxConfirm:
                 if (!NotificationBox.IsOpen())
                     Scheduler.Dispatcher.Schedule(
                         () => {
                             try {
                                 if (!NotificationBox.IsOpen())
                                     NotificationBox.Show(options.Title, options.Text,
                                                          new NotificationBoxCommand(Labels.OkMessage, () => LogAndSend(request)),
                                                          new NotificationBoxCommand(Labels.CancelMessage, () => { }));
                             }
                             catch { }
                         });
                 break;
             default:
                 LogAndSend(request);
                 break;
         }
     }
     catch (Exception) {
         if (options.Type != enNotificationType.MessageBoxConfirm) {
             LogAndSend(request);
         }
     }
 }
開發者ID:hermitdave,項目名稱:BugSense-Windows-Phone-library,代碼行數:44,代碼來源:BugSenseHandler.cs


注:本文中的System.Exception.ToBugSenseEx方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。