-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSQLiteModuleNoop.cs
executable file
·786 lines (696 loc) · 26.7 KB
/
SQLiteModuleNoop.cs
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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
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
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
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
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
/********************************************************
* ADO.NET 2.0 Data Provider for SQLite Version 3.X
* Written by Joe Mistachkin (joe@mistachkin.com)
*
* Released to the public domain, use at your own risk!
********************************************************/
using System.Collections.Generic;
namespace System.Data.SQLite
{
/// <summary>
/// This class implements a virtual table module that does nothing by
/// providing "empty" implementations for all of the
/// <see cref="ISQLiteManagedModule" /> interface methods. The result
/// codes returned by these "empty" method implementations may be
/// controlled on a per-method basis by using and/or overriding the
/// <see cref="GetDefaultResultCode" />,
/// <see cref="ResultCodeToEofResult" />,
/// <see cref="ResultCodeToFindFunctionResult" />,
/// <see cref="GetMethodResultCode" />, and
/// <see cref="SetMethodResultCode" /> methods from within derived classes.
/// </summary>
public class SQLiteModuleNoop : SQLiteModule /* NOT SEALED */
{
#region Private Data
/// <summary>
/// This field is used to store the <see cref="SQLiteErrorCode" />
/// values to return, on a per-method basis, for all methods that are
/// part of the <see cref="ISQLiteManagedModule" /> interface.
/// </summary>
private Dictionary<string, SQLiteErrorCode> resultCodes;
#endregion
///////////////////////////////////////////////////////////////////////
#region Public Constructors
/// <summary>
/// Constructs an instance of this class.
/// </summary>
/// <param name="name">
/// The name of the module. This parameter cannot be null.
/// </param>
public SQLiteModuleNoop(
string name
)
: base(name)
{
resultCodes = new Dictionary<string, SQLiteErrorCode>();
}
#endregion
///////////////////////////////////////////////////////////////////////
#region Protected Methods
/// <summary>
/// Determines the default <see cref="SQLiteErrorCode" /> value to be
/// returned by methods of the <see cref="ISQLiteManagedModule" />
/// interface that lack an overridden implementation in all classes
/// derived from the <see cref="SQLiteModuleNoop" /> class.
/// </summary>
/// <returns>
/// The <see cref="SQLiteErrorCode" /> value that should be returned
/// by all <see cref="ISQLiteManagedModule" /> interface methods unless
/// a more specific result code has been set for that interface method.
/// </returns>
protected virtual SQLiteErrorCode GetDefaultResultCode()
{
return SQLiteErrorCode.Ok;
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// Converts a <see cref="SQLiteErrorCode" /> value into a boolean
/// return value for use with the
/// <see cref="ISQLiteManagedModule.Eof" /> method.
/// </summary>
/// <param name="resultCode">
/// The <see cref="SQLiteErrorCode" /> value to convert.
/// </param>
/// <returns>
/// The <see cref="Boolean" /> value.
/// </returns>
protected virtual bool ResultCodeToEofResult(
SQLiteErrorCode resultCode
)
{
return (resultCode == SQLiteErrorCode.Ok) ? false : true;
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// Converts a <see cref="SQLiteErrorCode" /> value into a boolean
/// return value for use with the
/// <see cref="ISQLiteManagedModule.FindFunction" /> method.
/// </summary>
/// <param name="resultCode">
/// The <see cref="SQLiteErrorCode" /> value to convert.
/// </param>
/// <returns>
/// The <see cref="Boolean" /> value.
/// </returns>
protected virtual bool ResultCodeToFindFunctionResult(
SQLiteErrorCode resultCode
)
{
return (resultCode == SQLiteErrorCode.Ok) ? true : false;
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// Determines the <see cref="SQLiteErrorCode" /> value that should be
/// returned by the specified <see cref="ISQLiteManagedModule" />
/// interface method if it lack an overridden implementation. If no
/// specific <see cref="SQLiteErrorCode" /> value is available (or set)
/// for the specified method, the <see cref="SQLiteErrorCode" /> value
/// returned by the <see cref="GetDefaultResultCode" /> method will be
/// returned instead.
/// </summary>
/// <param name="methodName">
/// The name of the method. Currently, this method must be part of
/// the <see cref="ISQLiteManagedModule" /> interface.
/// </param>
/// <returns>
/// The <see cref="SQLiteErrorCode" /> value that should be returned
/// by the <see cref="ISQLiteManagedModule" /> interface method.
/// </returns>
protected virtual SQLiteErrorCode GetMethodResultCode(
string methodName
)
{
if ((methodName == null) || (resultCodes == null))
return GetDefaultResultCode();
SQLiteErrorCode resultCode;
if ((resultCodes != null) &&
resultCodes.TryGetValue(methodName, out resultCode))
{
return resultCode;
}
return GetDefaultResultCode();
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// Sets the <see cref="SQLiteErrorCode" /> value that should be
/// returned by the specified <see cref="ISQLiteManagedModule" />
/// interface method if it lack an overridden implementation.
/// </summary>
/// <param name="methodName">
/// The name of the method. Currently, this method must be part of
/// the <see cref="ISQLiteManagedModule" /> interface.
/// </param>
/// <param name="resultCode">
/// The <see cref="SQLiteErrorCode" /> value that should be returned
/// by the <see cref="ISQLiteManagedModule" /> interface method.
/// </param>
/// <returns>
/// Non-zero upon success.
/// </returns>
protected virtual bool SetMethodResultCode(
string methodName,
SQLiteErrorCode resultCode
)
{
if ((methodName == null) || (resultCodes == null))
return false;
resultCodes[methodName] = resultCode;
return true;
}
#endregion
///////////////////////////////////////////////////////////////////////
#region ISQLiteManagedModule Members
/// <summary>
/// See the <see cref="ISQLiteManagedModule.Create" /> method.
/// </summary>
/// <param name="connection">
/// See the <see cref="ISQLiteManagedModule.Create" /> method.
/// </param>
/// <param name="pClientData">
/// See the <see cref="ISQLiteManagedModule.Create" /> method.
/// </param>
/// <param name="arguments">
/// See the <see cref="ISQLiteManagedModule.Create" /> method.
/// </param>
/// <param name="table">
/// See the <see cref="ISQLiteManagedModule.Create" /> method.
/// </param>
/// <param name="error">
/// See the <see cref="ISQLiteManagedModule.Create" /> method.
/// </param>
/// <returns>
/// See the <see cref="ISQLiteManagedModule.Create" /> method.
/// </returns>
public override SQLiteErrorCode Create(
SQLiteConnection connection,
IntPtr pClientData,
string[] arguments,
ref SQLiteVirtualTable table,
ref string error
)
{
CheckDisposed();
return GetMethodResultCode("Create");
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// See the <see cref="ISQLiteManagedModule.Connect" /> method.
/// </summary>
/// <param name="connection">
/// See the <see cref="ISQLiteManagedModule.Connect" /> method.
/// </param>
/// <param name="pClientData">
/// See the <see cref="ISQLiteManagedModule.Connect" /> method.
/// </param>
/// <param name="arguments">
/// See the <see cref="ISQLiteManagedModule.Connect" /> method.
/// </param>
/// <param name="table">
/// See the <see cref="ISQLiteManagedModule.Connect" /> method.
/// </param>
/// <param name="error">
/// See the <see cref="ISQLiteManagedModule.Connect" /> method.
/// </param>
/// <returns>
/// See the <see cref="ISQLiteManagedModule.Connect" /> method.
/// </returns>
public override SQLiteErrorCode Connect(
SQLiteConnection connection,
IntPtr pClientData,
string[] arguments,
ref SQLiteVirtualTable table,
ref string error
)
{
CheckDisposed();
return GetMethodResultCode("Connect");
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// See the <see cref="ISQLiteManagedModule.BestIndex" /> method.
/// </summary>
/// <param name="table">
/// See the <see cref="ISQLiteManagedModule.BestIndex" /> method.
/// </param>
/// <param name="index">
/// See the <see cref="ISQLiteManagedModule.BestIndex" /> method.
/// </param>
/// <returns>
/// See the <see cref="ISQLiteManagedModule.BestIndex" /> method.
/// </returns>
public override SQLiteErrorCode BestIndex(
SQLiteVirtualTable table,
SQLiteIndex index
)
{
CheckDisposed();
return GetMethodResultCode("BestIndex");
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// See the <see cref="ISQLiteManagedModule.Disconnect" /> method.
/// </summary>
/// <param name="table">
/// See the <see cref="ISQLiteManagedModule.Disconnect" /> method.
/// </param>
/// <returns>
/// See the <see cref="ISQLiteManagedModule.Disconnect" /> method.
/// </returns>
public override SQLiteErrorCode Disconnect(
SQLiteVirtualTable table
)
{
CheckDisposed();
return GetMethodResultCode("Disconnect");
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// See the <see cref="ISQLiteManagedModule.Destroy" /> method.
/// </summary>
/// <param name="table">
/// See the <see cref="ISQLiteManagedModule.Destroy" /> method.
/// </param>
/// <returns>
/// See the <see cref="ISQLiteManagedModule.Destroy" /> method.
/// </returns>
public override SQLiteErrorCode Destroy(
SQLiteVirtualTable table
)
{
CheckDisposed();
return GetMethodResultCode("Destroy");
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// See the <see cref="ISQLiteManagedModule.Open" /> method.
/// </summary>
/// <param name="table">
/// See the <see cref="ISQLiteManagedModule.Open" /> method.
/// </param>
/// <param name="cursor">
/// See the <see cref="ISQLiteManagedModule.Open" /> method.
/// </param>
/// <returns>
/// See the <see cref="ISQLiteManagedModule.Open" /> method.
/// </returns>
public override SQLiteErrorCode Open(
SQLiteVirtualTable table,
ref SQLiteVirtualTableCursor cursor
)
{
CheckDisposed();
return GetMethodResultCode("Open");
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// See the <see cref="ISQLiteManagedModule.Close" /> method.
/// </summary>
/// <param name="cursor">
/// See the <see cref="ISQLiteManagedModule.Close" /> method.
/// </param>
/// <returns>
/// See the <see cref="ISQLiteManagedModule.Close" /> method.
/// </returns>
public override SQLiteErrorCode Close(
SQLiteVirtualTableCursor cursor
)
{
CheckDisposed();
return GetMethodResultCode("Close");
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// See the <see cref="ISQLiteManagedModule.Filter" /> method.
/// </summary>
/// <param name="cursor">
/// See the <see cref="ISQLiteManagedModule.Filter" /> method.
/// </param>
/// <param name="indexNumber">
/// See the <see cref="ISQLiteManagedModule.Filter" /> method.
/// </param>
/// <param name="indexString">
/// See the <see cref="ISQLiteManagedModule.Filter" /> method.
/// </param>
/// <param name="values">
/// See the <see cref="ISQLiteManagedModule.Filter" /> method.
/// </param>
/// <returns>
/// See the <see cref="ISQLiteManagedModule.Filter" /> method.
/// </returns>
public override SQLiteErrorCode Filter(
SQLiteVirtualTableCursor cursor,
int indexNumber,
string indexString,
SQLiteValue[] values
)
{
CheckDisposed();
return GetMethodResultCode("Filter");
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// See the <see cref="ISQLiteManagedModule.Next" /> method.
/// </summary>
/// <param name="cursor">
/// See the <see cref="ISQLiteManagedModule.Next" /> method.
/// </param>
/// <returns>
/// See the <see cref="ISQLiteManagedModule.Next" /> method.
/// </returns>
public override SQLiteErrorCode Next(
SQLiteVirtualTableCursor cursor
)
{
CheckDisposed();
return GetMethodResultCode("Next");
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// See the <see cref="ISQLiteManagedModule.Eof" /> method.
/// </summary>
/// <param name="cursor">
/// See the <see cref="ISQLiteManagedModule.Eof" /> method.
/// </param>
/// <returns>
/// See the <see cref="ISQLiteManagedModule.Eof" /> method.
/// </returns>
public override bool Eof(
SQLiteVirtualTableCursor cursor
)
{
CheckDisposed();
return ResultCodeToEofResult(GetMethodResultCode("Eof"));
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// See the <see cref="ISQLiteManagedModule.Column" /> method.
/// </summary>
/// <param name="cursor">
/// See the <see cref="ISQLiteManagedModule.Column" /> method.
/// </param>
/// <param name="context">
/// See the <see cref="ISQLiteManagedModule.Column" /> method.
/// </param>
/// <param name="index">
/// See the <see cref="ISQLiteManagedModule.Column" /> method.
/// </param>
/// <returns>
/// See the <see cref="ISQLiteManagedModule.Column" /> method.
/// </returns>
public override SQLiteErrorCode Column(
SQLiteVirtualTableCursor cursor,
SQLiteContext context,
int index
)
{
CheckDisposed();
return GetMethodResultCode("Column");
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// See the <see cref="ISQLiteManagedModule.RowId" /> method.
/// </summary>
/// <param name="cursor">
/// See the <see cref="ISQLiteManagedModule.RowId" /> method.
/// </param>
/// <param name="rowId">
/// See the <see cref="ISQLiteManagedModule.RowId" /> method.
/// </param>
/// <returns>
/// See the <see cref="ISQLiteManagedModule.RowId" /> method.
/// </returns>
public override SQLiteErrorCode RowId(
SQLiteVirtualTableCursor cursor,
ref long rowId
)
{
CheckDisposed();
return GetMethodResultCode("RowId");
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// See the <see cref="ISQLiteManagedModule.Update" /> method.
/// </summary>
/// <param name="table">
/// See the <see cref="ISQLiteManagedModule.Update" /> method.
/// </param>
/// <param name="values">
/// See the <see cref="ISQLiteManagedModule.Update" /> method.
/// </param>
/// <param name="rowId">
/// See the <see cref="ISQLiteManagedModule.Update" /> method.
/// </param>
/// <returns>
/// See the <see cref="ISQLiteManagedModule.Update" /> method.
/// </returns>
public override SQLiteErrorCode Update(
SQLiteVirtualTable table,
SQLiteValue[] values,
ref long rowId
)
{
CheckDisposed();
return GetMethodResultCode("Update");
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// See the <see cref="ISQLiteManagedModule.Begin" /> method.
/// </summary>
/// <param name="table">
/// See the <see cref="ISQLiteManagedModule.Begin" /> method.
/// </param>
/// <returns>
/// See the <see cref="ISQLiteManagedModule.Begin" /> method.
/// </returns>
public override SQLiteErrorCode Begin(
SQLiteVirtualTable table
)
{
CheckDisposed();
return GetMethodResultCode("Begin");
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// See the <see cref="ISQLiteManagedModule.Sync" /> method.
/// </summary>
/// <param name="table">
/// See the <see cref="ISQLiteManagedModule.Sync" /> method.
/// </param>
/// <returns>
/// See the <see cref="ISQLiteManagedModule.Sync" /> method.
/// </returns>
public override SQLiteErrorCode Sync(
SQLiteVirtualTable table
)
{
CheckDisposed();
return GetMethodResultCode("Sync");
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// See the <see cref="ISQLiteManagedModule.Commit" /> method.
/// </summary>
/// <param name="table">
/// See the <see cref="ISQLiteManagedModule.Commit" /> method.
/// </param>
/// <returns>
/// See the <see cref="ISQLiteManagedModule.Commit" /> method.
/// </returns>
public override SQLiteErrorCode Commit(
SQLiteVirtualTable table
)
{
CheckDisposed();
return GetMethodResultCode("Commit");
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// See the <see cref="ISQLiteManagedModule.Rollback" /> method.
/// </summary>
/// <param name="table">
/// See the <see cref="ISQLiteManagedModule.Rollback" /> method.
/// </param>
/// <returns>
/// See the <see cref="ISQLiteManagedModule.Rollback" /> method.
/// </returns>
public override SQLiteErrorCode Rollback(
SQLiteVirtualTable table
)
{
CheckDisposed();
return GetMethodResultCode("Rollback");
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// See the <see cref="ISQLiteManagedModule.FindFunction" /> method.
/// </summary>
/// <param name="table">
/// See the <see cref="ISQLiteManagedModule.FindFunction" /> method.
/// </param>
/// <param name="argumentCount">
/// See the <see cref="ISQLiteManagedModule.FindFunction" /> method.
/// </param>
/// <param name="name">
/// See the <see cref="ISQLiteManagedModule.FindFunction" /> method.
/// </param>
/// <param name="function">
/// See the <see cref="ISQLiteManagedModule.FindFunction" /> method.
/// </param>
/// <param name="pClientData">
/// See the <see cref="ISQLiteManagedModule.FindFunction" /> method.
/// </param>
/// <returns>
/// See the <see cref="ISQLiteManagedModule.FindFunction" /> method.
/// </returns>
public override bool FindFunction(
SQLiteVirtualTable table,
int argumentCount,
string name,
ref SQLiteFunction function,
ref IntPtr pClientData
)
{
CheckDisposed();
return ResultCodeToFindFunctionResult(GetMethodResultCode(
"FindFunction"));
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// See the <see cref="ISQLiteManagedModule.Rename" /> method.
/// </summary>
/// <param name="table">
/// See the <see cref="ISQLiteManagedModule.Rename" /> method.
/// </param>
/// <param name="newName">
/// See the <see cref="ISQLiteManagedModule.Rename" /> method.
/// </param>
/// <returns>
/// See the <see cref="ISQLiteManagedModule.Rename" /> method.
/// </returns>
public override SQLiteErrorCode Rename(
SQLiteVirtualTable table,
string newName
)
{
CheckDisposed();
return GetMethodResultCode("Rename");
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// See the <see cref="ISQLiteManagedModule.Savepoint" /> method.
/// </summary>
/// <param name="table">
/// See the <see cref="ISQLiteManagedModule.Savepoint" /> method.
/// </param>
/// <param name="savepoint">
/// See the <see cref="ISQLiteManagedModule.Savepoint" /> method.
/// </param>
/// <returns>
/// See the <see cref="ISQLiteManagedModule.Savepoint" /> method.
/// </returns>
public override SQLiteErrorCode Savepoint(
SQLiteVirtualTable table,
int savepoint
)
{
CheckDisposed();
return GetMethodResultCode("Savepoint");
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// See the <see cref="ISQLiteManagedModule.Release" /> method.
/// </summary>
/// <param name="table">
/// See the <see cref="ISQLiteManagedModule.Release" /> method.
/// </param>
/// <param name="savepoint">
/// See the <see cref="ISQLiteManagedModule.Release" /> method.
/// </param>
/// <returns>
/// See the <see cref="ISQLiteManagedModule.Release" /> method.
/// </returns>
public override SQLiteErrorCode Release(
SQLiteVirtualTable table,
int savepoint
)
{
CheckDisposed();
return GetMethodResultCode("Release");
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// See the <see cref="ISQLiteManagedModule.RollbackTo" /> method.
/// </summary>
/// <param name="table">
/// See the <see cref="ISQLiteManagedModule.RollbackTo" /> method.
/// </param>
/// <param name="savepoint">
/// See the <see cref="ISQLiteManagedModule.RollbackTo" /> method.
/// </param>
/// <returns>
/// See the <see cref="ISQLiteManagedModule.RollbackTo" /> method.
/// </returns>
public override SQLiteErrorCode RollbackTo(
SQLiteVirtualTable table,
int savepoint
)
{
CheckDisposed();
return GetMethodResultCode("RollbackTo");
}
#endregion
///////////////////////////////////////////////////////////////////////
#region IDisposable "Pattern" Members
private bool disposed;
/// <summary>
/// Throws an <see cref="ObjectDisposedException" /> if this object
/// instance has been disposed.
/// </summary>
private void CheckDisposed() /* throw */
{
#if THROW_ON_DISPOSED
if (disposed)
{
throw new ObjectDisposedException(
typeof(SQLiteModuleNoop).Name);
}
#endif
}
///////////////////////////////////////////////////////////////////////
/// <summary>
/// Disposes of this object instance.
/// </summary>
/// <param name="disposing">
/// Non-zero if this method is being called from the
/// <see cref="IDisposable.Dispose" /> method. Zero if this method is
/// being called from the finalizer.
/// </param>
protected override void Dispose(bool disposing)
{
try
{
if (!disposed)
{
//if (disposing)
//{
// ////////////////////////////////////
// // dispose managed resources here...
// ////////////////////////////////////
//}
//////////////////////////////////////
// release unmanaged resources here...
//////////////////////////////////////
}
}
finally
{
base.Dispose(disposing);
//
// NOTE: Everything should be fully disposed at this point.
//
disposed = true;
}
}
#endregion
}
}