|
| 1 | +// Copyright © 2010-2016 The CefSharp Authors. All rights reserved. |
| 2 | +// |
| 3 | +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. |
| 4 | + |
| 5 | +using System; |
| 6 | + |
| 7 | +namespace CefSharp |
| 8 | +{ |
| 9 | + /// <summary> |
| 10 | + /// Represents an entry in navigation history. |
| 11 | + /// </summary> |
| 12 | + public struct NavigationEntry |
| 13 | + { |
| 14 | + private DateTime completionTime; |
| 15 | + private string displayUrl; |
| 16 | + private int httpStatusCode; |
| 17 | + private string originalUrl; |
| 18 | + private string title; |
| 19 | + private TransitionType transitionType; |
| 20 | + private string url; |
| 21 | + private bool hasPostData; |
| 22 | + private bool isValid; |
| 23 | + private bool isCurrent; |
| 24 | + |
| 25 | + /// <summary> |
| 26 | + /// NavigationEntry |
| 27 | + /// </summary> |
| 28 | + /// <param name="completionTime">completionTime</param> |
| 29 | + /// <param name="displayUrl">displayUrl</param> |
| 30 | + /// <param name="httpStatusCode">httpStatusCode</param> |
| 31 | + /// <param name="originalUrl">originalUrl</param> |
| 32 | + /// <param name="title">title</param> |
| 33 | + /// <param name="transitionType">transitionType</param> |
| 34 | + /// <param name="url">url</param> |
| 35 | + /// <param name="hasPostData">hasPostData</param> |
| 36 | + /// <param name="isValid">isValid</param> |
| 37 | + /// <param name="isCurrent">is the current entry</param> |
| 38 | + public NavigationEntry(bool isCurrent, DateTime completionTime, string displayUrl, int httpStatusCode, string originalUrl, string title, TransitionType transitionType, string url, bool hasPostData, bool isValid) |
| 39 | + { |
| 40 | + this.isCurrent = isCurrent; |
| 41 | + this.completionTime = completionTime; |
| 42 | + this.displayUrl = displayUrl; |
| 43 | + this.httpStatusCode = httpStatusCode; |
| 44 | + this.originalUrl = originalUrl; |
| 45 | + this.title = title; |
| 46 | + this.transitionType = transitionType; |
| 47 | + this.url = url; |
| 48 | + this.hasPostData = hasPostData; |
| 49 | + this.isValid = isValid; |
| 50 | + } |
| 51 | + |
| 52 | + /// <summary> |
| 53 | + /// Returns the time for the last known successful navigation completion. |
| 54 | + /// </summary> |
| 55 | + public DateTime CompletionTime |
| 56 | + { |
| 57 | + get { return completionTime; } |
| 58 | + } |
| 59 | + |
| 60 | + /// <summary> |
| 61 | + /// Returns a display-friendly version of the URL. |
| 62 | + /// </summary> |
| 63 | + public string DisplayUrl |
| 64 | + { |
| 65 | + get { return displayUrl; } |
| 66 | + } |
| 67 | + |
| 68 | + /// <summary> |
| 69 | + /// Returns the HTTP status code for the last known successful navigation response. |
| 70 | + /// </summary> |
| 71 | + public int HttpStatusCode |
| 72 | + { |
| 73 | + get { return httpStatusCode; } |
| 74 | + } |
| 75 | + |
| 76 | + /// <summary> |
| 77 | + /// Returns the original URL that was entered by the user before any redirects. |
| 78 | + /// </summary> |
| 79 | + public string OriginalUrl |
| 80 | + { |
| 81 | + get { return originalUrl; } |
| 82 | + } |
| 83 | + |
| 84 | + /// <summary> |
| 85 | + /// Returns the title set by the page. |
| 86 | + /// </summary> |
| 87 | + public string Title |
| 88 | + { |
| 89 | + get { return title; } |
| 90 | + } |
| 91 | + |
| 92 | + /// <summary> |
| 93 | + /// Returns the transition type which indicates what the user did to move to this page from the previous page. |
| 94 | + /// </summary> |
| 95 | + public TransitionType TransitionType |
| 96 | + { |
| 97 | + get { return transitionType; } |
| 98 | + } |
| 99 | + |
| 100 | + /// <summary> |
| 101 | + /// Returns the actual URL of the page. |
| 102 | + /// </summary> |
| 103 | + public string Url |
| 104 | + { |
| 105 | + get { return url; } |
| 106 | + } |
| 107 | + |
| 108 | + /// <summary> |
| 109 | + /// Returns true if this navigation includes post data. |
| 110 | + /// </summary> |
| 111 | + public bool HasPostData |
| 112 | + { |
| 113 | + get { return hasPostData; } |
| 114 | + } |
| 115 | + |
| 116 | + /// <summary> |
| 117 | + /// Returns true if this object is valid. |
| 118 | + /// </summary> |
| 119 | + public bool IsValid |
| 120 | + { |
| 121 | + get { return isValid;} |
| 122 | + } |
| 123 | + |
| 124 | + /// <summary> |
| 125 | + /// If true if this entry is the currently loaded navigation entry |
| 126 | + /// </summary> |
| 127 | + public bool IsCurrent |
| 128 | + { |
| 129 | + get { return isCurrent; } |
| 130 | + } |
| 131 | + } |
| 132 | +} |
0 commit comments