Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fire notification events before a connection is opened or closed. Enhance documentation comments to that include references. Workaround issue in NDoc3 to allow project reference links to be resolved correctly. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
69f6030c7fec9974bebb86d0889c5ca7 |
User & Date: | mistachkin 2012-09-20 02:39:00.742 |
Context
2012-09-20
| ||
11:53 | Allow opened connections to skip adding the extension functions included in the interop assembly. Support loading of SQLite extensions. Add more notifications that use the new static Changed event. Miscellaneous comment cleanup. Cleanup usage of compile-time options for the .NET Framework version. Fix argument checking for the batch file tools. check-in: 5759e099be user: mistachkin tags: trunk | |
02:39 | Fire notification events before a connection is opened or closed. Enhance documentation comments to that include references. Workaround issue in NDoc3 to allow project reference links to be resolved correctly. check-in: 69f6030c7f user: mistachkin tags: trunk | |
00:50 | Remove suppression for warning 4703 from the source code and add it to the property files. check-in: cdb73c1d3f user: mistachkin tags: trunk | |
Changes
Changes to Doc/buildChm.tcl.
︙ | |||
34 35 36 37 38 39 40 | 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 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + | } set path [file dirname [info script]] set nDocPath [file join $env(ProgramFiles) NDoc3] if {![file isdirectory $nDocPath]} then { |
︙ | |||
73 74 75 76 77 78 79 | 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | - + + | foreach fileName $fileNames { set fileName [file join $path $outputPath $fileName] # # NOTE: Make sure the file we need actually exists. # if {![file isfile $fileName]} then { |
︙ | |||
122 123 124 125 126 127 128 | 167 168 169 170 171 172 173 174 175 | - + + | # NOTE: For hhc.exe, zero means failure. # puts stdout $result; if {$code == 0} then {exit 1} file copy -force [file join $path $outputPath SQLite.NET.chm] \ [file join $path SQLite.NET.chm] |
Changes to System.Data.SQLite/SQLiteConnection.cs.
︙ | |||
13 14 15 16 17 18 19 20 21 22 23 | 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 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + | using System.Diagnostics; using System.Collections.Generic; using System.Globalization; using System.ComponentModel; using System.Runtime.InteropServices; using System.IO; ///////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Event data for connection event handlers. /// </summary> public class ConnectionEventArgs : EventArgs { /// <summary> /// The type of event being raised. /// </summary> public readonly SQLiteConnectionEventType EventType; /// <summary> /// The <see cref="StateChangeEventArgs" /> associated with this event, if any. /// </summary> public readonly StateChangeEventArgs EventArgs; /// <summary> /// Command or message text associated with this event, if any. /// </summary> public readonly string Text; /// <summary> /// Extra data associated with this event, if any. /// </summary> public readonly object Data; /// <summary> /// Constructs the object. /// </summary> /// <param name="eventType">The type of event being raised.</param> /// <param name="eventArgs">The base <see cref="EventArgs" /> associated /// with this event, if any.</param> /// <param name="text">The command or message text, if any.</param> /// <param name="data">The extra data, if any.</param> internal ConnectionEventArgs( SQLiteConnectionEventType eventType, StateChangeEventArgs eventArgs, string text, object data ) { EventType = eventType; EventArgs = eventArgs; Text = text; Data = data; } } ///////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Raised when an event pertaining to a connection occurs. /// </summary> /// <param name="sender">The connection involved.</param> /// <param name="e">Extra information about the event.</param> public delegate void SQLiteConnectionEventHandler(object sender, ConnectionEventArgs e); ///////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// SQLite implentation of DbConnection. /// </summary> /// <remarks> |
︙ | |||
169 170 171 172 173 174 175 | 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | - + | /// <description>Foreign Keys</description> /// <description>Enable foreign key constraints</description> /// <description>N</description> /// <description>False</description> /// </item> /// <item> /// <description>Flags</description> |
︙ | |||
195 196 197 198 199 200 201 202 203 204 205 206 207 208 | 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | + | /// <description>N</description> /// <description>True</description> /// </item> /// </list> /// </remarks> public sealed partial class SQLiteConnection : DbConnection, ICloneable { #region Private Constants /// <summary> /// The default "stub" (i.e. placeholder) base schema name to use when /// returning column schema information. Used as the initial value of /// the BaseSchemaName property. This should start with "sqlite_*" /// because those names are reserved for use by SQLite (i.e. they cannot /// be confused with the names of user objects). /// </summary> |
︙ | |||
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 | 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 | + + + + + + + + + + + + + + + + + + + | private const bool DefaultSetDefaults = true; private const int SQLITE_FCNTL_WIN32_AV_RETRY = 9; private const string _dataDirectory = "|DataDirectory|"; private const string _masterdb = "sqlite_master"; private const string _tempmasterdb = "sqlite_temp_master"; #endregion /////////////////////////////////////////////////////////////////////////////////////////////// #region Private Static Data /// <summary> /// Object used to synchronize access to the static instance data /// for this class. /// </summary> private static object _syncRoot = new object(); /// <summary> /// Static variable to store the connection event handlers to call. /// </summary> private static event SQLiteConnectionEventHandler _handlers; #endregion /////////////////////////////////////////////////////////////////////////////////////////////// #region Private Data /// <summary> /// State of the current connection /// </summary> private ConnectionState _connectionState; /// <summary> /// The connection string /// </summary> |
︙ | |||
287 288 289 290 291 292 293 | 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 | + - + | /// The "stub" (i.e. placeholder) base schema name to use when returning /// column schema information. /// </summary> internal string _baseSchemaName; /// <summary> /// The extra behavioral flags for this connection, if any. See the /// <see cref="SQLiteConnectionFlags" /> enumeration for a list of |
︙ | |||
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 | 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 | + + + + + | private event SQLiteTraceEventHandler _traceHandler; private event EventHandler _rollbackHandler; private SQLiteUpdateCallback _updateCallback; private SQLiteCommitCallback _commitCallback; private SQLiteTraceCallback _traceCallback; private SQLiteRollbackCallback _rollbackCallback; #endregion /////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// This event is raised whenever the database is opened or closed. /// </summary> public override event StateChangeEventHandler StateChange; /////////////////////////////////////////////////////////////////////////////////////////////// ///<overloads> /// Constructs a new SQLiteConnection object /// </overloads> /// <summary> /// Default constructor /// </summary> |
︙ | |||
383 384 385 386 387 388 389 390 391 392 393 394 395 396 | 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | cmd.ExecuteNonQuery(); } } } } } } /////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Raises the <see cref="Changed" /> event. /// </summary> /// <param name="connection"> /// The connection associated with this event. /// </param> /// <param name="e"> /// A <see cref="ConnectionEventArgs" /> that contains the event data. /// </param> public static void OnChanged( SQLiteConnection connection, ConnectionEventArgs e ) { if (connection == null) return; #if !PLATFORM_COMPACTFRAMEWORK if (!connection.CanRaiseEvents) return; #endif SQLiteConnectionEventHandler handlers; lock (_syncRoot) { handlers = _handlers; } if (handlers != null) handlers(connection, e); } /////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// This event is raised when events related to the lifecycle of a /// SQLiteConnection object occur. /// </summary> public static event SQLiteConnectionEventHandler Changed { add { lock (_syncRoot) { // Remove any copies of this event handler from registered // list. This essentially means that a handler will be // called only once no matter how many times it is added. _handlers -= value; // Add this to the list of event handlers. _handlers += value; } } remove { lock (_syncRoot) { _handlers -= value; } } } /////////////////////////////////////////////////////////////////////////////////////////////// #region Backup API Members /// <summary> /// Backs up the database, using the specified database connection as the /// destination. |
︙ | |||
616 617 618 619 620 621 622 | 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 | - - + + + + + + + + + - - + + + - - - - - + + + + + + + + + | FileStream fs = File.Create(databaseFileName); fs.Close(); } /// <summary> /// Raises the state change event when the state of the connection changes /// </summary> |
︙ | |||
723 724 725 726 727 728 729 730 731 732 733 734 735 736 | 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 | + + + | /// <summary> /// When the database connection is closed, all commands linked to this connection are automatically reset. /// </summary> public override void Close() { CheckDisposed(); OnChanged(this, new ConnectionEventArgs( SQLiteConnectionEventType.Closing, null, null, null)); if (_sql != null) { #if !PLATFORM_COMPACTFRAMEWORK if (_enlistment != null) { // If the connection is enlisted in a transaction scope and the scope is still active, // we cannot truly shut down this connection until the scope has completed. Therefore make a |
︙ | |||
752 753 754 755 756 757 758 | 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 | + + - + + + + | if (_sql != null) { _sql.Close(); _sql = null; } _transactionLevel = 0; } StateChangeEventArgs eventArgs = null; |
︙ | |||
941 942 943 944 945 946 947 | 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 | - + | /// <description>Foreign Keys</description> /// <description>Enable foreign key constraints</description> /// <description>N</description> /// <description>False</description> /// </item> /// <item> /// <description>Flags</description> |
︙ | |||
1145 1146 1147 1148 1149 1150 1151 | 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 | - + + + + | // do nothing. } return null; } /// <summary> |
︙ | |||
1387 1388 1389 1390 1391 1392 1393 | 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 | + + - + + + + - + + - + | SQLiteConvert.ToBoolean(FindKey(opts, "Enlist", DefaultEnlist.ToString()))) { EnlistTransaction(transaction); } #endif _connectionState = oldstate; StateChangeEventArgs eventArgs = null; |
︙ |
Changes to System.Data.SQLite/SQLiteConvert.cs.
︙ | |||
981 982 983 984 985 986 987 988 989 990 991 992 993 994 | 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | /// </summary> DateTime = 10, /// <summary> /// Used internally /// </summary> None = 11, } /// <summary> /// These are the event types associated with the /// <see cref="SQLiteConnectionEventHandler" /> /// delegate (and its corresponding event) and the /// <see cref="ConnectionEventArgs" /> class. /// </summary> public enum SQLiteConnectionEventType { /// <summary> /// Not used. /// </summary> Invalid = -1, /// <summary> /// Not used. /// </summary> Unknown = 0, /// <summary> /// The connection is being opened. /// </summary> Opening = 1, /// <summary> /// The connection was opened. /// </summary> Opened = 2, /// <summary> /// The connection is being closed. /// </summary> Closing = 3, /// <summary> /// The connection was closed. /// </summary> Closed = 4 } /// <summary> /// This implementation of SQLite for ADO.NET can process date/time fields in databases in only one of three formats. Ticks, ISO8601 /// and JulianDay. /// </summary> /// <remarks> /// ISO8601 is more compatible, readable, fully-processable, but less accurate as it doesn't provide time down to fractions of a second. |
︙ |
Changes to System.Data.SQLite/SQLiteLog.cs.
︙ | |||
14 15 16 17 18 19 20 | 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 | - + - + - + | /// <summary> /// Event data for logging event handlers. /// </summary> public class LogEventArgs : EventArgs { /// <summary> /// The error code. The type of this object value should be |
︙ |