-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename type to 'Context'; this matches the existing UsePeriodicPasswordProvider. Add CancellationToken; the user might execute commands against the server that might need to be cancelled. Remove sync overload; it could be unnecessary. Move types to their own files. Allow multiple callbacks to be added. Signed-off-by: Bradley Grainger <[email protected]>
- Loading branch information
Showing
6 changed files
with
60 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace MySqlConnector; | ||
|
||
/// <summary> | ||
/// Bitflags giving the conditions under which a connection was opened. | ||
/// </summary> | ||
[Flags] | ||
public enum MySqlConnectionOpenedConditions | ||
{ | ||
/// <summary> | ||
/// No specific conditions apply. This value may be used when an existing pooled connection is reused without being reset. | ||
/// </summary> | ||
None = 0, | ||
|
||
/// <summary> | ||
/// A new physical connection to a MySQL Server was opened. This value is mutually exclusive with <see cref="Reset"/>. | ||
/// </summary> | ||
New = 1, | ||
|
||
/// <summary> | ||
/// An existing pooled connection to a MySQL Server was reset. This value is mutually exclusive with <see cref="New"/>. | ||
/// </summary> | ||
Reset = 2, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace MySqlConnector; | ||
|
||
/// <summary> | ||
/// Contains information passed to <see cref="MySqlConnectionOpenedCallback"/> when a new <see cref="MySqlConnection"/> is opened. | ||
/// </summary> | ||
public sealed class MySqlConnectionOpenedContext | ||
{ | ||
/// <summary> | ||
/// The <see cref="MySqlConnection"/> that was opened. | ||
/// </summary> | ||
public MySqlConnection Connection { get; } | ||
|
||
/// <summary> | ||
/// Bitflags giving the conditions under which a connection was opened. | ||
/// </summary> | ||
public MySqlConnectionOpenedConditions Conditions { get; } | ||
|
||
internal MySqlConnectionOpenedContext(MySqlConnection connection, MySqlConnectionOpenedConditions conditions) | ||
{ | ||
Connection = connection; | ||
Conditions = conditions; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters