System.Data.SQLite
Check-in [250eb1f8b2]
Not logged in

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

Overview
Comment:Fix compilation issues for the SQLiteFunction delegate functionality on the .NET Compact Framework.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 250eb1f8b2d2bb895b75a8acfbea6b8444d1f569
User & Date: mistachkin 2015-08-18 22:10:04
Context
2015-08-18
22:13
Update the included FTS5 extension to the latest trunk code. check-in: 6458f27af1 user: mistachkin tags: trunk
22:10
Fix compilation issues for the SQLiteFunction delegate functionality on the .NET Compact Framework. check-in: 250eb1f8b2 user: mistachkin tags: trunk
03:04
Update the included FTS5 extension to the latest trunk code. check-in: e3cb9d9023 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

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

  1188   1188       string param0,
  1189   1189       string param1,
  1190   1190       string param2
  1191   1191     );
  1192   1192   
  1193   1193     /////////////////////////////////////////////////////////////////////////////
  1194   1194   
         1195  +#if !PLATFORM_COMPACTFRAMEWORK
         1196  +  /// <summary>
         1197  +  /// This class implements a SQLite function using a <see cref="Delegate" />.
         1198  +  /// All the virtual methods of the <see cref="SQLiteFunction" /> class are
         1199  +  /// implemented using calls to the <see cref="SQLiteInvokeDelegate" />,
         1200  +  /// <see cref="SQLiteStepDelegate" />, <see cref="SQLiteFinalDelegate" />,
         1201  +  /// and <see cref="SQLiteCompareDelegate" /> strongly typed delegate types
         1202  +  /// or via the <see cref="Delegate.DynamicInvoke" /> method.
         1203  +  /// The arguments are presented in the same order they appear in
         1204  +  /// the associated <see cref="SQLiteFunction" /> methods with one exception:
         1205  +  /// the first argument is the name of the virtual method being implemented.
         1206  +  /// </summary>
         1207  +#else
  1195   1208     /// <summary>
  1196   1209     /// This class implements a SQLite function using a <see cref="Delegate" />.
  1197   1210     /// All the virtual methods of the <see cref="SQLiteFunction" /> class are
  1198         -  /// implemented using calls to the <see cref="Delegate.DynamicInvoke" />
  1199         -  /// method.  The arguments are presented in the same order they appear in
         1211  +  /// implemented using calls to the <see cref="SQLiteInvokeDelegate" />,
         1212  +  /// <see cref="SQLiteStepDelegate" />, <see cref="SQLiteFinalDelegate" />,
         1213  +  /// and <see cref="SQLiteCompareDelegate" /> strongly typed delegate types.
         1214  +  /// The arguments are presented in the same order they appear in
  1200   1215     /// the associated <see cref="SQLiteFunction" /> methods with one exception:
  1201   1216     /// the first argument is the name of the virtual method being implemented.
  1202   1217     /// </summary>
         1218  +#endif
  1203   1219     public class SQLiteDelegateFunction : SQLiteFunction
  1204   1220     {
  1205   1221         #region Private Constants
  1206   1222         /// <summary>
  1207   1223         /// This error message is used by the overridden virtual methods when
  1208   1224         /// a required <see cref="Delegate" /> property (e.g.
  1209   1225         /// <see cref="Callback1" /> or <see cref="Callback2" />) has not been
................................................................................
  1502   1518   
  1503   1519             if (invokeDelegate != null)
  1504   1520             {
  1505   1521                 return invokeDelegate.Invoke("Invoke", args); /* throw */
  1506   1522             }
  1507   1523             else
  1508   1524             {
         1525  +#if !PLATFORM_COMPACTFRAMEWORK
  1509   1526                 return callback1.DynamicInvoke(
  1510   1527                     GetInvokeArgs(args, false)); /* throw */
         1528  +#else
         1529  +              throw new NotImplementedException();
         1530  +#endif
  1511   1531             }
  1512   1532         }
  1513   1533   
  1514   1534         /////////////////////////////////////////////////////////////////////////
  1515   1535   
  1516   1536         /// <summary>
  1517   1537         /// This virtual method is part of the implementation for aggregate
................................................................................
  1548   1568             if (stepDelegate != null)
  1549   1569             {
  1550   1570                 stepDelegate.Invoke(
  1551   1571                     "Step", args, stepNumber, ref contextData); /* throw */
  1552   1572             }
  1553   1573             else
  1554   1574             {
         1575  +#if !PLATFORM_COMPACTFRAMEWORK
  1555   1576                 object[] newArgs = GetStepArgs(
  1556   1577                     args, stepNumber, contextData, false);
  1557   1578   
  1558   1579                 /* IGNORED */
  1559   1580                 callback1.DynamicInvoke(newArgs); /* throw */
  1560   1581   
  1561   1582                 UpdateStepArgs(newArgs, ref contextData, false);
         1583  +#else
         1584  +              throw new NotImplementedException();
         1585  +#endif
  1562   1586             }
  1563   1587         }
  1564   1588   
  1565   1589         /////////////////////////////////////////////////////////////////////////
  1566   1590   
  1567   1591         /// <summary>
  1568   1592         /// This virtual method is part of the implementation for aggregate
................................................................................
  1592   1616   
  1593   1617             if (finalDelegate != null)
  1594   1618             {
  1595   1619                 return finalDelegate.Invoke("Final", contextData); /* throw */
  1596   1620             }
  1597   1621             else
  1598   1622             {
         1623  +#if !PLATFORM_COMPACTFRAMEWORK
  1599   1624                 return callback1.DynamicInvoke(GetFinalArgs(
  1600   1625                     contextData, false)); /* throw */
         1626  +#else
         1627  +              throw new NotImplementedException();
         1628  +#endif
  1601   1629             }
  1602   1630         }
  1603   1631   
  1604   1632         /////////////////////////////////////////////////////////////////////////
  1605   1633   
  1606   1634         /// <summary>
  1607   1635         /// This virtual method is part of the implementation for collating
................................................................................
  1640   1668             if (compareDelegate != null)
  1641   1669             {
  1642   1670                 return compareDelegate.Invoke(
  1643   1671                     "Compare", param1, param2); /* throw */
  1644   1672             }
  1645   1673             else
  1646   1674             {
         1675  +#if !PLATFORM_COMPACTFRAMEWORK
  1647   1676                 object result = callback1.DynamicInvoke(GetCompareArgs(
  1648   1677                     param1, param2, false)); /* throw */
  1649   1678   
  1650   1679                 if (result is int)
  1651   1680                     return (int)result;
  1652   1681   
  1653   1682                 throw new InvalidOperationException(
  1654   1683                     UnsafeNativeMethods.StringFormat(
  1655   1684                     CultureInfo.CurrentCulture,
  1656   1685                     ResultInt32Error, "Compare"));
         1686  +#else
         1687  +              throw new NotImplementedException();
         1688  +#endif
  1657   1689             }
  1658   1690         }
  1659   1691         #endregion
  1660   1692     }
  1661   1693   
  1662   1694     /////////////////////////////////////////////////////////////////////////////
  1663   1695