From f7d00245df85c662a6beb1c8ad8072cc0ed9167f Mon Sep 17 00:00:00 2001 From: Benjamin Mayrargue Date: Mon, 26 Feb 2024 15:57:50 +0100 Subject: [PATCH] net8 --- SQLite.Net.Tests/ArithmeticTest.cs | 3 + SQLite.Net.Tests/BaseTest.cs | 10 +- SQLite.Net.Tests/ExceptionAssert.cs | 2 +- SQLite.Net.Tests/NotNullAttributeTest.cs | 10 +- SQLite.Net.Tests/SQLite.Net2.Tests.csproj | 10 +- SQLite.Net.sln | 20 -- examples/Stocks/AssemblyInfo.cs | 26 -- examples/Stocks/Main.cs | 137 ---------- examples/Stocks/Stocks.cs | 126 --------- examples/Stocks/Stocks.csproj | 87 ------ examples/Stocks/Stocks.sln | 20 -- examples/Stocks/app.config | 3 - examples/StocksTouch/AddStockView.xib | 248 ------------------ examples/StocksTouch/AddStockView.xib.cs | 49 ---- .../StocksTouch/AddStockView.xib.designer.cs | 49 ---- examples/StocksTouch/Info.plist | 8 - examples/StocksTouch/Main.cs | 46 ---- examples/StocksTouch/MainWindow.xib | 184 ------------- .../StocksTouch/MainWindow.xib.designer.cs | 15 -- examples/StocksTouch/StocksTouch.csproj | 92 ------- examples/StocksTouch/StocksTouch.sln | 26 -- examples/StocksTouch/StocksView.xib | 201 -------------- examples/StocksTouch/StocksView.xib.cs | 107 -------- .../StocksTouch/StocksView.xib.designer.cs | 38 --- nuget/pack.ps1 | 2 +- src/SQLite.Net/SQLite.Net2.csproj | 6 +- 26 files changed, 25 insertions(+), 1500 deletions(-) delete mode 100644 examples/Stocks/AssemblyInfo.cs delete mode 100644 examples/Stocks/Main.cs delete mode 100644 examples/Stocks/Stocks.cs delete mode 100644 examples/Stocks/Stocks.csproj delete mode 100644 examples/Stocks/Stocks.sln delete mode 100644 examples/Stocks/app.config delete mode 100644 examples/StocksTouch/AddStockView.xib delete mode 100644 examples/StocksTouch/AddStockView.xib.cs delete mode 100644 examples/StocksTouch/AddStockView.xib.designer.cs delete mode 100644 examples/StocksTouch/Info.plist delete mode 100644 examples/StocksTouch/Main.cs delete mode 100644 examples/StocksTouch/MainWindow.xib delete mode 100644 examples/StocksTouch/MainWindow.xib.designer.cs delete mode 100644 examples/StocksTouch/StocksTouch.csproj delete mode 100644 examples/StocksTouch/StocksTouch.sln delete mode 100644 examples/StocksTouch/StocksView.xib delete mode 100644 examples/StocksTouch/StocksView.xib.cs delete mode 100644 examples/StocksTouch/StocksView.xib.designer.cs diff --git a/SQLite.Net.Tests/ArithmeticTest.cs b/SQLite.Net.Tests/ArithmeticTest.cs index 926e47da0..33b73041e 100644 --- a/SQLite.Net.Tests/ArithmeticTest.cs +++ b/SQLite.Net.Tests/ArithmeticTest.cs @@ -50,6 +50,9 @@ public void CanHaveAddInWhereClause() db.InsertAll(cq); TableQuery results = db.Table().Where(o => o.Data + 10 >= n); + + // Assert.That(results.Count(), Is.EqualTo(11)); + // Assert.That(results.OrderBy(o => o.Data).FirstOrDefault().Data, Is.EqualTo(10)); Assert.AreEqual(results.Count(), 11); Assert.AreEqual(results.OrderBy(o => o.Data).FirstOrDefault().Data, 10); } diff --git a/SQLite.Net.Tests/BaseTest.cs b/SQLite.Net.Tests/BaseTest.cs index e65becb94..b034b4e7e 100644 --- a/SQLite.Net.Tests/BaseTest.cs +++ b/SQLite.Net.Tests/BaseTest.cs @@ -1,4 +1,12 @@ -using NUnit.Framework; +//https://docs.nunit.org/articles/nunit/release-notes/Nunit4.0-MigrationGuide.html +global using Assert = NUnit.Framework.Legacy.ClassicAssert; +global using CollectionAssert = NUnit.Framework.Legacy.CollectionAssert; +global using StringAssert = NUnit.Framework.Legacy.StringAssert; +global using DirectoryAssert = NUnit.Framework.Legacy.DirectoryAssert; +global using FileAssert = NUnit.Framework.Legacy.FileAssert; + + +using NUnit.Framework; using System; using System.Collections.Generic; using System.Linq; diff --git a/SQLite.Net.Tests/ExceptionAssert.cs b/SQLite.Net.Tests/ExceptionAssert.cs index b63ab6349..0ceb7626b 100644 --- a/SQLite.Net.Tests/ExceptionAssert.cs +++ b/SQLite.Net.Tests/ExceptionAssert.cs @@ -16,7 +16,7 @@ public static T Throws(Action action) where T : Exception return ex; } - Assert.Fail("Expected exception of type {0}.", typeof (T)); + Assert.Fail($"Expected exception of type {typeof (T)}."); return null; } diff --git a/SQLite.Net.Tests/NotNullAttributeTest.cs b/SQLite.Net.Tests/NotNullAttributeTest.cs index a55058646..48c062ea5 100644 --- a/SQLite.Net.Tests/NotNullAttributeTest.cs +++ b/SQLite.Net.Tests/NotNullAttributeTest.cs @@ -215,9 +215,7 @@ public void NotNullConstraintExceptionListsOffendingColumnsOnUpdate() } catch (Exception ex) { - Assert.Fail( - "Expected an exception of type NotNullConstraintViolationException to be thrown. An exception of type {0} was thrown instead.", - ex.GetType().Name); + Assert.Fail($"Expected an exception of type NotNullConstraintViolationException to be thrown. An exception of type {ex.GetType().Name} was thrown instead."); } Assert.Fail("Expected an exception of type NotNullConstraintViolationException to be thrown. No exception was thrown."); } @@ -252,9 +250,7 @@ public void InsertQueryWithNullThrowsException() } catch (Exception ex) { - Assert.Fail( - "Expected an exception of type NotNullConstraintViolationException to be thrown. An exception of type {0} was thrown instead.", - ex.GetType().Name); + Assert.Fail($"Expected an exception of type NotNullConstraintViolationException to be thrown. An exception of type {ex.GetType().Name} was thrown instead."); } } Assert.Fail("Expected an exception of type NotNullConstraintViolationException to be thrown. No exception was thrown."); @@ -291,7 +287,7 @@ public void UpdateQueryWithNullThrowsException() } catch (Exception ex) { - Assert.Fail("Expected an exception of type NotNullConstraintViolationException to be thrown. An exception of type {0} was thrown instead.", ex.GetType().Name); + Assert.Fail($"Expected an exception of type NotNullConstraintViolationException to be thrown. An exception of type {ex.GetType().Name} was thrown instead."); } Assert.Fail("Expected an exception of type NotNullConstraintViolationException to be thrown. No exception was thrown."); } diff --git a/SQLite.Net.Tests/SQLite.Net2.Tests.csproj b/SQLite.Net.Tests/SQLite.Net2.Tests.csproj index 55879ba2b..4b67ed71a 100644 --- a/SQLite.Net.Tests/SQLite.Net2.Tests.csproj +++ b/SQLite.Net.Tests/SQLite.Net2.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net8.0 false @@ -11,13 +11,13 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/SQLite.Net.sln b/SQLite.Net.sln index 16aaefc82..5725c9533 100644 --- a/SQLite.Net.sln +++ b/SQLite.Net.sln @@ -3,10 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.28803.156 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{49C7015B-F41A-47A6-8200-B925902E74E9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stocks", "examples\Stocks\Stocks.csproj", "{9E5D6B89-B69B-486B-9F7B-406BE8690589}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{5BD976ED-6E22-44A3-A5A1-D6C6633BAADD}" ProjectSection(SolutionItems) = preProject license.md = license.md @@ -35,21 +31,6 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9E5D6B89-B69B-486B-9F7B-406BE8690589}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9E5D6B89-B69B-486B-9F7B-406BE8690589}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9E5D6B89-B69B-486B-9F7B-406BE8690589}.Debug|ARM.ActiveCfg = Debug|Any CPU - {9E5D6B89-B69B-486B-9F7B-406BE8690589}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {9E5D6B89-B69B-486B-9F7B-406BE8690589}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {9E5D6B89-B69B-486B-9F7B-406BE8690589}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {9E5D6B89-B69B-486B-9F7B-406BE8690589}.Debug|x64.ActiveCfg = Debug|Any CPU - {9E5D6B89-B69B-486B-9F7B-406BE8690589}.Debug|x86.ActiveCfg = Debug|Any CPU - {9E5D6B89-B69B-486B-9F7B-406BE8690589}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9E5D6B89-B69B-486B-9F7B-406BE8690589}.Release|ARM.ActiveCfg = Release|Any CPU - {9E5D6B89-B69B-486B-9F7B-406BE8690589}.Release|ARM64.ActiveCfg = Release|Any CPU - {9E5D6B89-B69B-486B-9F7B-406BE8690589}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {9E5D6B89-B69B-486B-9F7B-406BE8690589}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {9E5D6B89-B69B-486B-9F7B-406BE8690589}.Release|x64.ActiveCfg = Release|Any CPU - {9E5D6B89-B69B-486B-9F7B-406BE8690589}.Release|x86.ActiveCfg = Release|Any CPU {FE454822-5982-4327-AE8D-26819659DC9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FE454822-5982-4327-AE8D-26819659DC9A}.Debug|Any CPU.Build.0 = Debug|Any CPU {FE454822-5982-4327-AE8D-26819659DC9A}.Debug|ARM.ActiveCfg = Debug|Any CPU @@ -102,7 +83,6 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {9E5D6B89-B69B-486B-9F7B-406BE8690589} = {49C7015B-F41A-47A6-8200-B925902E74E9} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {ED68D56C-F9AF-45E9-9609-E8CABC16A3E2} diff --git a/examples/Stocks/AssemblyInfo.cs b/examples/Stocks/AssemblyInfo.cs deleted file mode 100644 index c415e3d57..000000000 --- a/examples/Stocks/AssemblyInfo.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. - -[assembly: AssemblyTitle("Stocks")] -[assembly: AssemblyDescription("An example of using sqlite-net")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. - -[assembly: AssemblyVersion("1.0.*")] - -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. - -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] diff --git a/examples/Stocks/Main.cs b/examples/Stocks/Main.cs deleted file mode 100644 index 95f44c100..000000000 --- a/examples/Stocks/Main.cs +++ /dev/null @@ -1,137 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Stocks.CommandLine -{ - class Program - { - public static void Main (string[] args) - { - SQLitePCL.Batteries_V2.Init(); - - new Program ().Run (); - } - - Database _db; - - void Initialize () - { - var dbPath = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments), "Stocks.db"); - _db = new Database (dbPath); - } - - void DisplayStock (string stockSymbol) - { - var stock = _db.QueryStock (stockSymbol); - - if (stock == null) { - Console.WriteLine ("I don't know about {0}", stockSymbol); - Console.WriteLine ("Run \"up {0}\" to update the stock", stockSymbol); - } else { - - // - // Display the last 1 week - // - foreach (var v in _db.QueryValuations (stock)) { - Console.WriteLine (" {0}", v); - } - - } - } - - void UpdateStock (string stockSymbol) - { - _db.UpdateStock(stockSymbol); - } - - void ListStocks () - { - foreach (var stock in _db.QueryAllStocks ()) { - Console.WriteLine (stock); - } - } - - void DisplayBanner () - { - Console.WriteLine ("Stocks - a demo of sqlite-net"); - Console.WriteLine ("Using " + _db.DatabasePath); - Console.WriteLine (); - } - - void DisplayHelp (string cmd) - { - Action display = (c, h) => { Console.WriteLine ("{0} {1}", c, h); }; - var cmds = new SortedDictionary { - { - "ls", - "\t List all known stocks" - }, - { - "exit", - "\t Exit stocks" - }, - { - "up stock", - "Updates stock" - }, - { - "help", - "\t Displays help" - }, - { - "stock", - "\t Displays latest valuations for stock" - } - }; - if (cmds.ContainsKey (cmd)) { - display (cmd, cmds[cmd]); - } else { - foreach (var ch in cmds) { - display (ch.Key, ch.Value); - } - } - } - - void Run () - { - var WS = new char[] { - ' ', - '\t', - '\r', - '\n' - }; - - Initialize (); - - DisplayBanner (); - DisplayHelp (""); - - for (;;) { - Console.Write ("$ "); - var cmdline = Console.ReadLine (); - - var args = cmdline.Split (WS, StringSplitOptions.RemoveEmptyEntries); - if (args.Length < 1) - continue; - var cmd = args[0].ToLowerInvariant (); - - if (cmd == "?" || cmd == "help") { - DisplayHelp (""); - } else if (cmd == "exit") { - break; - } else if (cmd == "ls") { - ListStocks (); - } else if (cmd == "up") { - if (args.Length == 2) { - UpdateStock (args[1].ToUpperInvariant ()); - } else { - DisplayHelp ("up stock"); - } - } else { - DisplayStock (cmd.ToUpperInvariant ()); - } - } - } - } -} diff --git a/examples/Stocks/Stocks.cs b/examples/Stocks/Stocks.cs deleted file mode 100644 index e4ff29746..000000000 --- a/examples/Stocks/Stocks.cs +++ /dev/null @@ -1,126 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using SQLite.Net2; -using System.Globalization; - -namespace Stocks -{ - public class Stock - { - [PrimaryKey, AutoIncrement] - public int Id { get; set; } - [MaxLength(8)] - public string Symbol { get; set; } - - public override string ToString () - { - return Symbol; - } - } - - public class Valuation - { - [PrimaryKey, AutoIncrement] - public int Id { get; set; } - [Indexed] - public int StockId { get; set; } - public DateTime Time { get; set; } - public decimal Price { get; set; } - - public override string ToString () - { - return string.Format ("{0:MMM dd yy} {1:C}", Time, Price); - } - } - - public class Database : SQLiteConnection - { - public Database (string path) : base(path) - { - //Crypt database - Execute("PRAGMA key = 'snKJRLKOT4HD-QGmxBXaHTHWiZypllQvYHhbknmR';"); - - CreateTable (); - CreateTable (); - } - public IEnumerable QueryValuations (Stock stock) - { - return Table ().Where(x => x.StockId == stock.Id); - } - public Valuation QueryLatestValuation (Stock stock) - { - return Table ().Where(x => x.StockId == stock.Id).OrderByDescending(x => x.Time).Take(1).FirstOrDefault(); - } - public Stock QueryStock (string stockSymbol) - { - return (from s in Table () - where s.Symbol == stockSymbol - select s).FirstOrDefault (); - } - public IEnumerable QueryAllStocks () - { - return from s in Table () - orderby s.Symbol - select s; - } - - public void UpdateStock (string stockSymbol) - { - // - // Ensure that there is a valid Stock in the DB - // - var stock = QueryStock (stockSymbol); - if (stock == null) { - stock = new Stock { Symbol = stockSymbol }; - Insert (stock); - } - - // - // When was it last valued? - // - var latest = QueryLatestValuation (stock); - var latestDate = latest != null ? latest.Time : new DateTime (1950, 1, 1); - - // - // Get the latest valuations - // - try { - var newVals = new YahooScraper ().GetValuations (stock, latestDate + TimeSpan.FromHours (23), DateTime.Now); - InsertAll (newVals); - } catch (System.Net.WebException ex) { - Console.WriteLine (ex); - } - } - } - - public class YahooScraper - { - public IEnumerable GetValuations (Stock stock, DateTime start, DateTime end) - { - var t = "http://ichart.finance.yahoo.com/table.csv?s={0}&d={1}&e={2}&f={3}&g=d&a={4}&b={5}&c={6}&ignore=.csv"; - var url = string.Format (t, stock.Symbol, end.Month - 1, end.Day, end.Year, start.Month - 1, start.Day, start.Year); - Console.WriteLine ("GET {0}", url); - var req = System.Net.WebRequest.Create (url); - using (var resp = new System.IO.StreamReader (req.GetResponse ().GetResponseStream ())) { - var first = true; - var dateCol = 0; - var priceCol = 6; - for (var line = resp.ReadLine (); line != null; line = resp.ReadLine ()) { - var parts = line.Split (','); - if (first) { - dateCol = Array.IndexOf (parts, "Date"); - priceCol = Array.IndexOf (parts, "Adj Close"); - first = false; - } else { - yield return new Valuation { - StockId = stock.Id, - Price = decimal.Parse (parts[priceCol], CultureInfo.InvariantCulture), - Time = DateTime.Parse (parts[dateCol]) - }; - } - } - } - } - } -} diff --git a/examples/Stocks/Stocks.csproj b/examples/Stocks/Stocks.csproj deleted file mode 100644 index 3a4ed527c..000000000 --- a/examples/Stocks/Stocks.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - Debug - AnyCPU - {9E5D6B89-B69B-486B-9F7B-406BE8690589} - Exe - Stocks - Stocks - v4.8 - - - - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug - DEBUG - prompt - 4 - false - - - none - false - bin\Release - prompt - 4 - false - - - - - - - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - - - {fe454822-5982-4327-ae8d-26819659dc9a} - SQLite.Net2 - - - - - 2.0.7 - - - - \ No newline at end of file diff --git a/examples/Stocks/Stocks.sln b/examples/Stocks/Stocks.sln deleted file mode 100644 index 48d3245f3..000000000 --- a/examples/Stocks/Stocks.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stocks", "Stocks.csproj", "{9E5D6B89-B69B-486B-9F7B-406BE8690589}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9E5D6B89-B69B-486B-9F7B-406BE8690589}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9E5D6B89-B69B-486B-9F7B-406BE8690589}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9E5D6B89-B69B-486B-9F7B-406BE8690589}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9E5D6B89-B69B-486B-9F7B-406BE8690589}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution - StartupItem = Stocks.csproj - EndGlobalSection -EndGlobal diff --git a/examples/Stocks/app.config b/examples/Stocks/app.config deleted file mode 100644 index 786a845b3..000000000 --- a/examples/Stocks/app.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/examples/StocksTouch/AddStockView.xib b/examples/StocksTouch/AddStockView.xib deleted file mode 100644 index ade7405d5..000000000 --- a/examples/StocksTouch/AddStockView.xib +++ /dev/null @@ -1,248 +0,0 @@ - - - - 768 - 10K549 - 1938 - 1038.36 - 461.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 933 - - - YES - IBUILabel - IBUIView - IBUITextField - IBProxyObject - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 292 - - YES - - - 292 - {{114, 76}, {186, 31}} - - - - NO - NO - IBCocoaTouchFramework - 0 - AAPL - 3 - - 3 - MAA - - 2 - - - YES - YES - 17 - - 3 - 1 - 9 - IBCocoaTouchFramework - - 1 - - Helvetica - Helvetica - 0 - 24 - - - Helvetica - 24 - 16 - - - - - 292 - {{20, 76}, {97, 32}} - - - - NO - YES - NO - IBCocoaTouchFramework - SYMBOL - - 3 - MC41AA - - - - 1 - 10 - - 1 - 17 - - - Helvetica - 17 - 16 - - - - {{0, 64}, {320, 416}} - - - - - 3 - MQA - - - - - NO - - IBCocoaTouchFramework - - - - - YES - - - view - - - - 7 - - - - symbolName - - - - 11 - - - - - YES - - 0 - - YES - - - - - - 1 - - - YES - - - - - - - -1 - - - File's Owner - - - -2 - - - - - 9 - - - - - 10 - - - - - - - YES - - YES - -1.CustomClassName - -1.IBPluginDependency - -2.CustomClassName - -2.IBPluginDependency - 1.IBPluginDependency - 10.IBPluginDependency - 9.IBPluginDependency - - - YES - AddStockView - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 13 - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - 933 - - diff --git a/examples/StocksTouch/AddStockView.xib.cs b/examples/StocksTouch/AddStockView.xib.cs deleted file mode 100644 index 8ba3ca235..000000000 --- a/examples/StocksTouch/AddStockView.xib.cs +++ /dev/null @@ -1,49 +0,0 @@ - -using System; -using System.Collections.Generic; -using System.Linq; -using MonoTouch.Foundation; -using MonoTouch.UIKit; - -namespace Stocks.Touch -{ - public partial class AddStockView : UIViewController - { - Database _db; - - public event EventHandler Finished = delegate {}; - - public AddStockView (Database db) - : base("AddStockView", null) - { - _db = db; - - Title = "New Symbol"; - NavigationItem.LeftBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Cancel, Cancel); - NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Done, AddSymbol); - } - - UITextField _symbolName; - - public override void ViewDidLoad () - { - _symbolName = symbolName; - _symbolName.ShouldReturn = delegate { - AddSymbol (symbolName, EventArgs.Empty); - return true; - }; - } - - void Cancel (object sender, EventArgs e) - { - DismissModalViewControllerAnimated(true); - } - - void AddSymbol (object sender, EventArgs e) - { - _db.UpdateStock (symbolName.Text); - DismissModalViewControllerAnimated (true); - Finished (this, EventArgs.Empty); - } - } -} diff --git a/examples/StocksTouch/AddStockView.xib.designer.cs b/examples/StocksTouch/AddStockView.xib.designer.cs deleted file mode 100644 index d42b5832a..000000000 --- a/examples/StocksTouch/AddStockView.xib.designer.cs +++ /dev/null @@ -1,49 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Mono Runtime Version: 2.0.50727.1433 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - -namespace Stocks.Touch { - - - // Base type probably should be MonoTouch.UIKit.UIViewController or subclass - [MonoTouch.Foundation.Register("AddStockView")] - public partial class AddStockView { - - #pragma warning disable 0169 - [MonoTouch.Foundation.Connect("view")] - private MonoTouch.UIKit.UIView view { - get { - return ((MonoTouch.UIKit.UIView)(this.GetNativeField("view"))); - } - set { - this.SetNativeField("view", value); - } - } - - [MonoTouch.Foundation.Connect("symbolName")] - private MonoTouch.UIKit.UITextField symbolName { - get { - return ((MonoTouch.UIKit.UITextField)(this.GetNativeField("symbolName"))); - } - set { - this.SetNativeField("symbolName", value); - } - } - - [MonoTouch.Foundation.Connect("addBtn")] - private MonoTouch.UIKit.UIButton addBtn { - get { - return ((MonoTouch.UIKit.UIButton)(this.GetNativeField("addBtn"))); - } - set { - this.SetNativeField("addBtn", value); - } - } - } -} diff --git a/examples/StocksTouch/Info.plist b/examples/StocksTouch/Info.plist deleted file mode 100644 index 4880da4d6..000000000 --- a/examples/StocksTouch/Info.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - NSMainNibFile - MainWindow - - diff --git a/examples/StocksTouch/Main.cs b/examples/StocksTouch/Main.cs deleted file mode 100644 index 944be2e6d..000000000 --- a/examples/StocksTouch/Main.cs +++ /dev/null @@ -1,46 +0,0 @@ - -using System; -using System.Collections.Generic; -using System.Linq; -using MonoTouch.Foundation; -using MonoTouch.UIKit; -using Path = System.IO.Path; -using SQLite; - -namespace Stocks.Touch -{ - public class Application - { - static void Main (string[] args) - { - UIApplication.Main (args); - } - } - - public partial class AppDelegate : UIApplicationDelegate - { - Database _db; - UINavigationController _navigationController; - - public override bool FinishedLaunching (UIApplication app, NSDictionary options) - { - _db = new Database (Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments), "stocks.db")); - _db.Trace = true; - - var stocksView = new StocksView (_db); - - _navigationController = new UINavigationController (stocksView); - - window.AddSubview (_navigationController.View); - - window.MakeKeyAndVisible (); - - return true; - } - - // This method is required in iPhoneOS 3.0 - public override void OnActivated (UIApplication application) - { - } - } -} diff --git a/examples/StocksTouch/MainWindow.xib b/examples/StocksTouch/MainWindow.xib deleted file mode 100644 index 9653fdcfc..000000000 --- a/examples/StocksTouch/MainWindow.xib +++ /dev/null @@ -1,184 +0,0 @@ - - - - 768 - 9J61 - 677 - 949.46 - 353.00 - - YES - - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - YES - - - - YES - - IBFilesOwner - - - IBFirstResponder - - - - - 1316 - - {320, 480} - - - 1 - MSAxIDEAA - - NO - NO - - - - - - YES - - - delegate - - - - 5 - - - - window - - - - 7 - - - - - YES - - 0 - - YES - - - - - - 2 - - - YES - - - - - -1 - - - RmlsZSdzIE93bmVyA - - - 4 - - - App Delegate - - - -2 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 2.IBAttributePlaceholdersKey - 2.IBEditorWindowLastContentRect - 2.IBPluginDependency - 2.UIWindow.visibleAtLaunch - 4.CustomClassName - 4.IBPluginDependency - - - YES - UIApplication - UIResponder - - YES - - YES - - - YES - - - {{593, 276}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - AppDelegate - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - YES - - - YES - - - - - YES - - YES - - - YES - - - - 7 - - - - YES - - AppDelegate - - window - id - - - IBUserSource - - - - - - 0 - - 3 - 3.0 - - \ No newline at end of file diff --git a/examples/StocksTouch/MainWindow.xib.designer.cs b/examples/StocksTouch/MainWindow.xib.designer.cs deleted file mode 100644 index 59b1daf62..000000000 --- a/examples/StocksTouch/MainWindow.xib.designer.cs +++ /dev/null @@ -1,15 +0,0 @@ - -namespace Stocks.Touch -{ - // Base type probably should be MonoTouch.Foundation.NSObject or subclass - [MonoTouch.Foundation.Register("AppDelegate")] - public partial class AppDelegate - { - - [MonoTouch.Foundation.Connect("window")] - private MonoTouch.UIKit.UIWindow window { - get { return ((MonoTouch.UIKit.UIWindow)(this.GetNativeField ("window"))); } - set { this.SetNativeField ("window", value); } - } - } -} diff --git a/examples/StocksTouch/StocksTouch.csproj b/examples/StocksTouch/StocksTouch.csproj deleted file mode 100644 index 1aa84228a..000000000 --- a/examples/StocksTouch/StocksTouch.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - iPhoneSimulator - 9.0.21022 - 2.0 - {082A4687-D717-4879-8AB1-3CE2BE1F16A0} - {6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Exe - Stocks.Touch - StocksTouch - - - true - full - false - bin\iPhoneSimulator\Debug - DEBUG - prompt - 4 - -linksdkonly - None - true - - - - none - false - bin\iPhoneSimulator\Release - prompt - 4 - - - - true - full - false - bin\iPhone\Debug - DEBUG - prompt - 4 - iPhone Developer - true - - - - none - false - bin\iPhone\Release - prompt - 4 - iPhone Developer - - - - - - - - - - - MainWindow.xib - - - - - - StocksView.xib - - - StocksView.xib - - - AddStockView.xib - - - AddStockView.xib - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/StocksTouch/StocksTouch.sln b/examples/StocksTouch/StocksTouch.sln deleted file mode 100644 index b1de6437f..000000000 --- a/examples/StocksTouch/StocksTouch.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StocksTouch", "StocksTouch.csproj", "{082A4687-D717-4879-8AB1-3CE2BE1F16A0}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|iPhoneSimulator = Debug|iPhoneSimulator - Release|iPhoneSimulator = Release|iPhoneSimulator - Debug|iPhone = Debug|iPhone - Release|iPhone = Release|iPhone - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {082A4687-D717-4879-8AB1-3CE2BE1F16A0}.Debug|iPhone.ActiveCfg = Debug|iPhone - {082A4687-D717-4879-8AB1-3CE2BE1F16A0}.Debug|iPhone.Build.0 = Debug|iPhone - {082A4687-D717-4879-8AB1-3CE2BE1F16A0}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator - {082A4687-D717-4879-8AB1-3CE2BE1F16A0}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator - {082A4687-D717-4879-8AB1-3CE2BE1F16A0}.Release|iPhone.ActiveCfg = Release|iPhone - {082A4687-D717-4879-8AB1-3CE2BE1F16A0}.Release|iPhone.Build.0 = Release|iPhone - {082A4687-D717-4879-8AB1-3CE2BE1F16A0}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator - {082A4687-D717-4879-8AB1-3CE2BE1F16A0}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator - EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution - StartupItem = StocksTouch.csproj - EndGlobalSection -EndGlobal diff --git a/examples/StocksTouch/StocksView.xib b/examples/StocksTouch/StocksView.xib deleted file mode 100644 index dcedc16e4..000000000 --- a/examples/StocksTouch/StocksView.xib +++ /dev/null @@ -1,201 +0,0 @@ - - - - 768 - 9L30 - 680 - 949.54 - 353.00 - - YES - - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - YES - - - - YES - - IBFilesOwner - - - IBFirstResponder - - - - 292 - - YES - - - 274 - {320, 460} - - - 3 - MQA - - NO - YES - NO - NO - 1 - 0 - YES - 4.400000e+01 - 2.200000e+01 - 2.200000e+01 - - - {320, 460} - - - 3 - MQA - - 2 - - - - - - - - YES - - - view - - - - 7 - - - - table - - - - 9 - - - - - YES - - 0 - - YES - - - - - - 1 - - - YES - - - - - - -1 - - - RmlsZSdzIE93bmVyA - - - -2 - - - - - 8 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - 8.IBPluginDependency - - - YES - StocksView - UIResponder - {{406, 235}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - YES - - - YES - - - - - YES - - YES - - - YES - - - - 9 - - - - YES - - StocksView - - YES - - YES - table - view - - - YES - id - id - - - - IBUserSource - - - - - - 0 - - 3 - 3.1 - - diff --git a/examples/StocksTouch/StocksView.xib.cs b/examples/StocksTouch/StocksView.xib.cs deleted file mode 100644 index 01b11f1b8..000000000 --- a/examples/StocksTouch/StocksView.xib.cs +++ /dev/null @@ -1,107 +0,0 @@ - -using System; -using System.Collections.Generic; -using System.Linq; -using MonoTouch.Foundation; -using MonoTouch.UIKit; -using SQLite.MonoTouchAdmin; - - -namespace Stocks.Touch -{ - public partial class StocksView : UIViewController - { - Database _db; - - public StocksView (Database db) - { - _db = db; - - Title = "Symbols"; - } - - public override void ViewDidLoad () - { - var ds = new SymbolsData (_db); - - table.DataSource = ds; - table.SetEditing (true, false); - - NavigationItem.RightBarButtonItem = new UIBarButtonItem (UIBarButtonSystemItem.Add, delegate { - var c = new AddStockView (_db); - c.Finished += delegate { - ds.Refresh (); - table.ReloadData (); - }; - var n = new UINavigationController (c); - NavigationController.PresentModalViewController(n, true); - }); - NavigationItem.LeftBarButtonItem = new UIBarButtonItem ("Admin", UIBarButtonItemStyle.Plain, delegate { - var c = new SQLiteAdmin(_db); - NavigationController.PushViewController(c.NewTablesViewController(), true); - }); - } - - public class SymbolsData : UITableViewDataSource - { - List rows; - Database _db; - - public SymbolsData(Database db) { - _db = db; - rows = _db.QueryAllStocks().ToList(); - } - - public void Refresh () { - rows = _db.QueryAllStocks().ToList(); - } - - public override void MoveRow (UITableView tableView, NSIndexPath sourceIndexPath, NSIndexPath destinationIndexPath) - { - var item = rows[sourceIndexPath.Row]; - rows.RemoveAt(sourceIndexPath.Row); - rows.Insert(destinationIndexPath.Row, item); - } - - public override bool CanMoveRow (UITableView tableView, NSIndexPath indexPath) - { - return true; - } - - public override void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath) - { - switch (editingStyle) { - case UITableViewCellEditingStyle.Delete: - _db.Delete(rows[indexPath.Row]); - rows.RemoveAt(indexPath.Row); - tableView.DeleteRows(new[]{indexPath}, UITableViewRowAnimation.Fade); - break; - } - } - - public override int NumberOfSections (UITableView tableView) - { - return 1; - } - - public override int RowsInSection (UITableView tableview, int section) - { - return rows.Count; - } - - public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) - { - var cell = tableView.DequeueReusableCell ("cell"); - if (cell == null) { - cell = new UITableViewCell (UITableViewCellStyle.Subtitle, "cell"); - } - cell.ShowsReorderControl = true; - var stock = rows[indexPath.Row]; - var val = _db.QueryLatestValuation (stock); - cell.TextLabel.Text = stock.Symbol; - cell.DetailTextLabel.Text = val != null ? val.Price.ToString () : "?"; - return cell; - } - } - } -} diff --git a/examples/StocksTouch/StocksView.xib.designer.cs b/examples/StocksTouch/StocksView.xib.designer.cs deleted file mode 100644 index 39d14acd2..000000000 --- a/examples/StocksTouch/StocksView.xib.designer.cs +++ /dev/null @@ -1,38 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Mono Runtime Version: 2.0.50727.1433 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - -namespace Stocks.Touch { - - - // Base type probably should be MonoTouch.UIKit.UIViewController or subclass - [MonoTouch.Foundation.Register("StocksView")] - public partial class StocksView { - - [MonoTouch.Foundation.Connect("view")] - private MonoTouch.UIKit.UIView view { - get { - return ((MonoTouch.UIKit.UIView)(this.GetNativeField("view"))); - } - set { - this.SetNativeField("view", value); - } - } - - [MonoTouch.Foundation.Connect("table")] - private MonoTouch.UIKit.UITableView table { - get { - return ((MonoTouch.UIKit.UITableView)(this.GetNativeField("table"))); - } - set { - this.SetNativeField("table", value); - } - } - } -} diff --git a/nuget/pack.ps1 b/nuget/pack.ps1 index d2bd0c6f9..3c12844fc 100644 --- a/nuget/pack.ps1 +++ b/nuget/pack.ps1 @@ -7,7 +7,7 @@ if ($IsMacOS) { $msbuild = join-path $msbuild 'MSBuild\Current\Bin\MSBuild.exe' } $version="2.1.0" -$versionSuffix="-preB" +$versionSuffix="" ##################### #Build release config diff --git a/src/SQLite.Net/SQLite.Net2.csproj b/src/SQLite.Net/SQLite.Net2.csproj index 959094721..4f2a3ec80 100644 --- a/src/SQLite.Net/SQLite.Net2.csproj +++ b/src/SQLite.Net/SQLite.Net2.csproj @@ -1,13 +1,13 @@  - netstandard2.0 + netstandard2.1;net8.0 SQLite.Net2 SQLite.Net2 portable SQLite.Net2 - Copyright ©2022 Benjamin Mayrargue + Copyright ©2024 Benjamin Mayrargue Latest enable @@ -47,7 +47,7 @@ - +