况洋洋
2025-07-04 0d247bd2a17e0f99f3609774a1ce54ae00857997
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
// Copyright © 2022 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.
 
namespace CefSharp
{
    /// <summary>
    /// WaitForNavigationAsyncResponse
    /// </summary>
    public class WaitForNavigationAsyncResponse
    {
        /// <summary>
        /// Error Code. If the network request was made successfully this value will be <see cref="CefErrorCode.None"/>
        /// (no error occured)
        /// </summary>
        public CefErrorCode ErrorCode { get; private set; }
        
        /// <summary>
        /// Http Status Code. If <see cref="ErrorCode"/> is not equal to <see cref="CefErrorCode.None"/>
        /// then this value will be -1.
        /// </summary>
        public int HttpStatusCode { get; private set; }
 
        /// <summary>
        /// If <see cref="ErrorCode"/> is equal to <see cref="CefErrorCode.None"/> and
        /// <see cref="HttpStatusCode"/> is equal to 200 (OK) then the main frame loaded without
        /// critical error. 
        /// </summary>
        public bool Success
        {
            get { return ErrorCode == CefErrorCode.None && HttpStatusCode == 200; }
        }
 
        /// <summary>
        /// Initializes a new instance of the WaitForNavigationAsyncResponse class.
        /// </summary>
        /// <param name="errorCode">CEF Error Code</param>
        /// <param name="httpStatusCode">Http Status Code</param>
        public WaitForNavigationAsyncResponse(CefErrorCode errorCode, int httpStatusCode)
        {
            ErrorCode = errorCode;
            HttpStatusCode = httpStatusCode;
        }
    }
}