System.Data.SQLite
Check-in [04332df7d6]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Introduce some private abstract base classes to isolate the differences between memory and stream enumeration.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sessions
Files: files | file ages | folders
SHA1: 04332df7d6a86dc03325e020780901bdd1dcc5ef
User & Date: mistachkin 2017-10-06 17:39:08
Context
2017-10-06
18:06
Work on cleaning up the enumerator/iterator classes and P/Invoke integration. check-in: c82ab41db1 user: mistachkin tags: sessions
17:39
Introduce some private abstract base classes to isolate the differences between memory and stream enumeration. check-in: 04332df7d6 user: mistachkin tags: sessions
16:08
Remove unused IsPatchSet property from the ISQLiteChangeSet interface. check-in: 54ac954062 user: mistachkin tags: sessions
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to System.Data.SQLite/SQLiteSessions.cs.

   131    131               string tableName
   132    132           );
   133    133       }
   134    134       #endregion
   135    135   
   136    136       ///////////////////////////////////////////////////////////////////////////
   137    137   
   138         -    #region SQLiteChangeSetIterator Class
   139         -    internal sealed class SQLiteChangeSetIterator : IDisposable
          138  +    internal abstract class SQLiteChangeSetIterator : IDisposable
   140    139       {
   141    140           #region Private Data
   142         -        private IntPtr pData;
   143    141           private IntPtr iterator;
   144    142           #endregion
   145    143   
   146    144           ///////////////////////////////////////////////////////////////////////
   147    145   
   148         -        #region Private Constructors
   149         -        private SQLiteChangeSetIterator(
   150         -            IntPtr pData,
          146  +        #region Protected Constructors
          147  +        protected SQLiteChangeSetIterator(
   151    148               IntPtr iterator
   152    149               )
   153    150           {
   154         -            this.pData = pData;
   155    151               this.iterator = iterator;
   156    152           }
   157    153           #endregion
   158    154   
   159    155           ///////////////////////////////////////////////////////////////////////
   160    156   
   161         -        #region Private Methods
   162         -        private void CheckHandle()
          157  +        #region Protected Methods
          158  +        protected void CheckHandle()
   163    159           {
   164    160               if (iterator == IntPtr.Zero)
   165    161                   throw new InvalidOperationException("iterator is not open");
   166    162           }
   167         -        #endregion
   168         -
   169         -        ///////////////////////////////////////////////////////////////////////
   170         -
   171         -        #region Static "Factory" Methods
   172         -        public static SQLiteChangeSetIterator Create(
   173         -            byte[] rawData
   174         -            )
   175         -        {
   176         -            if (rawData == null)
   177         -                throw new ArgumentNullException("rawData");
   178         -
   179         -            SQLiteChangeSetIterator result = null;
   180         -            IntPtr pData = IntPtr.Zero;
   181         -            IntPtr iterator = IntPtr.Zero;
   182         -
   183         -            try
   184         -            {
   185         -                int nData = 0;
   186         -
   187         -                pData = SQLiteBytes.ToIntPtr(rawData, ref nData);
   188         -
   189         -                if (pData == IntPtr.Zero)
   190         -                    throw new SQLiteException(SQLiteErrorCode.NoMem, null);
   191         -
   192         -                SQLiteErrorCode rc = UnsafeNativeMethods.sqlite3changeset_start(
   193         -                    ref iterator, nData, pData);
   194         -
   195         -                if (rc != SQLiteErrorCode.Ok)
   196         -                    throw new SQLiteException(rc, "sqlite3changeset_start");
   197         -
   198         -                result = new SQLiteChangeSetIterator(pData, iterator);
   199         -            }
   200         -            finally
   201         -            {
   202         -                if (result == null)
   203         -                {
   204         -                    if (iterator != IntPtr.Zero)
   205         -                    {
   206         -                        UnsafeNativeMethods.sqlite3changeset_finalize(
   207         -                            iterator);
   208         -
   209         -                        iterator = IntPtr.Zero;
   210         -                    }
   211         -
   212         -                    if (pData != IntPtr.Zero)
   213         -                    {
   214         -                        SQLiteMemory.Free(pData);
   215         -                        pData = IntPtr.Zero;
   216         -                    }
   217         -                }
   218         -            }
   219         -
   220         -            return result;
   221         -        }
   222         -
   223         -        ///////////////////////////////////////////////////////////////////////
   224         -
   225         -        public static SQLiteChangeSetIterator Create(
   226         -            Stream stream,
   227         -            SQLiteConnectionFlags flags
   228         -            )
   229         -        {
   230         -            if (stream == null)
   231         -                throw new ArgumentNullException("stream");
   232         -
   233         -            SQLiteChangeSetIterator result = null;
   234         -            IntPtr iterator = IntPtr.Zero;
   235         -
   236         -            try
   237         -            {
   238         -                SQLiteErrorCode rc = UnsafeNativeMethods.sqlite3changeset_start_strm(
   239         -                    ref iterator, new SQLiteStreamAdapter(stream, flags).xInput,
   240         -                    IntPtr.Zero);
   241         -
   242         -                if (rc != SQLiteErrorCode.Ok)
   243         -                    throw new SQLiteException(rc, "sqlite3changeset_start_strm");
   244         -
   245         -                result = new SQLiteChangeSetIterator(IntPtr.Zero, iterator);
   246         -            }
   247         -            finally
   248         -            {
   249         -                if (result == null)
   250         -                {
   251         -                    if (iterator != IntPtr.Zero)
   252         -                    {
   253         -                        UnsafeNativeMethods.sqlite3changeset_finalize(
   254         -                            iterator);
   255         -
   256         -                        iterator = IntPtr.Zero;
   257         -                    }
   258         -                }
   259         -            }
   260         -
   261         -            return result;
   262         -        }
   263    163           #endregion
   264    164   
   265    165           ///////////////////////////////////////////////////////////////////////
   266    166   
   267    167           #region Public Methods
   268    168           public void Next()
   269    169           {
................................................................................
   301    201                       typeof(SQLiteChangeSetIterator).Name);
   302    202               }
   303    203   #endif
   304    204           }
   305    205   
   306    206           ///////////////////////////////////////////////////////////////////////
   307    207   
   308         -        private /* protected virtual */ void Dispose(bool disposing)
          208  +        protected virtual void Dispose(bool disposing)
   309    209           {
   310    210               try
   311    211               {
   312    212                   if (!disposed)
   313    213                   {
   314    214                       //if (disposing)
   315    215                       //{
................................................................................
   325    225                       if (iterator != IntPtr.Zero)
   326    226                       {
   327    227                           UnsafeNativeMethods.sqlite3changeset_finalize(
   328    228                               iterator);
   329    229   
   330    230                           iterator = IntPtr.Zero;
   331    231                       }
   332         -
   333         -                    if (pData != IntPtr.Zero)
   334         -                    {
   335         -                        SQLiteMemory.Free(pData);
   336         -                        pData = IntPtr.Zero;
   337         -                    }
   338    232                   }
   339    233               }
   340    234               finally
   341    235               {
   342    236                   //
   343    237                   // NOTE: Everything should be fully disposed at this point.
   344    238                   //
................................................................................
   349    243   
   350    244           ///////////////////////////////////////////////////////////////////////
   351    245   
   352    246           #region Destructor
   353    247           ~SQLiteChangeSetIterator()
   354    248           {
   355    249               Dispose(false);
          250  +        }
          251  +        #endregion
          252  +    }
          253  +
          254  +    ///////////////////////////////////////////////////////////////////////////
          255  +
          256  +    #region SQLiteMemoryChangeSetIterator Class
          257  +    internal sealed class SQLiteMemoryChangeSetIterator :
          258  +        SQLiteChangeSetIterator
          259  +    {
          260  +        #region Private Data
          261  +        private IntPtr pData;
          262  +        #endregion
          263  +
          264  +        ///////////////////////////////////////////////////////////////////////
          265  +
          266  +        #region Private Constructors
          267  +        private SQLiteMemoryChangeSetIterator(
          268  +            IntPtr pData,
          269  +            IntPtr iterator
          270  +            )
          271  +            : base(iterator)
          272  +        {
          273  +            this.pData = pData;
          274  +        }
          275  +        #endregion
          276  +
          277  +        ///////////////////////////////////////////////////////////////////////
          278  +
          279  +        #region Static "Factory" Methods
          280  +        public static SQLiteMemoryChangeSetIterator Create(
          281  +            byte[] rawData
          282  +            )
          283  +        {
          284  +            if (rawData == null)
          285  +                throw new ArgumentNullException("rawData");
          286  +
          287  +            SQLiteMemoryChangeSetIterator result = null;
          288  +            IntPtr pData = IntPtr.Zero;
          289  +            IntPtr iterator = IntPtr.Zero;
          290  +
          291  +            try
          292  +            {
          293  +                int nData = 0;
          294  +
          295  +                pData = SQLiteBytes.ToIntPtr(rawData, ref nData);
          296  +
          297  +                if (pData == IntPtr.Zero)
          298  +                    throw new SQLiteException(SQLiteErrorCode.NoMem, null);
          299  +
          300  +                SQLiteErrorCode rc = UnsafeNativeMethods.sqlite3changeset_start(
          301  +                    ref iterator, nData, pData);
          302  +
          303  +                if (rc != SQLiteErrorCode.Ok)
          304  +                    throw new SQLiteException(rc, "sqlite3changeset_start");
          305  +
          306  +                result = new SQLiteMemoryChangeSetIterator(pData, iterator);
          307  +            }
          308  +            finally
          309  +            {
          310  +                if (result == null)
          311  +                {
          312  +                    if (iterator != IntPtr.Zero)
          313  +                    {
          314  +                        UnsafeNativeMethods.sqlite3changeset_finalize(
          315  +                            iterator);
          316  +
          317  +                        iterator = IntPtr.Zero;
          318  +                    }
          319  +
          320  +                    if (pData != IntPtr.Zero)
          321  +                    {
          322  +                        SQLiteMemory.Free(pData);
          323  +                        pData = IntPtr.Zero;
          324  +                    }
          325  +                }
          326  +            }
          327  +
          328  +            return result;
          329  +        }
          330  +        #endregion
          331  +
          332  +        ///////////////////////////////////////////////////////////////////////
          333  +
          334  +        #region IDisposable "Pattern" Members
          335  +        private bool disposed;
          336  +        private void CheckDisposed() /* throw */
          337  +        {
          338  +#if THROW_ON_DISPOSED
          339  +            if (disposed)
          340  +            {
          341  +                throw new ObjectDisposedException(
          342  +                    typeof(SQLiteMemoryChangeSetIterator).Name);
          343  +            }
          344  +#endif
          345  +        }
          346  +
          347  +        ///////////////////////////////////////////////////////////////////////
          348  +
          349  +        protected override void Dispose(bool disposing)
          350  +        {
          351  +            //
          352  +            // NOTE: Must dispose of the base class first (leaky abstraction)
          353  +            //       because it contains the iterator handle, which must be
          354  +            //       closed *prior* to freeing the underlying memory.
          355  +            //
          356  +            base.Dispose(disposing);
          357  +
          358  +            try
          359  +            {
          360  +                if (!disposed)
          361  +                {
          362  +                    //if (disposing)
          363  +                    //{
          364  +                    //    ////////////////////////////////////
          365  +                    //    // dispose managed resources here...
          366  +                    //    ////////////////////////////////////
          367  +                    //}
          368  +
          369  +                    //////////////////////////////////////
          370  +                    // release unmanaged resources here...
          371  +                    //////////////////////////////////////
          372  +
          373  +                    if (pData != IntPtr.Zero)
          374  +                    {
          375  +                        SQLiteMemory.Free(pData);
          376  +                        pData = IntPtr.Zero;
          377  +                    }
          378  +                }
          379  +            }
          380  +            finally
          381  +            {
          382  +                //
          383  +                // NOTE: Everything should be fully disposed at this point.
          384  +                //
          385  +                disposed = true;
          386  +            }
          387  +        }
          388  +        #endregion
          389  +    }
          390  +    #endregion
          391  +
          392  +    ///////////////////////////////////////////////////////////////////////////
          393  +
          394  +    #region SQLiteStreamChangeSetIterator Class
          395  +    internal sealed class SQLiteStreamChangeSetIterator :
          396  +        SQLiteChangeSetIterator
          397  +    {
          398  +        #region Private Constructors
          399  +        private SQLiteStreamChangeSetIterator(
          400  +            IntPtr iterator
          401  +            )
          402  +            : base(iterator)
          403  +        {
          404  +            // do nothing.
          405  +        }
          406  +        #endregion
          407  +
          408  +        ///////////////////////////////////////////////////////////////////////
          409  +
          410  +        #region Static "Factory" Methods
          411  +        public static SQLiteStreamChangeSetIterator Create(
          412  +            Stream stream,
          413  +            SQLiteConnectionFlags flags
          414  +            )
          415  +        {
          416  +            if (stream == null)
          417  +                throw new ArgumentNullException("stream");
          418  +
          419  +            SQLiteStreamChangeSetIterator result = null;
          420  +            IntPtr iterator = IntPtr.Zero;
          421  +
          422  +            try
          423  +            {
          424  +                SQLiteErrorCode rc = UnsafeNativeMethods.sqlite3changeset_start_strm(
          425  +                    ref iterator, new SQLiteStreamAdapter(stream, flags).xInput,
          426  +                    IntPtr.Zero);
          427  +
          428  +                if (rc != SQLiteErrorCode.Ok)
          429  +                    throw new SQLiteException(rc, "sqlite3changeset_start_strm");
          430  +
          431  +                result = new SQLiteStreamChangeSetIterator(iterator);
          432  +            }
          433  +            finally
          434  +            {
          435  +                if (result == null)
          436  +                {
          437  +                    if (iterator != IntPtr.Zero)
          438  +                    {
          439  +                        UnsafeNativeMethods.sqlite3changeset_finalize(
          440  +                            iterator);
          441  +
          442  +                        iterator = IntPtr.Zero;
          443  +                    }
          444  +                }
          445  +            }
          446  +
          447  +            return result;
          448  +        }
          449  +        #endregion
          450  +
          451  +        ///////////////////////////////////////////////////////////////////////
          452  +
          453  +        #region IDisposable "Pattern" Members
          454  +        private bool disposed;
          455  +        private void CheckDisposed() /* throw */
          456  +        {
          457  +#if THROW_ON_DISPOSED
          458  +            if (disposed)
          459  +            {
          460  +                throw new ObjectDisposedException(
          461  +                    typeof(SQLiteStreamChangeSetIterator).Name);
          462  +            }
          463  +#endif
          464  +        }
          465  +
          466  +        ///////////////////////////////////////////////////////////////////////
          467  +
          468  +        protected override void Dispose(bool disposing)
          469  +        {
          470  +            try
          471  +            {
          472  +                if (!disposed)
          473  +                {
          474  +                    //if (disposing)
          475  +                    //{
          476  +                    //    ////////////////////////////////////
          477  +                    //    // dispose managed resources here...
          478  +                    //    ////////////////////////////////////
          479  +                    //}
          480  +
          481  +                    //////////////////////////////////////
          482  +                    // release unmanaged resources here...
          483  +                    //////////////////////////////////////
          484  +                }
          485  +            }
          486  +            finally
          487  +            {
          488  +                base.Dispose(disposing);
          489  +
          490  +                //
          491  +                // NOTE: Everything should be fully disposed at this point.
          492  +                //
          493  +                disposed = true;
          494  +            }
   356    495           }
   357    496           #endregion
   358    497       }
   359    498       #endregion
   360    499   
   361    500       ///////////////////////////////////////////////////////////////////////////
   362    501   
................................................................................
   922   1061           #endregion
   923   1062       }
   924   1063       #endregion
   925   1064   
   926   1065       ///////////////////////////////////////////////////////////////////////////
   927   1066   
   928   1067       #region SQLiteMemoryChangeSet Class
   929         -    public sealed class SQLiteMemoryChangeSet :
         1068  +    internal sealed class SQLiteMemoryChangeSet :
   930   1069           ISQLiteChangeSet, IEnumerable<ISQLiteChangeSetMetadataItem>,
   931   1070           IDisposable
   932   1071       {
   933   1072           #region Private Data
   934   1073           private byte[] rawData;
   935   1074           private SQLiteConnectionHandle handle;
   936   1075           private SQLiteConnectionFlags flags;
................................................................................
  1200   1339           #endregion
  1201   1340   
  1202   1341           ///////////////////////////////////////////////////////////////////////
  1203   1342   
  1204   1343           #region IEnumerable<ISQLiteChangeSetMetadataItem> Members
  1205   1344           public IEnumerator<ISQLiteChangeSetMetadataItem> GetEnumerator()
  1206   1345           {
  1207         -            return new SQLiteChangeSetEnumerator(rawData);
         1346  +            return new SQLiteMemoryChangeSetEnumerator(rawData);
  1208   1347           }
  1209   1348           #endregion
  1210   1349   
  1211   1350           ///////////////////////////////////////////////////////////////////////
  1212   1351   
  1213   1352           #region IEnumerable Members
  1214   1353           IEnumerator System.Collections.IEnumerable.GetEnumerator()
................................................................................
  1285   1424           #endregion
  1286   1425       }
  1287   1426       #endregion
  1288   1427   
  1289   1428       ///////////////////////////////////////////////////////////////////////////
  1290   1429   
  1291   1430       #region SQLiteStreamChangeSet Class
  1292         -    public sealed class SQLiteStreamChangeSet :
         1431  +    internal sealed class SQLiteStreamChangeSet :
  1293   1432           ISQLiteChangeSet, IEnumerable<ISQLiteChangeSetMetadataItem>,
  1294   1433           IDisposable
  1295   1434       {
  1296   1435           #region Private Data
  1297   1436           private Stream inputStream;
  1298   1437           private Stream outputStream;
  1299   1438           private SQLiteConnectionHandle handle;
................................................................................
  1495   1634           #endregion
  1496   1635   
  1497   1636           ///////////////////////////////////////////////////////////////////////
  1498   1637   
  1499   1638           #region IEnumerable<ISQLiteChangeSetMetadataItem> Members
  1500   1639           public IEnumerator<ISQLiteChangeSetMetadataItem> GetEnumerator()
  1501   1640           {
  1502         -            return new SQLiteChangeSetEnumerator(inputStream, flags);
         1641  +            return new SQLiteStreamChangeSetEnumerator(inputStream, flags);
  1503   1642           }
  1504   1643           #endregion
  1505   1644   
  1506   1645           ///////////////////////////////////////////////////////////////////////
  1507   1646   
  1508   1647           #region IEnumerable Members
  1509   1648           IEnumerator System.Collections.IEnumerable.GetEnumerator()
................................................................................
  1583   1722           #endregion
  1584   1723       }
  1585   1724       #endregion
  1586   1725   
  1587   1726       ///////////////////////////////////////////////////////////////////////////
  1588   1727   
  1589   1728       #region SQLiteChangeSetEnumerator Class
  1590         -    internal sealed class SQLiteChangeSetEnumerator :
         1729  +    internal abstract class SQLiteChangeSetEnumerator :
  1591   1730           IEnumerator<ISQLiteChangeSetMetadataItem>
  1592   1731       {
  1593   1732           #region Private Data
  1594   1733           private SQLiteChangeSetIterator iterator;
  1595   1734           #endregion
  1596   1735   
  1597   1736           ///////////////////////////////////////////////////////////////////////
  1598   1737   
  1599   1738           #region Public Constructors
  1600   1739           public SQLiteChangeSetEnumerator(
  1601         -            byte[] rawData
         1740  +            SQLiteChangeSetIterator iterator
  1602   1741               )
  1603   1742           {
  1604         -            iterator = SQLiteChangeSetIterator.Create(rawData);
  1605         -        }
  1606         -
  1607         -        ///////////////////////////////////////////////////////////////////////
  1608         -
  1609         -        public SQLiteChangeSetEnumerator(
  1610         -            Stream stream,
  1611         -            SQLiteConnectionFlags flags
  1612         -            )
  1613         -        {
  1614         -            iterator = SQLiteChangeSetIterator.Create(stream, flags);
         1743  +            this.iterator = iterator;
  1615   1744           }
  1616   1745           #endregion
  1617   1746   
  1618   1747           ///////////////////////////////////////////////////////////////////////
  1619   1748   
  1620   1749           #region IEnumerator<ISQLiteChangeSetMetadataItem> Members
  1621   1750           public ISQLiteChangeSetMetadataItem Current
................................................................................
  1670   1799                       typeof(SQLiteChangeSetEnumerator).Name);
  1671   1800               }
  1672   1801   #endif
  1673   1802           }
  1674   1803   
  1675   1804           ///////////////////////////////////////////////////////////////////////
  1676   1805   
  1677         -        private /* protected virtual */ void Dispose(bool disposing)
         1806  +        protected virtual void Dispose(bool disposing)
  1678   1807           {
  1679   1808               try
  1680   1809               {
  1681   1810                   if (!disposed)
  1682   1811                   {
  1683   1812                       if (disposing)
  1684   1813                       {
................................................................................
  1710   1839   
  1711   1840           ///////////////////////////////////////////////////////////////////////
  1712   1841   
  1713   1842           #region Destructor
  1714   1843           ~SQLiteChangeSetEnumerator()
  1715   1844           {
  1716   1845               Dispose(false);
         1846  +        }
         1847  +        #endregion
         1848  +    }
         1849  +    #endregion
         1850  +
         1851  +    ///////////////////////////////////////////////////////////////////////////
         1852  +
         1853  +    #region SQLiteMemoryChangeSetEnumerator Class
         1854  +    internal sealed class SQLiteMemoryChangeSetEnumerator :
         1855  +        SQLiteChangeSetEnumerator
         1856  +    {
         1857  +        #region Public Constructors
         1858  +        public SQLiteMemoryChangeSetEnumerator(
         1859  +            byte[] rawData
         1860  +            )
         1861  +            : base(SQLiteMemoryChangeSetIterator.Create(rawData))
         1862  +        {
         1863  +            // do nothing.
         1864  +        }
         1865  +        #endregion
         1866  +
         1867  +        ///////////////////////////////////////////////////////////////////////
         1868  +
         1869  +        #region IDisposable "Pattern" Members
         1870  +        private bool disposed;
         1871  +        private void CheckDisposed() /* throw */
         1872  +        {
         1873  +#if THROW_ON_DISPOSED
         1874  +            if (disposed)
         1875  +            {
         1876  +                throw new ObjectDisposedException(
         1877  +                    typeof(SQLiteMemoryChangeSetEnumerator).Name);
         1878  +            }
         1879  +#endif
         1880  +        }
         1881  +
         1882  +        ///////////////////////////////////////////////////////////////////////
         1883  +
         1884  +        protected override void Dispose(bool disposing)
         1885  +        {
         1886  +            try
         1887  +            {
         1888  +                if (!disposed)
         1889  +                {
         1890  +                    if (disposing)
         1891  +                    {
         1892  +                        ////////////////////////////////////
         1893  +                        // dispose managed resources here...
         1894  +                        ////////////////////////////////////
         1895  +                    }
         1896  +
         1897  +                    //////////////////////////////////////
         1898  +                    // release unmanaged resources here...
         1899  +                    //////////////////////////////////////
         1900  +                }
         1901  +            }
         1902  +            finally
         1903  +            {
         1904  +                base.Dispose(disposing);
         1905  +
         1906  +                //
         1907  +                // NOTE: Everything should be fully disposed at this point.
         1908  +                //
         1909  +                disposed = true;
         1910  +            }
         1911  +        }
         1912  +        #endregion
         1913  +    }
         1914  +    #endregion
         1915  +
         1916  +    ///////////////////////////////////////////////////////////////////////////
         1917  +
         1918  +    #region SQLiteStreamChangeSetEnumerator Class
         1919  +    internal sealed class SQLiteStreamChangeSetEnumerator :
         1920  +        SQLiteChangeSetEnumerator
         1921  +    {
         1922  +        #region Public Constructors
         1923  +        public SQLiteStreamChangeSetEnumerator(
         1924  +            Stream stream,
         1925  +            SQLiteConnectionFlags flags
         1926  +            )
         1927  +            : base(SQLiteStreamChangeSetIterator.Create(stream, flags))
         1928  +        {
         1929  +            // do nothing.
         1930  +        }
         1931  +        #endregion
         1932  +
         1933  +        ///////////////////////////////////////////////////////////////////////
         1934  +
         1935  +        #region IDisposable "Pattern" Members
         1936  +        private bool disposed;
         1937  +        private void CheckDisposed() /* throw */
         1938  +        {
         1939  +#if THROW_ON_DISPOSED
         1940  +            if (disposed)
         1941  +            {
         1942  +                throw new ObjectDisposedException(
         1943  +                    typeof(SQLiteStreamChangeSetEnumerator).Name);
         1944  +            }
         1945  +#endif
         1946  +        }
         1947  +
         1948  +        ///////////////////////////////////////////////////////////////////////
         1949  +
         1950  +        protected override void Dispose(bool disposing)
         1951  +        {
         1952  +            try
         1953  +            {
         1954  +                //if (!disposed)
         1955  +                //{
         1956  +                //    if (disposing)
         1957  +                //    {
         1958  +                //        ////////////////////////////////////
         1959  +                //        // dispose managed resources here...
         1960  +                //        ////////////////////////////////////
         1961  +                //    }
         1962  +
         1963  +                //    //////////////////////////////////////
         1964  +                //    // release unmanaged resources here...
         1965  +                //    //////////////////////////////////////
         1966  +                //}
         1967  +            }
         1968  +            finally
         1969  +            {
         1970  +                base.Dispose(disposing);
         1971  +
         1972  +                //
         1973  +                // NOTE: Everything should be fully disposed at this point.
         1974  +                //
         1975  +                disposed = true;
         1976  +            }
  1717   1977           }
  1718   1978           #endregion
  1719   1979       }
  1720   1980       #endregion
  1721   1981   
  1722   1982       ///////////////////////////////////////////////////////////////////////////
  1723   1983