FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
CefSharp/CefSharp.Example/ExceptionTestBoundObject.cs at cefsharp/45 · cefsharp/CefSharp · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
cefsharp
/
CefSharp
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
2.9k
Star
10.2k
Code
Issues
61
Pull requests
13
Discussions
Actions
Wiki
Security and quality
9
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
CefSharp
/
CefSharp.Example
/
ExceptionTestBoundObject.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
72 lines (65 loc) · 2.13 KB
Breadcrumbs
CefSharp
/
CefSharp.Example
/
ExceptionTestBoundObject.cs
Copy path
File metadata and controls
72 lines (65 loc) · 2.13 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Copyright © 2010-2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using
System
;
using
System
.
Collections
.
Generic
;
using
System
.
Linq
;
using
System
.
Text
;
using
System
.
Threading
.
Tasks
;
using
System
.
Diagnostics
;
namespace
CefSharp
.
Example
{
public
class
ExceptionTestBoundObject
{
[
DebuggerStepThrough
]
private
double
DivisionByZero
(
int
zero
)
{
return
10
/
zero
;
}
[
DebuggerStepThrough
]
public
double
TriggerNestedExceptions
(
)
{
try
{
try
{
return
DivisionByZero
(
0
)
;
}
catch
(
Exception
innerException
)
{
throw
new
InvalidOperationException
(
"Nested Exception Invalid"
,
innerException
)
;
}
}
catch
(
Exception
e
)
{
throw
new
OperationCanceledException
(
"Nested Exception Canceled"
,
e
)
;
}
}
[
DebuggerStepThrough
]
public
int
TriggerParameterException
(
int
parameter
)
{
return
parameter
;
}
public
void
TestCallbackException
(
IJavascriptCallback
errorCallback
,
IJavascriptCallback
errorCallbackResult
)
{
const
int
taskDelay
=
500
;
Task
.
Run
(
async
(
)
=>
{
await
Task
.
Delay
(
taskDelay
)
;
using
(
errorCallback
)
{
JavascriptResponse
result
=
await
errorCallback
.
ExecuteAsync
(
"This callback from C# was delayed "
+
taskDelay
+
"ms"
)
;
string
resultMessage
;
if
(
result
.
Success
)
{
resultMessage
=
"Fatal: No Exception thrown in error callback"
;
}
else
{
resultMessage
=
"Exception Thrown: "
+
result
.
Message
;
}
await
errorCallbackResult
.
ExecuteAsync
(
resultMessage
)
;
}
}
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL