diff --git a/bulky/.gitignore b/bulky/.gitignore new file mode 100644 index 0000000..bdc3535 --- /dev/null +++ b/bulky/.gitignore @@ -0,0 +1,108 @@ +# Build Folders (you can keep bin if you'd like, to store dlls and pdbs) +[Bb]in/ +[Oo]bj/ + +# mstest test results +TestResults + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results +[Dd]ebug/ +[Rr]elease/ +x64/ +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.log +*.vspscc +*.vssscc +.builds + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper* + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish + +# Publish Web Output +*.Publish.xml + +# NuGet Packages Directory +packages + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +[Bb]in +[Oo]bj +sql +TestResults +[Tt]est[Rr]esult* +*.Cache +ClientBin +[Ss]tyle[Cc]op.* +~$* +*.dbmdl +Generated_Code #added for RIA/Silverlight projects + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML diff --git a/bulky/.nuget/NuGet.Config b/bulky/.nuget/NuGet.Config new file mode 100644 index 0000000..5e74378 --- /dev/null +++ b/bulky/.nuget/NuGet.Config @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/bulky/.nuget/NuGet.targets b/bulky/.nuget/NuGet.targets new file mode 100644 index 0000000..bda5bea --- /dev/null +++ b/bulky/.nuget/NuGet.targets @@ -0,0 +1,143 @@ + + + + $(MSBuildProjectDirectory)\..\ + + + false + + + false + + + true + + + false + + + + + + + + + + $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) + $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) + $([System.IO.Path]::Combine($(SolutionDir), "packages")) + + + + + $(SolutionDir).nuget + packages.config + $(SolutionDir)packages + + + + + $(NuGetToolsPath)\nuget.exe + @(PackageSource) + + "$(NuGetExePath)" + mono --runtime=v4.0.30319 $(NuGetExePath) + + $(TargetDir.Trim('\\')) + + -RequireConsent + + $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(RequireConsentSwitch) -o "$(PackagesDir)" + $(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols + + + + RestorePackages; + $(BuildDependsOn); + + + + + $(BuildDependsOn); + BuildPackage; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bulky/LICENSE.md b/bulky/LICENSE.md new file mode 100644 index 0000000..d6329b6 --- /dev/null +++ b/bulky/LICENSE.md @@ -0,0 +1,16 @@ +### bulky +#### http://github.com/danielcrenna/copper + +Copyright (c) 2012 Conatus Creative Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/bulky/README.md b/bulky/README.md new file mode 100644 index 0000000..0fad8b4 --- /dev/null +++ b/bulky/README.md @@ -0,0 +1,102 @@ +bulky +===== + +```powershell +PM> Install-Package bulky +``` + +Bulky is an idiomatic bulk insert interface for databases. It gives you the ability to use the +native bulk copy mechanism of your database simply, using plain C# objects and an extension method on `IDbConnection`, much like how [Dapper](https://github.com/SamSaffron/dapper-dot-net) functions. + +### Why would I use this? +- You want simple, high speed bulk inserts of large collections of objects +- You need support for multiple databases (SQL Server, MySQL, and SQLite are supported today) +- You use [copper](http://github.com/danielcrenna/copper), and you want to hook up a `BulkCopyConsumer` for high performance, periodic batching inserts +- It works great with [tophat](http://github.com/danielcrenna/tophat) + + +### Usage + +The hands-free usage is simple: + +```csharp +using bulky; + +// Get your objects from somewhere +IEnumerable users = ReallyLargeCollectionOfUsers(); + +// Get your connection from somewhere else +IDbConnection connection = GetMyDatabaseConnectionFromSomewhere(); + +// Profit! +connection.BulkCopy(users); +``` + +Behind the scenes, Bulky is using the provided bulk copy implementation. +This is how you can change the underlying strategy: + +```csharp +using bulky; + +// Change to MySQL multi-value inserts +Bulky.BulkCopier = new MySqlBulkCopy(); + +// Change to SQLite's transactional flush +Bulky.BulkCopier = new SqliteBulkCopy(); + +// Change to SQL Server's SqlBulkCopy (the default) +Bulky.BulkCopier = new SqlServerBulkCopy(); +``` + +### How does bulky map objects to database columns? + +Under the hood, bulky relies on a [TableDescriptor](http://github.com/danielcrenna/TableDescriptor) definition +of a class in order to map it to database columns. By default, it uses TableDescriptor's built-in `SimpleDescriptor` +to perform that mapping, but you can always pass in any implementation of `Descriptor`. The default conventions +are simple enough, but if you have more advanced mapping needs you'll want to look at that project directly. +For example, this `User` object will map to the database below: + +```csharp +public class User +{ + public int Id { get; set; } + public string Email { get; set; } +} +``` + +```sql +CREATE TABLE [dbo].[User] +( + [Id] [int] IDENTITY(1,1) NOT NULL, + [Email] [varchar](255) NOT NULL, + CONSTRAINT [PK_User] PRIMARY KEY CLUSTERED ([Id] ASC) +) +``` + +### How do I use this with [copper](http://github.com/danielcrenna/copper)? + +Bulky includes a `BulkCopyConsumer` (in source, not in the distro) that will batch events handled by it and +bulk insert them to the underlying database. By default, it uses [tophat](http://github.com/danielcrenna/tophat) for connection scoping +(but you can provide your own `ConnectionBuilder` function), and [TableDescriptor](http://github.com/danielcrenna/TableDescriptor) for object mapping +(but you can provide your own `Descriptor` for custom mapping). + +```csharp +using tophat; +using TableDescriptor; +using bulky; + +// Consumer will bulk copy every 100 records, or every five seconds, whichever comes first +var consumer = new BulkCopyConsumer(100, TimeSpan.FromSeconds(5); + +// By default, the connection used by the consumer is tophat's current unit of work +consumer.ConnectionBuilder = () => UnitOfWork.Current; + +// By default, the mapper used by the consumer is TableDescriptor's SimpleDescriptor +consumer.Descriptor = SimpleDescriptor.Create(); + +// These users could come from anywhere... +var users = MyBigBagOfUsers() + +// Some producer is off obtaining users from somewhere, and bulk copying them in batches +var producer = new CollectionProducer(users).Consumes(consumer).Start(); +``` \ No newline at end of file diff --git a/bulky/bulky.1.0.5.nupkg b/bulky/bulky.1.0.5.nupkg new file mode 100644 index 0000000..c4ed86b Binary files /dev/null and b/bulky/bulky.1.0.5.nupkg differ diff --git a/bulky/bulky.nuspec b/bulky/bulky.nuspec new file mode 100644 index 0000000..632e3f9 --- /dev/null +++ b/bulky/bulky.nuspec @@ -0,0 +1,20 @@ + + + + bulky + 1.0.5 + Daniel Crenna + Daniel Crenna + An idiomatic bulk insert interface for databases + An idiomatic bulk insert interface for databases. Allows you to bulk insert arbitrary types to an underlying database using a fast insert mechanism specific for that database. Currently supports SQL Server, MySQL, and SQLite. Works on the IDbConnection with extension methods, like Dapper. + en-US + http://github.com/danielcrenna/bulky + https://github.com/danielcrenna/bulky/blob/master/LICENSE + http://apitize.com.s3.amazonaws.com/logo_generic.png + bulk insert sqlserver sqlite mysql dapper + + + + + + \ No newline at end of file diff --git a/bulky/pack-nuget.bat b/bulky/pack-nuget.bat new file mode 100644 index 0000000..48b3708 --- /dev/null +++ b/bulky/pack-nuget.bat @@ -0,0 +1,3 @@ +copy LICENSE.md bin +copy README.md bin +".nuget\NuGet.exe" pack bulky.nuspec -BasePath bin \ No newline at end of file diff --git a/bulky/push-nuget.bat b/bulky/push-nuget.bat new file mode 100644 index 0000000..c359e0b --- /dev/null +++ b/bulky/push-nuget.bat @@ -0,0 +1 @@ +".nuget\NuGet.exe" push bulky.1.0.5.nupkg \ No newline at end of file diff --git a/bulky/src/.nuget/packages.config b/bulky/src/.nuget/packages.config new file mode 100644 index 0000000..c811286 --- /dev/null +++ b/bulky/src/.nuget/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/bulky/src/Bulky.Tests/App.config b/bulky/src/Bulky.Tests/App.config new file mode 100644 index 0000000..c2a413a --- /dev/null +++ b/bulky/src/Bulky.Tests/App.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/bulky/src/Bulky.Tests/Baseline.cs b/bulky/src/Bulky.Tests/Baseline.cs new file mode 100644 index 0000000..3d65a7c --- /dev/null +++ b/bulky/src/Bulky.Tests/Baseline.cs @@ -0,0 +1,19 @@ +using FluentMigrator; + +namespace bulky.Tests +{ + [Migration(1)] + public class Baseline : AutoReversingMigration + { + public override void Up() + { + Create.Table("User") + .WithColumn("Id").AsInt32().PrimaryKey().Identity() + .WithColumn("Email").AsAnsiString(); + + Create.Table("UserRole") + .WithColumn("UserId").AsInt32().PrimaryKey() + .WithColumn("RoleId").AsInt32().PrimaryKey(); + } + } +} \ No newline at end of file diff --git a/bulky/src/Bulky.Tests/Fixtures/BulkCopyFixture.cs b/bulky/src/Bulky.Tests/Fixtures/BulkCopyFixture.cs new file mode 100644 index 0000000..b475ec9 --- /dev/null +++ b/bulky/src/Bulky.Tests/Fixtures/BulkCopyFixture.cs @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading; +using Dapper; +using NUnit.Framework; +using copper; +using tophat; +using tuxedo; + +namespace bulky.Tests.Fixtures +{ + public class BulkCopyFixture + { + public static Dialect Dialect { get; set; } + + public static void BulkCopyUsers(int trials, bool trace = false) + { + var users = ResetUsers(trials); + var sw = Stopwatch.StartNew(); + UnitOfWork.Current.BulkCopy(users); + var elapsed = sw.Elapsed; + var count = AssertInsertCount(users.Count, elapsed, trace); + if (trace) + { + Console.WriteLine("Inserting {0} records took {1}", count, elapsed); + } + } + + public static void BulkCopyUsersWithConsumer(int trials, bool trace = false) + { + var users = ResetUsers(trials); + var consumer = new BulkCopyConsumer(100); + + var block = new ManualResetEvent(false); + var producer = new ObservingProducer().Produces(users, onCompleted: () => + { + while (consumer.Consumed < trials) + { + Thread.Sleep(100); + } + block.Set(); + }); + producer.Consumes(consumer); + var sw = Stopwatch.StartNew(); + producer.Start(); + block.WaitOne(); + var elapsed = sw.Elapsed; + + var count = AssertInsertCount(users.Count, elapsed, trace); + if (trace) + { + Console.WriteLine("Inserting {0} records took {1}", count, elapsed); + } + } + + public static List ResetUsers(int trials) + { + var sql = "DELETE FROM " + QualifiedUser(); + UnitOfWork.Current.Execute(sql); + var users = GetInsertCollection(trials).ToList(); + return users; + } + + public static IEnumerable GetInsertCollection(int number) + { + for (var i = 1; i < number + 1; i++) + { + yield return new User { Email = String.Format("user{0}@email.com", i) }; + } + } + + public static int AssertInsertCount(int expected, TimeSpan elapsed, bool trace = false) + { + int actual; + try + { + actual = UnitOfWork.Current.Query("SELECT COUNT(1) FROM " + QualifiedUser()).Single(); + } + catch + { + // SQlite... + actual = (int)UnitOfWork.Current.Query("SELECT COUNT(1) FROM " + QualifiedUser()).Single(); + } + + Assert.AreEqual(expected, actual); + return actual; + } + + private static string QualifiedUser() + { + return Dialect.StartIdentifier + "User" + Dialect.EndIdentifier; + } + + } +} \ No newline at end of file diff --git a/bulky/src/Bulky.Tests/Fixtures/MySqlFixture.cs b/bulky/src/Bulky.Tests/Fixtures/MySqlFixture.cs new file mode 100644 index 0000000..b76fd93 --- /dev/null +++ b/bulky/src/Bulky.Tests/Fixtures/MySqlFixture.cs @@ -0,0 +1,61 @@ +using System; +using System.Configuration; +using System.Linq; +using Dapper; +using NUnit.Framework; +using bulky.Tests.MySql; +using tophat; +using tuxedo.Dialects; + +namespace bulky.Tests.Fixtures +{ + public class MySqlFixture + { + [TestFixtureSetUp] + public void TestFixtureSetUp() + { + Bulky.BulkCopier = new MySqlBulkCopy(); + BulkCopyFixture.Dialect = new MySqlDialect(); + } + + [SetUp] + public void SetUp() + { + UnitOfWork.Purge(); + ConfigureTestDatabase(); + } + + [TearDown] + public void TearDown() + { + UnitOfWork.Current.Execute(string.Format("DROP DATABASE `{0}`", UnitOfWork.Current.Database)); + UnitOfWork.Purge(); + } + + private static void ConfigureTestDatabase() + { + var database = CreateDatabase(); + var connectionString = string.Format("Server=localhost;Uid={0};Pwd={1};Database={2};", ConfigurationManager.AppSettings["MySQLUser"], ConfigurationManager.AppSettings["MySQLPassword"], database); + Database.Install(connectionString, ConnectionScope.ByThread); + new MigrationService().MigrateToLatest("mysql", connectionString); + UnitOfWork.Current.Query("SELECT COUNT(*) AS `C` FROM `User`").Single(); + Assert.AreEqual(UnitOfWork.Current.Database, database.ToString()); + } + + private static Guid CreateDatabase() + { + var database = Guid.NewGuid(); + var connectionString = string.Format("Server=localhost;Uid={0};Pwd={1};", ConfigurationManager.AppSettings["MySQLUser"], ConfigurationManager.AppSettings["MySQLPassword"]); + var factory = new MySqlConnectionFactory { ConnectionString = connectionString }; + using (var connection = factory.CreateConnection()) + { + connection.Open(); + var sql = string.Format("CREATE DATABASE `{0}`", database); + connection.Execute(sql); + sql = string.Format("USE `{0}`", database); + connection.Execute(sql); + } + return database; + } + } +} diff --git a/bulky/src/Bulky.Tests/Fixtures/SqlServerFixture.cs b/bulky/src/Bulky.Tests/Fixtures/SqlServerFixture.cs new file mode 100644 index 0000000..3f29de5 --- /dev/null +++ b/bulky/src/Bulky.Tests/Fixtures/SqlServerFixture.cs @@ -0,0 +1,59 @@ +using System; +using Dapper; +using NUnit.Framework; +using tophat; +using tuxedo.Dialects; + +namespace bulky.Tests.Fixtures +{ + public class SqlServerFixture + { + private string _database; + + [TestFixtureSetUp] + public void TestFixtureSetUp() + { + Bulky.BulkCopier = new SqlServerBulkCopy(); + BulkCopyFixture.Dialect = new SqlServerDialect(); + } + + [SetUp] + public void SetUp() + { + UnitOfWork.Purge(); + _database = ConfigureTestDatabase(); + } + + [TearDown] + public void TearDown() + { + UnitOfWork.Current.Execute("USE master"); + UnitOfWork.Current.Execute(string.Format("ALTER DATABASE [{0}] SET SINGLE_USER WITH ROLLBACK IMMEDIATE", _database)); + UnitOfWork.Current.Execute(string.Format("DROP DATABASE [{0}]", _database)); + UnitOfWork.Purge(); + } + + private static string ConfigureTestDatabase() + { + var database = CreateDatabase(); + var connectionString = string.Format("Data Source=localhost;Initial Catalog={0};Integrated Security=true", database); + Database.Install(connectionString, ConnectionScope.ByThread); + new MigrationService().MigrateToLatest("sqlserver", connectionString); + return database.ToString(); + } + + private static Guid CreateDatabase() + { + var database = Guid.NewGuid(); + var connectionString = string.Format("Data Source=localhost;Integrated Security=true;"); + var factory = new SqlServerConnectionFactory { ConnectionString = connectionString }; + using (var connection = factory.CreateConnection()) + { + connection.Open(); + var sql = string.Format("CREATE DATABASE [{0}]", database); + connection.Execute(sql); + } + return database; + } + } +} \ No newline at end of file diff --git a/bulky/src/Bulky.Tests/Fixtures/SqliteFixture.cs b/bulky/src/Bulky.Tests/Fixtures/SqliteFixture.cs new file mode 100644 index 0000000..81eda2b --- /dev/null +++ b/bulky/src/Bulky.Tests/Fixtures/SqliteFixture.cs @@ -0,0 +1,84 @@ +using System; +using System.IO; +using System.Threading; +using NUnit.Framework; +using bulky.Tests.Sqlite; +using tophat; +using tuxedo.Dialects; + +namespace bulky.Tests.Fixtures +{ + public class SqliteFixture + { + [TestFixtureSetUp] + public void TestFixtureSetUp() + { + Bulky.BulkCopier = new SqliteBulkCopy(); + BulkCopyFixture.Dialect = new SqliteDialect(); + foreach (var database in Directory.GetFiles(Utils.WhereAmI(), "*.db")) + { + DeleteDatabase(database); + } + } + + [SetUp] + public void SetUp() + { + CreateTestDatabase(); + } + + [TearDown] + public void TearDown() + { + UnitOfWork.Purge(); + } + + private static void DeleteDatabase(string databaseName) + { + if (!File.Exists(databaseName)) + { + return; + } + var i = 10; + while (IsDatabaseInUse(databaseName) && i > 0) + { + i--; + Thread.Sleep(1000); + } + if (i > 0) + { + File.Delete(databaseName); + } + } + + private static bool IsDatabaseInUse(string databaseName) + { + FileStream fs = null; + try + { + var fi = new FileInfo(databaseName); + fs = fi.Open(FileMode.Open, FileAccess.ReadWrite, FileShare.None); + return false; + } + catch (Exception) + { + return true; + } + finally + { + if (fs != null) + { + fs.Close(); + } + } + } + + private static void CreateTestDatabase() + { + var database = string.Format("{0}.db", Guid.NewGuid()); + var connectionString = string.Format("Data Source={0};Version=3;New=True;", database); + Database.Install(connectionString, ConnectionScope.ByThread); + new MigrationService().MigrateToLatest("sqlite", connectionString); + } + } +} diff --git a/bulky/src/Bulky.Tests/Fixtures/Utils.cs b/bulky/src/Bulky.Tests/Fixtures/Utils.cs new file mode 100644 index 0000000..0239cba --- /dev/null +++ b/bulky/src/Bulky.Tests/Fixtures/Utils.cs @@ -0,0 +1,16 @@ +using System; +using System.IO; +using System.Reflection; + +namespace bulky.Tests.Fixtures +{ + public class Utils + { + public static string WhereAmI() + { + var dir = new Uri(Assembly.GetExecutingAssembly().CodeBase); + var fi = new FileInfo(dir.AbsolutePath); + return fi.Directory != null ? fi.Directory.FullName : null; + } + } +} \ No newline at end of file diff --git a/bulky/src/Bulky.Tests/MigrationExtensions.cs b/bulky/src/Bulky.Tests/MigrationExtensions.cs new file mode 100644 index 0000000..6e2ad13 --- /dev/null +++ b/bulky/src/Bulky.Tests/MigrationExtensions.cs @@ -0,0 +1,118 @@ +using System; +using System.IO; +using System.Reflection; +using FluentMigrator; +using FluentMigrator.Builders.Create.Table; +using FluentMigrator.Runner; +using FluentMigrator.Runner.Announcers; +using FluentMigrator.Runner.Initialization; + +namespace bulky.Tests +{ + internal static class Migrator + { + static Migrator() + { + Builder = CreateMigratorMethod(); + } + + private static Lazy Builder { get; set; } + private static Lazy CreateMigratorMethod() + { + return new Lazy(() => new MigrationService()); + } + + public static void MigrateToLatest(string databaseType, string connectionString, string profile = null, Assembly assembly = null, bool trace = false) + { + Builder.Value.MigrateToLatest(databaseType, connectionString, profile, assembly, trace); + } + + public static void MigrateToVersion(string databaseType, string connectionString, long version, string profile = null, Assembly assembly = null, bool trace = false) + { + Builder.Value.MigrateToVersion(databaseType, connectionString, version, profile, assembly, trace); + } + } + + public static class DatabaseType + { + public static readonly string SqlServer = "sqlserver"; + public static readonly string SqlServerCe = "sqlserver"; + public static readonly string Sqlite = "sqlite"; + public static readonly string MySql = "mysql"; + public static readonly string Oracle = "oracle"; + + // Add all the others FluentMigrator supports... + } + + public interface IMigrationService + { + void MigrateToLatest(string databaseType, string connectionString, string profile = null, Assembly assembly = null, bool trace = false); + void MigrateToVersion(string databaseType, string connectionString, long version, string profile = null, Assembly assembly = null, bool trace = false); + } + + public class MigrationService : IMigrationService + { + public void MigrateToLatest(string databaseType, string connectionString, string profile = null, Assembly assembly = null, bool trace = false) + { + MigrateToVersion(databaseType, connectionString, 0, profile, assembly); + } + + public void MigrateToVersion(string databaseType, string connectionString, long version, string profile = null, Assembly assembly = null, bool trace = false) + { + if (databaseType == "sqlite") + { + CopyInteropAssemblyByPlatform(); + } + assembly = assembly ?? Assembly.GetExecutingAssembly(); + var announcer = trace ? new TextWriterAnnouncer(Console.Out) : (IAnnouncer)new NullAnnouncer(); + var context = new RunnerContext(announcer) + { + Connection = connectionString, + Database = databaseType, + Target = assembly.FullName, + Version = version, + Profile = profile + }; + var executor = new TaskExecutor(context); + executor.Execute(); + } + + private const string SQLiteAssembly = "SQLite.Interop.dll"; + public static void CopyInteropAssemblyByPlatform() + { + var baseDir = WhereAmI(); + var destination = Path.Combine(baseDir, SQLiteAssembly); + if (File.Exists(destination)) + { + return; + } + var arch = Environment.Is64BitProcess ? "x64" : "x86"; + var path = Path.Combine(arch, SQLiteAssembly); + var source = Path.Combine(baseDir, path); + File.Copy(source, destination, true); + } + internal static string WhereAmI() + { + var dir = new Uri(Assembly.GetExecutingAssembly().CodeBase); + var fi = new FileInfo(dir.AbsolutePath); + return fi.Directory != null ? fi.Directory.FullName : null; + } + } + + internal static class MigrationExtensions + { + public static ICreateTableWithColumnSyntax Timestamps(this ICreateTableWithColumnSyntax migration) + { + return migration + .WithColumn("CreatedAt").AsDateTime().NotNullable().WithDefault(SystemMethods.CurrentDateTime) + .WithColumn("UpdatedAt").AsDateTime().Nullable(); + } + + public static ICreateTableWithColumnSyntax EffectiveDates(this ICreateTableWithColumnSyntax migration) + { + return migration + .WithColumn("StartDate").AsDateTime().NotNullable().WithDefault(SystemMethods.CurrentDateTime) + .WithColumn("EndDate").AsDateTime().Nullable(); + } + } +} \ No newline at end of file diff --git a/bulky/src/Bulky.Tests/MySql/MySqlConnectionFactory.cs b/bulky/src/Bulky.Tests/MySql/MySqlConnectionFactory.cs new file mode 100644 index 0000000..0dbde1e --- /dev/null +++ b/bulky/src/Bulky.Tests/MySql/MySqlConnectionFactory.cs @@ -0,0 +1,14 @@ +using System.Data; +using MySql.Data.MySqlClient; +using tophat; + +namespace bulky.Tests.MySql +{ + public class MySqlConnectionFactory : ConnectionFactory + { + public override IDbConnection CreateConnection() + { + return new MySqlConnection(ConnectionString); + } + } +} diff --git a/bulky/src/Bulky.Tests/MySql/MySqlDataContext.cs b/bulky/src/Bulky.Tests/MySql/MySqlDataContext.cs new file mode 100644 index 0000000..d8c2781 --- /dev/null +++ b/bulky/src/Bulky.Tests/MySql/MySqlDataContext.cs @@ -0,0 +1,12 @@ +using tophat; + +namespace bulky.Tests.MySql +{ + public class MySqlDataContext : DataContext + { + public MySqlDataContext(string connectionString) : base(connectionString) + { + + } + } +} \ No newline at end of file diff --git a/bulky/src/Bulky.Tests/MySqlBulkCopyTests.cs b/bulky/src/Bulky.Tests/MySqlBulkCopyTests.cs new file mode 100644 index 0000000..4d46127 --- /dev/null +++ b/bulky/src/Bulky.Tests/MySqlBulkCopyTests.cs @@ -0,0 +1,27 @@ +using NUnit.Framework; +using bulky.Tests.Fixtures; + +namespace bulky.Tests +{ + [TestFixture] + public class MySqlBulkCopyTests : MySqlFixture + { + [TestCase(100)] + [TestCase(1000)] + [TestCase(10000)] + [TestCase(100000)] + public void Bulk_copy_n_records_directly(int trials) + { + BulkCopyFixture.BulkCopyUsers(trials); + BulkCopyFixture.BulkCopyUsers(trials, trace: true); + } + + [TestCase(100)] + [TestCase(1000)] + public void Bulk_copy_n_records_with_consumer(int trials) + { + BulkCopyFixture.BulkCopyUsersWithConsumer(trials); + BulkCopyFixture.BulkCopyUsersWithConsumer(trials, trace: true); + } + } +} \ No newline at end of file diff --git a/bulky/src/Bulky.Tests/Properties/AssemblyInfo.cs b/bulky/src/Bulky.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..332e23e --- /dev/null +++ b/bulky/src/Bulky.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("bulky.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("bulky.Tests")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("ff405887-e680-4b97-ae98-4559c39f7cdb")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/bulky/src/Bulky.Tests/SqlServerBulkCopyTests.cs b/bulky/src/Bulky.Tests/SqlServerBulkCopyTests.cs new file mode 100644 index 0000000..718e392 --- /dev/null +++ b/bulky/src/Bulky.Tests/SqlServerBulkCopyTests.cs @@ -0,0 +1,27 @@ +using NUnit.Framework; +using bulky.Tests.Fixtures; + +namespace bulky.Tests +{ + [TestFixture] + public class SqlServerBulkCopyTests : SqlServerFixture + { + [TestCase(100)] + [TestCase(1000)] + [TestCase(10000)] + [TestCase(100000)] + public void Bulk_copy_n_records_directly(int trials) + { + BulkCopyFixture.BulkCopyUsers(trials); + BulkCopyFixture.BulkCopyUsers(trials, trace: true); + } + + [TestCase(100)] + [TestCase(1000)] + public void Bulk_copy_n_records_with_consumer(int trials) + { + BulkCopyFixture.BulkCopyUsersWithConsumer(trials); + BulkCopyFixture.BulkCopyUsersWithConsumer(trials, trace: true); + } + } +} diff --git a/bulky/src/Bulky.Tests/Sqlite/SqliteConnectionFactory.cs b/bulky/src/Bulky.Tests/Sqlite/SqliteConnectionFactory.cs new file mode 100644 index 0000000..1da91ed --- /dev/null +++ b/bulky/src/Bulky.Tests/Sqlite/SqliteConnectionFactory.cs @@ -0,0 +1,14 @@ +using System.Data; +using System.Data.SQLite; +using tophat; + +namespace bulky.Tests.Sqlite +{ + public class SqliteConnectionFactory : ConnectionFactory + { + public override IDbConnection CreateConnection() + { + return new SQLiteConnection(ConnectionString); + } + } +} \ No newline at end of file diff --git a/bulky/src/Bulky.Tests/Sqlite/SqliteDataContext.cs b/bulky/src/Bulky.Tests/Sqlite/SqliteDataContext.cs new file mode 100644 index 0000000..aee3ae6 --- /dev/null +++ b/bulky/src/Bulky.Tests/Sqlite/SqliteDataContext.cs @@ -0,0 +1,12 @@ +using tophat; + +namespace bulky.Tests.Sqlite +{ + public class SqliteDataContext : DataContext + { + public SqliteDataContext(string connectionString) : base(connectionString) + { + + } + } +} \ No newline at end of file diff --git a/bulky/src/Bulky.Tests/SqliteBulkCopyTests.cs b/bulky/src/Bulky.Tests/SqliteBulkCopyTests.cs new file mode 100644 index 0000000..6af6a19 --- /dev/null +++ b/bulky/src/Bulky.Tests/SqliteBulkCopyTests.cs @@ -0,0 +1,27 @@ +using NUnit.Framework; +using bulky.Tests.Fixtures; + +namespace bulky.Tests +{ + [TestFixture] + public class SqliteBulkCopyTests : SqliteFixture + { + [TestCase(100)] + [TestCase(1000)] + [TestCase(10000)] + [TestCase(100000)] + public void Bulk_copy_n_records_directly(int trials) + { + BulkCopyFixture.BulkCopyUsers(trials); + BulkCopyFixture.BulkCopyUsers(trials, trace: true); + } + + [TestCase(100)] + [TestCase(1000)] + public void Bulk_copy_n_records_with_consumer(int trials) + { + BulkCopyFixture.BulkCopyUsersWithConsumer(trials); + BulkCopyFixture.BulkCopyUsersWithConsumer(trials, trace: true); + } + } +} \ No newline at end of file diff --git a/bulky/src/Bulky.Tests/User.cs b/bulky/src/Bulky.Tests/User.cs new file mode 100644 index 0000000..781b0e5 --- /dev/null +++ b/bulky/src/Bulky.Tests/User.cs @@ -0,0 +1,8 @@ +namespace bulky.Tests +{ + public class User + { + public int Id { get; set; } + public string Email { get; set; } + } +} \ No newline at end of file diff --git a/bulky/src/Bulky.Tests/bulky.Tests.csproj b/bulky/src/Bulky.Tests/bulky.Tests.csproj new file mode 100644 index 0000000..45712c3 --- /dev/null +++ b/bulky/src/Bulky.Tests/bulky.Tests.csproj @@ -0,0 +1,130 @@ + + + + + Debug + AnyCPU + {F556E6C7-9500-4BF0-A746-D8ABF9A7B7D0} + Library + Properties + bulky.Tests + bulky.Tests + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\tophat.1.3.0\lib\net40\container.dll + + + False + ..\..\..\copper\bin\net40\copper.dll + + + ..\packages\tuxedo.1.0.1\lib\net40\Dapper.dll + + + ..\packages\FluentMigrator.1.0.6.0\lib\40\FluentMigrator.dll + + + ..\packages\FluentMigrator.Tools.1.0.6.0\tools\AnyCPU\40\FluentMigrator.Runner.dll + + + ..\packages\MySql.Data.6.6.4\lib\net40\MySql.Data.dll + + + ..\packages\NUnit.2.6.2\lib\nunit.framework.dll + + + + + + ..\packages\System.Data.SQLite.1.0.84.0\lib\net40\System.Data.SQLite.dll + + + ..\packages\System.Data.SQLite.1.0.84.0\lib\net40\System.Data.SQLite.Linq.dll + + + + + + + + ..\packages\tuxedo.1.0.1\lib\net40\TableDescriptor.dll + + + ..\packages\tophat.1.3.0\lib\net40\tophat.dll + + + ..\packages\tuxedo.1.0.1\lib\net40\tuxedo.dll + + + ..\packages\tuxedo.1.0.1\lib\net40\tuxedo.Dapper.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + {B8A26190-F414-4BF6-943B-AA786411637C} + bulky.Copper + + + {b9424b16-efdd-497a-b698-3abc1dac51e6} + bulky + + + + + Always + + + Always + + + + + \ No newline at end of file diff --git a/bulky/src/Bulky.Tests/packages.config b/bulky/src/Bulky.Tests/packages.config new file mode 100644 index 0000000..f20f7b9 --- /dev/null +++ b/bulky/src/Bulky.Tests/packages.config @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bulky/src/Bulky.sln b/bulky/src/Bulky.sln new file mode 100644 index 0000000..4ac4e7a --- /dev/null +++ b/bulky/src/Bulky.sln @@ -0,0 +1,41 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bulky", "bulky\bulky.csproj", "{B9424B16-EFDD-497A-B698-3ABC1DAC51E6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bulky.Tests", "Bulky.Tests\bulky.Tests.csproj", "{F556E6C7-9500-4BF0-A746-D8ABF9A7B7D0}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{13D473E5-192F-438C-B9EC-6AF89A1DB793}" + ProjectSection(SolutionItems) = preProject + ..\bulky.nuspec = ..\bulky.nuspec + ..\LICENSE.md = ..\LICENSE.md + ..\pack-nuget.bat = ..\pack-nuget.bat + ..\push-nuget.bat = ..\push-nuget.bat + ..\README.md = ..\README.md + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bulky.Copper", "bulky.Copper\bulky.Copper.csproj", "{B8A26190-F414-4BF6-943B-AA786411637C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B9424B16-EFDD-497A-B698-3ABC1DAC51E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B9424B16-EFDD-497A-B698-3ABC1DAC51E6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B9424B16-EFDD-497A-B698-3ABC1DAC51E6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B9424B16-EFDD-497A-B698-3ABC1DAC51E6}.Release|Any CPU.Build.0 = Release|Any CPU + {F556E6C7-9500-4BF0-A746-D8ABF9A7B7D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F556E6C7-9500-4BF0-A746-D8ABF9A7B7D0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F556E6C7-9500-4BF0-A746-D8ABF9A7B7D0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F556E6C7-9500-4BF0-A746-D8ABF9A7B7D0}.Release|Any CPU.Build.0 = Release|Any CPU + {B8A26190-F414-4BF6-943B-AA786411637C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B8A26190-F414-4BF6-943B-AA786411637C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B8A26190-F414-4BF6-943B-AA786411637C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B8A26190-F414-4BF6-943B-AA786411637C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/bulky/src/Bulky/BulkCopyMapping.cs b/bulky/src/Bulky/BulkCopyMapping.cs new file mode 100644 index 0000000..ad8867e --- /dev/null +++ b/bulky/src/Bulky/BulkCopyMapping.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; +using System.Data; + +namespace bulky +{ + public class BulkCopyMapping + { + public DataTable DataReaderTable { get; set; } + public IEnumerable SchemaTableColumns { get; set; } + public IEnumerable DatabaseTableColumns { get; set; } + } +} \ No newline at end of file diff --git a/bulky/src/Bulky/Bulky.cs b/bulky/src/Bulky/Bulky.cs new file mode 100644 index 0000000..c07b98c --- /dev/null +++ b/bulky/src/Bulky/Bulky.cs @@ -0,0 +1,11 @@ +namespace bulky +{ + public static class Bulky + { + public static IBulkCopy BulkCopier { get; set; } + static Bulky() + { + BulkCopier = new SqlServerBulkCopy(); + } + } +} \ No newline at end of file diff --git a/bulky/src/Bulky/BulkyExtensions.cs b/bulky/src/Bulky/BulkyExtensions.cs new file mode 100644 index 0000000..44ca436 --- /dev/null +++ b/bulky/src/Bulky/BulkyExtensions.cs @@ -0,0 +1,19 @@ +using System.Collections.Generic; +using System.Data; +using TableDescriptor; + +namespace bulky +{ + public static class BulkyExtensions + { + public static void BulkCopy(this IDbConnection connection, IEnumerable entities, IDbTransaction transaction = null, int? commandTimeout = null) + { + Bulky.BulkCopier.Copy(SimpleDescriptor.Create(), connection, entities, transaction, commandTimeout); + } + + public static void BulkCopy(this IDbConnection connection, Descriptor descriptor, IEnumerable entities, IDbTransaction transaction = null, int? commandTimeout = null) + { + Bulky.BulkCopier.Copy(SimpleDescriptor.Create(), connection, entities, transaction, commandTimeout); + } + } +} \ No newline at end of file diff --git a/bulky/src/Bulky/EnumerableDataReader.cs b/bulky/src/Bulky/EnumerableDataReader.cs new file mode 100644 index 0000000..6969685 --- /dev/null +++ b/bulky/src/Bulky/EnumerableDataReader.cs @@ -0,0 +1,297 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using TableDescriptor; + +namespace bulky +{ + /// + /// A data reader that wraps an sequence. + /// + /// - Since bulk copying sometimes requires the total record count to optimize batch sizes, it's up to the enumerable to avoid re-enumerating when Count() is requested. + /// + /// + /// + public class EnumerableDataReader : IDataReader + { + private IEnumerable _enumerable; + private object[] _record; + private readonly PropertyToColumn[] _properties; + private readonly string _tableName; + private readonly IEnumerator _enumerator; + + public int Count + { + get { return _enumerable.Count(); } + } + + public EnumerableDataReader(IEnumerable entities) : this() + { + _enumerable = new ConcurrentQueue(entities); + _enumerator = _enumerable.GetEnumerator(); + } + + public EnumerableDataReader() : this(SimpleDescriptor.Create()) + { + + } + + public EnumerableDataReader(Descriptor descriptor) + { + _tableName = descriptor.Table; + _properties = descriptor.Insertable.ToArray(); + FieldCount = _properties.Length; + } + + public DataTable GetSchemaTable() + { + var table = new DataTable(); + foreach (var property in _properties) + { + var columnName = property.ColumnName; + var columnType = property.Property.Type; + var fieldType = columnType; + var isNullable = IsNullable(columnType); + if (isNullable) + { + fieldType = Nullable.GetUnderlyingType(columnType); + } + var column = table.Columns.Add(columnName, fieldType); + column.AllowDBNull = isNullable; + column.ReadOnly = true; + } + table.TableName = _tableName; + return table; + } + + public static bool IsNullable(Type type) + { + return type.IsValueType && + type.IsGenericType && + type.GetGenericTypeDefinition() == typeof(Nullable<>); + } + + public bool Read() + { + if (!_enumerator.MoveNext()) + { + return false; + } + var next = _enumerator.Current; + var properties = _properties; + _record = new object[properties.Length]; + for (var i = 0; i < _record.Length; i++) + { + var propertyMap = properties[i]; + _record[i] = propertyMap.Property.Get(next); + } + return true; + } + + private TValue GetValue(int i) + { + var value = GetValue(i); + if (value == DBNull.Value && !IsNullable(typeof(TValue))) + { + throw new InvalidOperationException("Value is not nullable"); + } + return (TValue)value; + } + + public int GetOrdinal(string name) + { + var map = _properties.First(p => p.ColumnName == name); + if (map != null) + { + for (var i = 0; i < _properties.Length; i++) + { + if (_properties[i] == map) + { + return i; + } + } + } + return -1; + } + + public int GetValues(object[] values) + { + var columns = 0; + for (var i = 0; i < values.Length && i < FieldCount; i++) + { + columns += 1; + values[i] = GetValue(i); + } + return columns; + } + + public int FieldCount { get; private set; } + + public void Close() + { + _enumerable = null; + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + public virtual void Dispose(bool disposing) + { + if(disposing) + { + Close(); + } + } + + #region Not Supported + private static void NotUsedByBulkCopy() + { + throw new NotSupportedException("This method does not apply to in-memory collections, which is all this class supports"); + } + + public int RecordsAffected + { + get + { + NotUsedByBulkCopy(); + return 0; + } + } + + public long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length) + { + NotUsedByBulkCopy(); + return 0; + } + + public long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length) + { + NotUsedByBulkCopy(); + return 0; + } + public IDataReader GetData(int i) + { + NotUsedByBulkCopy(); + return null; + } + #endregion + + #region Passthrough + + public object this[string name] + { + get { return GetValue(GetOrdinal(name)); } + } + + public object this[int i] + { + get { return GetValue(i); } + } + + public bool NextResult() + { + return false; + } + + public int Depth + { + get { return 1; } + } + + public bool IsClosed + { + get { return _enumerable == null; } + } + + public object GetValue(int i) + { + return _record[i]; + } + + public string GetName(int i) + { + return _properties[i].ColumnName; + } + + public string GetDataTypeName(int i) + { + return GetFieldType(i).Name; + } + + public Type GetFieldType(int i) + { + return _properties[i].Property.Type; + } + + public bool GetBoolean(int i) + { + return GetValue(i); + } + + public byte GetByte(int i) + { + return GetValue(i); + } + + public char GetChar(int i) + { + return GetValue(i); + } + + public Guid GetGuid(int i) + { + return GetValue(i); + } + + public short GetInt16(int i) + { + return GetValue(i); + } + + public int GetInt32(int i) + { + return GetValue(i); + } + + public long GetInt64(int i) + { + return GetValue(i); + } + + public float GetFloat(int i) + { + return GetValue(i); + } + + public double GetDouble(int i) + { + return GetValue(i); + } + + public string GetString(int i) + { + return GetValue(i); + } + + public decimal GetDecimal(int i) + { + return GetValue(i); + } + + public DateTime GetDateTime(int i) + { + return GetValue(i); + } + + public bool IsDBNull(int i) + { + return (GetValue(i) == DBNull.Value); + } + #endregion + } +} \ No newline at end of file diff --git a/bulky/src/Bulky/IBulkCopy.cs b/bulky/src/Bulky/IBulkCopy.cs new file mode 100644 index 0000000..63b8b6b --- /dev/null +++ b/bulky/src/Bulky/IBulkCopy.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; +using System.Data; +using TableDescriptor; + +namespace bulky +{ + public interface IBulkCopy + { + void Copy(Descriptor descriptor, IDbConnection connection, IEnumerable entities, IDbTransaction transaction = null, int? commandTimeout = null); + } +} diff --git a/bulky/src/Bulky/MySqlBulkCopy.cs b/bulky/src/Bulky/MySqlBulkCopy.cs new file mode 100644 index 0000000..6ab6a00 --- /dev/null +++ b/bulky/src/Bulky/MySqlBulkCopy.cs @@ -0,0 +1,165 @@ +using System.Collections.Generic; +using System.Data; +using System.Linq; +using TableDescriptor; +using tuxedo; +using tuxedo.Dialects; + +namespace bulky +{ + /// + /// Performs high speed bulk inserts against a MySQL database. + /// + /// - Note that prepared statements bypass the query cache in MySQL; Flint caches statements by type and batch size + /// - This currently doesn't intelligently set the batch size based on packets; the value is arbitrary + /// + /// + /// + /// + /// + public class MySqlBulkCopy : IBulkCopy + { + public const int BatchSize = 100; + + private static readonly MySqlDialect Dialect; + + static MySqlBulkCopy() + { + Dialect = new MySqlDialect(); + } + + public void Copy(Descriptor descriptor, IDbConnection connection, IEnumerable entities, IDbTransaction transaction = null, int? commandTimeout = null) + { + descriptor = descriptor ?? SimpleDescriptor.Create(); + transaction = transaction ?? connection.BeginTransaction(); + var reader = new EnumerableDataReader(entities); + var total = reader.Count; + var batchSize = total < BatchSize ? total : BatchSize; + var pending = new List(batchSize); + var columnCount = descriptor.Insertable.Count(); + var read = 0; + while (reader.Read()) + { + read = ReadOne(columnCount, reader, pending, read); + if (pending.Count >= batchSize) + { + PrepareAndInsert(connection, transaction, descriptor, batchSize, pending); + } + } + if (pending.Count > 0) + { + PrepareAndInsert(connection, transaction, descriptor, pending.Count, pending); + } + transaction.Commit(); + } + + private static int ReadOne(int columnCount, IDataRecord reader, ICollection pending, int read) + { + var count = columnCount; + var parameterValues = new object[count]; + for (var i = 0; i < count; i++) + { + parameterValues[i] = reader.GetValue(i); + } + pending.Add(parameterValues); + read++; + return read; + } + + private void PrepareAndInsert(IDbConnection connection, IDbTransaction transaction, Descriptor map, int batchSize, ICollection pending) + { + var command = PrepareCommand(connection, transaction, map, batchSize); + var index = 0; + foreach (var item in pending.SelectMany(@group => @group)) + { + ((IDbDataParameter)command.Parameters[index]).Value = item; + index++; + } + command.Connection = connection; + command.ExecuteNonQuery(); + pending.Clear(); + } + + private static readonly IDictionary> InsertCommands = new Dictionary>(); + private IDbCommand PrepareCommand(IDbConnection connection, IDbTransaction transaction, Descriptor classMap, int batchSize) + { + IDictionary store; + if (!InsertCommands.TryGetValue(classMap, out store)) + { + store = new Dictionary(); + InsertCommands.Add(classMap, store); + } + IDbCommand command; + if (!store.TryGetValue(batchSize, out command)) + { + command = connection.CreateCommand(); + command.CommandText = MultiValueInsert(classMap, batchSize); + var properties = classMap.Insertable.ToArray(); + var parameterNames = properties.Select(p => p.ColumnName).ToList(); + var parameters = new List(); + for (var i = 0; i < batchSize; i++) + { + foreach (var pn in parameterNames) + { + var parameter = command.CreateParameter(); + parameter.ParameterName = string.Concat(pn, "_", i); + command.Parameters.Add(parameter); + parameters.Add(parameter); + } + } + command.Transaction = transaction; + command.Prepare(); + store.Add(batchSize, command); + } + return command; + } + + private static readonly IDictionary> MultiValueInserts = new Dictionary>(); + public string MultiValueInsert(Descriptor descriptor, int blockSize) + { + IDictionary store; + if (!MultiValueInserts.TryGetValue(descriptor, out store)) + { + store = new Dictionary(); + MultiValueInserts.Add(descriptor, store); + } + string sql; + if (!store.TryGetValue(blockSize, out sql)) + { + var columns = descriptor.Insertable.ToArray(); + var parameters = new List(); + var columnNames = new List(); + + var dialect = Tuxedo.Dialect; + Tuxedo.Dialect = Dialect; + + foreach (var column in columns) + { + columnNames.Add(column.ColumnName); + for (var i = 0; i < blockSize; i++) + { + parameters.Add(string.Concat("@", column.ColumnName, "_", i)); + } + } + sql = string.Concat("INSERT INTO ", Tuxedo.TableName(descriptor), " (", columnNames.ConcatQualified(Dialect), ") VALUES "); + var sqlValues = new List(); + var index = 0; + for (var i = 0; i < blockSize; i++) + { + var slice = new List(); + for (var j = 0; j < columns.Length; j++) + { + slice.Add(parameters[index]); + } + sqlValues.Add(string.Concat("(", slice.Concat(), ")")); + index++; + } + sql = string.Concat(sql, sqlValues.Concat()); + store.Add(blockSize, sql); + + Tuxedo.Dialect = dialect; + } + return sql; + } + } +} \ No newline at end of file diff --git a/bulky/src/Bulky/Properties/AssemblyInfo.cs b/bulky/src/Bulky/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..8e12ee4 --- /dev/null +++ b/bulky/src/Bulky/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("bulky")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("bulky")] +[assembly: AssemblyCopyright("Copyright © Conatus Creative Inc. 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("08390ac8-e330-4134-8c87-d5a05cb51744")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/bulky/src/Bulky/SqlServerBulkCopy.cs b/bulky/src/Bulky/SqlServerBulkCopy.cs new file mode 100644 index 0000000..d93d0cb --- /dev/null +++ b/bulky/src/Bulky/SqlServerBulkCopy.cs @@ -0,0 +1,123 @@ +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Diagnostics; +using System.Linq; +using TableDescriptor; + +namespace bulky +{ + /// + /// Performs high speed bulk inserts against a SQL Server database. + /// Optimizations: + /// - TABLOCK is set + /// - The batch size is set to the number of rows inserted + /// - The recovery model is set to bulk-logged + /// - Page verify is temporarily turned off if it is on + /// Assumptions (for best performance): + /// - The target table is not being replicated + /// - The target table does not have any triggers + /// - The target table has either 0 rows or no indexes + /// + /// + /// + public class SqlServerBulkCopy : IBulkCopy + { + public virtual void Copy(Descriptor descriptor, IDbConnection connection, IEnumerable entities, IDbTransaction transaction = null, int? commandTimeout = null) + { + descriptor = descriptor ?? SimpleDescriptor.Create(); + var reader = new EnumerableDataReader(entities); + var timeout = commandTimeout.HasValue ? commandTimeout.Value : 0; + var mapping = GenerateBulkCopyMapping(descriptor, reader, connection, timeout); + + var settings = BeforeBulkInsert(connection, transaction, timeout); + try + { + using (var bcp = new SqlBulkCopy((SqlConnection)connection, SqlBulkCopyOptions.TableLock, (SqlTransaction)transaction)) + { + foreach (var column in mapping.DatabaseTableColumns) + { + bcp.ColumnMappings.Add(new SqlBulkCopyColumnMapping(column, column)); + } + bcp.BatchSize = reader.Count; + bcp.DestinationTableName = !string.IsNullOrWhiteSpace(descriptor.Schema) ? string.Format("[{0}].[{1}]", descriptor.Schema, mapping.DataReaderTable.TableName) : string.Format("[dbo].[{0}]", mapping.DataReaderTable.TableName); + bcp.BulkCopyTimeout = timeout; + bcp.WriteToServer(reader); + } + } + finally + { + AfterBulkInsert(connection, transaction, timeout, settings); + } + } + + public virtual SqlServerSettings BeforeBulkInsert(IDbConnection connection, IDbTransaction transaction, int timeout) + { + var database = connection.Database; + var settings = new SqlServerSettings + { + PageVerify = Util.AdHoc(connection, transaction, timeout, string.Format("SELECT page_verify_option_desc FROM sys.databases WHERE [NAME] = '{0}'", database)).ToString(), + RecoveryModel = Util.AdHoc(connection, transaction, timeout, string.Format("SELECT recovery_model_desc FROM sys.databases WHERE [NAME] = '{0}'", database)).ToString() + }; + + Util.AdHoc(connection, transaction, timeout, "USE master;"); + Util.AdHoc(connection, transaction, timeout, string.Format("ALTER DATABASE [{0}] SET PAGE_VERIFY NONE;", database)); + Util.AdHoc(connection, transaction, timeout, string.Format("ALTER DATABASE [{0}] SET RECOVERY BULK_LOGGED", database)); + Util.AdHoc(connection, transaction, timeout, string.Format("USE [{0}]", database)); + + return settings; + } + + public virtual void AfterBulkInsert(IDbConnection connection, IDbTransaction transaction, int timeout, SqlServerSettings settings) + { + var database = connection.Database; + Util.AdHoc(connection, transaction, timeout, "USE master"); + Util.AdHoc(connection, transaction, timeout, string.Format("ALTER DATABASE [{0}] SET PAGE_VERIFY {1};", database, settings.PageVerify)); + Util.AdHoc(connection, transaction, timeout, string.Format("ALTER DATABASE [{0}] SET RECOVERY {1}", database, settings.RecoveryModel)); + Util.AdHoc(connection, transaction, timeout, string.Format("USE [{0}]", database)); + } + + public virtual BulkCopyMapping GenerateBulkCopyMapping(Descriptor descriptor, IDataReader reader, IDbConnection connection, int commandTimeout) + { + var schemaTable = reader.GetSchemaTable(); + var schemaTableColumns = (from DataColumn column in schemaTable.Columns select column.ColumnName).ToList(); + var databaseTableColumns = GetDatabaseTableColumns(connection, schemaTable.TableName, commandTimeout).ToList(); + var excludedColumns = descriptor.Computed.Select(c => c.ColumnName).ToList(); + databaseTableColumns = databaseTableColumns.Except(excludedColumns).ToList(); + Debug.Assert(databaseTableColumns.Count() == schemaTableColumns.Count()); + return new BulkCopyMapping + { + DataReaderTable = schemaTable, + DatabaseTableColumns = databaseTableColumns, + SchemaTableColumns = schemaTableColumns + }; + } + + public virtual IEnumerable GetDatabaseTableColumns(IDbConnection connection, string tableName, int commandTimeout) + { + using (var command = connection.CreateCommand()) + { + command.CommandText = "sp_Columns"; + command.CommandType = CommandType.StoredProcedure; + command.CommandTimeout = commandTimeout; + + //command.Parameters.Add("@table_name", SqlDbType.NVarChar, 384).Value = tableName; + var parameter = command.CreateParameter(); + parameter.ParameterName = "@table_name"; + parameter.DbType = DbType.String; + parameter.Size = 384; + parameter.Value = tableName; + command.Parameters.Add(parameter); + + if (connection.State == ConnectionState.Closed) connection.Open(); + using (var reader = command.ExecuteReader()) + { + while (reader != null && reader.Read()) + { + yield return (string) reader["column_name"]; + } + } + } + } + } +} \ No newline at end of file diff --git a/bulky/src/Bulky/SqlServerSettings.cs b/bulky/src/Bulky/SqlServerSettings.cs new file mode 100644 index 0000000..3a0f017 --- /dev/null +++ b/bulky/src/Bulky/SqlServerSettings.cs @@ -0,0 +1,8 @@ +namespace bulky +{ + public class SqlServerSettings + { + public string PageVerify { get; set; } + public string RecoveryModel { get; set; } + } +} \ No newline at end of file diff --git a/bulky/src/Bulky/SqliteBulkCopy.cs b/bulky/src/Bulky/SqliteBulkCopy.cs new file mode 100644 index 0000000..05e84ac --- /dev/null +++ b/bulky/src/Bulky/SqliteBulkCopy.cs @@ -0,0 +1,100 @@ +using System.Collections.Generic; +using System.Data; +using System.Linq; +using TableDescriptor; +using tuxedo; +using tuxedo.Dialects; + +namespace bulky +{ + /// + /// Performs high speed bulk inserts against a SQLite database. + /// + public class SqliteBulkCopy : IBulkCopy + { + private static readonly SqliteDialect Dialect; + + static SqliteBulkCopy() + { + Dialect = new SqliteDialect(); + } + + public void Copy(Descriptor descriptor, IDbConnection connection, IEnumerable entities, IDbTransaction transaction = null, int? commandTimeout = null) + { + if (entities == null || !entities.Any()) + { + return; + } + + var settings = BeforeBulkInsert(connection, transaction, commandTimeout); + try + { + descriptor = descriptor ?? SimpleDescriptor.Create(); + var command = connection.CreateCommand(); + transaction = transaction ?? connection.BeginTransaction(); + + SetCommandText(command, entities.First()); + + var properties = descriptor.Insertable.ToArray(); + var parameterNames = properties.Select(p => p.ColumnName); + var parameters = parameterNames.Select(pn => + { + var parameter = command.CreateParameter(); + parameter.ParameterName = pn; + command.Parameters.Add(parameter); + return parameter; + }).ToArray(); + + command.Transaction = transaction; + command.Prepare(); + + var reader = new EnumerableDataReader(entities); + while (reader.Read()) + { + for (var i = 0; i < parameters.Length; i++) + { + parameters[i].Value = reader.GetValue(i); + } + command.ExecuteNonQuery(); + } + transaction.Commit(); + } + finally + { + AfterBulkInsert(connection, settings); + } + } + + private static void SetCommandText(IDbCommand command, T example) + { + var dialect = Tuxedo.Dialect; + Tuxedo.Dialect = Dialect; + command.CommandText = Tuxedo.Insert(example).Sql; + Tuxedo.Dialect = dialect; + } + + private static SqliteSettings BeforeBulkInsert(IDbConnection connection, IDbTransaction transaction = null, int? commandTimeout = null) + { + var settings = new SqliteSettings + { + Synchronous = Util.AdHoc(connection, transaction, commandTimeout.HasValue ? commandTimeout.Value : 0, "PRAGMA synchronous").ToString(), + JournalMode = Util.AdHoc(connection, transaction, commandTimeout.HasValue ? commandTimeout.Value : 0, "PRAGMA journal_mode").ToString() + }; + var pragma = connection.CreateCommand(); + pragma.CommandText = "PRAGMA synchronous = OFF"; + pragma.ExecuteNonQuery(); + pragma.CommandText = "PRAGMA journal_mode = MEMORY"; + pragma.ExecuteNonQuery(); + return settings; + } + + private static void AfterBulkInsert(IDbConnection connection, SqliteSettings settings) + { + var pragma = connection.CreateCommand(); + pragma.CommandText = "PRAGMA synchronous = " + settings.Synchronous; + pragma.ExecuteNonQuery(); + pragma.CommandText = "PRAGMA journal_mode = " + settings.JournalMode; + pragma.ExecuteNonQuery(); + } + } +} \ No newline at end of file diff --git a/bulky/src/Bulky/SqliteSettings.cs b/bulky/src/Bulky/SqliteSettings.cs new file mode 100644 index 0000000..856c782 --- /dev/null +++ b/bulky/src/Bulky/SqliteSettings.cs @@ -0,0 +1,8 @@ +namespace bulky +{ + public class SqliteSettings + { + public string Synchronous { get; set; } + public string JournalMode { get; set; } + } +} \ No newline at end of file diff --git a/bulky/src/Bulky/StringExtensions.cs b/bulky/src/Bulky/StringExtensions.cs new file mode 100644 index 0000000..9616d6f --- /dev/null +++ b/bulky/src/Bulky/StringExtensions.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using System.Linq; +using tuxedo; + +namespace bulky +{ + internal static class StringExtensions + { + public const string DefaultSeparator = ", "; + + public static string Concat(this IEnumerable list, string separator = DefaultSeparator) + { + return string.Join(separator, list); + } + + public static string Qualify(this string value, Dialect dialect) + { + return string.IsNullOrWhiteSpace(value) ? value : string.Concat(dialect.StartIdentifier, value, dialect.EndIdentifier).Trim(); + } + + public static string ConcatQualified(this IEnumerable list, Dialect dialect, string separator = DefaultSeparator) + { + var qualified = list.Where(i => !string.IsNullOrWhiteSpace(i)).Select(i => i.Qualify(dialect)); + return string.Join(separator, qualified); + } + } +} \ No newline at end of file diff --git a/bulky/src/Bulky/Util.cs b/bulky/src/Bulky/Util.cs new file mode 100644 index 0000000..385c30b --- /dev/null +++ b/bulky/src/Bulky/Util.cs @@ -0,0 +1,17 @@ +using System.Data; + +namespace bulky +{ + public class Util + { + public static object AdHoc(IDbConnection connection, IDbTransaction transaction, int timeout, string sql) + { + if (connection.State == ConnectionState.Closed) connection.Open(); + var command = connection.CreateCommand(); + command.CommandText = sql; + command.CommandTimeout = timeout; + command.Transaction = transaction; + return command.ExecuteScalar(); + } + } +} \ No newline at end of file diff --git a/bulky/src/Bulky/bulky.csproj b/bulky/src/Bulky/bulky.csproj new file mode 100644 index 0000000..dcab9d7 --- /dev/null +++ b/bulky/src/Bulky/bulky.csproj @@ -0,0 +1,83 @@ + + + + + Debug + AnyCPU + {B9424B16-EFDD-497A-B698-3ABC1DAC51E6} + Library + Properties + bulky + bulky + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\bin\lib\net40\ + TRACE + prompt + 4 + + + + False + ..\packages\tuxedo.1.0.1\lib\net40\Dapper.dll + + + + + + + + + + False + ..\packages\tuxedo.1.0.1\lib\net40\TableDescriptor.dll + + + False + ..\packages\tuxedo.1.0.1\lib\net40\tuxedo.dll + + + False + ..\packages\tuxedo.1.0.1\lib\net40\tuxedo.Dapper.dll + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bulky/src/Bulky/packages.config b/bulky/src/Bulky/packages.config new file mode 100644 index 0000000..75dec50 --- /dev/null +++ b/bulky/src/Bulky/packages.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/bulky/src/bulky.Copper/BulkCopyConsumer.cs b/bulky/src/bulky.Copper/BulkCopyConsumer.cs new file mode 100644 index 0000000..b191dea --- /dev/null +++ b/bulky/src/bulky.Copper/BulkCopyConsumer.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Data; +using TableDescriptor; +using copper; +using tophat; + +namespace bulky +{ + /// + /// A consumer that bulk inserts objects in batches. + /// By default, a tophat connection scope is used, or you may provide one through . + /// By default, the object mapping is performed by TableDescriptor's , or you may provide a custom . + /// + /// + public class BulkCopyConsumer : BatchingConsumer + { + public Func ConnectionBuilder { get; set; } + public Descriptor Descriptor { get; set; } + public int Consumed { get; private set; } + + public BulkCopyConsumer(int itemsPerBatch) : base(itemsPerBatch) + { + InitializeDefaults(); + } + + public BulkCopyConsumer(TimeSpan interval) : base(interval) + { + InitializeDefaults(); + } + + public BulkCopyConsumer(int itemsPerBatch, TimeSpan orInterval) : base(itemsPerBatch, orInterval) + { + InitializeDefaults(); + } + + private void InitializeDefaults() + { + Descriptor = SimpleDescriptor.Create(); + ConnectionBuilder = () => UnitOfWork.Current; + } + + public override bool Handle(IList batch) + { + ConnectionBuilder().BulkCopy(Descriptor, batch); + Consumed += batch.Count; + return true; + } + } +} diff --git a/bulky/src/bulky.Copper/Properties/AssemblyInfo.cs b/bulky/src/bulky.Copper/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..a70ceae --- /dev/null +++ b/bulky/src/bulky.Copper/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("bulky.Copper")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("bulky.Copper")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("4fee3427-0cc8-4238-9b29-2ed5b28534d2")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/bulky/src/bulky.Copper/bulky.Copper.csproj b/bulky/src/bulky.Copper/bulky.Copper.csproj new file mode 100644 index 0000000..8f3b392 --- /dev/null +++ b/bulky/src/bulky.Copper/bulky.Copper.csproj @@ -0,0 +1,74 @@ + + + + + Debug + AnyCPU + {B8A26190-F414-4BF6-943B-AA786411637C} + Library + Properties + bulky.Copper + bulky.Copper + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\tophat.1.3.0\lib\net40\container.dll + + + ..\..\..\copper\bin\net40\copper.dll + + + + + + + + + + ..\packages\TableDescriptor.1.0.1\lib\net40\TableDescriptor.dll + + + ..\packages\tophat.1.3.0\lib\net40\tophat.dll + + + + + + + + + {b9424b16-efdd-497a-b698-3abc1dac51e6} + bulky + + + + + + + + \ No newline at end of file diff --git a/bulky/src/bulky.Copper/packages.config b/bulky/src/bulky.Copper/packages.config new file mode 100644 index 0000000..9b9ecd3 --- /dev/null +++ b/bulky/src/bulky.Copper/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/container/.gitignore b/container/.gitignore new file mode 100644 index 0000000..2f7b39f --- /dev/null +++ b/container/.gitignore @@ -0,0 +1,40 @@ +#ignore thumbnails created by windows +Thumbs.db +#Ignore files build by Visual Studio +*.obj +*.pdb +*.user +*.aps +*.pch +*.vspscc +*_i.c +*_p.c +*.ncb +*.suo +*.tlb +*.tlh +*.bak +*.cache +*.ilk +*.log +[Bb]in +[Dd]ebug +[Cc]lientBin*/ +*.lib +*.sbr +obj/ +[Rr]elease*/ +_ReSharper*/ +[Tt]est[Rr]esult* +deploy.config +*.vsmdi +*.pidb +*.userprefs +*.testrunconfig +*.testsettings +publish.xml +TestResults +$SSH_ENV +src/.DS_Store +src/.nuget/NuGet.Config +*.nupkg diff --git a/container/.nuget/NuGet.Config b/container/.nuget/NuGet.Config new file mode 100644 index 0000000..5e74378 --- /dev/null +++ b/container/.nuget/NuGet.Config @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/container/.nuget/NuGet.targets b/container/.nuget/NuGet.targets new file mode 100644 index 0000000..bda5bea --- /dev/null +++ b/container/.nuget/NuGet.targets @@ -0,0 +1,143 @@ + + + + $(MSBuildProjectDirectory)\..\ + + + false + + + false + + + true + + + false + + + + + + + + + + $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) + $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) + $([System.IO.Path]::Combine($(SolutionDir), "packages")) + + + + + $(SolutionDir).nuget + packages.config + $(SolutionDir)packages + + + + + $(NuGetToolsPath)\nuget.exe + @(PackageSource) + + "$(NuGetExePath)" + mono --runtime=v4.0.30319 $(NuGetExePath) + + $(TargetDir.Trim('\\')) + + -RequireConsent + + $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(RequireConsentSwitch) -o "$(PackagesDir)" + $(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols + + + + RestorePackages; + $(BuildDependsOn); + + + + + $(BuildDependsOn); + BuildPackage; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/container/LICENSE.md b/container/LICENSE.md new file mode 100644 index 0000000..a9a4201 --- /dev/null +++ b/container/LICENSE.md @@ -0,0 +1,21 @@ +Container (http://github.com/danielcrenna/container) +-------------------------------------- +Copyright (c) 2013 Conatus Creative Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Currently includes an embedded version of Munq: +Munq (http://munq.codeplex.com) +-------------------------------------- + Copyright 2011 by Matthew Dennis. +Released under the Microsoft Public License (Ms-PL) http://www.opensource.org/licenses/ms-pl.html \ No newline at end of file diff --git a/container/README.md b/container/README.md new file mode 100644 index 0000000..5feb241 --- /dev/null +++ b/container/README.md @@ -0,0 +1,46 @@ +# Container +## A simple interface for function-descriptor style IoC containers + +``` +PM> Install-Package container +``` + +### Introduction +IoC is an overwrought, stinky little skeleton in the static language closet. There, I said it. +But it _is_ useful for distributing libraries when you want to allow consumers to swap the +internal componentry. Since I have to maintain a dozen or so of these, this is the small +abstraction I use to enable embedded dependency resolution. + +### Features + +* Uses the function-descriptor style of registration, which, come on, is the nicest way +* Low to no ceremony +* Ships with Munq already embedded in it for a good default choice + +### Usage + +#### Registering and resolving + +```csharp +var container = new Container(); +container.Register(r => new Foo()); +container.Register(r => new Bar(r.Resolve())); + +var bar = container.Resolve(); +``` + +#### Swapping the container + +```csharp +Container.DefaultContainer = ()=> new MyAwesomeContainer(); +``` + +### Why did you embed Munq? + +I like Munq. It's fast enough and it's simple. But it has a few problems, +mainly summed up [here](http://munq.codeplex.com/workitem/7131). It doesn't sound +like a big deal, but it boils down to having to wrap resolutions in a try/catch, +which is terrible for high-performing applications. The Munq that ships as the +default container will not throw exceptions, making it more suitable for rapid +resolution and cheap tests using `CanResolve`. If the author ever patches it, I'll be +happy to take on a dependency. \ No newline at end of file diff --git a/container/container.nuspec b/container/container.nuspec new file mode 100644 index 0000000..b533a13 --- /dev/null +++ b/container/container.nuspec @@ -0,0 +1,16 @@ + + + + container + 1.1.0 + Daniel Crenna + Daniel Crenna + A simple interface for function-descriptor style IoC containers. + A simple interface for function-descriptor style IoC containers. Includes an embedded Munq container by default. + en-US + http://github.com/danielcrenna/container + https://github.com/danielcrenna/container/blob/master/LICENSE.md + http://apitize.com.s3.amazonaws.com/logo_generic.png + ioc container + + \ No newline at end of file diff --git a/container/pack-nuget.bat b/container/pack-nuget.bat new file mode 100644 index 0000000..8be1336 --- /dev/null +++ b/container/pack-nuget.bat @@ -0,0 +1,3 @@ +copy LICENSE.md bin +copy README.md bin +".nuget\NuGet.exe" pack container.nuspec -BasePath bin \ No newline at end of file diff --git a/container/push-nuget.bat b/container/push-nuget.bat new file mode 100644 index 0000000..c91111e --- /dev/null +++ b/container/push-nuget.bat @@ -0,0 +1 @@ +".nuget\NuGet.exe" push container.1.1.0.nupkg \ No newline at end of file diff --git a/container/src/container.Tests/DefaultContainerTests.cs b/container/src/container.Tests/DefaultContainerTests.cs new file mode 100644 index 0000000..d47e58c --- /dev/null +++ b/container/src/container.Tests/DefaultContainerTests.cs @@ -0,0 +1,89 @@ +using System; +using NUnit.Framework; + +namespace container.Tests +{ + [TestFixture] + public class DefaultContainerTests + { + [Test] + public void Removals_dont_cause_exceptions() + { + Assert.DoesNotThrow(() => + { + var container = new DefaultContainer(); + + container.Register(r => new Foo()); + Assert.IsTrue(container.Remove()); + Assert.IsFalse(container.Remove()); + + container.Register("MyFoo", r=> new Foo()); + Assert.IsTrue(container.Remove("MyFoo")); + Assert.IsFalse(container.Remove("VitaminFail")); + }); + } + + [Test] + public void Can_resolve_returns_true_for_arbitrary_type() + { + var container = new Container(); + container.Register(r => new Foo()); + Assert.IsTrue(container.CanResolve()); + } + + [Test] + public void Can_resolve_returns_true_for_arbitrary_untyped_type() + { + var container = new Container(); + container.Register(typeof(IFoo), r => new Foo()); + Assert.IsTrue(container.CanResolve()); + } + + [Test] + public void Can_resolve_untyped_type() + { + var container = new Container(); + container.Register(typeof(IFoo), r => new Foo()); + Assert.IsNotNull(container.Resolve()); + } + + [Test] + public void Null_resolutions_do_not_result_in_exceptions() + { + // Simple case of missing dependency + var container = new Container(); + var foo = container.Resolve(); + Assert.IsNull(foo); + + // Advanced case of missing inner dependency on registered type + container = new Container(); + container.Register(r => new Bar(r.Resolve())); + var bar = container.Resolve(); + Assert.IsNotNull(bar); + Assert.IsNull(bar.Foo); + } + + public interface IFoo + { + + } + public class Foo : IFoo + { + + } + public class Bar + { + public IFoo Foo { get; private set; } + + public Bar(IFoo foo) + { + Foo = foo; + } + + public void Baz() + { + Console.WriteLine(Foo); + } + } + } +} diff --git a/container/src/container.Tests/Properties/AssemblyInfo.cs b/container/src/container.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..95d4637 --- /dev/null +++ b/container/src/container.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("container.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("container.Tests")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("ec6c4822-104f-494a-b871-341bb83aa595")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/container/src/container.Tests/container.Tests.csproj b/container/src/container.Tests/container.Tests.csproj new file mode 100644 index 0000000..4c1e5b3 --- /dev/null +++ b/container/src/container.Tests/container.Tests.csproj @@ -0,0 +1,65 @@ + + + + + Debug + AnyCPU + {B4EBB592-99AD-4DC4-94CB-C87821968BA6} + Library + Properties + container.Tests + container.Tests + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\NUnit.2.6.1\lib\nunit.framework.dll + + + + + + + + + + + + + + + + {ecf06383-f12e-4e9b-bfa0-9dbc314e3ae2} + container + + + + + + + + \ No newline at end of file diff --git a/container/src/container.Tests/packages.config b/container/src/container.Tests/packages.config new file mode 100644 index 0000000..bd9ee8b --- /dev/null +++ b/container/src/container.Tests/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/container/src/container.sln b/container/src/container.sln new file mode 100644 index 0000000..03779c9 --- /dev/null +++ b/container/src/container.sln @@ -0,0 +1,35 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "container", "container\container.csproj", "{ECF06383-F12E-4E9B-BFA0-9DBC314E3AE2}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CD953136-4F13-493C-B67B-3D03377BB3C2}" + ProjectSection(SolutionItems) = preProject + ..\container.nuspec = ..\container.nuspec + ..\LICENSE.md = ..\LICENSE.md + ..\pack-nuget.bat = ..\pack-nuget.bat + ..\push-nuget.bat = ..\push-nuget.bat + ..\README.md = ..\README.md + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "container.Tests", "container.Tests\container.Tests.csproj", "{B4EBB592-99AD-4DC4-94CB-C87821968BA6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {ECF06383-F12E-4E9B-BFA0-9DBC314E3AE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ECF06383-F12E-4E9B-BFA0-9DBC314E3AE2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ECF06383-F12E-4E9B-BFA0-9DBC314E3AE2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ECF06383-F12E-4E9B-BFA0-9DBC314E3AE2}.Release|Any CPU.Build.0 = Release|Any CPU + {B4EBB592-99AD-4DC4-94CB-C87821968BA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B4EBB592-99AD-4DC4-94CB-C87821968BA6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B4EBB592-99AD-4DC4-94CB-C87821968BA6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B4EBB592-99AD-4DC4-94CB-C87821968BA6}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/container/src/container/Container.cs b/container/src/container/Container.cs new file mode 100644 index 0000000..ab37c49 --- /dev/null +++ b/container/src/container/Container.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; + +namespace container +{ + public class Container : IContainer + { + private readonly IDependencyResolver _resolver; + private readonly IDependencyRegistrar _registrar; + public static Func DefaultContainer { get; set; } + static Container() + { + DefaultContainer = ()=> new DefaultContainer(); + } + public Container(IDependencyResolver resolver, IDependencyRegistrar registrar) + { + _resolver = resolver; + _registrar = registrar; + } + public Container() + { + var container = DefaultContainer(); + _resolver = container; + _registrar = container; + } + public bool CanResolve() where T : class + { + return _resolver.CanResolve(); + } + public T Resolve() where T : class + { + return _resolver.Resolve(); + } + public T Resolve(string name) where T : class + { + return _resolver.Resolve(name); + } + public bool CanResolve(Type serviceType) + { + return _resolver.CanResolve(serviceType); + } + public object Resolve(Type serviceType) + { + return _resolver.Resolve(serviceType); + } + public object Resolve(Type serviceType, string name) + { + return _resolver.Resolve(serviceType, name); + } + public IEnumerable ResolveAll() where T : class + { + return _resolver.ResolveAll(); + } + public IEnumerable ResolveAll(Type serviceType) + { + return _resolver.ResolveAll(serviceType); + } + public ILifetime Register(Func builder) where T : class + { + return _registrar.Register(builder); + } + public ILifetime Register(string name, Func builder) where T : class + { + return _registrar.Register(name, builder); + } + public ILifetime Register(Func builder) where T : class + { + return _registrar.Register(r => builder(this)); + } + public ILifetime Register(string name, Func builder) where T : class + { + return _registrar.Register(name, builder); + } + public ILifetime Register(Type type, Func builder) + { + return _registrar.Register(type, builder); + } + public bool Remove() where T : class + { + return _registrar.Remove(); + } + public bool Remove(string name) where T : class + { + return _registrar.Remove(name); + } + public void Dispose() + { + _resolver.Dispose(); + if (_registrar != _resolver) + { + _registrar.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/container/src/container/DefaultContainer.cs b/container/src/container/DefaultContainer.cs new file mode 100644 index 0000000..81194f8 --- /dev/null +++ b/container/src/container/DefaultContainer.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using Munq; + +namespace container +{ + public class DefaultContainer : IContainer + { + private readonly IocContainer _container; + public DefaultContainer() + { + _container = new IocContainer(); + } + public bool CanResolve() where T : class + { + return _container.CanResolve(); + } + public T Resolve() where T : class + { + return _container.CanResolve() ? _container.Resolve() : null; + } + public T Resolve(string name) where T : class + { + return _container.Resolve(name); + } + public bool CanResolve(Type serviceType) + { + return _container.CanResolve(serviceType); + } + public object Resolve(Type serviceType) + { + return _container.CanResolve(serviceType) ? _container.Resolve(serviceType) : null; + } + public object Resolve(Type serviceType, string name) + { + return _container.Resolve(name, serviceType); + } + public IEnumerable ResolveAll() where T : class + { + return _container.ResolveAll(); + } + public IEnumerable ResolveAll(Type serviceType) + { + return _container.ResolveAll(serviceType); + } + public ILifetime Register(Func builder) where T : class + { + return new DefaultLifetime(_container.Register(r => builder())); + } + public ILifetime Register(string name, Func builder) where T : class + { + return new DefaultLifetime(_container.Register(name, r => builder())); + } + public ILifetime Register(Func builder) where T : class + { + return new DefaultLifetime(_container.Register(r => builder(this))); + } + public ILifetime Register(string name, Func builder) where T : class + { + return new DefaultLifetime(_container.Register(name, r => builder(this))); + } + public ILifetime Register(Type type, Func builder) + { + return new DefaultLifetime(_container.Register(type, r => builder(this))); + } + public bool Remove() where T : class + { + var registration = _container.GetRegistration(); + if (registration == null) return false; + _container.Remove(registration); + return true; + } + public bool Remove(string name) where T : class + { + var registration = _container.GetRegistration(name); + if (registration == null) return false; + _container.Remove(registration); + return true; + } + public void Dispose() + { + _container.Dispose(); + } + } +} \ No newline at end of file diff --git a/container/src/container/DefaultLifetime.cs b/container/src/container/DefaultLifetime.cs new file mode 100644 index 0000000..d37dacb --- /dev/null +++ b/container/src/container/DefaultLifetime.cs @@ -0,0 +1,33 @@ +using Munq; + +namespace container +{ + public class DefaultLifetime : ILifetime + { + private readonly IRegistration _registration; + public DefaultLifetime(IRegistration registration) + { + _registration = registration; + } + public void Permanent() + { + _registration.AsContainerSingleton(); + } + public void Thread() + { + _registration.AsThreadSingleton(); + } + public void Request() + { + _registration.AsRequestSingleton(); + } + public void Session() + { + _registration.AsSessionSingleton(); + } + public void AlwaysNew() + { + _registration.AsAlwaysNew(); + } + } +} \ No newline at end of file diff --git a/container/src/container/IContainer.cs b/container/src/container/IContainer.cs new file mode 100644 index 0000000..44da010 --- /dev/null +++ b/container/src/container/IContainer.cs @@ -0,0 +1,7 @@ +namespace container +{ + public interface IContainer : IDependencyResolver, IDependencyRegistrar + { + + } +} \ No newline at end of file diff --git a/container/src/container/IDependencyRegistrar.cs b/container/src/container/IDependencyRegistrar.cs new file mode 100644 index 0000000..7aef6ed --- /dev/null +++ b/container/src/container/IDependencyRegistrar.cs @@ -0,0 +1,17 @@ +using System; + +namespace container +{ + public interface IDependencyRegistrar : IDisposable + { + ILifetime Register(Func builder) where T : class; + ILifetime Register(string name, Func builder) where T : class; + ILifetime Register(Func builder) where T : class; + ILifetime Register(string name, Func builder) where T : class; + + ILifetime Register(Type type, Func builder); + + bool Remove() where T : class; + bool Remove(string name) where T : class; + } +} \ No newline at end of file diff --git a/container/src/container/IDependencyResolver.cs b/container/src/container/IDependencyResolver.cs new file mode 100644 index 0000000..8c81227 --- /dev/null +++ b/container/src/container/IDependencyResolver.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +namespace container +{ + public interface IDependencyResolver : IDisposable + { + bool CanResolve() where T : class; + T Resolve() where T : class; + T Resolve(string name) where T : class; + bool CanResolve(Type serviceType); + object Resolve(Type serviceType); + object Resolve(Type serviceType, string name); + IEnumerable ResolveAll() where T : class; + IEnumerable ResolveAll(Type serviceType); + } +} diff --git a/container/src/container/ILifetime.cs b/container/src/container/ILifetime.cs new file mode 100644 index 0000000..0678993 --- /dev/null +++ b/container/src/container/ILifetime.cs @@ -0,0 +1,11 @@ +namespace container +{ + public interface ILifetime + { + void AlwaysNew(); + void Permanent(); + void Thread(); + void Request(); + void Session(); + } +} \ No newline at end of file diff --git a/container/src/container/Munq/ConfigurationLoader.cs b/container/src/container/Munq/ConfigurationLoader.cs new file mode 100644 index 0000000..a83a78a --- /dev/null +++ b/container/src/container/Munq/ConfigurationLoader.cs @@ -0,0 +1,68 @@ +// -------------------------------------------------------------------------------------------------- +// © Copyright 2011 by Matthew Dennis. +// Released under the Microsoft Public License (Ms-PL) http://www.opensource.org/licenses/ms-pl.html +// -------------------------------------------------------------------------------------------------- + +using System; +using System.IO; +using System.Linq; +using System.Web; +using System.Reflection; + +namespace Munq.Configuration +{ + /// + /// This static class contains methods to discover classes that implement the IMunqConfig interface + /// and to call the RegisterIn method on them. + /// + public static class ConfigurationLoader + { + /// + /// Finds all the types that implement the IMunqConfig interface, create an instance and + /// then call the RegisterIn method on the type. The bin directory is checked for web + /// applications, the current directory for Windows applications. + /// + /// The Munq IOC container to register class factories in. + public static void FindAndRegisterDependencies(IocContainer container) + { + // get all the assemblies in the bin directory + string binPath = HttpContext.Current != null ? HttpContext.Current.Server.MapPath("/bin") + : Environment.CurrentDirectory; + CallRegistrarsInDirectory(container, binPath); + } + + /// + /// Finds all the types that implement the IMunqConfig interface, create an instance and + /// then call the RegisterIn method on the type. + /// + /// The Munq IOC container to register the class factories in. + /// The path of the directory to search. + /// The optional file pattern for files to check. The default is *.dll + public static void CallRegistrarsInDirectory(IocContainer container, string binPath, string filePattern = "*.dll") + { + var assemblyNames = Directory.GetFiles(binPath, filePattern); + + foreach (var filename in assemblyNames) + CallRegistrarsInAssembly(container, filename); + + } + + /// + /// Finds all classes the IMunqConfig interface in an assembly and call the RegisterIn + /// method on each. + /// + /// The Munq IOC Container. + /// The full filename to be loaded and checked. + public static void CallRegistrarsInAssembly(IocContainer container, string filename) + { + var assembly = Assembly.LoadFile(filename); + // find all the types that implements IMunqConfig ... + var registrars = assembly.GetExportedTypes() + .Where(type => type.GetInterface(typeof(IMunqConfig).ToString()) != null); + + // and call the RegisterIn method on each + foreach (var registrar in registrars) + (Activator.CreateInstance(registrar) as IMunqConfig).RegisterIn(container); + } + } +} diff --git a/container/src/container/Munq/Container.Registrar.cs b/container/src/container/Munq/Container.Registrar.cs new file mode 100644 index 0000000..f691f6f --- /dev/null +++ b/container/src/container/Munq/Container.Registrar.cs @@ -0,0 +1,152 @@ +// -------------------------------------------------------------------------------------------------- +// © Copyright 2011 by Matthew Dennis. +// Released under the Microsoft Public License (Ms-PL) http://www.opensource.org/licenses/ms-pl.html +// -------------------------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; + +namespace Munq +{ + public partial class IocContainer : IDependecyRegistrar + { + private const string STR_RegistrationNotFoundFor = "Registration not found for {0}"; + + /// + public IRegistration Register(Func func) + where TType : class + { + return Register(null, typeof(TType), c => (func(c) as Object)); + } + + /// + public IRegistration Register(string name, Func func) + where TType : class + { + return Register(name, typeof(TType), c => (func(c) as Object)); + } + + /// + public IRegistration Register(Type type, Func func) + { + return Register(null, type, func); + } + + /// + public IRegistration Register(string name, Type type, Func func) + { + if (func == null) + throw new ArgumentNullException("func"); + + var entry = new Registration(this, name, type, func); + entry.WithLifetimeManager(DefaultLifetimeManager); + typeRegistry.Add(entry); + return entry; + } + + /// + public IRegistration Register() + where TType : class + where TImpl : class, TType + { + return Register(typeof(TType), typeof(TImpl)); + } + + /// + public IRegistration Register(string name) + where TType : class + where TImpl : class, TType + { + return Register(name, typeof(TType), typeof(TImpl)); + } + + /// + public IRegistration Register(Type tType, Type tImpl) + { + return Register(null, tType, tImpl); + } + + /// + public IRegistration Register(string name, Type tType, Type tImpl) + { + if (tType.ContainsGenericParameters) + return RegisterOpenType(name, tType, tImpl); + else + return Register(name, tType, CreateInstanceDelegateFactory.Create(tImpl)); + } + + private IRegistration RegisterOpenType(string name, Type tType, Type tImpl) + { + var entry = new Registration(this, name, tType, tImpl); + entry.WithLifetimeManager(DefaultLifetimeManager); + opentypeRegistry.Add(entry); + return entry; + } + + /// + public IRegistration RegisterInstance(TType instance) where TType : class + { + return Register(c => instance).WithLifetimeManager(null); + } + + /// + public IRegistration RegisterInstance(string name, TType instance) where TType : class + { + return Register(name, c => instance).WithLifetimeManager(null); + } + + /// + public IRegistration RegisterInstance(Type type, object instance) + { + return Register(type, c => instance).WithLifetimeManager(null); + } + + /// + public IRegistration RegisterInstance(string name, Type type, object instance) + { + return Register(name, type, c => instance).WithLifetimeManager(null); + } + + /// + public void Remove(IRegistration ireg) + { + typeRegistry.Remove(ireg); + } + + /// + public IRegistration GetRegistration() where TType : class + { + return GetRegistration(null, typeof(TType)); + } + + /// + public IRegistration GetRegistration(string name) where TType : class + { + return GetRegistration(name, typeof(TType)); + } + + /// + public IRegistration GetRegistration(Type type) + { + return GetRegistration(null, type); + } + + /// + public IRegistration GetRegistration(string name, Type type) + { + return typeRegistry.Get(name, type); + } + + /// + public IEnumerable GetRegistrations() where TType : class + { + return GetRegistrations(typeof(TType)); + } + + /// + public IEnumerable GetRegistrations(Type type) + { + return typeRegistry.All(type); + } + } +} diff --git a/container/src/container/Munq/Container.Resolver.cs b/container/src/container/Munq/Container.Resolver.cs new file mode 100644 index 0000000..787aafe --- /dev/null +++ b/container/src/container/Munq/Container.Resolver.cs @@ -0,0 +1,185 @@ +// -------------------------------------------------------------------------------------------------- +// © Copyright 2011 by Matthew Dennis. +// Released under the Microsoft Public License (Ms-PL) http://www.opensource.org/licenses/ms-pl.html +// -------------------------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Munq +{ + public partial class IocContainer : IDependencyResolver + { + /// + public TType Resolve() where TType : class + { + return Resolve(null, typeof(TType)) as TType; + } + + /// + public TType Resolve(string name) where TType : class + { + return Resolve(name, typeof(TType)) as TType; + } + + /// + public object Resolve(Type type) + { + return Resolve(null, type); + } + + /// + public object Resolve(string name, Type type) + { + var registration = typeRegistry.Get(name, type); + if(registration != null) + { + return registration.GetInstance(); + } + var arbitrary = HandleUnResolved(name, type); + return arbitrary; + } + + private object HandleUnResolved(string name, Type type) + { + if (type.IsGenericType) + { + var result = ResolveUsingOpenType(name, type); + if (result!=null) + { + return result; + } + } + + if (type.IsClass) + { + var func = CreateInstanceDelegateFactory.Create(type); + Register(name, type, func); + // Thanks to dfullerton for catching this. + return typeRegistry.Get(name, type).GetInstance(); + } + + if (type.IsInterface) + { + var regs = typeRegistry.GetDerived(name, type); + var reg = regs.FirstOrDefault(); + if (reg != null) + { + var instance = reg.GetInstance(); + Register(name, type, (c) => c.Resolve(name, instance.GetType())); + return instance; + } + } + return null; + } + + private object ResolveUsingOpenType(string name, Type type) + { + if (type.ContainsGenericParameters) + { + return null; + } + + // Look for an Open Type Definition registration + // create a type using the registered Open Type + // Try and resolve this type + var definition = type.GetGenericTypeDefinition(); + var arguments = type.GetGenericArguments(); + if (opentypeRegistry.ContainsKey(name, definition)) + { + var reg = opentypeRegistry.Get(name, definition); + var implType = reg.ImplType; + var newType = implType.MakeGenericType(arguments); + try + { + if (CanResolve(name, newType)) + return Resolve(name, newType); + + Register(name, type, newType).WithLifetimeManager(reg.LifetimeManager); + return typeRegistry.Get(name, type).GetInstance(); + } + catch + { + return null; + } + } + return null; + } + + /// + public bool CanResolve() + where TType : class + { + return CanResolve(null, typeof(TType)); + } + + /// + public bool CanResolve(string name) + where TType : class + { + return CanResolve(name, typeof(TType)); + } + + /// + public bool CanResolve(Type type) + { + return CanResolve(null, type); + } + + /// + public bool CanResolve(string name, Type type) + { + var @explicit = typeRegistry.ContainsKey(name, type); + return @explicit || Resolve(name, type) != null; + } + + /// + public IEnumerable ResolveAll() where TType : class + { + return ResolveAll(typeof(TType)).Cast(); + } + + /// + public IEnumerable ResolveAll(Type type) + { + var registrations = typeRegistry.GetDerived(type); + var instances = new List(); + foreach (var reg in registrations) + { + instances.Add(reg.GetInstance()); + } + return instances; + } + + /// + public Func LazyResolve() where TType : class + { + return LazyResolve(null); + } + + /// + public Func LazyResolve(string name) where TType : class + { + return () => Resolve(name); + } + + /// + public Func LazyResolve(Type type) + { + return LazyResolve(null, type); + } + + /// + /// + public Func LazyResolve(string name, Type type) + { + return () => Resolve(name, type); + } + + private static string ResolveFailureMessage(Type type) + { + return String.Format("Munq IocContainer failed to resolve {0}", type); + } + } +} diff --git a/container/src/container/Munq/Container.cs b/container/src/container/Munq/Container.cs new file mode 100644 index 0000000..6fe5d15 --- /dev/null +++ b/container/src/container/Munq/Container.cs @@ -0,0 +1,91 @@ +// -------------------------------------------------------------------------------------------------- +// © Copyright 2011 by Matthew Dennis. +// Released under the Microsoft Public License (Ms-PL) http://www.opensource.org/licenses/ms-pl.html +// -------------------------------------------------------------------------------------------------- + +using System; + +namespace Munq +{ + /// + /// The implementation of the IOC container. Implements the IDependencyRegistrar and + /// IDependencyResolver, along with the IContainerFluent and IDisposable interfaces. + /// The container is thread safe. + /// + public partial class IocContainer : IContainerFluent, IDisposable + { + private readonly TypeRegistry typeRegistry = new TypeRegistry(); + private readonly TypeRegistry opentypeRegistry = new TypeRegistry(); + + // Track whether Dispose has been called. + private bool disposed; + + // null for the lifetime manager is the same as AlwaysNew, but slightly faster. + /// + public ILifetimeManager DefaultLifetimeManager { get; set; } + + #region Fluent Interface Members + /// + public IContainerFluent UsesDefaultLifetimeManagerOf(ILifetimeManager lifetimeManager) + { + DefaultLifetimeManager = lifetimeManager; + return this; + } + #endregion + + #region constructors + /// + /// Initializes a new instance of the IocContainer class; + /// The types IocContainer, IDependencyRegistrar, and IDependencyResolver are all registered + /// to resolve to this instance of the class. + /// + public IocContainer() + { + RegisterInstance(this); + RegisterInstance(this); + RegisterInstance(this); + } + #endregion + + #region IDisposable Members + + /// + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// + /// + /// Disposes of all Container scoped (ContainerLifetime) instances cached in the type registry, and + /// disposes of the type registry itself. + /// + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + /// + /// Implements the Disposed(boolean disposing) method of Disposable pattern. + /// + /// True if disposing. + protected virtual void Dispose(bool disposing) + { + // Check to see if Dispose has already been called. + if (!disposed) + { + // If disposing equals true, dispose all ContainerLifetime instances + if (disposing) + { + typeRegistry.Dispose(); + opentypeRegistry.Dispose(); + } + } + disposed = true; + } + + /// + /// The finalizer just ensures the container is disposed. + /// + ~IocContainer() { Dispose(false); } + + #endregion + } +} diff --git a/container/src/container/Munq/CreateInstanceDelegateFactory.cs b/container/src/container/Munq/CreateInstanceDelegateFactory.cs new file mode 100644 index 0000000..5981310 --- /dev/null +++ b/container/src/container/Munq/CreateInstanceDelegateFactory.cs @@ -0,0 +1,87 @@ +// -------------------------------------------------------------------------------------------------- +// © Copyright 2011 by Matthew Dennis. +// Released under the Microsoft Public License (Ms-PL) http://www.opensource.org/licenses/ms-pl.html +// -------------------------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; + +namespace Munq +{ + /// + /// This class provides a method to build a delegate to create a specified type. It is used + /// by Register<TType, TImp>() to build the Func<IDependencyResolver, TImp> need + /// to create the instance to be returned. Also used by the Resolve methods if the type requested + /// is a class, not an interface, and is not currently Registered in the container. + /// + internal class CreateInstanceDelegateFactory + { + /// + /// Build a delegate to return an instance of the specified type given an instance of IocContainer. + /// Finds the public constructor with the most parameters. The resulting method calls the container + /// to resolve each parameter in the constructor. + /// + /// The class to be resolved. + /// The delegate to create an instance of the class. + public static Func Create(Type tImpl) + { + ParameterExpression container = Expression.Parameter(typeof(IDependencyResolver), "container"); + NewExpression exp = BuildExpression(tImpl, container); + if(exp == null) + { + return resolver => null; + } + return Expression.Lambda>( + exp, + new ParameterExpression[] { container } + ).Compile(); + } + + private static NewExpression BuildExpression(Type type, ParameterExpression container) + { + if (!type.IsGenericTypeDefinition) + { + // No public constructor, i.e. an abstract base class or private constructor; we can't create this + ConstructorInfo constructor = GetConstructorInfo(type); + if(constructor == null) + { + return null; + } + + ParameterInfo[] parameters = constructor.GetParameters(); + + // create the arguments for the constructor + List arguments = new List(); + + foreach (var paramInfo in parameters) + { + var p = Expression.Call(container, "Resolve", new Type[] { paramInfo.ParameterType }, + new Expression[] { }); + arguments.Add(p); + } + + // create the new MyClass( ... ) call + return Expression.New(constructor, arguments); + } + else + { + return null; + } + } + + private static ConstructorInfo GetConstructorInfo(Type implType) + { + var constructors = implType.GetConstructors(); + var constructor = constructors + .OrderBy(c => c.GetParameters().Length) + .LastOrDefault(); + + return constructor; + } + + } +} + diff --git a/container/src/container/Munq/IContainerFluent.cs b/container/src/container/Munq/IContainerFluent.cs new file mode 100644 index 0000000..474a1f7 --- /dev/null +++ b/container/src/container/Munq/IContainerFluent.cs @@ -0,0 +1,17 @@ +// -------------------------------------------------------------------------------------------------- +// Copyright 2011 by Matthew Dennis. +// Released under the Microsoft Public License (Ms-PL) http://www.opensource.org/licenses/ms-pl.html +// -------------------------------------------------------------------------------------------------- + +using System; + +namespace Munq +{ + /// + public interface IContainerFluent + { + /// + IContainerFluent UsesDefaultLifetimeManagerOf(ILifetimeManager lifetimeManager); + } +} diff --git a/container/src/container/Munq/IDependecyRegistrar.cs b/container/src/container/Munq/IDependecyRegistrar.cs new file mode 100644 index 0000000..c752e06 --- /dev/null +++ b/container/src/container/Munq/IDependecyRegistrar.cs @@ -0,0 +1,74 @@ +// -------------------------------------------------------------------------------------------------- +// © Copyright 2011 by Matthew Dennis. +// Released under the Microsoft Public License (Ms-PL) http://www.opensource.org/licenses/ms-pl.html +// -------------------------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; + +namespace Munq +{ + /// + public interface IDependecyRegistrar + { + // ---- Lifetime Manager ----------------------------------------------------------------- + + /// + ILifetimeManager DefaultLifetimeManager { get; set; } + + // ---- Register ------------------------------------------------------------------------- + + /// + IRegistration Register(Func func) where TType : class; + /// + IRegistration Register(string name, Func func) where TType : class; + + /// + IRegistration Register(Type type, Func func); + /// + IRegistration Register(string name, Type type, Func func); + + // ---- Register Instance ---------------------------------------------------------------- + /// + IRegistration RegisterInstance(TType instance) where TType : class; + /// + IRegistration RegisterInstance(string name, TType instance) where TType : class; + + /// + IRegistration RegisterInstance(Type type, object instance); + /// + IRegistration RegisterInstance(string name, Type type, object instance); + + // ---- Register Type Implementation ----------------------------------------------------- + /// + IRegistration Register() where TType: class where TImpl : class, TType; + /// + IRegistration Register(string name) where TType: class where TImpl : class, TType; + + /// + IRegistration Register(Type tType, Type tImpl); + /// + IRegistration Register(string name, Type tType, Type tImpl); + + // ---- Remove Registration -------------------------------------------------------------- + /// + void Remove(IRegistration ireg); + + // ---- Get Registration ----------------------------------------------------------- + /// + IRegistration GetRegistration() where TType : class; + /// + IRegistration GetRegistration(string name) where TType : class; + + /// + IRegistration GetRegistration(Type type); + /// + IRegistration GetRegistration(string name, Type type); + + // ---- Get Registrations ---------------------------------------------------------- + /// + IEnumerable GetRegistrations() where TType : class; + /// + IEnumerable GetRegistrations(Type type); + } +} \ No newline at end of file diff --git a/container/src/container/Munq/IDependencyResolver.cs b/container/src/container/Munq/IDependencyResolver.cs new file mode 100644 index 0000000..ded9959 --- /dev/null +++ b/container/src/container/Munq/IDependencyResolver.cs @@ -0,0 +1,50 @@ +// -------------------------------------------------------------------------------------------------- +// Copyright 2011 by Matthew Dennis. +// Released under the Microsoft Public License (Ms-PL) http://www.opensource.org/licenses/ms-pl.html +// -------------------------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; + +namespace Munq +{ + /// + public interface IDependencyResolver + { + //Resolve + /// + TType Resolve() where TType : class; + /// + TType Resolve(string name) where TType : class; + /// + object Resolve(Type type); + /// + object Resolve(string name, Type type); + + //ResolveAll + /// + IEnumerable ResolveAll() where TType : class; + /// + IEnumerable ResolveAll(Type type); + + //Lazy Resolve + /// + Func LazyResolve() where TType : class; + /// + Func LazyResolve(string name) where TType : class; + /// + Func LazyResolve(Type type); + /// + Func LazyResolve(string name, Type type); + + //CanResolve + /// + bool CanResolve() where TType : class; + /// + bool CanResolve(string name) where TType : class; + /// + bool CanResolve(Type type); + /// + bool CanResolve(string name, Type type); + } +} diff --git a/container/src/container/Munq/ILifetimeManager.cs b/container/src/container/Munq/ILifetimeManager.cs new file mode 100644 index 0000000..812568f --- /dev/null +++ b/container/src/container/Munq/ILifetimeManager.cs @@ -0,0 +1,35 @@ +// -------------------------------------------------------------------------------------------------- +// © Copyright 2011 by Matthew Dennis. +// Released under the Microsoft Public License (Ms-PL) http://www.opensource.org/licenses/ms-pl.html +// -------------------------------------------------------------------------------------------------- + +namespace Munq +{ + /// + /// Defines the functionality for Lifetime Managers. Implementation should instantiate an + /// instance store and use the Registration's Key property to index the data in the store. + /// This allows one lifetime manager to service multiple Registrations. + /// + public interface ILifetimeManager + { + /// + /// Get an instance for the registration, using the lifetime manager to cache instance + /// as required by the scope of the lifetime manager. + /// + /// + /// The registration which is used to supply the storage key and create a new instance if + /// required. + /// + /// The cached or new instance. + object GetInstance(IRegistration registration); + + /// + /// Invalidate the instance in whatever storage is used by the lifetime manager. + /// + /// + /// The registration which is used to supply the storage key and create a new instance if + /// required. + /// + void InvalidateInstanceCache(IRegistration registration); + } +} diff --git a/container/src/container/Munq/IMunqConfig.cs b/container/src/container/Munq/IMunqConfig.cs new file mode 100644 index 0000000..1a88d17 --- /dev/null +++ b/container/src/container/Munq/IMunqConfig.cs @@ -0,0 +1,22 @@ +// -------------------------------------------------------------------------------------------------- +// © Copyright 2011 by Matthew Dennis. +// Released under the Microsoft Public License (Ms-PL) http://www.opensource.org/licenses/ms-pl.html +// -------------------------------------------------------------------------------------------------- + +namespace Munq.Configuration +{ + /// + /// This interface is defined on classes that are used to dynamically register dependencies + /// in the container. Classes implementing this interface can be discovered and the RegisterIn + /// method automatically called. + /// + public interface IMunqConfig + { + /// + /// Classes that implement this interface are automatically called to + /// register type factories in the Munq IOC container + /// + /// The Munq IOC Container. + void RegisterIn(IDependecyRegistrar container); + } +} diff --git a/container/src/container/Munq/IRegistration.cs b/container/src/container/Munq/IRegistration.cs new file mode 100644 index 0000000..ad04b5c --- /dev/null +++ b/container/src/container/Munq/IRegistration.cs @@ -0,0 +1,49 @@ +// -------------------------------------------------------------------------------------------------- +// Copyright 2011 by Matthew Dennis. +// Released under the Microsoft Public License (Ms-PL) http://www.opensource.org/licenses/ms-pl.html +// -------------------------------------------------------------------------------------------------- + +using System; + +namespace Munq +{ + /// + /// This is the result of registering a type in the container. + /// + public interface IRegistration + { + /// + /// Gets the name of the registration. + /// + string Name { get; } + + /// + /// Gets the key that is used to identify cached values. + /// + string Key { get; } + + /// + /// Gets the type the contain will Resolve to when this Registration is used. + /// + Type ResolvesTo { get; } + + /// + /// Sets the lifetime manager to be used by this Registration. + /// + /// The ILifetimeManager to use. + /// 'this', or the Registration. + IRegistration WithLifetimeManager(ILifetimeManager manager); + + /// + /// Invalidates any cached value so that a new instance will be created on + /// the next Resolve call. + /// + void InvalidateInstanceCache(); + + /// + /// Creates an instance of the type using the registered function. + /// + /// The new instance. + object CreateInstance(); + } +} diff --git a/container/src/container/Munq/IRegistrationKey.cs b/container/src/container/Munq/IRegistrationKey.cs new file mode 100644 index 0000000..fc21c51 --- /dev/null +++ b/container/src/container/Munq/IRegistrationKey.cs @@ -0,0 +1,23 @@ +// -------------------------------------------------------------------------------------------------- +// © Copyright 2011 by Matthew Dennis. +// Released under the Microsoft Public License (Ms-PL) http://www.opensource.org/licenses/ms-pl.html +// -------------------------------------------------------------------------------------------------- + +using System; + +namespace Munq +{ + /// + /// This interface is used internally to identify registrations in the type registry. + /// + internal interface IRegistrationKey + { + /// + /// Gets the type that this key identifies. + /// + /// Returns the type of the registration. + Type GetInstanceType(); + bool Equals(object obj); + int GetHashCode(); + } +} diff --git a/container/src/container/Munq/LifetimeExtensions.cs b/container/src/container/Munq/LifetimeExtensions.cs new file mode 100644 index 0000000..1f5f585 --- /dev/null +++ b/container/src/container/Munq/LifetimeExtensions.cs @@ -0,0 +1,43 @@ +using Munq.LifetimeManagers; + +namespace Munq +{ + public static class LifetimeExtensions + { + readonly static CachedLifetime cachedLifetime = new CachedLifetime(); + readonly static ContainerLifetime containerLifetime = new ContainerLifetime(); + readonly static RequestLifetime requestLifetime = new RequestLifetime(); + readonly static SessionLifetime sessionLifetime = new SessionLifetime(); + readonly static ThreadLocalStorageLifetime threadLocalLifetime = new ThreadLocalStorageLifetime(); + + public static IRegistration AsAlwaysNew(this IRegistration reg) + { + return reg.WithLifetimeManager(null); + } + + public static IRegistration AsCached(this IRegistration reg) + { + return reg.WithLifetimeManager(cachedLifetime); + } + + public static IRegistration AsContainerSingleton(this IRegistration reg) + { + return reg.WithLifetimeManager(containerLifetime); + } + + public static IRegistration AsRequestSingleton(this IRegistration reg) + { + return reg.WithLifetimeManager(requestLifetime); + } + + public static IRegistration AsSessionSingleton(this IRegistration reg) + { + return reg.WithLifetimeManager(sessionLifetime); + } + + public static IRegistration AsThreadSingleton(this IRegistration reg) + { + return reg.WithLifetimeManager(threadLocalLifetime); + } + } +} diff --git a/container/src/container/Munq/LifetimeManagers/AlwaysNewLifetime.cs b/container/src/container/Munq/LifetimeManagers/AlwaysNewLifetime.cs new file mode 100644 index 0000000..094c5ed --- /dev/null +++ b/container/src/container/Munq/LifetimeManagers/AlwaysNewLifetime.cs @@ -0,0 +1,57 @@ +// -------------------------------------------------------------------------------------------------- +// © Copyright 2011 by Matthew Dennis. +// Released under the Microsoft Public License (Ms-PL) http://www.opensource.org/licenses/ms-pl.html +// -------------------------------------------------------------------------------------------------- + +namespace Munq.LifetimeManagers +{ + /// + /// A Lifetime Manager that always returns a new instance. + /// + /// + /// Setting the IocContainer's or Registration's lifetime manager to null is equivalent + /// to setting it to an instance of AlwaysNewLifetime. This is the default lifetime manager + /// for the IocContainer. + /// The one instance can be used for all registrations. + /// + /// + /// The IocContainer default lifetime manager is set to Request lifetime, but one interface + /// needs to alway be a new instance. + /// + /// var requestLifetime = new RequestLifetime(); + /// var alwaysNewLifetime = new AlwaysNewLifetime(); + /// var container = new IocContainer(); + /// + /// container.UsesDefaultLifetimeManagerOf(requestLifetime); + /// container.Register<IMyInterface, MyImplementation>() + /// .WithLifetimeManager(alwaysNewLifetime); + /// container.Register<IMyInterface2, MyImplementation2>() + /// .WithLifetimeManager(alwaysNewLifetime); + /// ... + /// + /// + public class AlwaysNewLifetime : ILifetimeManager + { + #region ILifetimeManager Members + + /// + /// Always creates a new instance. + /// + /// The creator (registration) that can create an instance + /// The new instance. + public object GetInstance(IRegistration registration) + { + return registration.CreateInstance(); + } + + /// + /// Does nothing as this lifetime manager does not cache. + /// + /// The registration. + public void InvalidateInstanceCache(IRegistration registration) + { + // there is no instance cache ... + } + #endregion + } +} diff --git a/container/src/container/Munq/LifetimeManagers/CachedLifetime.cs b/container/src/container/Munq/LifetimeManagers/CachedLifetime.cs new file mode 100644 index 0000000..abfe854 --- /dev/null +++ b/container/src/container/Munq/LifetimeManagers/CachedLifetime.cs @@ -0,0 +1,226 @@ +// -------------------------------------------------------------------------------------------------- +// © Copyright 2011 by Matthew Dennis. +// Released under the Microsoft Public License (Ms-PL) http://www.opensource.org/licenses/ms-pl.html +// -------------------------------------------------------------------------------------------------- + +using System; +using System.Web; +using System.Web.Caching; + +namespace Munq.LifetimeManagers +{ + /// + /// A Lifetime Manager that uses the Cache to store the instance + /// + /// + /// The cache can be invalidated at any time. After that, the next Resolve will create a new + /// instance will be created and cached. Don't assume that instances are the same. + /// + /// + /// This example uses the IocContainer to cache RSS feeds for 15 minutes, and reloads on the + /// next request after that. + /// + /// var container = new IocContainer(); + /// var cachedFor15Minutes = new CachedLifetime().ExpiresAfter(new TimeSpan(0, 15, 0)); + /// + /// container.Register<IRssFeed>("Munq", c => new RssFeed("http://munq.codeplex.com/Project/ProjectRss.aspx")) + /// .WithLifetimeManager(cachedFor15Minutes); + /// + /// container.Register<IRssFeed>("TheGu", c => new RssFeed("http://weblogs.asp.net/scottgu/rss.aspx")) + /// .WithLifetimeManager(cachedFor15Minutes); + /// + /// container.Register<IRssFeed>("Haacked", c => new RssFeed("http://feeds.haacked.com/haacked/")) + /// .WithLifetimeManager(cachedFor15Minutes); + /// ... + /// var feed = container.Resolve<IRssFeed>("TheGu"); + /// + /// + public class CachedLifetime : ILifetimeManager, IDisposable + { + private enum Expires + { + None, + OnDateTime, + AfterFixedDuration, + AfterSlidingDuration + }; + private Expires _expirationKind = Expires.None; + private DateTime _expiresOn = Cache.NoAbsoluteExpiration; + private TimeSpan _duration = Cache.NoSlidingExpiration; + private CacheItemPriority _priority = CacheItemPriority.Default; + private CacheDependency _dependencies; + private CacheItemRemovedCallback _onRemoveCallback; + private readonly object _lock = new object(); + + #region ILifetimeManager Members + /// + /// Gets the instance from cache, if available, otherwise creates a new + /// instance and caches it. + /// + /// The creator (registration) to create a new instance. + /// The instance. + public object GetInstance(IRegistration registration) + { + Cache cache = HttpRuntime.Cache; + + string key = registration.Key; + object instance = cache[key]; + if (instance == null) + { + lock (_lock) + { + instance = cache[key]; + if (instance == null) + { + instance = registration.CreateInstance(); + + if (_expiresOn == Cache.NoAbsoluteExpiration && + _duration == Cache.NoSlidingExpiration) + _expirationKind = Expires.None; + + switch (_expirationKind) + { + case Expires.None: + cache.Insert(key, instance, _dependencies, Cache.NoAbsoluteExpiration, + Cache.NoSlidingExpiration, _priority, _onRemoveCallback); + break; + + case Expires.OnDateTime: + cache.Insert(key, instance, _dependencies, _expiresOn, + Cache.NoSlidingExpiration, _priority, _onRemoveCallback); + break; + + case Expires.AfterFixedDuration: + cache.Insert(key, instance, _dependencies, DateTime.Now.Add(_duration), + Cache.NoSlidingExpiration, _priority, _onRemoveCallback); + break; + + case Expires.AfterSlidingDuration: + cache.Insert(key, instance, _dependencies, Cache.NoAbsoluteExpiration, + _duration, _priority, _onRemoveCallback); + break; + } + + } + } + } + + return instance; + } + + /// + /// Invalidates the cached value. + /// + /// The Registration which is having its value invalidated + public void InvalidateInstanceCache(IRegistration registration) + { + Cache cache = HttpRuntime.Cache; + cache.Remove(registration.Key); + } + + #endregion + + /// + /// Sets the Cache Dependencies for this LifetimeManager. + /// + /// The CacheDependencies. + /// The CachedLifetime instance (allows chaining). + public CachedLifetime IsDependentOn(CacheDependency dependencies) + { + _dependencies = dependencies; + return this; + } + + /// + /// Sets the absolute time when the cached value expires. + /// + /// The date/time when the item expires. + /// The CachedLifetime instance (allows chaining). + public CachedLifetime ExpiresOn(DateTime absoluteExpiration) + { + if (absoluteExpiration != Cache.NoAbsoluteExpiration) + { + _duration = Cache.NoSlidingExpiration; + _expirationKind = Expires.OnDateTime; + } + + _expiresOn = absoluteExpiration; + return this; + } + + /// + /// Sets the duration the cached item will remain valid. This is a sliding duration. + /// + /// The duration. Use Cache.NoSlidingExpiration to disable. + /// The CachedLifetime instance (allows chaining). + public CachedLifetime ExpiresAfterNotAccessedFor(TimeSpan duration) + { + if (duration != Cache.NoSlidingExpiration) + { + _expiresOn = Cache.NoAbsoluteExpiration; + _expirationKind = Expires.AfterSlidingDuration; + } + + _duration = duration; + return this; + } + + /// + /// Sets the duration the cached item will remain valid. This is a fixed duration. + /// + /// The duration. Use Cache.NoSlidingExpiration to disable. + /// The CachedLifetime instance (allows chaining). + public CachedLifetime ExpiresAfter(TimeSpan duration) + { + if (duration != Cache.NoSlidingExpiration) + { + _expiresOn = Cache.NoAbsoluteExpiration; + _expirationKind = Expires.AfterFixedDuration; + } + + _duration = duration; + return this; + } + + /// + /// Sets the priority of the item in the cache. + /// + /// The priority. + /// The CachedLifetime instance (allows chaining). + + public CachedLifetime WithPriority(CacheItemPriority priority) + { + _priority = priority; + return this; + } + + /// + /// Sets a callback method for when an item is removed (expires). + /// + /// The callback method. + /// The CachedLifetime instance (allows chaining). + public CachedLifetime CallbackOnRemoval(CacheItemRemovedCallback onRemoveCallback) + { + _onRemoveCallback = onRemoveCallback; + return this; + } + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + protected virtual void Dispose(bool disposing) + { + if (disposing) + if (_dependencies != null) + { + _dependencies.Dispose(); + _dependencies = null; + } + } + ~CachedLifetime() + { + Dispose(false); + } + } +} diff --git a/container/src/container/Munq/LifetimeManagers/ContainerLifetime.cs b/container/src/container/Munq/LifetimeManagers/ContainerLifetime.cs new file mode 100644 index 0000000..9dd9ab5 --- /dev/null +++ b/container/src/container/Munq/LifetimeManagers/ContainerLifetime.cs @@ -0,0 +1,40 @@ +// -------------------------------------------------------------------------------------------------- +// © Copyright 2011 by Matthew Dennis. +// Released under the Microsoft Public License (Ms-PL) http://www.opensource.org/licenses/ms-pl.html +// -------------------------------------------------------------------------------------------------- + +namespace Munq.LifetimeManagers +{ + /// + /// A lifetime manager that scopes the lifetime of created instances to the lifetime of the + /// container. + /// + public class ContainerLifetime : ILifetimeManager + { + #region ILifetimeManager Members + /// + /// Gets the instance from the container instance cache, if available, otherwise creates a new + /// instance and caches it. This effectively make the instance an application scoped Singleton. + /// + /// The creator (registration) to create a new instance. + /// The instance. + public object GetInstance(IRegistration registration) + { + return (registration as Registration).GetCachedInstance(); + } + + /// + /// Invalidates the cached value. + /// + /// The Registration which is having its value invalidated + public void InvalidateInstanceCache(IRegistration registration) + { + var reg = registration as Registration; + if (reg != null) + reg.Instance = null; + } + + #endregion + + } +} diff --git a/container/src/container/Munq/LifetimeManagers/RequestLifetime.cs b/container/src/container/Munq/LifetimeManagers/RequestLifetime.cs new file mode 100644 index 0000000..4740097 --- /dev/null +++ b/container/src/container/Munq/LifetimeManagers/RequestLifetime.cs @@ -0,0 +1,101 @@ +// -------------------------------------------------------------------------------------------------- +// © Copyright 2011 by Matthew Dennis. +// Released under the Microsoft Public License (Ms-PL) http://www.opensource.org/licenses/ms-pl.html +// -------------------------------------------------------------------------------------------------- + +using System.Linq; +using System.Runtime.Remoting.Messaging; +using System.Web; +using System; +using System.Collections.Generic; + +namespace Munq.LifetimeManagers +{ + public class RequestLifetime : ILifetimeManager + { + private const string MunqRequestLtItemsKey = "MunqRequestLtItemsKey"; + private readonly object _lock = new object(); + + public static void Disposer(object sender, EventArgs e) + { + var application = (HttpApplication)sender; + var _context = application.Context; + if (_context == null) return; + + var requestLifetimeInstances = (Dictionary)_context.Items[MunqRequestLtItemsKey]; + if (requestLifetimeInstances == null) return; + foreach (var item in requestLifetimeInstances.Values.OfType()) + { + item.Dispose(); + } + } + + private static HttpContextBase Context + { + get + { + var context = (HttpContext.Current != null) + ? new HttpContextWrapper(HttpContext.Current) + : null; + return context; + } + } + + private static Dictionary RequestLifetimeInstances + { + get + { + Dictionary requestLifetimeInstances; + if(Context != null) + { + requestLifetimeInstances = Context.Items[MunqRequestLtItemsKey] as Dictionary; + } + else + { + requestLifetimeInstances = CallContext.GetData(MunqRequestLtItemsKey) as Dictionary; + } + if (requestLifetimeInstances == null) + { + requestLifetimeInstances = new Dictionary(); + + if(Context != null) + { + Context.Items[MunqRequestLtItemsKey] = requestLifetimeInstances; + } + else + { + CallContext.SetData(MunqRequestLtItemsKey, requestLifetimeInstances); + } + } + return requestLifetimeInstances; + } + } + + public object GetInstance(IRegistration registration) + { + object instance; + if (!RequestLifetimeInstances.TryGetValue(registration.Key, out instance)) + { + lock (_lock) + { + if (!RequestLifetimeInstances.TryGetValue(registration.Key, out instance)) + { + instance = registration.CreateInstance(); + RequestLifetimeInstances[registration.Key] = instance; + } + } + } + + return instance; + } + + /// + /// Invalidates the cached value. + /// + /// The Registration which is having its value invalidated + public void InvalidateInstanceCache(IRegistration registration) + { + RequestLifetimeInstances.Remove(registration.Key); + } + } +} diff --git a/container/src/container/Munq/LifetimeManagers/RequestLifetimeModule.cs b/container/src/container/Munq/LifetimeManagers/RequestLifetimeModule.cs new file mode 100644 index 0000000..ef31a99 --- /dev/null +++ b/container/src/container/Munq/LifetimeManagers/RequestLifetimeModule.cs @@ -0,0 +1,35 @@ +using System; +using System.Web; + +namespace Munq.LifetimeManagers +{ + public class RequestLifetimeModule : IHttpModule + { + /// + /// You will need to configure this module in the web.config file of your + /// web and register it with IIS before being able to use it. For more information + /// see the following link: http://go.microsoft.com/?linkid=8101007 + /// + #region IHttpModule Members + + public void Dispose() + { + //clean-up code here. + } + + public void Init(HttpApplication context) + { + // Below is an example of how you can handle LogRequest event and provide + // custom logging implementation for it + context.EndRequest += new EventHandler(context_EndRequest); + } + + void context_EndRequest(object sender, EventArgs e) + { + RequestLifetime.Disposer(sender, e); + } + + #endregion + + } +} diff --git a/container/src/container/Munq/LifetimeManagers/SessionLifetime.cs b/container/src/container/Munq/LifetimeManagers/SessionLifetime.cs new file mode 100644 index 0000000..b0d9e01 --- /dev/null +++ b/container/src/container/Munq/LifetimeManagers/SessionLifetime.cs @@ -0,0 +1,80 @@ +// -------------------------------------------------------------------------------------------------- +// © Copyright 2011 by Matthew Dennis. +// Released under the Microsoft Public License (Ms-PL) http://www.opensource.org/licenses/ms-pl.html +// -------------------------------------------------------------------------------------------------- + +using System.Web; + +namespace Munq.LifetimeManagers +{ + /// + /// A lifetime manager that scopes the lifetime of created instances to the current browser + /// session. An example of a class that might have Session Lifetime would be a Shopping Cart, + /// or a multi-page entry form. + /// + public class SessionLifetime : ILifetimeManager + { + private HttpSessionStateBase _testSession; + private readonly object _lock = new object(); + + /// + /// Gets the Session. + /// + private HttpSessionStateBase Session + { + get + { + var session = (HttpContext.Current != null) + ? new HttpSessionStateWrapper(HttpContext.Current.Session) + : _testSession; + return session; + } + } + + #region ILifetimeManager Members + /// + /// Gets the instance from the Session, if available, otherwise creates a new + /// instance and stores in the Session. + /// + /// The creator (registration) to create a new instance. + /// The instance. + public object GetInstance(IRegistration registration) + { + object instance = Session[registration.Key]; + if (instance == null) + { + lock (_lock) + { + instance = Session[registration.Key]; + if (instance == null) + { + instance = registration.CreateInstance(); + Session[registration.Key] = instance; + } + } + } + + return instance; + } + + /// + /// Invalidates the cached value. + /// + /// The Registration which is having its value invalidated + public void InvalidateInstanceCache(IRegistration registration) + { + Session.Remove(registration.Key); + } + + #endregion + + /// + /// Only used for testing. Has no effect when in web application + /// + /// + public void SetContext(HttpContextBase context) + { + _testSession = context.Session; + } + } +} diff --git a/container/src/container/Munq/LifetimeManagers/ThreadLocalStorageLifetime.cs b/container/src/container/Munq/LifetimeManagers/ThreadLocalStorageLifetime.cs new file mode 100644 index 0000000..b108d5f --- /dev/null +++ b/container/src/container/Munq/LifetimeManagers/ThreadLocalStorageLifetime.cs @@ -0,0 +1,55 @@ +// -------------------------------------------------------------------------------------------------- +// © Copyright 2011 by Matthew Dennis. +// Released under the Microsoft Public License (Ms-PL) http://www.opensource.org/licenses/ms-pl.html +// -------------------------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; + +namespace Munq.LifetimeManagers +{ + /// + /// A LifetimeManager that uses Thread Local Storage to cache instances. + /// + public class ThreadLocalStorageLifetime : ILifetimeManager + { + // The thread local storage. The ThreadStatic attribute makes this easy. + [ThreadStatic] + static Dictionary localStorage; + + /// + /// Gets an instance from the thread local storage, or creates a new instance if not found. + /// + /// The IInstanceCreate to use to get the Key and create new if required. + /// The instance. + public object GetInstance(IRegistration creator) + { + object instance = null; + + // if it is a new thread then the localStorage needs to be initialized; + if (localStorage == null) + localStorage = new Dictionary(); + + if (!localStorage.TryGetValue(creator.Key, out instance)) + { + instance = creator.CreateInstance(); + localStorage[creator.Key] = instance; + } + + return instance; + } + + /// + /// Removes the instance for the registration from the local storage cache. + /// + /// The IRegistration returned when the type was registered in the IOC container. + public void InvalidateInstanceCache(IRegistration registration) + { + // nothing stored yet + if (localStorage == null) + return; + + localStorage.Remove(registration.Key); + } + } +} diff --git a/container/src/container/Munq/NamedRegistrationKey.cs b/container/src/container/Munq/NamedRegistrationKey.cs new file mode 100644 index 0000000..92ca25e --- /dev/null +++ b/container/src/container/Munq/NamedRegistrationKey.cs @@ -0,0 +1,37 @@ +// -------------------------------------------------------------------------------------------------- +// Copyright 2011 by Matthew Dennis. +// Released under the Microsoft Public License (Ms-PL) http://www.opensource.org/licenses/ms-pl.html +// -------------------------------------------------------------------------------------------------- + +using System; + +namespace Munq +{ + internal class NamedRegistrationKey : IRegistrationKey + { + internal Type InstanceType; + internal string Name; + + public NamedRegistrationKey(string name, Type type) + { + Name = name ?? String.Empty; + InstanceType = type; + } + + public Type GetInstanceType() { return InstanceType; } + + // comparison methods + public override bool Equals(object obj) + { + var r = obj as NamedRegistrationKey; + return (r != null) && + Object.ReferenceEquals(InstanceType, r.InstanceType) && + String.Compare(Name, r.Name, true) == 0; // ignore case + } + + public override int GetHashCode() + { + return InstanceType.GetHashCode(); + } + } +} diff --git a/container/src/container/Munq/Registration.cs b/container/src/container/Munq/Registration.cs new file mode 100644 index 0000000..516fee9 --- /dev/null +++ b/container/src/container/Munq/Registration.cs @@ -0,0 +1,101 @@ +// -------------------------------------------------------------------------------------------------- +// © Copyright 2011 by Matthew Dennis. +// Released under the Microsoft Public License (Ms-PL) http://www.opensource.org/licenses/ms-pl.html +// -------------------------------------------------------------------------------------------------- + +using System; + +namespace Munq +{ + internal class Registration : IRegistration + { + internal ILifetimeManager LifetimeManager; + internal Func Factory; + private readonly string _key; + private readonly Type _regType; + private readonly Type _implType; + + public object Instance; + private readonly IDependencyResolver Container; + private readonly object _lock = new object(); + + + public Registration(IDependencyResolver container, string name, Type regType, + Func factory) + { + LifetimeManager = null; + Container = container; + Factory = factory; + Name = name; + _regType = regType; + _implType = null; + _key = String.Format("[{0}]:{1}", (name ?? "null"), regType.FullName); + } + + public Registration(IDependencyResolver container, string name, Type regType, Type implType) + { + LifetimeManager = null; + Container = container; + Factory = null; + Name = name; + _regType = regType; + _implType = implType; + _key = String.Format("[{0}]:{1}", (name ?? "null"), implType.FullName); + } + + public string Key + { + get { return _key; } + } + + public Type ResolvesTo + { + get { return _regType; } + } + + public Type ImplType + { + get + { + return _implType; + } + } + + public string Name { get; private set; } + + public IRegistration WithLifetimeManager(ILifetimeManager manager) + { + LifetimeManager = manager; + return this; + } + + public object GetCachedInstance() + { + if (Instance == null) + lock (_lock) + { + if (Instance == null) + Instance = Factory(Container); + } + return Instance; + } + + public object CreateInstance() + { + return Factory(Container); + } + + public object GetInstance() + { + return Instance ?? + ((LifetimeManager != null) ? LifetimeManager.GetInstance(this) : Factory(Container)); + } + + public void InvalidateInstanceCache() + { + Instance = null; + if (LifetimeManager != null) + LifetimeManager.InvalidateInstanceCache(this); + } + } +} diff --git a/container/src/container/Munq/TypeRegistry.cs b/container/src/container/Munq/TypeRegistry.cs new file mode 100644 index 0000000..bfa3ba3 --- /dev/null +++ b/container/src/container/Munq/TypeRegistry.cs @@ -0,0 +1,105 @@ +// -------------------------------------------------------------------------------------------------- +// Copyright 2011 by Matthew Dennis. +// Released under the Microsoft Public License (Ms-PL) http://www.opensource.org/licenses/ms-pl.html +// -------------------------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Collections.Concurrent; +using System.Linq; + +namespace Munq +{ + internal class TypeRegistry : IDisposable + { + // Track whether Dispose has been called. + private const int INITIAL_SIZE = 257; // a prime number greater than the initial size + private bool disposed; + private readonly IDictionary typeRegistrations = + new ConcurrentDictionary(Environment.ProcessorCount * 2, + INITIAL_SIZE); + + public void Add(Registration reg) + { + IRegistrationKey key = MakeKey(reg.Name, reg.ResolvesTo); + typeRegistrations[key] = reg; + } + + public Registration Get(string name, Type type) + { + var key = MakeKey(name, type); + Registration registration; + typeRegistrations.TryGetValue(key, out registration); + return registration; + } + + public IEnumerable GetDerived(string name, Type type) + { + var regs = typeRegistrations.Values + .Where(r => String.Compare(r.Name, name, true) == 0 && + type.IsAssignableFrom(r.ResolvesTo)); + return regs; + } + + public IEnumerable GetDerived(Type type) + { + var regs = typeRegistrations.Values + .Where(r => type.IsAssignableFrom(r.ResolvesTo)); + return regs; + } + + public bool ContainsKey(string name, Type type) + { + IRegistrationKey key = MakeKey(name, type); + return typeRegistrations.Keys.Contains(key); + } + + public IEnumerable All(Type type) + { + return typeRegistrations.Values.Where(reg => reg.ResolvesTo == type); + } + + public void Remove(IRegistration ireg) + { + IRegistrationKey key = MakeKey(ireg.Name, ireg.ResolvesTo); + typeRegistrations.Remove(key); + ireg.InvalidateInstanceCache(); + } + + private static IRegistrationKey MakeKey(string name, Type type) + { + return (name == null ? new UnNamedRegistrationKey(type) + : (IRegistrationKey)new NamedRegistrationKey(name, type)); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + // Check to see if Dispose has already been called. + if (!disposed) + { + // If disposing equals true, dispose all ContainerLifetime instances + if (disposing) + { + foreach (Registration reg in typeRegistrations.Values) + { + var instance = reg.Instance as IDisposable; + if (instance != null) + { + instance.Dispose(); + reg.Instance = null; + } + reg.InvalidateInstanceCache(); + } + } + } + disposed = true; + } + ~TypeRegistry() { Dispose(false); } + } +} diff --git a/container/src/container/Munq/UnNamedRegistrationKey.cs b/container/src/container/Munq/UnNamedRegistrationKey.cs new file mode 100644 index 0000000..0afff6a --- /dev/null +++ b/container/src/container/Munq/UnNamedRegistrationKey.cs @@ -0,0 +1,33 @@ +// -------------------------------------------------------------------------------------------------- +// Copyright 2011 by Matthew Dennis. +// Released under the Microsoft Public License (Ms-PL) http://www.opensource.org/licenses/ms-pl.html +// -------------------------------------------------------------------------------------------------- + +using System; + +namespace Munq +{ + internal class UnNamedRegistrationKey : IRegistrationKey + { + internal Type InstanceType; + + public UnNamedRegistrationKey(Type type) + { + InstanceType = type; + } + + public Type GetInstanceType() { return InstanceType; } + + // comparison methods + public override bool Equals(object obj) + { + var r = obj as UnNamedRegistrationKey; + return (r != null) && Object.ReferenceEquals(InstanceType, r.InstanceType); + } + + public override int GetHashCode() + { + return InstanceType.GetHashCode(); + } + } +} diff --git a/container/src/container/Properties/AssemblyInfo.cs b/container/src/container/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e7e0831 --- /dev/null +++ b/container/src/container/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("container")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("container")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("038367c2-a064-4eb1-a2c0-fd2203aaf55d")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/container/src/container/container.csproj b/container/src/container/container.csproj new file mode 100644 index 0000000..acd1817 --- /dev/null +++ b/container/src/container/container.csproj @@ -0,0 +1,84 @@ + + + + + Debug + AnyCPU + {ECF06383-F12E-4E9B-BFA0-9DBC314E3AE2} + Library + Properties + container + container + v4.0 + 512 + + + true + full + false + ..\..\bin\lib\net40\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\bin\lib\net40\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/container/src/packages/NUnit.2.6.1/lib/nunit.framework.xml b/container/src/packages/NUnit.2.6.1/lib/nunit.framework.xml new file mode 100644 index 0000000..7b0e798 --- /dev/null +++ b/container/src/packages/NUnit.2.6.1/lib/nunit.framework.xml @@ -0,0 +1,10892 @@ + + + + nunit.framework + + + + + Attribute used to apply a category to a test + + + + + The name of the category + + + + + Construct attribute for a given category based on + a name. The name may not contain the characters ',', + '+', '-' or '!'. However, this is not checked in the + constructor since it would cause an error to arise at + as the test was loaded without giving a clear indication + of where the problem is located. The error is handled + in NUnitFramework.cs by marking the test as not + runnable. + + The name of the category + + + + Protected constructor uses the Type name as the name + of the category. + + + + + The name of the category + + + + + Used to mark a field for use as a datapoint when executing a theory + within the same fixture that requires an argument of the field's Type. + + + + + Used to mark an array as containing a set of datapoints to be used + executing a theory within the same fixture that requires an argument + of the Type of the array elements. + + + + + Attribute used to provide descriptive text about a + test case or fixture. + + + + + Construct the attribute + + Text describing the test + + + + Gets the test description + + + + + Enumeration indicating how the expected message parameter is to be used + + + + Expect an exact match + + + Expect a message containing the parameter string + + + Match the regular expression provided as a parameter + + + Expect a message that starts with the parameter string + + + + ExpectedExceptionAttribute + + + + + + Constructor for a non-specific exception + + + + + Constructor for a given type of exception + + The type of the expected exception + + + + Constructor for a given exception name + + The full name of the expected exception + + + + Gets or sets the expected exception type + + + + + Gets or sets the full Type name of the expected exception + + + + + Gets or sets the expected message text + + + + + Gets or sets the user message displayed in case of failure + + + + + Gets or sets the type of match to be performed on the expected message + + + + + Gets the name of a method to be used as an exception handler + + + + + ExplicitAttribute marks a test or test fixture so that it will + only be run if explicitly executed from the gui or command line + or if it is included by use of a filter. The test will not be + run simply because an enclosing suite is run. + + + + + Default constructor + + + + + Constructor with a reason + + The reason test is marked explicit + + + + The reason test is marked explicit + + + + + Attribute used to mark a test that is to be ignored. + Ignored tests result in a warning message when the + tests are run. + + + + + Constructs the attribute without giving a reason + for ignoring the test. + + + + + Constructs the attribute giving a reason for ignoring the test + + The reason for ignoring the test + + + + The reason for ignoring a test + + + + + Abstract base for Attributes that are used to include tests + in the test run based on environmental settings. + + + + + Constructor with no included items specified, for use + with named property syntax. + + + + + Constructor taking one or more included items + + Comma-delimited list of included items + + + + Name of the item that is needed in order for + a test to run. Multiple itemss may be given, + separated by a comma. + + + + + Name of the item to be excluded. Multiple items + may be given, separated by a comma. + + + + + The reason for including or excluding the test + + + + + PlatformAttribute is used to mark a test fixture or an + individual method as applying to a particular platform only. + + + + + Constructor with no platforms specified, for use + with named property syntax. + + + + + Constructor taking one or more platforms + + Comma-deliminted list of platforms + + + + CultureAttribute is used to mark a test fixture or an + individual method as applying to a particular Culture only. + + + + + Constructor with no cultures specified, for use + with named property syntax. + + + + + Constructor taking one or more cultures + + Comma-deliminted list of cultures + + + + Marks a test to use a combinatorial join of any argument data + provided. NUnit will create a test case for every combination of + the arguments provided. This can result in a large number of test + cases and so should be used judiciously. This is the default join + type, so the attribute need not be used except as documentation. + + + + + PropertyAttribute is used to attach information to a test as a name/value pair.. + + + + + Construct a PropertyAttribute with a name and string value + + The name of the property + The property value + + + + Construct a PropertyAttribute with a name and int value + + The name of the property + The property value + + + + Construct a PropertyAttribute with a name and double value + + The name of the property + The property value + + + + Constructor for derived classes that set the + property dictionary directly. + + + + + Constructor for use by derived classes that use the + name of the type as the property name. Derived classes + must ensure that the Type of the property value is + a standard type supported by the BCL. Any custom + types will cause a serialization Exception when + in the client. + + + + + Gets the property dictionary for this attribute + + + + + Default constructor + + + + + Marks a test to use pairwise join of any argument data provided. + NUnit will attempt too excercise every pair of argument values at + least once, using as small a number of test cases as it can. With + only two arguments, this is the same as a combinatorial join. + + + + + Default constructor + + + + + Marks a test to use a sequential join of any argument data + provided. NUnit will use arguements for each parameter in + sequence, generating test cases up to the largest number + of argument values provided and using null for any arguments + for which it runs out of values. Normally, this should be + used with the same number of arguments for each parameter. + + + + + Default constructor + + + + + Summary description for MaxTimeAttribute. + + + + + Construct a MaxTimeAttribute, given a time in milliseconds. + + The maximum elapsed time in milliseconds + + + + RandomAttribute is used to supply a set of random values + to a single parameter of a parameterized test. + + + + + ValuesAttribute is used to provide literal arguments for + an individual parameter of a test. + + + + + Abstract base class for attributes that apply to parameters + and supply data for the parameter. + + + + + Gets the data to be provided to the specified parameter + + + + + The collection of data to be returned. Must + be set by any derived attribute classes. + We use an object[] so that the individual + elements may have their type changed in GetData + if necessary. + + + + + Construct with one argument + + + + + + Construct with two arguments + + + + + + + Construct with three arguments + + + + + + + + Construct with an array of arguments + + + + + + Get the collection of values to be used as arguments + + + + + Construct a set of doubles from 0.0 to 1.0, + specifying only the count. + + + + + + Construct a set of doubles from min to max + + + + + + + + Construct a set of ints from min to max + + + + + + + + Get the collection of values to be used as arguments + + + + + RangeAttribute is used to supply a range of values to an + individual parameter of a parameterized test. + + + + + Construct a range of ints using default step of 1 + + + + + + + Construct a range of ints specifying the step size + + + + + + + + Construct a range of longs + + + + + + + + Construct a range of doubles + + + + + + + + Construct a range of floats + + + + + + + + RepeatAttribute may be applied to test case in order + to run it multiple times. + + + + + Construct a RepeatAttribute + + The number of times to run the test + + + + RequiredAddinAttribute may be used to indicate the names of any addins + that must be present in order to run some or all of the tests in an + assembly. If the addin is not loaded, the entire assembly is marked + as NotRunnable. + + + + + Initializes a new instance of the class. + + The required addin. + + + + Gets the name of required addin. + + The required addin name. + + + + Summary description for SetCultureAttribute. + + + + + Construct given the name of a culture + + + + + + Summary description for SetUICultureAttribute. + + + + + Construct given the name of a culture + + + + + + SetUpAttribute is used in a TestFixture to identify a method + that is called immediately before each test is run. It is + also used in a SetUpFixture to identify the method that is + called once, before any of the subordinate tests are run. + + + + + Attribute used to mark a class that contains one-time SetUp + and/or TearDown methods that apply to all the tests in a + namespace or an assembly. + + + + + Attribute used to mark a static (shared in VB) property + that returns a list of tests. + + + + + Attribute used in a TestFixture to identify a method that is + called immediately after each test is run. It is also used + in a SetUpFixture to identify the method that is called once, + after all subordinate tests have run. In either case, the method + is guaranteed to be called, even if an exception is thrown. + + + + + Provide actions to execute before and after tests. + + + + + When implemented by an attribute, this interface implemented to provide actions to execute before and after tests. + + + + + Executed before each test is run + + Provides details about the test that is going to be run. + + + + Executed after each test is run + + Provides details about the test that has just been run. + + + + Provides the target for the action attribute + + The target for the action attribute + + + + Adding this attribute to a method within a + class makes the method callable from the NUnit test runner. There is a property + called Description which is optional which you can provide a more detailed test + description. This class cannot be inherited. + + + + [TestFixture] + public class Fixture + { + [Test] + public void MethodToTest() + {} + + [Test(Description = "more detailed description")] + publc void TestDescriptionMethod() + {} + } + + + + + + Descriptive text for this test + + + + + TestCaseAttribute is used to mark parameterized test cases + and provide them with their arguments. + + + + + The ITestCaseData interface is implemented by a class + that is able to return complete testcases for use by + a parameterized test method. + + NOTE: This interface is used in both the framework + and the core, even though that results in two different + types. However, sharing the source code guarantees that + the various implementations will be compatible and that + the core is able to reflect successfully over the + framework implementations of ITestCaseData. + + + + + Gets the argument list to be provided to the test + + + + + Gets the expected result + + + + + Indicates whether a result has been specified. + This is necessary because the result may be + null, so it's value cannot be checked. + + + + + Gets the expected exception Type + + + + + Gets the FullName of the expected exception + + + + + Gets the name to be used for the test + + + + + Gets the description of the test + + + + + Gets a value indicating whether this is ignored. + + true if ignored; otherwise, false. + + + + Gets a value indicating whether this is explicit. + + true if explicit; otherwise, false. + + + + Gets the ignore reason. + + The ignore reason. + + + + Construct a TestCaseAttribute with a list of arguments. + This constructor is not CLS-Compliant + + + + + + Construct a TestCaseAttribute with a single argument + + + + + + Construct a TestCaseAttribute with a two arguments + + + + + + + Construct a TestCaseAttribute with a three arguments + + + + + + + + Gets the list of arguments to a test case + + + + + Gets or sets the expected result. + + The result. + + + + Gets the expected result. + + The result. + + + + Gets a flag indicating whether an expected + result has been set. + + + + + Gets a list of categories associated with this test; + + + + + Gets or sets the category associated with this test. + May be a single category or a comma-separated list. + + + + + Gets or sets the expected exception. + + The expected exception. + + + + Gets or sets the name the expected exception. + + The expected name of the exception. + + + + Gets or sets the expected message of the expected exception + + The expected message of the exception. + + + + Gets or sets the type of match to be performed on the expected message + + + + + Gets or sets the description. + + The description. + + + + Gets or sets the name of the test. + + The name of the test. + + + + Gets or sets the ignored status of the test + + + + + Gets or sets the ignored status of the test + + + + + Gets or sets the explicit status of the test + + + + + Gets or sets the reason for not running the test + + + + + Gets or sets the reason for not running the test. + Set has the side effect of marking the test as ignored. + + The ignore reason. + + + + FactoryAttribute indicates the source to be used to + provide test cases for a test method. + + + + + Construct with the name of the factory - for use with languages + that don't support params arrays. + + An array of the names of the factories that will provide data + + + + Construct with a Type and name - for use with languages + that don't support params arrays. + + The Type that will provide data + The name of the method, property or field that will provide data + + + + The name of a the method, property or fiend to be used as a source + + + + + A Type to be used as a source + + + + + Gets or sets the category associated with this test. + May be a single category or a comma-separated list. + + + + + [TestFixture] + public class ExampleClass + {} + + + + + Default constructor + + + + + Construct with a object[] representing a set of arguments. + In .NET 2.0, the arguments may later be separated into + type arguments and constructor arguments. + + + + + + Descriptive text for this fixture + + + + + Gets and sets the category for this fixture. + May be a comma-separated list of categories. + + + + + Gets a list of categories for this fixture + + + + + The arguments originally provided to the attribute + + + + + Gets or sets a value indicating whether this should be ignored. + + true if ignore; otherwise, false. + + + + Gets or sets the ignore reason. May set Ignored as a side effect. + + The ignore reason. + + + + Get or set the type arguments. If not set + explicitly, any leading arguments that are + Types are taken as type arguments. + + + + + Attribute used to identify a method that is + called before any tests in a fixture are run. + + + + + Attribute used to identify a method that is called after + all the tests in a fixture have run. The method is + guaranteed to be called, even if an exception is thrown. + + + + + Adding this attribute to a method within a + class makes the method callable from the NUnit test runner. There is a property + called Description which is optional which you can provide a more detailed test + description. This class cannot be inherited. + + + + [TestFixture] + public class Fixture + { + [Test] + public void MethodToTest() + {} + + [Test(Description = "more detailed description")] + publc void TestDescriptionMethod() + {} + } + + + + + + Used on a method, marks the test with a timeout value in milliseconds. + The test will be run in a separate thread and is cancelled if the timeout + is exceeded. Used on a method or assembly, sets the default timeout + for all contained test methods. + + + + + Construct a TimeoutAttribute given a time in milliseconds + + The timeout value in milliseconds + + + + Marks a test that must run in the STA, causing it + to run in a separate thread if necessary. + + On methods, you may also use STAThreadAttribute + to serve the same purpose. + + + + + Construct a RequiresSTAAttribute + + + + + Marks a test that must run in the MTA, causing it + to run in a separate thread if necessary. + + On methods, you may also use MTAThreadAttribute + to serve the same purpose. + + + + + Construct a RequiresMTAAttribute + + + + + Marks a test that must run on a separate thread. + + + + + Construct a RequiresThreadAttribute + + + + + Construct a RequiresThreadAttribute, specifying the apartment + + + + + ValueSourceAttribute indicates the source to be used to + provide data for one parameter of a test method. + + + + + Construct with the name of the factory - for use with languages + that don't support params arrays. + + The name of the data source to be used + + + + Construct with a Type and name - for use with languages + that don't support params arrays. + + The Type that will provide data + The name of the method, property or field that will provide data + + + + The name of a the method, property or fiend to be used as a source + + + + + A Type to be used as a source + + + + + AttributeExistsConstraint tests for the presence of a + specified attribute on a Type. + + + + + The Constraint class is the base of all built-in constraints + within NUnit. It provides the operator overloads used to combine + constraints. + + + + + The IConstraintExpression interface is implemented by all + complete and resolvable constraints and expressions. + + + + + Return the top-level constraint for this expression + + + + + + Static UnsetObject used to detect derived constraints + failing to set the actual value. + + + + + The actual value being tested against a constraint + + + + + The display name of this Constraint for use by ToString() + + + + + Argument fields used by ToString(); + + + + + The builder holding this constraint + + + + + Construct a constraint with no arguments + + + + + Construct a constraint with one argument + + + + + Construct a constraint with two arguments + + + + + Sets the ConstraintBuilder holding this constraint + + + + + Write the failure message to the MessageWriter provided + as an argument. The default implementation simply passes + the constraint and the actual value to the writer, which + then displays the constraint description and the value. + + Constraints that need to provide additional details, + such as where the error occured can override this. + + The MessageWriter on which to display the message + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Test whether the constraint is satisfied by an + ActualValueDelegate that returns the value to be tested. + The default implementation simply evaluates the delegate + but derived classes may override it to provide for delayed + processing. + + An ActualValueDelegate + True for success, false for failure + + + + Test whether the constraint is satisfied by a given reference. + The default implementation simply dereferences the value but + derived classes may override it to provide for delayed processing. + + A reference to the value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + Default override of ToString returns the constraint DisplayName + followed by any arguments within angle brackets. + + + + + + Returns the string representation of this constraint + + + + + This operator creates a constraint that is satisfied only if both + argument constraints are satisfied. + + + + + This operator creates a constraint that is satisfied if either + of the argument constraints is satisfied. + + + + + This operator creates a constraint that is satisfied if the + argument constraint is not satisfied. + + + + + Returns a DelayedConstraint with the specified delay time. + + The delay in milliseconds. + + + + + Returns a DelayedConstraint with the specified delay time + and polling interval. + + The delay in milliseconds. + The interval at which to test the constraint. + + + + + The display name of this Constraint for use by ToString(). + The default value is the name of the constraint with + trailing "Constraint" removed. Derived classes may set + this to another name in their constructors. + + + + + Returns a ConstraintExpression by appending And + to the current constraint. + + + + + Returns a ConstraintExpression by appending And + to the current constraint. + + + + + Returns a ConstraintExpression by appending Or + to the current constraint. + + + + + Class used to detect any derived constraints + that fail to set the actual value in their + Matches override. + + + + + Constructs an AttributeExistsConstraint for a specific attribute Type + + + + + + Tests whether the object provides the expected attribute. + + A Type, MethodInfo, or other ICustomAttributeProvider + True if the expected attribute is present, otherwise false + + + + Writes the description of the constraint to the specified writer + + + + + AttributeConstraint tests that a specified attribute is present + on a Type or other provider and that the value of the attribute + satisfies some other constraint. + + + + + Abstract base class used for prefixes + + + + + The base constraint + + + + + Construct given a base constraint + + + + + + Constructs an AttributeConstraint for a specified attriute + Type and base constraint. + + + + + + + Determines whether the Type or other provider has the + expected attribute and if its value matches the + additional constraint specified. + + + + + Writes a description of the attribute to the specified writer. + + + + + Writes the actual value supplied to the specified writer. + + + + + Returns a string representation of the constraint. + + + + + BasicConstraint is the abstract base for constraints that + perform a simple comparison to a constant value. + + + + + Initializes a new instance of the class. + + The expected. + The description. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + NullConstraint tests that the actual value is null + + + + + Initializes a new instance of the class. + + + + + TrueConstraint tests that the actual value is true + + + + + Initializes a new instance of the class. + + + + + FalseConstraint tests that the actual value is false + + + + + Initializes a new instance of the class. + + + + + NaNConstraint tests that the actual value is a double or float NaN + + + + + Test that the actual value is an NaN + + + + + + + Write the constraint description to a specified writer + + + + + + BinaryConstraint is the abstract base of all constraints + that combine two other constraints in some fashion. + + + + + The first constraint being combined + + + + + The second constraint being combined + + + + + Construct a BinaryConstraint from two other constraints + + The first constraint + The second constraint + + + + AndConstraint succeeds only if both members succeed. + + + + + Create an AndConstraint from two other constraints + + The first constraint + The second constraint + + + + Apply both member constraints to an actual value, succeeding + succeeding only if both of them succeed. + + The actual value + True if the constraints both succeeded + + + + Write a description for this contraint to a MessageWriter + + The MessageWriter to receive the description + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + OrConstraint succeeds if either member succeeds + + + + + Create an OrConstraint from two other constraints + + The first constraint + The second constraint + + + + Apply the member constraints to an actual value, succeeding + succeeding as soon as one of them succeeds. + + The actual value + True if either constraint succeeded + + + + Write a description for this contraint to a MessageWriter + + The MessageWriter to receive the description + + + + CollectionConstraint is the abstract base class for + constraints that operate on collections. + + + + + Construct an empty CollectionConstraint + + + + + Construct a CollectionConstraint + + + + + + Determines whether the specified enumerable is empty. + + The enumerable. + + true if the specified enumerable is empty; otherwise, false. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Protected method to be implemented by derived classes + + + + + + + CollectionItemsEqualConstraint is the abstract base class for all + collection constraints that apply some notion of item equality + as a part of their operation. + + + + + Construct an empty CollectionConstraint + + + + + Construct a CollectionConstraint + + + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied Comparison object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + Self. + + + + Compares two collection members for equality + + + + + Return a new CollectionTally for use in making tests + + The collection to be included in the tally + + + + Flag the constraint to ignore case and return self. + + + + + EmptyCollectionConstraint tests whether a collection is empty. + + + + + Check that the collection is empty + + + + + + + Write the constraint description to a MessageWriter + + + + + + UniqueItemsConstraint tests whether all the items in a + collection are unique. + + + + + Check that all items are unique. + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + CollectionContainsConstraint is used to test whether a collection + contains an expected object as a member. + + + + + Construct a CollectionContainsConstraint + + + + + + Test whether the expected item is contained in the collection + + + + + + + Write a descripton of the constraint to a MessageWriter + + + + + + CollectionEquivalentCOnstraint is used to determine whether two + collections are equivalent. + + + + + Construct a CollectionEquivalentConstraint + + + + + + Test whether two collections are equivalent + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + CollectionSubsetConstraint is used to determine whether + one collection is a subset of another + + + + + Construct a CollectionSubsetConstraint + + The collection that the actual value is expected to be a subset of + + + + Test whether the actual collection is a subset of + the expected collection provided. + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + CollectionOrderedConstraint is used to test whether a collection is ordered. + + + + + Construct a CollectionOrderedConstraint + + + + + Modifies the constraint to use an IComparer and returns self. + + + + + Modifies the constraint to use an IComparer<T> and returns self. + + + + + Modifies the constraint to use a Comparison<T> and returns self. + + + + + Modifies the constraint to test ordering by the value of + a specified property and returns self. + + + + + Test whether the collection is ordered + + + + + + + Write a description of the constraint to a MessageWriter + + + + + + Returns the string representation of the constraint. + + + + + + If used performs a reverse comparison + + + + + CollectionTally counts (tallies) the number of + occurences of each object in one or more enumerations. + + + + + Construct a CollectionTally object from a comparer and a collection + + + + + Try to remove an object from the tally + + The object to remove + True if successful, false if the object was not found + + + + Try to remove a set of objects from the tally + + The objects to remove + True if successful, false if any object was not found + + + + The number of objects remaining in the tally + + + + + ComparisonAdapter class centralizes all comparisons of + values in NUnit, adapting to the use of any provided + IComparer, IComparer<T> or Comparison<T> + + + + + Returns a ComparisonAdapter that wraps an IComparer + + + + + Returns a ComparisonAdapter that wraps an IComparer<T> + + + + + Returns a ComparisonAdapter that wraps a Comparison<T> + + + + + Compares two objects + + + + + Gets the default ComparisonAdapter, which wraps an + NUnitComparer object. + + + + + Construct a ComparisonAdapter for an IComparer + + + + + Compares two objects + + + + + + + + Construct a default ComparisonAdapter + + + + + ComparisonAdapter<T> extends ComparisonAdapter and + allows use of an IComparer<T> or Comparison<T> + to actually perform the comparison. + + + + + Construct a ComparisonAdapter for an IComparer<T> + + + + + Compare a Type T to an object + + + + + Construct a ComparisonAdapter for a Comparison<T> + + + + + Compare a Type T to an object + + + + + Abstract base class for constraints that compare values to + determine if one is greater than, equal to or less than + the other. This class supplies the Using modifiers. + + + + + ComparisonAdapter to be used in making the comparison + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Modifies the constraint to use an IComparer and returns self + + + + + Modifies the constraint to use an IComparer<T> and returns self + + + + + Modifies the constraint to use a Comparison<T> and returns self + + + + + Delegate used to delay evaluation of the actual value + to be used in evaluating a constraint + + + + + ConstraintBuilder maintains the stacks that are used in + processing a ConstraintExpression. An OperatorStack + is used to hold operators that are waiting for their + operands to be reognized. a ConstraintStack holds + input constraints as well as the results of each + operator applied. + + + + + Initializes a new instance of the class. + + + + + Appends the specified operator to the expression by first + reducing the operator stack and then pushing the new + operator on the stack. + + The operator to push. + + + + Appends the specified constraint to the expresson by pushing + it on the constraint stack. + + The constraint to push. + + + + Sets the top operator right context. + + The right context. + + + + Reduces the operator stack until the topmost item + precedence is greater than or equal to the target precedence. + + The target precedence. + + + + Resolves this instance, returning a Constraint. If the builder + is not currently in a resolvable state, an exception is thrown. + + The resolved constraint + + + + Gets a value indicating whether this instance is resolvable. + + + true if this instance is resolvable; otherwise, false. + + + + + OperatorStack is a type-safe stack for holding ConstraintOperators + + + + + Initializes a new instance of the class. + + The builder. + + + + Pushes the specified operator onto the stack. + + The op. + + + + Pops the topmost operator from the stack. + + + + + + Gets a value indicating whether this is empty. + + true if empty; otherwise, false. + + + + Gets the topmost operator without modifying the stack. + + The top. + + + + ConstraintStack is a type-safe stack for holding Constraints + + + + + Initializes a new instance of the class. + + The builder. + + + + Pushes the specified constraint. As a side effect, + the constraint's builder field is set to the + ConstraintBuilder owning this stack. + + The constraint. + + + + Pops this topmost constrait from the stack. + As a side effect, the constraint's builder + field is set to null. + + + + + + Gets a value indicating whether this is empty. + + true if empty; otherwise, false. + + + + Gets the topmost constraint without modifying the stack. + + The topmost constraint + + + + ConstraintExpression represents a compound constraint in the + process of being constructed from a series of syntactic elements. + + Individual elements are appended to the expression as they are + reognized. Once an actual Constraint is appended, the expression + returns a resolvable Constraint. + + + + + ConstraintExpressionBase is the abstract base class for the + ConstraintExpression class, which represents a + compound constraint in the process of being constructed + from a series of syntactic elements. + + NOTE: ConstraintExpressionBase is separate because the + ConstraintExpression class was generated in earlier + versions of NUnit. The two classes may be combined + in a future version. + + + + + The ConstraintBuilder holding the elements recognized so far + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the + class passing in a ConstraintBuilder, which may be pre-populated. + + The builder. + + + + Returns a string representation of the expression as it + currently stands. This should only be used for testing, + since it has the side-effect of resolving the expression. + + + + + + Appends an operator to the expression and returns the + resulting expression itself. + + + + + Appends a self-resolving operator to the expression and + returns a new ResolvableConstraintExpression. + + + + + Appends a constraint to the expression and returns that + constraint, which is associated with the current state + of the expression being built. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the + class passing in a ConstraintBuilder, which may be pre-populated. + + The builder. + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding only if a specified number of them succeed. + + + + + Returns a new PropertyConstraintExpression, which will either + test for the existence of the named property on the object + being tested or apply any following constraint to that property. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns the constraint provided as an argument - used to allow custom + custom constraints to easily participate in the syntax. + + + + + Returns the constraint provided as an argument - used to allow custom + custom constraints to easily participate in the syntax. + + + + + Returns a constraint that tests two items for equality + + + + + Returns a constraint that tests that two references are the same object + + + + + Returns a constraint that tests whether the + actual value is greater than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a collection containing the same elements as the + collection supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a subset of the collection supplied as an argument. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a new ContainsConstraint. This constraint + will, in turn, make use of the appropriate second-level + constraint, depending on the type of the actual argument. + This overload is only used if the item sought is a string, + since any other type implies that we are looking for a + collection member. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that tests whether the path provided + is the same as an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the actual value falls + within a specified range. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if at least one of them succeeds. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them fail. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Length property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Count property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Message property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the InnerException property of the object being tested. + + + + + With is currently a NOP - reserved for future use. + + + + + Returns a constraint that tests for null + + + + + Returns a constraint that tests for True + + + + + Returns a constraint that tests for False + + + + + Returns a constraint that tests for a positive value + + + + + Returns a constraint that tests for a negative value + + + + + Returns a constraint that tests for NaN + + + + + Returns a constraint that tests for empty + + + + + Returns a constraint that tests whether a collection + contains all unique items. + + + + + Returns a constraint that tests whether an object graph is serializable in binary format. + + + + + Returns a constraint that tests whether an object graph is serializable in xml format. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding only if a specified number of them succeed. + + + + + Returns a new PropertyConstraintExpression, which will either + test for the existence of the named property on the object + being tested or apply any following constraint to that property. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a constraint that tests two items for equality + + + + + Returns a constraint that tests that two references are the same object + + + + + Returns a constraint that tests whether the + actual value is greater than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a collection containing the same elements as the + collection supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a subset of the collection supplied as an argument. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a new ContainsConstraint. This constraint + will, in turn, make use of the appropriate second-level + constraint, depending on the type of the actual argument. + This overload is only used if the item sought is a string, + since any other type implies that we are looking for a + collection member. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that fails if the actual + value matches the pattern supplied as an argument. + + + + + Returns a constraint that tests whether the path provided + is the same as an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the actual value falls + within a specified range. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if at least one of them succeeds. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them fail. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Length property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Count property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Message property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the InnerException property of the object being tested. + + + + + Returns a constraint that tests for null + + + + + Returns a constraint that tests for True + + + + + Returns a constraint that tests for False + + + + + Returns a constraint that tests for a positive value + + + + + Returns a constraint that tests for a negative value + + + + + Returns a constraint that tests for NaN + + + + + Returns a constraint that tests for empty + + + + + Returns a constraint that tests whether a collection + contains all unique items. + + + + + Returns a constraint that tests whether an object graph is serializable in binary format. + + + + + Returns a constraint that tests whether an object graph is serializable in xml format. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + The ConstraintOperator class is used internally by a + ConstraintBuilder to represent an operator that + modifies or combines constraints. + + Constraint operators use left and right precedence + values to determine whether the top operator on the + stack should be reduced before pushing a new operator. + + + + + The precedence value used when the operator + is about to be pushed to the stack. + + + + + The precedence value used when the operator + is on the top of the stack. + + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + + The syntax element preceding this operator + + + + + The syntax element folowing this operator + + + + + The precedence value used when the operator + is about to be pushed to the stack. + + + + + The precedence value used when the operator + is on the top of the stack. + + + + + PrefixOperator takes a single constraint and modifies + it's action in some way. + + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + + Returns the constraint created by applying this + prefix to another constraint. + + + + + + + Negates the test of the constraint it wraps. + + + + + Constructs a new NotOperator + + + + + Returns a NotConstraint applied to its argument. + + + + + Abstract base for operators that indicate how to + apply a constraint to items in a collection. + + + + + Constructs a CollectionOperator + + + + + Represents a constraint that succeeds if all the + members of a collection match a base constraint. + + + + + Returns a constraint that will apply the argument + to the members of a collection, succeeding if + they all succeed. + + + + + Represents a constraint that succeeds if any of the + members of a collection match a base constraint. + + + + + Returns a constraint that will apply the argument + to the members of a collection, succeeding if + any of them succeed. + + + + + Represents a constraint that succeeds if none of the + members of a collection match a base constraint. + + + + + Returns a constraint that will apply the argument + to the members of a collection, succeeding if + none of them succeed. + + + + + Represents a constraint that succeeds if the specified + count of members of a collection match a base constraint. + + + + + Construct an ExactCountOperator for a specified count + + The expected count + + + + Returns a constraint that will apply the argument + to the members of a collection, succeeding if + none of them succeed. + + + + + Represents a constraint that simply wraps the + constraint provided as an argument, without any + further functionality, but which modifes the + order of evaluation because of its precedence. + + + + + Constructor for the WithOperator + + + + + Returns a constraint that wraps its argument + + + + + Abstract base class for operators that are able to reduce to a + constraint whether or not another syntactic element follows. + + + + + Operator used to test for the presence of a named Property + on an object and optionally apply further tests to the + value of that property. + + + + + Constructs a PropOperator for a particular named property + + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + + Gets the name of the property to which the operator applies + + + + + Operator that tests for the presence of a particular attribute + on a type and optionally applies further tests to the attribute. + + + + + Construct an AttributeOperator for a particular Type + + The Type of attribute tested + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + Operator that tests that an exception is thrown and + optionally applies further tests to the exception. + + + + + Construct a ThrowsOperator + + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + Abstract base class for all binary operators + + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + + Abstract method that produces a constraint by applying + the operator to its left and right constraint arguments. + + + + + Gets the left precedence of the operator + + + + + Gets the right precedence of the operator + + + + + Operator that requires both it's arguments to succeed + + + + + Construct an AndOperator + + + + + Apply the operator to produce an AndConstraint + + + + + Operator that requires at least one of it's arguments to succeed + + + + + Construct an OrOperator + + + + + Apply the operator to produce an OrConstraint + + + + + ContainsConstraint tests a whether a string contains a substring + or a collection contains an object. It postpones the decision of + which test to use until the type of the actual argument is known. + This allows testing whether a string is contained in a collection + or as a substring of another string using the same syntax. + + + + + Initializes a new instance of the class. + + The expected. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied Comparison object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to ignore case and return self. + + + + + Applies a delay to the match so that a match can be evaluated in the future. + + + + + Creates a new DelayedConstraint + + The inner constraint two decorate + The time interval after which the match is performed + If the value of is less than 0 + + + + Creates a new DelayedConstraint + + The inner constraint two decorate + The time interval after which the match is performed + The time interval used for polling + If the value of is less than 0 + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for if the base constraint fails, false if it succeeds + + + + Test whether the constraint is satisfied by a delegate + + The delegate whose value is to be tested + True for if the base constraint fails, false if it succeeds + + + + Test whether the constraint is satisfied by a given reference. + Overridden to wait for the specified delay period before + calling the base constraint with the dereferenced value. + + A reference to the value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a MessageWriter. + + The writer on which the actual value is displayed + + + + Returns the string representation of the constraint. + + + + + EmptyDirectoryConstraint is used to test that a directory is empty + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + EmptyConstraint tests a whether a string or collection is empty, + postponing the decision about which test is applied until the + type of the actual argument is known. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + EqualConstraint is able to compare an actual value with the + expected value provided in its constructor. Two objects are + considered equal if both are null, or if both have the same + value. NUnit has special semantics for some object types. + + + + + If true, strings in error messages will be clipped + + + + + NUnitEqualityComparer used to test equality. + + + + + Initializes a new instance of the class. + + The expected value. + + + + Flag the constraint to use a tolerance when determining equality. + + Tolerance value to be used + Self. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied Comparison object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + Self. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write a failure message. Overridden to provide custom + failure messages for EqualConstraint. + + The MessageWriter to write to + + + + Write description of this constraint + + The MessageWriter to write to + + + + Display the failure information for two collections that did not match. + + The MessageWriter on which to display + The expected collection. + The actual collection + The depth of this failure in a set of nested collections + + + + Displays a single line showing the types and sizes of the expected + and actual enumerations, collections or arrays. If both are identical, + the value is only shown once. + + The MessageWriter on which to display + The expected collection or array + The actual collection or array + The indentation level for the message line + + + + Displays a single line showing the point in the expected and actual + arrays at which the comparison failed. If the arrays have different + structures or dimensions, both values are shown. + + The MessageWriter on which to display + The expected array + The actual array + Index of the failure point in the underlying collections + The indentation level for the message line + + + + Display the failure information for two IEnumerables that did not match. + + The MessageWriter on which to display + The expected enumeration. + The actual enumeration + The depth of this failure in a set of nested collections + + + + Flag the constraint to ignore case and return self. + + + + + Flag the constraint to suppress string clipping + and return self. + + + + + Flag the constraint to compare arrays as collections + and return self. + + + + + Switches the .Within() modifier to interpret its tolerance as + a distance in representable values (see remarks). + + Self. + + Ulp stands for "unit in the last place" and describes the minimum + amount a given value can change. For any integers, an ulp is 1 whole + digit. For floating point values, the accuracy of which is better + for smaller numbers and worse for larger numbers, an ulp depends + on the size of the number. Using ulps for comparison of floating + point results instead of fixed tolerances is safer because it will + automatically compensate for the added inaccuracy of larger numbers. + + + + + Switches the .Within() modifier to interpret its tolerance as + a percentage that the actual values is allowed to deviate from + the expected value. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in days. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in hours. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in minutes. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in seconds. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in milliseconds. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in clock ticks. + + Self + + + + EqualityAdapter class handles all equality comparisons + that use an IEqualityComparer, IEqualityComparer<T> + or a ComparisonAdapter. + + + + + Compares two objects, returning true if they are equal + + + + + Returns true if the two objects can be compared by this adapter. + The base adapter cannot handle IEnumerables except for strings. + + + + + Returns an EqualityAdapter that wraps an IComparer. + + + + + Returns an EqualityAdapter that wraps an IEqualityComparer. + + + + + Returns an EqualityAdapter that wraps an IEqualityComparer<T>. + + + + + Returns an EqualityAdapter that wraps an IComparer<T>. + + + + + Returns an EqualityAdapter that wraps a Comparison<T>. + + + + + EqualityAdapter that wraps an IComparer. + + + + + Returns true if the two objects can be compared by this adapter. + Generic adapter requires objects of the specified type. + + + + + EqualityAdapter that wraps an IComparer. + + + + Helper routines for working with floating point numbers + + + The floating point comparison code is based on this excellent article: + http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm + + + "ULP" means Unit in the Last Place and in the context of this library refers to + the distance between two adjacent floating point numbers. IEEE floating point + numbers can only represent a finite subset of natural numbers, with greater + accuracy for smaller numbers and lower accuracy for very large numbers. + + + If a comparison is allowed "2 ulps" of deviation, that means the values are + allowed to deviate by up to 2 adjacent floating point values, which might be + as low as 0.0000001 for small numbers or as high as 10.0 for large numbers. + + + + + Compares two floating point values for equality + First floating point value to be compared + Second floating point value t be compared + + Maximum number of representable floating point values that are allowed to + be between the left and the right floating point values + + True if both numbers are equal or close to being equal + + + Floating point values can only represent a finite subset of natural numbers. + For example, the values 2.00000000 and 2.00000024 can be stored in a float, + but nothing inbetween them. + + + This comparison will count how many possible floating point values are between + the left and the right number. If the number of possible values between both + numbers is less than or equal to maxUlps, then the numbers are considered as + being equal. + + + Implementation partially follows the code outlined here: + http://www.anttirt.net/2007/08/19/proper-floating-point-comparisons/ + + + + + Compares two double precision floating point values for equality + First double precision floating point value to be compared + Second double precision floating point value t be compared + + Maximum number of representable double precision floating point values that are + allowed to be between the left and the right double precision floating point values + + True if both numbers are equal or close to being equal + + + Double precision floating point values can only represent a limited series of + natural numbers. For example, the values 2.0000000000000000 and 2.0000000000000004 + can be stored in a double, but nothing inbetween them. + + + This comparison will count how many possible double precision floating point + values are between the left and the right number. If the number of possible + values between both numbers is less than or equal to maxUlps, then the numbers + are considered as being equal. + + + Implementation partially follows the code outlined here: + http://www.anttirt.net/2007/08/19/proper-floating-point-comparisons/ + + + + + + Reinterprets the memory contents of a floating point value as an integer value + + + Floating point value whose memory contents to reinterpret + + + The memory contents of the floating point value interpreted as an integer + + + + + Reinterprets the memory contents of a double precision floating point + value as an integer value + + + Double precision floating point value whose memory contents to reinterpret + + + The memory contents of the double precision floating point value + interpreted as an integer + + + + + Reinterprets the memory contents of an integer as a floating point value + + Integer value whose memory contents to reinterpret + + The memory contents of the integer value interpreted as a floating point value + + + + + Reinterprets the memory contents of an integer value as a double precision + floating point value + + Integer whose memory contents to reinterpret + + The memory contents of the integer interpreted as a double precision + floating point value + + + + Union of a floating point variable and an integer + + + The union's value as a floating point variable + + + The union's value as an integer + + + The union's value as an unsigned integer + + + Union of a double precision floating point variable and a long + + + The union's value as a double precision floating point variable + + + The union's value as a long + + + The union's value as an unsigned long + + + + Tests whether a value is greater than the value supplied to its constructor + + + + + The value against which a comparison is to be made + + + + + Initializes a new instance of the class. + + The expected value. + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Tests whether a value is greater than or equal to the value supplied to its constructor + + + + + The value against which a comparison is to be made + + + + + Initializes a new instance of the class. + + The expected value. + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Tests whether a value is less than the value supplied to its constructor + + + + + The value against which a comparison is to be made + + + + + Initializes a new instance of the class. + + The expected value. + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Tests whether a value is less than or equal to the value supplied to its constructor + + + + + The value against which a comparison is to be made + + + + + Initializes a new instance of the class. + + The expected value. + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + MessageWriter is the abstract base for classes that write + constraint descriptions and messages in some form. The + class has separate methods for writing various components + of a message, allowing implementations to tailor the + presentation as needed. + + + + + Construct a MessageWriter given a culture + + + + + Method to write single line message with optional args, usually + written to precede the general failure message. + + The message to be written + Any arguments used in formatting the message + + + + Method to write single line message with optional args, usually + written to precede the general failure message, at a givel + indentation level. + + The indentation level of the message + The message to be written + Any arguments used in formatting the message + + + + Display Expected and Actual lines for a constraint. This + is called by MessageWriter's default implementation of + WriteMessageTo and provides the generic two-line display. + + The constraint that failed + + + + Display Expected and Actual lines for given values. This + method may be called by constraints that need more control over + the display of actual and expected values than is provided + by the default implementation. + + The expected value + The actual value causing the failure + + + + Display Expected and Actual lines for given values, including + a tolerance value on the Expected line. + + The expected value + The actual value causing the failure + The tolerance within which the test was made + + + + Display the expected and actual string values on separate lines. + If the mismatch parameter is >=0, an additional line is displayed + line containing a caret that points to the mismatch point. + + The expected string value + The actual string value + The point at which the strings don't match or -1 + If true, case is ignored in locating the point where the strings differ + If true, the strings should be clipped to fit the line + + + + Writes the text for a connector. + + The connector. + + + + Writes the text for a predicate. + + The predicate. + + + + Writes the text for an expected value. + + The expected value. + + + + Writes the text for a modifier + + The modifier. + + + + Writes the text for an actual value. + + The actual value. + + + + Writes the text for a generalized value. + + The value. + + + + Writes the text for a collection value, + starting at a particular point, to a max length + + The collection containing elements to write. + The starting point of the elements to write + The maximum number of elements to write + + + + Abstract method to get the max line length + + + + + Static methods used in creating messages + + + + + Static string used when strings are clipped + + + + + Returns the representation of a type as used in NUnitLite. + This is the same as Type.ToString() except for arrays, + which are displayed with their declared sizes. + + + + + + + Converts any control characters in a string + to their escaped representation. + + The string to be converted + The converted string + + + + Return the a string representation for a set of indices into an array + + Array of indices for which a string is needed + + + + Get an array of indices representing the point in a enumerable, + collection or array corresponding to a single int index into the + collection. + + The collection to which the indices apply + Index in the collection + Array of indices + + + + Clip a string to a given length, starting at a particular offset, returning the clipped + string with ellipses representing the removed parts + + The string to be clipped + The maximum permitted length of the result string + The point at which to start clipping + The clipped string + + + + Clip the expected and actual strings in a coordinated fashion, + so that they may be displayed together. + + + + + + + + + Shows the position two strings start to differ. Comparison + starts at the start index. + + The expected string + The actual string + The index in the strings at which comparison should start + Boolean indicating whether case should be ignored + -1 if no mismatch found, or the index where mismatch found + + + + The Numerics class contains common operations on numeric values. + + + + + Checks the type of the object, returning true if + the object is a numeric type. + + The object to check + true if the object is a numeric type + + + + Checks the type of the object, returning true if + the object is a floating point numeric type. + + The object to check + true if the object is a floating point numeric type + + + + Checks the type of the object, returning true if + the object is a fixed point numeric type. + + The object to check + true if the object is a fixed point numeric type + + + + Test two numeric values for equality, performing the usual numeric + conversions and using a provided or default tolerance. If the tolerance + provided is Empty, this method may set it to a default tolerance. + + The expected value + The actual value + A reference to the tolerance in effect + True if the values are equal + + + + Compare two numeric values, performing the usual numeric conversions. + + The expected value + The actual value + The relationship of the values to each other + + + + NUnitComparer encapsulates NUnit's default behavior + in comparing two objects. + + + + + Compares two objects + + + + + + + + Returns the default NUnitComparer. + + + + + Generic version of NUnitComparer + + + + + + Compare two objects of the same type + + + + + NUnitEqualityComparer encapsulates NUnit's handling of + equality tests between objects. + + + + + + + + + + Compares two objects for equality within a tolerance + + The first object to compare + The second object to compare + The tolerance to use in the comparison + + + + + If true, all string comparisons will ignore case + + + + + If true, arrays will be treated as collections, allowing + those of different dimensions to be compared + + + + + Comparison objects used in comparisons for some constraints. + + + + + Compares two objects for equality within a tolerance. + + + + + Helper method to compare two arrays + + + + + Method to compare two DirectoryInfo objects + + first directory to compare + second directory to compare + true if equivalent, false if not + + + + Returns the default NUnitEqualityComparer + + + + + Gets and sets a flag indicating whether case should + be ignored in determining equality. + + + + + Gets and sets a flag indicating that arrays should be + compared as collections, without regard to their shape. + + + + + Gets and sets an external comparer to be used to + test for equality. It is applied to members of + collections, in place of NUnit's own logic. + + + + + Gets the list of failure points for the last Match performed. + + + + + FailurePoint class represents one point of failure + in an equality test. + + + + + The location of the failure + + + + + The expected value + + + + + The actual value + + + + + Indicates whether the expected value is valid + + + + + Indicates whether the actual value is valid + + + + + PathConstraint serves as the abstract base of constraints + that operate on paths and provides several helper methods. + + + + + The expected path used in the constraint + + + + + The actual path being tested + + + + + Flag indicating whether a caseInsensitive comparison should be made + + + + + Construct a PathConstraint for a give expected path + + The expected path + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Returns true if the expected path and actual path match + + + + + Returns the string representation of this constraint + + + + + Canonicalize the provided path + + + The path in standardized form + + + + Test whether two paths are the same + + The first path + The second path + Indicates whether case should be ignored + + + + + Test whether one path is under another path + + The first path - supposed to be the parent path + The second path - supposed to be the child path + Indicates whether case should be ignored + + + + + Test whether one path is the same as or under another path + + The first path - supposed to be the parent path + The second path - supposed to be the child path + + + + + Modifies the current instance to be case-insensitve + and returns it. + + + + + Modifies the current instance to be case-sensitve + and returns it. + + + + + Summary description for SamePathConstraint. + + + + + Initializes a new instance of the class. + + The expected path + + + + Test whether the constraint is satisfied by a given value + + The expected path + The actual path + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + SubPathConstraint tests that the actual path is under the expected path + + + + + Initializes a new instance of the class. + + The expected path + + + + Test whether the constraint is satisfied by a given value + + The expected path + The actual path + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + SamePathOrUnderConstraint tests that one path is under another + + + + + Initializes a new instance of the class. + + The expected path + + + + Test whether the constraint is satisfied by a given value + + The expected path + The actual path + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Predicate constraint wraps a Predicate in a constraint, + returning success if the predicate is true. + + + + + Construct a PredicateConstraint from a predicate + + + + + Determines whether the predicate succeeds when applied + to the actual value. + + + + + Writes the description to a MessageWriter + + + + + NotConstraint negates the effect of some other constraint + + + + + Initializes a new instance of the class. + + The base constraint to be negated. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for if the base constraint fails, false if it succeeds + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a MessageWriter. + + The writer on which the actual value is displayed + + + + AllItemsConstraint applies another constraint to each + item in a collection, succeeding if they all succeed. + + + + + Construct an AllItemsConstraint on top of an existing constraint + + + + + + Apply the item constraint to each item in the collection, + failing if any item fails. + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + SomeItemsConstraint applies another constraint to each + item in a collection, succeeding if any of them succeeds. + + + + + Construct a SomeItemsConstraint on top of an existing constraint + + + + + + Apply the item constraint to each item in the collection, + succeeding if any item succeeds. + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + NoItemConstraint applies another constraint to each + item in a collection, failing if any of them succeeds. + + + + + Construct a NoItemConstraint on top of an existing constraint + + + + + + Apply the item constraint to each item in the collection, + failing if any item fails. + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + ExactCoutConstraint applies another constraint to each + item in a collection, succeeding only if a specified + number of items succeed. + + + + + Construct an ExactCountConstraint on top of an existing constraint + + + + + + + Apply the item constraint to each item in the collection, + succeeding only if the expected number of items pass. + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + PropertyExistsConstraint tests that a named property + exists on the object provided through Match. + + Originally, PropertyConstraint provided this feature + in addition to making optional tests on the vaue + of the property. The two constraints are now separate. + + + + + Initializes a new instance of the class. + + The name of the property. + + + + Test whether the property exists for a given object + + The object to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. + + The writer on which the actual value is displayed + + + + Returns the string representation of the constraint. + + + + + + PropertyConstraint extracts a named property and uses + its value as the actual value for a chained constraint. + + + + + Initializes a new instance of the class. + + The name. + The constraint to apply to the property. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + Returns the string representation of the constraint. + + + + + + RangeConstraint tests whethe two values are within a + specified range. + + + + + Initializes a new instance of the class. + + From. + To. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + ResolvableConstraintExpression is used to represent a compound + constraint being constructed at a point where the last operator + may either terminate the expression or may have additional + qualifying constraints added to it. + + It is used, for example, for a Property element or for + an Exception element, either of which may be optionally + followed by constraints that apply to the property or + exception. + + + + + Create a new instance of ResolvableConstraintExpression + + + + + Create a new instance of ResolvableConstraintExpression, + passing in a pre-populated ConstraintBuilder. + + + + + Resolve the current expression to a Constraint + + + + + This operator creates a constraint that is satisfied only if both + argument constraints are satisfied. + + + + + This operator creates a constraint that is satisfied only if both + argument constraints are satisfied. + + + + + This operator creates a constraint that is satisfied only if both + argument constraints are satisfied. + + + + + This operator creates a constraint that is satisfied if either + of the argument constraints is satisfied. + + + + + This operator creates a constraint that is satisfied if either + of the argument constraints is satisfied. + + + + + This operator creates a constraint that is satisfied if either + of the argument constraints is satisfied. + + + + + This operator creates a constraint that is satisfied if the + argument constraint is not satisfied. + + + + + Appends an And Operator to the expression + + + + + Appends an Or operator to the expression. + + + + + ReusableConstraint wraps a resolved constraint so that it + may be saved and reused as needed. + + + + + Construct a ReusableConstraint + + The constraint or expression to be reused + + + + Conversion operator from a normal constraint to a ReusableConstraint. + + The original constraint to be wrapped as a ReusableConstraint + + + + + Returns the string representation of the constraint. + + A string representing the constraint + + + + Resolves the ReusableConstraint by returning the constraint + that it originally wrapped. + + A resolved constraint + + + + SameAsConstraint tests whether an object is identical to + the object passed to its constructor + + + + + Initializes a new instance of the class. + + The expected object. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + BinarySerializableConstraint tests whether + an object is serializable in binary format. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + Returns the string representation + + + + + BinarySerializableConstraint tests whether + an object is serializable in binary format. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + Returns the string representation of this constraint + + + + + StringConstraint is the abstract base for constraints + that operate on strings. It supports the IgnoreCase + modifier for string operations. + + + + + The expected value + + + + + Indicates whether tests should be case-insensitive + + + + + Constructs a StringConstraint given an expected value + + The expected value + + + + Modify the constraint to ignore case in matching. + + + + + EmptyStringConstraint tests whether a string is empty. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + NullEmptyStringConstraint tests whether a string is either null or empty. + + + + + Constructs a new NullOrEmptyStringConstraint + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + SubstringConstraint can test whether a string contains + the expected substring. + + + + + Initializes a new instance of the class. + + The expected. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + StartsWithConstraint can test whether a string starts + with an expected substring. + + + + + Initializes a new instance of the class. + + The expected string + + + + Test whether the constraint is matched by the actual value. + This is a template method, which calls the IsMatch method + of the derived class. + + + + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + EndsWithConstraint can test whether a string ends + with an expected substring. + + + + + Initializes a new instance of the class. + + The expected string + + + + Test whether the constraint is matched by the actual value. + This is a template method, which calls the IsMatch method + of the derived class. + + + + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + RegexConstraint can test whether a string matches + the pattern provided. + + + + + Initializes a new instance of the class. + + The pattern. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + ThrowsConstraint is used to test the exception thrown by + a delegate by applying a constraint to it. + + + + + Initializes a new instance of the class, + using a constraint to be applied to the exception. + + A constraint to apply to the caught exception. + + + + Executes the code of the delegate and captures any exception. + If a non-null base constraint was provided, it applies that + constraint to the exception. + + A delegate representing the code to be tested + True if an exception is thrown and the constraint succeeds, otherwise false + + + + Converts an ActualValueDelegate to a TestDelegate + before calling the primary overload. + + + + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + Returns the string representation of this constraint + + + + + Get the actual exception thrown - used by Assert.Throws. + + + + + ThrowsNothingConstraint tests that a delegate does not + throw an exception. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True if no exception is thrown, otherwise false + + + + Converts an ActualValueDelegate to a TestDelegate + before calling the primary overload. + + + + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + Modes in which the tolerance value for a comparison can + be interpreted. + + + + + The tolerance was created with a value, without specifying + how the value would be used. This is used to prevent setting + the mode more than once and is generally changed to Linear + upon execution of the test. + + + + + The tolerance is used as a numeric range within which + two compared values are considered to be equal. + + + + + Interprets the tolerance as the percentage by which + the two compared values my deviate from each other. + + + + + Compares two values based in their distance in + representable numbers. + + + + + The Tolerance class generalizes the notion of a tolerance + within which an equality test succeeds. Normally, it is + used with numeric types, but it can be used with any + type that supports taking a difference between two + objects and comparing that difference to a value. + + + + + Constructs a linear tolerance of a specdified amount + + + + + Constructs a tolerance given an amount and ToleranceMode + + + + + Tests that the current Tolerance is linear with a + numeric value, throwing an exception if it is not. + + + + + Returns an empty Tolerance object, equivalent to + specifying no tolerance. In most cases, it results + in an exact match but for floats and doubles a + default tolerance may be used. + + + + + Returns a zero Tolerance object, equivalent to + specifying an exact match. + + + + + Gets the ToleranceMode for the current Tolerance + + + + + Gets the value of the current Tolerance instance. + + + + + Returns a new tolerance, using the current amount as a percentage. + + + + + Returns a new tolerance, using the current amount in Ulps. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of days. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of hours. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of minutes. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of seconds. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of milliseconds. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of clock ticks. + + + + + Returns true if the current tolerance is empty. + + + + + TypeConstraint is the abstract base for constraints + that take a Type as their expected value. + + + + + The expected Type used by the constraint + + + + + Construct a TypeConstraint for a given Type + + + + + + Write the actual value for a failing constraint test to a + MessageWriter. TypeConstraints override this method to write + the name of the type. + + The writer on which the actual value is displayed + + + + ExactTypeConstraint is used to test that an object + is of the exact type provided in the constructor + + + + + Construct an ExactTypeConstraint for a given Type + + The expected Type. + + + + Test that an object is of the exact type specified + + The actual value. + True if the tested object is of the exact type provided, otherwise false. + + + + Write the description of this constraint to a MessageWriter + + The MessageWriter to use + + + + ExceptionTypeConstraint is a special version of ExactTypeConstraint + used to provided detailed info about the exception thrown in + an error message. + + + + + Constructs an ExceptionTypeConstraint + + + + + Write the actual value for a failing constraint test to a + MessageWriter. Overriden to write additional information + in the case of an Exception. + + The MessageWriter to use + + + + InstanceOfTypeConstraint is used to test that an object + is of the same type provided or derived from it. + + + + + Construct an InstanceOfTypeConstraint for the type provided + + The expected Type + + + + Test whether an object is of the specified type or a derived type + + The object to be tested + True if the object is of the provided type or derives from it, otherwise false. + + + + Write a description of this constraint to a MessageWriter + + The MessageWriter to use + + + + AssignableFromConstraint is used to test that an object + can be assigned from a given Type. + + + + + Construct an AssignableFromConstraint for the type provided + + + + + + Test whether an object can be assigned from the specified type + + The object to be tested + True if the object can be assigned a value of the expected Type, otherwise false. + + + + Write a description of this constraint to a MessageWriter + + The MessageWriter to use + + + + AssignableToConstraint is used to test that an object + can be assigned to a given Type. + + + + + Construct an AssignableToConstraint for the type provided + + + + + + Test whether an object can be assigned to the specified type + + The object to be tested + True if the object can be assigned a value of the expected Type, otherwise false. + + + + Write a description of this constraint to a MessageWriter + + The MessageWriter to use + + + + Thrown when an assertion failed. + + + + + The error message that explains + the reason for the exception + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Thrown when an assertion failed. + + + + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Thrown when a test executes inconclusively. + + + + + The error message that explains + the reason for the exception + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Thrown when an assertion failed. + + + + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + + + + + + + Compares two objects of a given Type for equality within a tolerance + + The first object to compare + The second object to compare + The tolerance to use in the comparison + + + + + The different targets a test action attribute can be applied to + + + + + Default target, which is determined by where the action attribute is attached + + + + + Target a individual test case + + + + + Target a suite of test cases + + + + + Delegate used by tests that execute code and + capture any thrown exception. + + + + + The Assert class contains a collection of static methods that + implement the most common assertions used in NUnit. + + + + + We don't actually want any instances of this object, but some people + like to inherit from it to add other static methods. Hence, the + protected constructor disallows any instances of this object. + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + Helper for Assert.AreEqual(double expected, double actual, ...) + allowing code generation to work consistently. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Throws a with the message and arguments + that are passed in. This allows a test to be cut short, with a result + of success returned to NUnit. + + The message to initialize the with. + Arguments to be used in formatting the message + + + + Throws a with the message and arguments + that are passed in. This allows a test to be cut short, with a result + of success returned to NUnit. + + The message to initialize the with. + + + + Throws a with the message and arguments + that are passed in. This allows a test to be cut short, with a result + of success returned to NUnit. + + + + + Throws an with the message and arguments + that are passed in. This is used by the other Assert functions. + + The message to initialize the with. + Arguments to be used in formatting the message + + + + Throws an with the message that is + passed in. This is used by the other Assert functions. + + The message to initialize the with. + + + + Throws an . + This is used by the other Assert functions. + + + + + Throws an with the message and arguments + that are passed in. This causes the test to be reported as ignored. + + The message to initialize the with. + Arguments to be used in formatting the message + + + + Throws an with the message that is + passed in. This causes the test to be reported as ignored. + + The message to initialize the with. + + + + Throws an . + This causes the test to be reported as ignored. + + + + + Throws an with the message and arguments + that are passed in. This causes the test to be reported as inconclusive. + + The message to initialize the with. + Arguments to be used in formatting the message + + + + Throws an with the message that is + passed in. This causes the test to be reported as inconclusive. + + The message to initialize the with. + + + + Throws an . + This causes the test to be reported as Inconclusive. + + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint expression to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint expression to be applied + An ActualValueDelegate returning the value to be tested + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint expression to be applied + An ActualValueDelegate returning the value to be tested + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display if the condition is false + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display if the condition is false + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A ThrowsConstraint used in the test + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + Used as a synonym for That in rare cases where a private setter + causes a Visual Basic compilation error. + + A Constraint to be applied + The actual value to test + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + Used as a synonym for That in rare cases where a private setter + causes a Visual Basic compilation error. + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + Used as a synonym for That in rare cases where a private setter + causes a Visual Basic compilation error. + + + This method is provided for use by VB developers needing to test + the value of properties with private setters. + + A Constraint expression to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws a particular exception when called. + + A constraint to be satisfied by the exception + A TestSnippet delegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws a particular exception when called. + + A constraint to be satisfied by the exception + A TestSnippet delegate + The message that will be displayed on failure + + + + Verifies that a delegate throws a particular exception when called. + + A constraint to be satisfied by the exception + A TestSnippet delegate + + + + Verifies that a delegate throws a particular exception when called. + + The exception Type expected + A TestSnippet delegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws a particular exception when called. + + The exception Type expected + A TestSnippet delegate + The message that will be displayed on failure + + + + Verifies that a delegate throws a particular exception when called. + + The exception Type expected + A TestSnippet delegate + + + + Verifies that a delegate throws a particular exception when called. + + Type of the expected exception + A TestSnippet delegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws a particular exception when called. + + Type of the expected exception + A TestSnippet delegate + The message that will be displayed on failure + + + + Verifies that a delegate throws a particular exception when called. + + Type of the expected exception + A TestSnippet delegate + + + + Verifies that a delegate throws an exception when called + and returns it. + + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws an exception when called + and returns it. + + A TestDelegate + The message that will be displayed on failure + + + + Verifies that a delegate throws an exception when called + and returns it. + + A TestDelegate + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + The expected Exception Type + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + The expected Exception Type + A TestDelegate + The message that will be displayed on failure + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + The expected Exception Type + A TestDelegate + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + The expected Exception Type + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + The expected Exception Type + A TestDelegate + The message that will be displayed on failure + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + The expected Exception Type + A TestDelegate + + + + Verifies that a delegate does not throw an exception + + A TestSnippet delegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate does not throw an exception. + + A TestSnippet delegate + The message that will be displayed on failure + + + + Verifies that a delegate does not throw an exception. + + A TestSnippet delegate + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display in case of failure + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display in case of failure + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + + + + Asserts that a condition is false. If the condition is true the method throws + an . + + The evaluated condition + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a condition is false. If the condition is true the method throws + an . + + The evaluated condition + The message to display in case of failure + + + + Asserts that a condition is false. If the condition is true the method throws + an . + + The evaluated condition + + + + Asserts that a condition is false. If the condition is true the method throws + an . + + The evaluated condition + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a condition is false. If the condition is true the method throws + an . + + The evaluated condition + The message to display in case of failure + + + + Asserts that a condition is false. If the condition is true the method throws + an . + + The evaluated condition + + + + Verifies that the object that is passed in is not equal to null + If the object is null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the object that is passed in is not equal to null + If the object is null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + + + + Verifies that the object that is passed in is not equal to null + If the object is null then an + is thrown. + + The object that is to be tested + + + + Verifies that the object that is passed in is not equal to null + If the object is null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the object that is passed in is not equal to null + If the object is null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + + + + Verifies that the object that is passed in is not equal to null + If the object is null then an + is thrown. + + The object that is to be tested + + + + Verifies that the object that is passed in is equal to null + If the object is not null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the object that is passed in is equal to null + If the object is not null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + + + + Verifies that the object that is passed in is equal to null + If the object is not null then an + is thrown. + + The object that is to be tested + + + + Verifies that the object that is passed in is equal to null + If the object is not null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the object that is passed in is equal to null + If the object is not null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + + + + Verifies that the object that is passed in is equal to null + If the object is not null then an + is thrown. + + The object that is to be tested + + + + Verifies that the double that is passed in is an NaN value. + If the object is not NaN then an + is thrown. + + The value that is to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the double that is passed in is an NaN value. + If the object is not NaN then an + is thrown. + + The value that is to be tested + The message to display in case of failure + + + + Verifies that the double that is passed in is an NaN value. + If the object is not NaN then an + is thrown. + + The value that is to be tested + + + + Verifies that the double that is passed in is an NaN value. + If the object is not NaN then an + is thrown. + + The value that is to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the double that is passed in is an NaN value. + If the object is not NaN then an + is thrown. + + The value that is to be tested + The message to display in case of failure + + + + Verifies that the double that is passed in is an NaN value. + If the object is not NaN then an + is thrown. + + The value that is to be tested + + + + Assert that a string is empty - that is equal to string.Empty + + The string to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Assert that a string is empty - that is equal to string.Empty + + The string to be tested + The message to display in case of failure + + + + Assert that a string is empty - that is equal to string.Empty + + The string to be tested + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing ICollection + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing ICollection + The message to display in case of failure + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing ICollection + + + + Assert that a string is not empty - that is not equal to string.Empty + + The string to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Assert that a string is not empty - that is not equal to string.Empty + + The string to be tested + The message to display in case of failure + + + + Assert that a string is not empty - that is not equal to string.Empty + + The string to be tested + + + + Assert that an array, list or other collection is not empty + + An array, list or other collection implementing ICollection + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Assert that an array, list or other collection is not empty + + An array, list or other collection implementing ICollection + The message to display in case of failure + + + + Assert that an array, list or other collection is not empty + + An array, list or other collection implementing ICollection + + + + Assert that a string is either null or equal to string.Empty + + The string to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Assert that a string is either null or equal to string.Empty + + The string to be tested + The message to display in case of failure + + + + Assert that a string is either null or equal to string.Empty + + The string to be tested + + + + Assert that a string is not null or empty + + The string to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Assert that a string is not null or empty + + The string to be tested + The message to display in case of failure + + + + Assert that a string is not null or empty + + The string to be tested + + + + Asserts that an object may be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object may be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + + + + Asserts that an object may be assigned a value of a given Type. + + The expected Type. + The object under examination + + + + Asserts that an object may be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object may be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + + + + Asserts that an object may be assigned a value of a given Type. + + The expected Type. + The object under examination + + + + Asserts that an object may not be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object may not be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + + + + Asserts that an object may not be assigned a value of a given Type. + + The expected Type. + The object under examination + + + + Asserts that an object may not be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object may not be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + + + + Asserts that an object may not be assigned a value of a given Type. + + The expected Type. + The object under examination + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two doubles are equal considering a delta. If the + expected value is infinity then the delta value is ignored. If + they are not equal then an is + thrown. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two doubles are equal considering a delta. If the + expected value is infinity then the delta value is ignored. If + they are not equal then an is + thrown. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + The message to display in case of failure + + + + Verifies that two doubles are equal considering a delta. If the + expected value is infinity then the delta value is ignored. If + they are not equal then an is + thrown. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + + + + Verifies that two doubles are equal considering a delta. If the + expected value is infinity then the delta value is ignored. If + they are not equal then an is + thrown. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two doubles are equal considering a delta. If the + expected value is infinity then the delta value is ignored. If + they are not equal then an is + thrown. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + The message to display in case of failure + + + + Verifies that two doubles are equal considering a delta. If the + expected value is infinity then the delta value is ignored. If + they are not equal then an is + thrown. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + + + + Verifies that two objects are equal. Two objects are considered + equal if both are null, or if both have the same value. NUnit + has special semantics for some object types. + If they are not equal an is thrown. + + The value that is expected + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two objects are equal. Two objects are considered + equal if both are null, or if both have the same value. NUnit + has special semantics for some object types. + If they are not equal an is thrown. + + The value that is expected + The actual value + The message to display in case of failure + + + + Verifies that two objects are equal. Two objects are considered + equal if both are null, or if both have the same value. NUnit + has special semantics for some object types. + If they are not equal an is thrown. + + The value that is expected + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two objects are not equal. Two objects are considered + equal if both are null, or if both have the same value. NUnit + has special semantics for some object types. + If they are equal an is thrown. + + The value that is expected + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two objects are not equal. Two objects are considered + equal if both are null, or if both have the same value. NUnit + has special semantics for some object types. + If they are equal an is thrown. + + The value that is expected + The actual value + The message to display in case of failure + + + + Verifies that two objects are not equal. Two objects are considered + equal if both are null, or if both have the same value. NUnit + has special semantics for some object types. + If they are equal an is thrown. + + The value that is expected + The actual value + + + + Asserts that two objects refer to the same object. If they + are not the same an is thrown. + + The expected object + The actual object + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that two objects refer to the same object. If they + are not the same an is thrown. + + The expected object + The actual object + The message to display in case of failure + + + + Asserts that two objects refer to the same object. If they + are not the same an is thrown. + + The expected object + The actual object + + + + Asserts that two objects do not refer to the same object. If they + are the same an is thrown. + + The expected object + The actual object + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that two objects do not refer to the same object. If they + are the same an is thrown. + + The expected object + The actual object + The message to display in case of failure + + + + Asserts that two objects do not refer to the same object. If they + are the same an is thrown. + + The expected object + The actual object + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Asserts that an object is contained in a list. + + The expected object + The list to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is contained in a list. + + The expected object + The list to be examined + The message to display in case of failure + + + + Asserts that an object is contained in a list. + + The expected object + The list to be examined + + + + Gets the number of assertions executed so far and + resets the counter to zero. + + + + + AssertionHelper is an optional base class for user tests, + allowing the use of shorter names for constraints and + asserts and avoiding conflict with the definition of + , from which it inherits much of its + behavior, in certain mock object frameworks. + + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. Works + identically to Assert.That + + A Constraint to be applied + The actual value to test + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. Works + identically to Assert.That. + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. Works + identically to Assert.That + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint expression to be applied + An ActualValueDelegate returning the value to be tested + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint expression to be applied + An ActualValueDelegate returning the value to be tested + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . Works Identically to Assert.That. + + The evaluated condition + The message to display if the condition is false + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . Works Identically to Assert.That. + + The evaluated condition + The message to display if the condition is false + + + + Asserts that a condition is true. If the condition is false the method throws + an . Works Identically Assert.That. + + The evaluated condition + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A ThrowsConstraint used in the test + + + + Returns a ListMapper based on a collection. + + The original collection + + + + + Provides static methods to express the assumptions + that must be met for a test to give a meaningful + result. If an assumption is not met, the test + should produce an inconclusive result. + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + The actual value to test + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + An ActualValueDelegate returning the value to be tested + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + An ActualValueDelegate returning the value to be tested + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + The actual value to test + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display if the condition is false + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display if the condition is false + + + + Asserts that a condition is true. If the condition is false the + method throws an . + + The evaluated condition + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A ThrowsConstraint used in the test + + + + A set of Assert methods operationg on one or more collections + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + Asserts that all items contained in collection are of the type specified by expectedType. + + IEnumerable containing objects to be considered + System.Type that all objects in collection must be instances of + + + + Asserts that all items contained in collection are of the type specified by expectedType. + + IEnumerable containing objects to be considered + System.Type that all objects in collection must be instances of + The message that will be displayed on failure + + + + Asserts that all items contained in collection are of the type specified by expectedType. + + IEnumerable containing objects to be considered + System.Type that all objects in collection must be instances of + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that all items contained in collection are not equal to null. + + IEnumerable containing objects to be considered + + + + Asserts that all items contained in collection are not equal to null. + + IEnumerable containing objects to be considered + The message that will be displayed on failure + + + + Asserts that all items contained in collection are not equal to null. + + IEnumerable of objects to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Ensures that every object contained in collection exists within the collection + once and only once. + + IEnumerable of objects to be considered + + + + Ensures that every object contained in collection exists within the collection + once and only once. + + IEnumerable of objects to be considered + The message that will be displayed on failure + + + + Ensures that every object contained in collection exists within the collection + once and only once. + + IEnumerable of objects to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that expected and actual are exactly equal. The collections must have the same count, + and contain the exact same objects in the same order. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + + + + Asserts that expected and actual are exactly equal. The collections must have the same count, + and contain the exact same objects in the same order. + If comparer is not null then it will be used to compare the objects. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The IComparer to use in comparing objects from each IEnumerable + + + + Asserts that expected and actual are exactly equal. The collections must have the same count, + and contain the exact same objects in the same order. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + + + + Asserts that expected and actual are exactly equal. The collections must have the same count, + and contain the exact same objects in the same order. + If comparer is not null then it will be used to compare the objects. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The IComparer to use in comparing objects from each IEnumerable + The message that will be displayed on failure + + + + Asserts that expected and actual are exactly equal. The collections must have the same count, + and contain the exact same objects in the same order. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that expected and actual are exactly equal. The collections must have the same count, + and contain the exact same objects in the same order. + If comparer is not null then it will be used to compare the objects. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The IComparer to use in comparing objects from each IEnumerable + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + + + + Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + + + + Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that expected and actual are not exactly equal. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + + + + Asserts that expected and actual are not exactly equal. + If comparer is not null then it will be used to compare the objects. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The IComparer to use in comparing objects from each IEnumerable + + + + Asserts that expected and actual are not exactly equal. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + + + + Asserts that expected and actual are not exactly equal. + If comparer is not null then it will be used to compare the objects. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The IComparer to use in comparing objects from each IEnumerable + The message that will be displayed on failure + + + + Asserts that expected and actual are not exactly equal. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that expected and actual are not exactly equal. + If comparer is not null then it will be used to compare the objects. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The IComparer to use in comparing objects from each IEnumerable + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that expected and actual are not equivalent. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + + + + Asserts that expected and actual are not equivalent. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + + + + Asserts that expected and actual are not equivalent. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that collection contains actual as an item. + + IEnumerable of objects to be considered + Object to be found within collection + + + + Asserts that collection contains actual as an item. + + IEnumerable of objects to be considered + Object to be found within collection + The message that will be displayed on failure + + + + Asserts that collection contains actual as an item. + + IEnumerable of objects to be considered + Object to be found within collection + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that collection does not contain actual as an item. + + IEnumerable of objects to be considered + Object that cannot exist within collection + + + + Asserts that collection does not contain actual as an item. + + IEnumerable of objects to be considered + Object that cannot exist within collection + The message that will be displayed on failure + + + + Asserts that collection does not contain actual as an item. + + IEnumerable of objects to be considered + Object that cannot exist within collection + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that superset is not a subject of subset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + + + + Asserts that superset is not a subject of subset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + The message that will be displayed on failure + + + + Asserts that superset is not a subject of subset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that superset is a subset of subset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + + + + Asserts that superset is a subset of subset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + The message that will be displayed on failure + + + + Asserts that superset is a subset of subset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing IEnumerable + The message to be displayed on failure + Arguments to be used in formatting the message + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing IEnumerable + The message to be displayed on failure + + + + Assert that an array,list or other collection is empty + + An array, list or other collection implementing IEnumerable + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing IEnumerable + The message to be displayed on failure + Arguments to be used in formatting the message + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing IEnumerable + The message to be displayed on failure + + + + Assert that an array,list or other collection is empty + + An array, list or other collection implementing IEnumerable + + + + Assert that an array, list or other collection is ordered + + An array, list or other collection implementing IEnumerable + The message to be displayed on failure + Arguments to be used in formatting the message + + + + Assert that an array, list or other collection is ordered + + An array, list or other collection implementing IEnumerable + The message to be displayed on failure + + + + Assert that an array, list or other collection is ordered + + An array, list or other collection implementing IEnumerable + + + + Assert that an array, list or other collection is ordered + + An array, list or other collection implementing IEnumerable + A custom comparer to perform the comparisons + The message to be displayed on failure + Arguments to be used in formatting the message + + + + Assert that an array, list or other collection is ordered + + An array, list or other collection implementing IEnumerable + A custom comparer to perform the comparisons + The message to be displayed on failure + + + + Assert that an array, list or other collection is ordered + + An array, list or other collection implementing IEnumerable + A custom comparer to perform the comparisons + + + + Static helper class used in the constraint-based syntax + + + + + Creates a new SubstringConstraint + + The value of the substring + A SubstringConstraint + + + + Creates a new CollectionContainsConstraint. + + The item that should be found. + A new CollectionContainsConstraint + + + + Summary description for DirectoryAssert + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + We don't actually want any instances of this object, but some people + like to inherit from it to add other static methods. Hence, the + protected constructor disallows any instances of this object. + + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A directory containing the value that is expected + A directory containing the actual value + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A directory containing the value that is expected + A directory containing the actual value + The message to display if directories are not equal + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A directory containing the value that is expected + A directory containing the actual value + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A directory path string containing the value that is expected + A directory path string containing the actual value + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A directory path string containing the value that is expected + A directory path string containing the actual value + The message to display if directories are not equal + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A directory path string containing the value that is expected + A directory path string containing the actual value + + + + Asserts that two directories are not equal. If they are equal + an is thrown. + + A directory containing the value that is expected + A directory containing the actual value + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Asserts that two directories are not equal. If they are equal + an is thrown. + + A directory containing the value that is expected + A directory containing the actual value + The message to display if directories are not equal + + + + Asserts that two directories are not equal. If they are equal + an is thrown. + + A directory containing the value that is expected + A directory containing the actual value + + + + Asserts that two directories are not equal. If they are equal + an is thrown. + + A directory path string containing the value that is expected + A directory path string containing the actual value + The message to display if directories are equal + Arguments to be used in formatting the message + + + + Asserts that two directories are not equal. If they are equal + an is thrown. + + A directory path string containing the value that is expected + A directory path string containing the actual value + The message to display if directories are equal + + + + Asserts that two directories are not equal. If they are equal + an is thrown. + + A directory path string containing the value that is expected + A directory path string containing the actual value + + + + Asserts that the directory is empty. If it is not empty + an is thrown. + + A directory to search + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Asserts that the directory is empty. If it is not empty + an is thrown. + + A directory to search + The message to display if directories are not equal + + + + Asserts that the directory is empty. If it is not empty + an is thrown. + + A directory to search + + + + Asserts that the directory is empty. If it is not empty + an is thrown. + + A directory to search + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Asserts that the directory is empty. If it is not empty + an is thrown. + + A directory to search + The message to display if directories are not equal + + + + Asserts that the directory is empty. If it is not empty + an is thrown. + + A directory to search + + + + Asserts that the directory is not empty. If it is empty + an is thrown. + + A directory to search + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Asserts that the directory is not empty. If it is empty + an is thrown. + + A directory to search + The message to display if directories are not equal + + + + Asserts that the directory is not empty. If it is empty + an is thrown. + + A directory to search + + + + Asserts that the directory is not empty. If it is empty + an is thrown. + + A directory to search + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Asserts that the directory is not empty. If it is empty + an is thrown. + + A directory to search + The message to display if directories are not equal + + + + Asserts that the directory is not empty. If it is empty + an is thrown. + + A directory to search + + + + Asserts that path contains actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + Arguments to be used in formatting the message + + + + Asserts that path contains actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + + + + Asserts that path contains actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + + + + Asserts that path contains actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + Arguments to be used in formatting the message + + + + Asserts that path contains actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + + + + Asserts that path contains actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + + + + Asserts that path does not contain actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + Arguments to be used in formatting the message + + + + Asserts that path does not contain actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + + + + Asserts that path does not contain actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + + + + Asserts that path does not contain actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + Arguments to be used in formatting the message + + + + Asserts that path does not contain actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + + + + Asserts that path does not contain actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + + + + Summary description for FileAssert. + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + We don't actually want any instances of this object, but some people + like to inherit from it to add other static methods. Hence, the + protected constructor disallows any instances of this object. + + + + + Verifies that two Streams are equal. Two Streams are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + The expected Stream + The actual Stream + The message to display if Streams are not equal + Arguments to be used in formatting the message + + + + Verifies that two Streams are equal. Two Streams are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + The expected Stream + The actual Stream + The message to display if objects are not equal + + + + Verifies that two Streams are equal. Two Streams are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + The expected Stream + The actual Stream + + + + Verifies that two files are equal. Two files are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A file containing the value that is expected + A file containing the actual value + The message to display if Streams are not equal + Arguments to be used in formatting the message + + + + Verifies that two files are equal. Two files are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A file containing the value that is expected + A file containing the actual value + The message to display if objects are not equal + + + + Verifies that two files are equal. Two files are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A file containing the value that is expected + A file containing the actual value + + + + Verifies that two files are equal. Two files are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + The path to a file containing the value that is expected + The path to a file containing the actual value + The message to display if Streams are not equal + Arguments to be used in formatting the message + + + + Verifies that two files are equal. Two files are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + The path to a file containing the value that is expected + The path to a file containing the actual value + The message to display if objects are not equal + + + + Verifies that two files are equal. Two files are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + The path to a file containing the value that is expected + The path to a file containing the actual value + + + + Asserts that two Streams are not equal. If they are equal + an is thrown. + + The expected Stream + The actual Stream + The message to be displayed when the two Stream are the same. + Arguments to be used in formatting the message + + + + Asserts that two Streams are not equal. If they are equal + an is thrown. + + The expected Stream + The actual Stream + The message to be displayed when the Streams are the same. + + + + Asserts that two Streams are not equal. If they are equal + an is thrown. + + The expected Stream + The actual Stream + + + + Asserts that two files are not equal. If they are equal + an is thrown. + + A file containing the value that is expected + A file containing the actual value + The message to display if Streams are not equal + Arguments to be used in formatting the message + + + + Asserts that two files are not equal. If they are equal + an is thrown. + + A file containing the value that is expected + A file containing the actual value + The message to display if objects are not equal + + + + Asserts that two files are not equal. If they are equal + an is thrown. + + A file containing the value that is expected + A file containing the actual value + + + + Asserts that two files are not equal. If they are equal + an is thrown. + + The path to a file containing the value that is expected + The path to a file containing the actual value + The message to display if Streams are not equal + Arguments to be used in formatting the message + + + + Asserts that two files are not equal. If they are equal + an is thrown. + + The path to a file containing the value that is expected + The path to a file containing the actual value + The message to display if objects are not equal + + + + Asserts that two files are not equal. If they are equal + an is thrown. + + The path to a file containing the value that is expected + The path to a file containing the actual value + + + + GlobalSettings is a place for setting default values used + by the framework in performing asserts. + + + + + Default tolerance for floating point equality + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding only if a specified number of them succeed. + + + + + Returns a new PropertyConstraintExpression, which will either + test for the existence of the named property on the object + being tested or apply any following constraint to that property. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if at least one of them succeeds. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them fail. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Length property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Count property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Message property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the InnerException property of the object being tested. + + + + + Interface implemented by a user fixture in order to + validate any expected exceptions. It is only called + for test methods marked with the ExpectedException + attribute. + + + + + Method to handle an expected exception + + The exception to be handled + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a constraint that tests two items for equality + + + + + Returns a constraint that tests that two references are the same object + + + + + Returns a constraint that tests whether the + actual value is greater than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a collection containing the same elements as the + collection supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a subset of the collection supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that tests whether the path provided + is the same as an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the actual value falls + within a specified range. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + Returns a constraint that tests for null + + + + + Returns a constraint that tests for True + + + + + Returns a constraint that tests for False + + + + + Returns a constraint that tests for a positive value + + + + + Returns a constraint that tests for a negative value + + + + + Returns a constraint that tests for NaN + + + + + Returns a constraint that tests for empty + + + + + Returns a constraint that tests whether a collection + contains all unique items. + + + + + Returns a constraint that tests whether an object graph is serializable in binary format. + + + + + Returns a constraint that tests whether an object graph is serializable in xml format. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + The Iz class is a synonym for Is intended for use in VB, + which regards Is as a keyword. + + + + + The List class is a helper class with properties and methods + that supply a number of constraints used with lists and collections. + + + + + List.Map returns a ListMapper, which can be used to map + the original collection to another collection. + + + + + + + ListMapper is used to transform a collection used as an actual argument + producing another collection to be used in the assertion. + + + + + Construct a ListMapper based on a collection + + The collection to be transformed + + + + Produces a collection containing all the values of a property + + The collection of property values + + + + + Randomizer returns a set of random values in a repeatable + way, to allow re-running of tests if necessary. + + + + + Get a randomizer for a particular member, returning + one that has already been created if it exists. + This ensures that the same values are generated + each time the tests are reloaded. + + + + + Get a randomizer for a particular parameter, returning + one that has already been created if it exists. + This ensures that the same values are generated + each time the tests are reloaded. + + + + + Construct a randomizer using a random seed + + + + + Construct a randomizer using a specified seed + + + + + Return an array of random doubles between 0.0 and 1.0. + + + + + + + Return an array of random doubles with values in a specified range. + + + + + Return an array of random ints with values in a specified range. + + + + + Get a random seed for use in creating a randomizer. + + + + + The SpecialValue enum is used to represent TestCase arguments + that cannot be used as arguments to an Attribute. + + + + + Null represents a null value, which cannot be used as an + argument to an attriute under .NET 1.x + + + + + Basic Asserts on strings. + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + + + + Asserts that a string is not found within another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + + + + Asserts that a string starts with another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string starts with another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string starts with another string. + + The expected string + The string to be examined + + + + Asserts that a string does not start with another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string does not start with another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string does not start with another string. + + The expected string + The string to be examined + + + + Asserts that a string ends with another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string ends with another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string ends with another string. + + The expected string + The string to be examined + + + + Asserts that a string does not end with another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string does not end with another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string does not end with another string. + + The expected string + The string to be examined + + + + Asserts that two strings are equal, without regard to case. + + The expected string + The actual string + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that two strings are equal, without regard to case. + + The expected string + The actual string + The message to display in case of failure + + + + Asserts that two strings are equal, without regard to case. + + The expected string + The actual string + + + + Asserts that two strings are not equal, without regard to case. + + The expected string + The actual string + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that two strings are Notequal, without regard to case. + + The expected string + The actual string + The message to display in case of failure + + + + Asserts that two strings are not equal, without regard to case. + + The expected string + The actual string + + + + Asserts that a string matches an expected regular expression pattern. + + The regex pattern to be matched + The actual string + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string matches an expected regular expression pattern. + + The regex pattern to be matched + The actual string + The message to display in case of failure + + + + Asserts that a string matches an expected regular expression pattern. + + The regex pattern to be matched + The actual string + + + + Asserts that a string does not match an expected regular expression pattern. + + The regex pattern to be used + The actual string + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string does not match an expected regular expression pattern. + + The regex pattern to be used + The actual string + The message to display in case of failure + + + + Asserts that a string does not match an expected regular expression pattern. + + The regex pattern to be used + The actual string + + + + The TestCaseData class represents a set of arguments + and other parameter info to be used for a parameterized + test case. It provides a number of instance modifiers + for use in initializing the test case. + + Note: Instance modifiers are getters that return + the same instance after modifying it's state. + + + + + The argument list to be provided to the test + + + + + The expected result to be returned + + + + + Set to true if this has an expected result + + + + + The expected exception Type + + + + + The FullName of the expected exception + + + + + The name to be used for the test + + + + + The description of the test + + + + + A dictionary of properties, used to add information + to tests without requiring the class to change. + + + + + If true, indicates that the test case is to be ignored + + + + + If true, indicates that the test case is marked explicit + + + + + The reason for ignoring a test case + + + + + Initializes a new instance of the class. + + The arguments. + + + + Initializes a new instance of the class. + + The argument. + + + + Initializes a new instance of the class. + + The first argument. + The second argument. + + + + Initializes a new instance of the class. + + The first argument. + The second argument. + The third argument. + + + + Sets the expected result for the test + + The expected result + A modified TestCaseData + + + + Sets the expected exception type for the test + + Type of the expected exception. + The modified TestCaseData instance + + + + Sets the expected exception type for the test + + FullName of the expected exception. + The modified TestCaseData instance + + + + Sets the name of the test case + + The modified TestCaseData instance + + + + Sets the description for the test case + being constructed. + + The description. + The modified TestCaseData instance. + + + + Applies a category to the test + + + + + + + Applies a named property to the test + + + + + + + + Applies a named property to the test + + + + + + + + Applies a named property to the test + + + + + + + + Ignores this TestCase. + + + + + + Ignores this TestCase, specifying the reason. + + The reason. + + + + + Marks this TestCase as Explicit + + + + + + Marks this TestCase as Explicit, specifying the reason. + + The reason. + + + + + Gets the argument list to be provided to the test + + + + + Gets the expected result + + + + + Returns true if the result has been set + + + + + Gets the expected exception Type + + + + + Gets the FullName of the expected exception + + + + + Gets the name to be used for the test + + + + + Gets the description of the test + + + + + Gets a value indicating whether this is ignored. + + true if ignored; otherwise, false. + + + + Gets a value indicating whether this is explicit. + + true if explicit; otherwise, false. + + + + Gets the ignore reason. + + The ignore reason. + + + + Gets a list of categories associated with this test. + + + + + Gets the property dictionary for this test + + + + + Provide the context information of the current test + + + + + Constructs a TestContext using the provided context dictionary + + A context dictionary + + + + Get the current test context. This is created + as needed. The user may save the context for + use within a test, but it should not be used + outside the test for which it is created. + + + + + Gets a TestAdapter representing the currently executing test in this context. + + + + + Gets a ResultAdapter representing the current result for the test + executing in this context. + + + + + Gets the directory containing the current test assembly. + + + + + Gets the directory to be used for outputing files created + by this test run. + + + + + TestAdapter adapts a Test for consumption by + the user test code. + + + + + Constructs a TestAdapter for this context + + The context dictionary + + + + The name of the test. + + + + + The FullName of the test + + + + + The properties of the test. + + + + + ResultAdapter adapts a TestResult for consumption by + the user test code. + + + + + Construct a ResultAdapter for a context + + The context holding the result + + + + The TestState of current test. This maps to the ResultState + used in nunit.core and is subject to change in the future. + + + + + The TestStatus of current test. This enum will be used + in future versions of NUnit and so is to be preferred + to the TestState value. + + + + + Provides details about a test + + + + + Creates an instance of TestDetails + + The fixture that the test is a member of, if available. + The method that implements the test, if available. + The full name of the test. + A string representing the type of test, e.g. "Test Case". + Indicates if the test represents a suite of tests. + + + + The fixture that the test is a member of, if available. + + + + + The method that implements the test, if available. + + + + + The full name of the test. + + + + + A string representing the type of test, e.g. "Test Case". + + + + + Indicates if the test represents a suite of tests. + + + + + The ResultState enum indicates the result of running a test + + + + + The result is inconclusive + + + + + The test was not runnable. + + + + + The test has been skipped. + + + + + The test has been ignored. + + + + + The test succeeded + + + + + The test failed + + + + + The test encountered an unexpected exception + + + + + The test was cancelled by the user + + + + + The TestStatus enum indicates the result of running a test + + + + + The test was inconclusive + + + + + The test has skipped + + + + + The test succeeded + + + + + The test failed + + + + + Helper class with static methods used to supply constraints + that operate on strings. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that fails if the actual + value matches the pattern supplied as an argument. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + TextMessageWriter writes constraint descriptions and messages + in displayable form as a text stream. It tailors the display + of individual message components to form the standard message + format of NUnit assertion failure messages. + + + + + Prefix used for the expected value line of a message + + + + + Prefix used for the actual value line of a message + + + + + Length of a message prefix + + + + + Construct a TextMessageWriter + + + + + Construct a TextMessageWriter, specifying a user message + and optional formatting arguments. + + + + + + + Method to write single line message with optional args, usually + written to precede the general failure message, at a givel + indentation level. + + The indentation level of the message + The message to be written + Any arguments used in formatting the message + + + + Display Expected and Actual lines for a constraint. This + is called by MessageWriter's default implementation of + WriteMessageTo and provides the generic two-line display. + + The constraint that failed + + + + Display Expected and Actual lines for given values. This + method may be called by constraints that need more control over + the display of actual and expected values than is provided + by the default implementation. + + The expected value + The actual value causing the failure + + + + Display Expected and Actual lines for given values, including + a tolerance value on the expected line. + + The expected value + The actual value causing the failure + The tolerance within which the test was made + + + + Display the expected and actual string values on separate lines. + If the mismatch parameter is >=0, an additional line is displayed + line containing a caret that points to the mismatch point. + + The expected string value + The actual string value + The point at which the strings don't match or -1 + If true, case is ignored in string comparisons + If true, clip the strings to fit the max line length + + + + Writes the text for a connector. + + The connector. + + + + Writes the text for a predicate. + + The predicate. + + + + Write the text for a modifier. + + The modifier. + + + + Writes the text for an expected value. + + The expected value. + + + + Writes the text for an actual value. + + The actual value. + + + + Writes the text for a generalized value. + + The value. + + + + Writes the text for a collection value, + starting at a particular point, to a max length + + The collection containing elements to write. + The starting point of the elements to write + The maximum number of elements to write + + + + Write the generic 'Expected' line for a constraint + + The constraint that failed + + + + Write the generic 'Expected' line for a given value + + The expected value + + + + Write the generic 'Expected' line for a given value + and tolerance. + + The expected value + The tolerance within which the test was made + + + + Write the generic 'Actual' line for a constraint + + The constraint for which the actual value is to be written + + + + Write the generic 'Actual' line for a given value + + The actual value causing a failure + + + + Gets or sets the maximum line length for this writer + + + + + Helper class with properties and methods that supply + constraints that operate on exceptions. + + + + + Creates a constraint specifying the exact type of exception expected + + + + + Creates a constraint specifying the exact type of exception expected + + + + + Creates a constraint specifying the type of exception expected + + + + + Creates a constraint specifying the type of exception expected + + + + + Creates a constraint specifying an expected exception + + + + + Creates a constraint specifying an exception with a given InnerException + + + + + Creates a constraint specifying an expected TargetInvocationException + + + + + Creates a constraint specifying an expected TargetInvocationException + + + + + Creates a constraint specifying an expected TargetInvocationException + + + + + Creates a constraint specifying that no exception is thrown + + + + diff --git a/container/src/packages/NUnit.2.6.1/license.txt b/container/src/packages/NUnit.2.6.1/license.txt new file mode 100644 index 0000000..530a6e0 --- /dev/null +++ b/container/src/packages/NUnit.2.6.1/license.txt @@ -0,0 +1,15 @@ +Copyright 2002-2012 Charlie Poole +Copyright 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov +Copyright 2000-2002 Philip A. Craig + +This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment (see the following) in the product documentation is required. + +Portions Copyright 2002-2012 Charlie Poole or Copyright 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright 2000-2002 Philip A. Craig + +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source distribution. diff --git a/container/src/packages/repositories.config b/container/src/packages/repositories.config new file mode 100644 index 0000000..5957287 --- /dev/null +++ b/container/src/packages/repositories.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/hollywood/.gitignore b/hollywood/.gitignore new file mode 100644 index 0000000..2f7b39f --- /dev/null +++ b/hollywood/.gitignore @@ -0,0 +1,40 @@ +#ignore thumbnails created by windows +Thumbs.db +#Ignore files build by Visual Studio +*.obj +*.pdb +*.user +*.aps +*.pch +*.vspscc +*_i.c +*_p.c +*.ncb +*.suo +*.tlb +*.tlh +*.bak +*.cache +*.ilk +*.log +[Bb]in +[Dd]ebug +[Cc]lientBin*/ +*.lib +*.sbr +obj/ +[Rr]elease*/ +_ReSharper*/ +[Tt]est[Rr]esult* +deploy.config +*.vsmdi +*.pidb +*.userprefs +*.testrunconfig +*.testsettings +publish.xml +TestResults +$SSH_ENV +src/.DS_Store +src/.nuget/NuGet.Config +*.nupkg diff --git a/hollywood/.nuget/NuGet.Config b/hollywood/.nuget/NuGet.Config new file mode 100644 index 0000000..67f8ea0 --- /dev/null +++ b/hollywood/.nuget/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/hollywood/.nuget/NuGet.targets b/hollywood/.nuget/NuGet.targets new file mode 100644 index 0000000..bda5bea --- /dev/null +++ b/hollywood/.nuget/NuGet.targets @@ -0,0 +1,143 @@ + + + + $(MSBuildProjectDirectory)\..\ + + + false + + + false + + + true + + + false + + + + + + + + + + $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) + $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) + $([System.IO.Path]::Combine($(SolutionDir), "packages")) + + + + + $(SolutionDir).nuget + packages.config + $(SolutionDir)packages + + + + + $(NuGetToolsPath)\nuget.exe + @(PackageSource) + + "$(NuGetExePath)" + mono --runtime=v4.0.30319 $(NuGetExePath) + + $(TargetDir.Trim('\\')) + + -RequireConsent + + $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(RequireConsentSwitch) -o "$(PackagesDir)" + $(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols + + + + RestorePackages; + $(BuildDependsOn); + + + + + $(BuildDependsOn); + BuildPackage; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hollywood/LICENSE.md b/hollywood/LICENSE.md new file mode 100644 index 0000000..73f277a --- /dev/null +++ b/hollywood/LICENSE.md @@ -0,0 +1,15 @@ +hollywood (http://github.com/danielcrenna/hollywood) +-------------------------------------- +Copyright (c) 2012 Conatus Creative Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/hollywood/README.md b/hollywood/README.md new file mode 100644 index 0000000..5fc55d8 --- /dev/null +++ b/hollywood/README.md @@ -0,0 +1,56 @@ +# hollywood +## A simple little tool for launching + +``` +PM> Install-Package hollywood +``` + +### Introduction +This is a little bit of code for making working on a site in "stealth mode" easier. +It is of course inspired by 37signals' definition of a [hollywood launch](http://gettingreal.37signals.com/ch13_Hollywood_Launch.php). + +### Features + +* Simple to set up +* Use it to do continuous deployment while maintaining a teaser page viewable to the public + +### Usage +* First, create a view folder called 'Launch' and add an index view; this will be your teaser page: +/Views/Launch/Index.cshtml +```html +

Your princess is in another castle. Unless...

+``` + +* Next, add `web.config` settings to control prelaunch. Typically you want prelaunch turned off by default, and on in `Release`: + +_Web.config_ + +```xml + + + + +``` + +_Web.Release.config_ + +```xml + + + +``` + +* Finally, opt-in to the feature by calling this on application startup: + +_Global.asax.cs_ + +```csharp +using hollywood; +Launch.InstallPrelaunch(); +Launch.AddAllowedUrls("/privacy", "/terms"); +``` + +* With everything installed, public-facing users will see your "launch page", while people in the know can pass `?token=allyourbase` into the page, and from then on access your site normally. + +#### TODO +Right now, access is provided through a single token mechanism. It should grant by email address, send beta invites, etc. diff --git a/hollywood/hollywood.nuspec b/hollywood/hollywood.nuspec new file mode 100644 index 0000000..234c8aa --- /dev/null +++ b/hollywood/hollywood.nuspec @@ -0,0 +1,19 @@ + + + + hollywood + 0.0.2 + Daniel Crenna + Daniel Crenna + A little tool for launches. + A little tool for launches, for ASP.NET MVC 4. + en-US + http://github.com/danielcrenna/hollywood + https://github.com/danielcrenna/hollywood/LICENSE.md + http://apitize.com.s3.amazonaws.com/logo_hollywood.png + launch prelaunch hollywood + + + + + \ No newline at end of file diff --git a/hollywood/pack-nuget.bat b/hollywood/pack-nuget.bat new file mode 100644 index 0000000..22ad28f --- /dev/null +++ b/hollywood/pack-nuget.bat @@ -0,0 +1,3 @@ +copy LICENSE.md bin +copy README.md bin +".nuget\NuGet.exe" pack hollywood.nuspec -BasePath bin \ No newline at end of file diff --git a/hollywood/push-nuget.bat b/hollywood/push-nuget.bat new file mode 100644 index 0000000..0be3ec7 --- /dev/null +++ b/hollywood/push-nuget.bat @@ -0,0 +1 @@ +".nuget\NuGet.exe" push hollywood.0.0.2.nupkg \ No newline at end of file diff --git a/hollywood/src/hollywood.Example/App_Start/FilterConfig.cs b/hollywood/src/hollywood.Example/App_Start/FilterConfig.cs new file mode 100644 index 0000000..b7ea938 --- /dev/null +++ b/hollywood/src/hollywood.Example/App_Start/FilterConfig.cs @@ -0,0 +1,13 @@ +using System.Web; +using System.Web.Mvc; + +namespace hollywood.Example +{ + public class FilterConfig + { + public static void RegisterGlobalFilters(GlobalFilterCollection filters) + { + filters.Add(new HandleErrorAttribute()); + } + } +} \ No newline at end of file diff --git a/hollywood/src/hollywood.Example/App_Start/RouteConfig.cs b/hollywood/src/hollywood.Example/App_Start/RouteConfig.cs new file mode 100644 index 0000000..d21f114 --- /dev/null +++ b/hollywood/src/hollywood.Example/App_Start/RouteConfig.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using System.Web.Routing; + +namespace hollywood.Example +{ + public class RouteConfig + { + public static void RegisterRoutes(RouteCollection routes) + { + routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); + + routes.MapRoute( + name: "Default", + url: "{controller}/{action}/{id}", + defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } + ); + } + } +} \ No newline at end of file diff --git a/hollywood/src/hollywood.Example/App_Start/WebApiConfig.cs b/hollywood/src/hollywood.Example/App_Start/WebApiConfig.cs new file mode 100644 index 0000000..e3e6ca7 --- /dev/null +++ b/hollywood/src/hollywood.Example/App_Start/WebApiConfig.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web.Http; + +namespace hollywood.Example +{ + public static class WebApiConfig + { + public static void Register(HttpConfiguration config) + { + config.Routes.MapHttpRoute( + name: "DefaultApi", + routeTemplate: "api/{controller}/{id}", + defaults: new { id = RouteParameter.Optional } + ); + } + } +} diff --git a/hollywood/src/hollywood.Example/Content/Site.css b/hollywood/src/hollywood.Example/Content/Site.css new file mode 100644 index 0000000..be14409 --- /dev/null +++ b/hollywood/src/hollywood.Example/Content/Site.css @@ -0,0 +1,756 @@ +html { + background-color: #e2e2e2; + margin: 0; + padding: 0; +} + +body { + background-color: #fff; + border-top: solid 10px #000; + color: #333; + font-size: .85em; + font-family: "Segoe UI", Verdana, Helvetica, Sans-Serif; + margin: 0; + padding: 0; +} + +a { + color: #333; + outline: none; + padding-left: 3px; + padding-right: 3px; + text-decoration: underline; +} + + a:link, a:visited, + a:active, a:hover { + color: #333; + } + + a:hover { + background-color: #c7d1d6; + } + +header, footer, hgroup, +nav, section { + display: block; +} + +mark { + background-color: #a6dbed; + padding-left: 5px; + padding-right: 5px; +} + +.float-left { + float: left; +} + +.float-right { + float: right; +} + +.clear-fix:after { + content: "."; + clear: both; + display: block; + height: 0; + visibility: hidden; +} + +h1, h2, h3, +h4, h5, h6 { + color: #000; + margin-bottom: 0; + padding-bottom: 0; +} + +h1 { + font-size: 2em; +} + +h2 { + font-size: 1.75em; +} + +h3 { + font-size: 1.2em; +} + +h4 { + font-size: 1.1em; +} + +h5, h6 { + font-size: 1em; +} + + h5 a:link, h5 a:visited, h5 a:active { + padding: 0; + text-decoration: none; + } + + +/* main layout +----------------------------------------------------------*/ +.content-wrapper { + margin: 0 auto; + max-width: 960px; +} + +#body { + background-color: #efeeef; + clear: both; + padding-bottom: 35px; +} + + .main-content { + background: url("../Images/accent.png") no-repeat; + padding-left: 10px; + padding-top: 30px; + } + + .featured + .main-content { + background: url("../Images/heroAccent.png") no-repeat; + } + +header .content-wrapper { + padding-top: 20px; +} + +footer { + clear: both; + background-color: #e2e2e2; + font-size: .8em; + height: 100px; +} + + +/* site title +----------------------------------------------------------*/ +.site-title { + color: #c8c8c8; + font-family: Rockwell, Consolas, "Courier New", Courier, monospace; + font-size: 2.3em; + margin: 0; +} + +.site-title a, .site-title a:hover, .site-title a:active { + background: none; + color: #c8c8c8; + outline: none; + text-decoration: none; +} + + +/* login +----------------------------------------------------------*/ +#login { + display: block; + font-size: .85em; + margin: 0 0 10px; + text-align: right; +} + + #login a { + background-color: #d3dce0; + margin-left: 10px; + margin-right: 3px; + padding: 2px 3px; + text-decoration: none; + } + + #login a.username { + background: none; + margin: 0; + padding: 0; + text-decoration: underline; + } + + #login ul { + margin: 0; + } + + #login li { + display: inline; + list-style: none; + } + + +/* menu +----------------------------------------------------------*/ +ul#menu { + font-size: 1.3em; + font-weight: 600; + margin: 0 0 5px; + padding: 0; + text-align: right; +} + + ul#menu li { + display: inline; + list-style: none; + padding-left: 15px; + } + + ul#menu li a { + background: none; + color: #999; + text-decoration: none; + } + + ul#menu li a:hover { + color: #333; + text-decoration: none; + } + + +/* page elements +----------------------------------------------------------*/ +/* featured */ +.featured { + background-color: #fff; +} + + .featured .content-wrapper { + background-color: #7ac0da; + background-image: -ms-linear-gradient(left, #7ac0da 0%, #a4d4e6 100%); + background-image: -o-linear-gradient(left, #7ac0da 0%, #a4d4e6 100%); + background-image: -webkit-gradient(linear, left top, right top, color-stop(0, #7ac0da), color-stop(1, #a4d4e6)); + background-image: -webkit-linear-gradient(left, #7ac0da 0%, #a4d4e6 100%); + background-image: linear-gradient(left, #7ac0da 0%, #a4d4e6 100%); + color: #3e5667; + padding: 20px 40px 30px 40px; + } + + .featured hgroup.title h1, .featured hgroup.title h2 { + color: #fff; + } + + .featured p { + font-size: 1.1em; + } + +/* page titles */ +hgroup.title { + margin-bottom: 10px; +} + +hgroup.title h1, hgroup.title h2 { + display: inline; +} + +hgroup.title h2 { + font-weight: normal; + margin-left: 3px; +} + +/* features */ +section.feature { + width: 300px; + float: left; + padding: 10px; +} + +/* ordered list */ +ol.round { + list-style-type: none; + padding-left: 0; +} + + ol.round li { + margin: 25px 0; + padding-left: 45px; + } + + ol.round li.zero { + background: url("../Images/orderedList0.png") no-repeat; + } + + ol.round li.one { + background: url("../Images/orderedList1.png") no-repeat; + } + + ol.round li.two { + background: url("../Images/orderedList2.png") no-repeat; + } + + ol.round li.three { + background: url("../Images/orderedList3.png") no-repeat; + } + + ol.round li.four { + background: url("../Images/orderedList4.png") no-repeat; + } + + ol.round li.five { + background: url("../Images/orderedList5.png") no-repeat; + } + + ol.round li.six { + background: url("../Images/orderedList6.png") no-repeat; + } + + ol.round li.seven { + background: url("../Images/orderedList7.png") no-repeat; + } + + ol.round li.eight { + background: url("../Images/orderedList8.png") no-repeat; + } + + ol.round li.nine { + background: url("../Images/orderedList9.png") no-repeat; + } + +/* content */ +article { + float: left; + width: 70%; +} + +aside { + float: right; + width: 25%; +} + + aside ul { + list-style: none; + padding: 0; + } + + aside ul li { + background: url("../Images/bullet.png") no-repeat 0 50%; + padding: 2px 0 2px 20px; + } + +.label { + font-weight: 700; +} + +/* login page */ +#loginForm { + border-right: solid 2px #c8c8c8; + float: left; + width: 55%; +} + + #loginForm .validation-error { + display: block; + margin-left: 15px; + } + + #loginForm .validation-summary-errors ul { + margin: 0; + padding: 0; + } + + #loginForm .validation-summary-errors li { + display: inline; + list-style: none; + margin: 0; + } + + #loginForm input { + width: 250px; + } + + #loginForm input[type="checkbox"], + #loginForm input[type="submit"], + #loginForm input[type="button"], + #loginForm button { + width: auto; + } + +#socialLoginForm { + margin-left: 40px; + float: left; + width: 40%; +} + + #socialLoginForm h2 { + margin-bottom: 5px; + } + +#socialLoginList button { + margin-bottom: 12px; +} + +#logoutForm { + display: inline; +} + +/* contact */ +.contact h3 { + font-size: 1.2em; +} + +.contact p { + margin: 5px 0 0 10px; +} + +.contact iframe { + border: 1px solid #333; + margin: 5px 0 0 10px; +} + +/* forms */ +fieldset { + border: none; + margin: 0; + padding: 0; +} + + fieldset legend { + display: none; + } + + fieldset ol { + padding: 0; + list-style: none; + } + + fieldset ol li { + padding-bottom: 5px; + } + +label { + display: block; + font-size: 1.2em; + font-weight: 600; +} + +label.checkbox { + display: inline; +} + +input, textarea { + border: 1px solid #e2e2e2; + background: #fff; + color: #333; + font-size: 1.2em; + margin: 5px 0 6px 0; + padding: 5px; + width: 300px; +} + +textarea { + font-family: inherit; + width: 500px; +} + + input:focus, textarea:focus { + border: 1px solid #7ac0da; + } + + input[type="checkbox"] { + background: transparent; + border: inherit; + width: auto; + } + + input[type="submit"], + input[type="button"], + button { + background-color: #d3dce0; + border: 1px solid #787878; + cursor: pointer; + font-size: 1.2em; + font-weight: 600; + padding: 7px; + margin-right: 8px; + width: auto; + } + + td input[type="submit"], + td input[type="button"], + td button { + font-size: 1em; + padding: 4px; + margin-right: 4px; + } + +/* info and errors */ +.message-info { + border: 1px solid; + clear: both; + padding: 10px 20px; +} + +.message-error { + clear: both; + color: #e80c4d; + font-size: 1.1em; + font-weight: bold; + margin: 20px 0 10px 0; +} + +.message-success { + color: #7ac0da; + font-size: 1.3em; + font-weight: bold; + margin: 20px 0 10px 0; +} + +.error { + color: #e80c4d; +} + +/* styles for validation helpers */ +.field-validation-error { + color: #e80c4d; + font-weight: bold; +} + +.field-validation-valid { + display: none; +} + +input.input-validation-error { + border: 1px solid #e80c4d; +} + +input[type="checkbox"].input-validation-error { + border: 0 none; +} + +.validation-summary-errors { + color: #e80c4d; + font-weight: bold; + font-size: 1.1em; +} + +.validation-summary-valid { + display: none; +} + + +/* tables +----------------------------------------------------------*/ +table { + border-collapse: collapse; + border-spacing: 0; + margin-top: 0.75em; + border: 0 none; +} + +th { + font-size: 1.2em; + text-align: left; + border: none 0px; + padding-left: 0; +} + + th a { + display: block; + position: relative; + } + + th a:link, th a:visited, th a:active, th a:hover { + color: #333; + font-weight: 600; + text-decoration: none; + padding: 0; + } + + th a:hover { + color: #000; + } + + th.asc a, th.desc a { + margin-right: .75em; + } + + th.asc a:after, th.desc a:after { + display: block; + position: absolute; + right: 0em; + top: 0; + font-size: 0.75em; + } + + th.asc a:after { + content: '▲'; + } + + th.desc a:after { + content: '▼'; + } + +td { + padding: 0.25em 2em 0.25em 0em; + border: 0 none; +} + +tr.pager td { + padding: 0 0.25em 0 0; +} + + +/******************** +* Mobile Styles * +********************/ +@media only screen and (max-width: 850px) { + + /* header + ----------------------------------------------------------*/ + header .float-left, + header .float-right { + float: none; + } + + /* logo */ + header .site-title { + margin: 10px; + text-align: center; + } + + /* login */ + #login { + font-size: .85em; + margin: 0 0 12px; + text-align: center; + } + + #login ul { + margin: 5px 0; + padding: 0; + } + + #login li { + display: inline; + list-style: none; + margin: 0; + padding: 0; + } + + #login a { + background: none; + color: #999; + font-weight: 600; + margin: 2px; + padding: 0; + } + + #login a:hover { + color: #333; + } + + /* menu */ + nav { + margin-bottom: 5px; + } + + ul#menu { + margin: 0; + padding: 0; + text-align: center; + } + + ul#menu li { + margin: 0; + padding: 0; + } + + + /* main layout + ----------------------------------------------------------*/ + .main-content, + .featured + .main-content { + background-position: 10px 0; + } + + .content-wrapper { + padding-right: 10px; + padding-left: 10px; + } + + .featured .content-wrapper { + padding: 10px; + } + + /* page content */ + article, aside { + float: none; + width: 100%; + } + + /* ordered list */ + ol.round { + list-style-type: none; + padding-left: 0; + } + + ol.round li { + padding-left: 10px; + margin: 25px 0; + } + + ol.round li.zero, + ol.round li.one, + ol.round li.two, + ol.round li.three, + ol.round li.four, + ol.round li.five, + ol.round li.six, + ol.round li.seven, + ol.round li.eight, + ol.round li.nine { + background: none; + } + + /* features */ + section.feature { + float: none; + padding: 10px; + width: auto; + } + + section.feature img { + color: #999; + content: attr(alt); + font-size: 1.5em; + font-weight: 600; + } + + /* forms */ + input { + width: 90%; + } + + /* login page */ + #loginForm { + border-right: none; + float: none; + width: auto; + } + + #loginForm .validation-error { + display: block; + margin-left: 15px; + } + + #socialLoginForm { + margin-left: 0; + float: none; + width: auto; + } + + + /* footer + ----------------------------------------------------------*/ + footer .float-left, + footer .float-right { + float: none; + } + + footer { + text-align: center; + height: auto; + padding: 10px 0; + } + + footer p { + margin: 0; + } +} diff --git a/hollywood/src/hollywood.Example/Controllers/HomeController.cs b/hollywood/src/hollywood.Example/Controllers/HomeController.cs new file mode 100644 index 0000000..8c722d2 --- /dev/null +++ b/hollywood/src/hollywood.Example/Controllers/HomeController.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; + +namespace hollywood.Example.Controllers +{ + public class HomeController : Controller + { + public ActionResult Index() + { + ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application."; + + return View(); + } + + public ActionResult About() + { + ViewBag.Message = "Your app description page."; + + return View(); + } + + public ActionResult Contact() + { + ViewBag.Message = "Your contact page."; + + return View(); + } + } +} diff --git a/hollywood/src/hollywood.Example/Global.asax b/hollywood/src/hollywood.Example/Global.asax new file mode 100644 index 0000000..daf46ad --- /dev/null +++ b/hollywood/src/hollywood.Example/Global.asax @@ -0,0 +1 @@ +<%@ Application Codebehind="Global.asax.cs" Inherits="hollywood.Example.MvcApplication" Language="C#" %> diff --git a/hollywood/src/hollywood.Example/Global.asax.cs b/hollywood/src/hollywood.Example/Global.asax.cs new file mode 100644 index 0000000..cd4786c --- /dev/null +++ b/hollywood/src/hollywood.Example/Global.asax.cs @@ -0,0 +1,21 @@ +using System.Web; +using System.Web.Http; +using System.Web.Mvc; +using System.Web.Routing; + +namespace hollywood.Example +{ + public class MvcApplication : HttpApplication + { + protected void Application_Start() + { + AreaRegistration.RegisterAllAreas(); + + WebApiConfig.Register(GlobalConfiguration.Configuration); + FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); + RouteConfig.RegisterRoutes(RouteTable.Routes); + + Launch.InstallPrelaunch(); + } + } +} \ No newline at end of file diff --git a/hollywood/src/hollywood.Example/Images/accent.png b/hollywood/src/hollywood.Example/Images/accent.png new file mode 100644 index 0000000..cd07580 Binary files /dev/null and b/hollywood/src/hollywood.Example/Images/accent.png differ diff --git a/hollywood/src/hollywood.Example/Images/bullet.png b/hollywood/src/hollywood.Example/Images/bullet.png new file mode 100644 index 0000000..d3824c1 Binary files /dev/null and b/hollywood/src/hollywood.Example/Images/bullet.png differ diff --git a/hollywood/src/hollywood.Example/Images/heroAccent.png b/hollywood/src/hollywood.Example/Images/heroAccent.png new file mode 100644 index 0000000..14ea59b Binary files /dev/null and b/hollywood/src/hollywood.Example/Images/heroAccent.png differ diff --git a/hollywood/src/hollywood.Example/Images/orderedList0.png b/hollywood/src/hollywood.Example/Images/orderedList0.png new file mode 100644 index 0000000..7a4ea25 Binary files /dev/null and b/hollywood/src/hollywood.Example/Images/orderedList0.png differ diff --git a/hollywood/src/hollywood.Example/Images/orderedList1.png b/hollywood/src/hollywood.Example/Images/orderedList1.png new file mode 100644 index 0000000..523c24d Binary files /dev/null and b/hollywood/src/hollywood.Example/Images/orderedList1.png differ diff --git a/hollywood/src/hollywood.Example/Images/orderedList2.png b/hollywood/src/hollywood.Example/Images/orderedList2.png new file mode 100644 index 0000000..553a2da Binary files /dev/null and b/hollywood/src/hollywood.Example/Images/orderedList2.png differ diff --git a/hollywood/src/hollywood.Example/Images/orderedList3.png b/hollywood/src/hollywood.Example/Images/orderedList3.png new file mode 100644 index 0000000..0714981 Binary files /dev/null and b/hollywood/src/hollywood.Example/Images/orderedList3.png differ diff --git a/hollywood/src/hollywood.Example/Images/orderedList4.png b/hollywood/src/hollywood.Example/Images/orderedList4.png new file mode 100644 index 0000000..ce91e8f Binary files /dev/null and b/hollywood/src/hollywood.Example/Images/orderedList4.png differ diff --git a/hollywood/src/hollywood.Example/Images/orderedList5.png b/hollywood/src/hollywood.Example/Images/orderedList5.png new file mode 100644 index 0000000..c073485 Binary files /dev/null and b/hollywood/src/hollywood.Example/Images/orderedList5.png differ diff --git a/hollywood/src/hollywood.Example/Images/orderedList6.png b/hollywood/src/hollywood.Example/Images/orderedList6.png new file mode 100644 index 0000000..3b9aa05 Binary files /dev/null and b/hollywood/src/hollywood.Example/Images/orderedList6.png differ diff --git a/hollywood/src/hollywood.Example/Images/orderedList7.png b/hollywood/src/hollywood.Example/Images/orderedList7.png new file mode 100644 index 0000000..f99c609 Binary files /dev/null and b/hollywood/src/hollywood.Example/Images/orderedList7.png differ diff --git a/hollywood/src/hollywood.Example/Images/orderedList8.png b/hollywood/src/hollywood.Example/Images/orderedList8.png new file mode 100644 index 0000000..127596d Binary files /dev/null and b/hollywood/src/hollywood.Example/Images/orderedList8.png differ diff --git a/hollywood/src/hollywood.Example/Images/orderedList9.png b/hollywood/src/hollywood.Example/Images/orderedList9.png new file mode 100644 index 0000000..39cfdcf Binary files /dev/null and b/hollywood/src/hollywood.Example/Images/orderedList9.png differ diff --git a/hollywood/src/hollywood.Example/Properties/AssemblyInfo.cs b/hollywood/src/hollywood.Example/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3aa59c5 --- /dev/null +++ b/hollywood/src/hollywood.Example/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("hollywood.Example")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("hollywood.Example")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("6cdbf9c7-8ada-4674-8c92-9241a3b48623")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/hollywood/src/hollywood.Example/Scripts/_references.js b/hollywood/src/hollywood.Example/Scripts/_references.js new file mode 100644 index 0000000..5684cc9 Binary files /dev/null and b/hollywood/src/hollywood.Example/Scripts/_references.js differ diff --git a/hollywood/src/hollywood.Example/Scripts/knockout-2.1.0.debug.js b/hollywood/src/hollywood.Example/Scripts/knockout-2.1.0.debug.js new file mode 100644 index 0000000..79882ce --- /dev/null +++ b/hollywood/src/hollywood.Example/Scripts/knockout-2.1.0.debug.js @@ -0,0 +1,3443 @@ +// Knockout JavaScript library v2.1.0 +// (c) Steven Sanderson - http://knockoutjs.com/ +// License: MIT (http://www.opensource.org/licenses/mit-license.php) + +(function(window,document,navigator,undefined){ +var DEBUG=true; +!function(factory) { + // Support three module loading scenarios + if (typeof require === 'function' && typeof exports === 'object' && typeof module === 'object') { + // [1] CommonJS/Node.js + var target = module['exports'] || exports; // module.exports is for Node.js + factory(target); + } else if (typeof define === 'function' && define['amd']) { + // [2] AMD anonymous module + define(['exports'], factory); + } else { + // [3] No module loader (plain "); + }; + + if (jQueryTmplVersion > 0) { + jQuery['tmpl']['tag']['ko_code'] = { + open: "__.push($1 || '');" + }; + jQuery['tmpl']['tag']['ko_with'] = { + open: "with($1) {", + close: "} " + }; + } + }; + + ko.jqueryTmplTemplateEngine.prototype = new ko.templateEngine(); + + // Use this one by default *only if jquery.tmpl is referenced* + var jqueryTmplTemplateEngineInstance = new ko.jqueryTmplTemplateEngine(); + if (jqueryTmplTemplateEngineInstance.jQueryTmplVersion > 0) + ko.setTemplateEngine(jqueryTmplTemplateEngineInstance); + + ko.exportSymbol('jqueryTmplTemplateEngine', ko.jqueryTmplTemplateEngine); +})(); +}); +})(window,document,navigator); diff --git a/hollywood/src/hollywood.Example/Scripts/knockout-2.1.0.js b/hollywood/src/hollywood.Example/Scripts/knockout-2.1.0.js new file mode 100644 index 0000000..107026d --- /dev/null +++ b/hollywood/src/hollywood.Example/Scripts/knockout-2.1.0.js @@ -0,0 +1,86 @@ +// Knockout JavaScript library v2.1.0 +// (c) Steven Sanderson - http://knockoutjs.com/ +// License: MIT (http://www.opensource.org/licenses/mit-license.php) + +(function(window,document,navigator,undefined){ +function m(w){throw w;}var n=void 0,p=!0,s=null,t=!1;function A(w){return function(){return w}};function E(w){function B(b,c,d){d&&c!==a.k.r(b)&&a.k.S(b,c);c!==a.k.r(b)&&a.a.va(b,"change")}var a="undefined"!==typeof w?w:{};a.b=function(b,c){for(var d=b.split("."),f=a,g=0;g",c[0];);return 4a.a.j(c,b[e])&&c.push(b[e]);return c},T:function(a,b){for(var a=a||[],c=[], +e=0,f=a.length;ea.length?t:a.substring(0,b.length)===b},eb:function(a,b){for(var c="return ("+a+")",e=0;e",""]||!d.indexOf("",""]||(!d.indexOf("",""]||[0,"",""];b="ignored
"+d[1]+b+d[2]+"
";for("function"==typeof window.innerShiv?c.appendChild(window.innerShiv(b)):c.innerHTML=b;d[0]--;)c=c.lastChild;c=a.a.L(c.lastChild.childNodes)}return c}; +a.a.Y=function(b,c){a.a.ga(b);if(c!==s&&c!==n)if("string"!=typeof c&&(c=c.toString()),"undefined"!=typeof jQuery)jQuery(b).html(c);else for(var d=a.a.pa(c),f=0;f"},Va:function(a,b){var c=d[a];c===n&&m(Error("Couldn't find any memo with ID "+a+". Perhaps it's already been unmemoized."));try{return c.apply(s,b||[]),p}finally{delete d[a]}},Wa:function(b,d){var e=[];c(b,e);for(var h=0,j=e.length;hc;c++)b=b();return b})};a.toJSON=function(b,c,e){b=a.Ta(b);return a.a.sa(b,c,e)}})();a.b("toJS",a.Ta);a.b("toJSON",a.toJSON);(function(){a.k={r:function(b){switch(a.a.o(b)){case "option":return b.__ko__hasDomDataOptionValue__===p?a.a.f.get(b,a.c.options.oa):b.getAttribute("value");case "select":return 0<=b.selectedIndex?a.k.r(b.options[b.selectedIndex]):n;default:return b.value}},S:function(b,c){switch(a.a.o(b)){case "option":switch(typeof c){case "string":a.a.f.set(b,a.c.options.oa, +n);"__ko__hasDomDataOptionValue__"in b&&delete b.__ko__hasDomDataOptionValue__;b.value=c;break;default:a.a.f.set(b,a.c.options.oa,c),b.__ko__hasDomDataOptionValue__=p,b.value="number"===typeof c?c:""}break;case "select":for(var d=b.options.length-1;0<=d;d--)if(a.k.r(b.options[d])==c){b.selectedIndex=d;break}break;default:if(c===s||c===n)c="";b.value=c}}}})();a.b("selectExtensions",a.k);a.b("selectExtensions.readValue",a.k.r);a.b("selectExtensions.writeValue",a.k.S);a.g=function(){function b(a,b){for(var d= +s;a!=d;)d=a,a=a.replace(c,function(a,c){return b[c]});return a}var c=/\@ko_token_(\d+)\@/g,d=/^[\_$a-z][\_$a-z0-9]*(\[.*?\])*(\.[\_$a-z][\_$a-z0-9]*(\[.*?\])*)*$/i,f=["true","false"];return{D:[],W:function(c){var e=a.a.w(c);if(3>e.length)return[];"{"===e.charAt(0)&&(e=e.substring(1,e.length-1));for(var c=[],d=s,f,k=0;k$/: +/^\s*ko\s+(.*\:.*)\s*$/,h=g?/^<\!--\s*\/ko\s*--\>$/:/^\s*\/ko\s*$/,j={ul:p,ol:p};a.e={C:{},childNodes:function(a){return b(a)?d(a):a.childNodes},ha:function(c){if(b(c))for(var c=a.e.childNodes(c),e=0,d=c.length;e"),t))}};a.c.uniqueName.gb=0;a.c.checked={init:function(b,c,d){a.a.n(b,"click",function(){var f;if("checkbox"==b.type)f=b.checked;else if("radio"==b.type&&b.checked)f=b.value;else return;var g=c();"checkbox"==b.type&&a.a.d(g)instanceof Array?(f=a.a.j(a.a.d(g),b.value), +b.checked&&0>f?g.push(b.value):!b.checked&&0<=f&&g.splice(f,1)):a.g.$(g,d,"checked",f,p)});"radio"==b.type&&!b.name&&a.c.uniqueName.init(b,A(p))},update:function(b,c){var d=a.a.d(c());"checkbox"==b.type?b.checked=d instanceof Array?0<=a.a.j(d,b.value):d:"radio"==b.type&&(b.checked=b.value==d)}};var F={"class":"className","for":"htmlFor"};a.c.attr={update:function(b,c){var d=a.a.d(c())||{},f;for(f in d)if("string"==typeof f){var g=a.a.d(d[f]),e=g===t||g===s||g===n;e&&b.removeAttribute(f);8>=a.a.ja&& +f in F?(f=F[f],e?b.removeAttribute(f):b[f]=g):e||b.setAttribute(f,g.toString())}}};a.c.hasfocus={init:function(b,c,d){function f(b){var e=c();a.g.$(e,d,"hasfocus",b,p)}a.a.n(b,"focus",function(){f(p)});a.a.n(b,"focusin",function(){f(p)});a.a.n(b,"blur",function(){f(t)});a.a.n(b,"focusout",function(){f(t)})},update:function(b,c){var d=a.a.d(c());d?b.focus():b.blur();a.a.va(b,d?"focusin":"focusout")}};a.c["with"]={p:function(b){return function(){var c=b();return{"if":c,data:c,templateEngine:a.q.K}}}, +init:function(b,c){return a.c.template.init(b,a.c["with"].p(c))},update:function(b,c,d,f,g){return a.c.template.update(b,a.c["with"].p(c),d,f,g)}};a.g.D["with"]=t;a.e.C["with"]=p;a.c["if"]={p:function(b){return function(){return{"if":b(),templateEngine:a.q.K}}},init:function(b,c){return a.c.template.init(b,a.c["if"].p(c))},update:function(b,c,d,f,g){return a.c.template.update(b,a.c["if"].p(c),d,f,g)}};a.g.D["if"]=t;a.e.C["if"]=p;a.c.ifnot={p:function(b){return function(){return{ifnot:b(),templateEngine:a.q.K}}}, +init:function(b,c){return a.c.template.init(b,a.c.ifnot.p(c))},update:function(b,c,d,f,g){return a.c.template.update(b,a.c.ifnot.p(c),d,f,g)}};a.g.D.ifnot=t;a.e.C.ifnot=p;a.c.foreach={p:function(b){return function(){var c=a.a.d(b());return!c||"number"==typeof c.length?{foreach:c,templateEngine:a.q.K}:{foreach:c.data,includeDestroyed:c.includeDestroyed,afterAdd:c.afterAdd,beforeRemove:c.beforeRemove,afterRender:c.afterRender,templateEngine:a.q.K}}},init:function(b,c){return a.c.template.init(b,a.c.foreach.p(c))}, +update:function(b,c,d,f,g){return a.c.template.update(b,a.c.foreach.p(c),d,f,g)}};a.g.D.foreach=t;a.e.C.foreach=p;a.t=function(){};a.t.prototype.renderTemplateSource=function(){m(Error("Override renderTemplateSource"))};a.t.prototype.createJavaScriptEvaluatorBlock=function(){m(Error("Override createJavaScriptEvaluatorBlock"))};a.t.prototype.makeTemplateSource=function(b,c){if("string"==typeof b){var c=c||document,d=c.getElementById(b);d||m(Error("Cannot find template with ID "+b));return new a.l.i(d)}if(1== +b.nodeType||8==b.nodeType)return new a.l.M(b);m(Error("Unknown template type: "+b))};a.t.prototype.renderTemplate=function(a,c,d,f){return this.renderTemplateSource(this.makeTemplateSource(a,f),c,d)};a.t.prototype.isTemplateRewritten=function(a,c){return this.allowTemplateRewriting===t||!(c&&c!=document)&&this.V&&this.V[a]?p:this.makeTemplateSource(a,c).data("isRewritten")};a.t.prototype.rewriteTemplate=function(a,c,d){var f=this.makeTemplateSource(a,d),c=c(f.text());f.text(c);f.data("isRewritten", +p);!(d&&d!=document)&&"string"==typeof a&&(this.V=this.V||{},this.V[a]=p)};a.b("templateEngine",a.t);a.Z=function(){function b(b,c,e){for(var b=a.g.W(b),d=a.g.D,j=0;j/g;return{mb:function(b,c,e){c.isTemplateRewritten(b,e)||c.rewriteTemplate(b,function(b){return a.Z.zb(b,c)},e)},zb:function(a,g){return a.replace(c,function(a,c,d,f,i,l,q){return b(q,c,g)}).replace(d,function(a,c){return b(c,"<\!-- ko --\>",g)})},Za:function(b){return a.s.na(function(c, +e){c.nextSibling&&a.ya(c.nextSibling,b,e)})}}}();a.b("templateRewriting",a.Z);a.b("templateRewriting.applyMemoizedBindingsToNextSibling",a.Z.Za);(function(){a.l={};a.l.i=function(a){this.i=a};a.l.i.prototype.text=function(){var b=a.a.o(this.i),b="script"===b?"text":"textarea"===b?"value":"innerHTML";if(0==arguments.length)return this.i[b];var c=arguments[0];"innerHTML"===b?a.a.Y(this.i,c):this.i[b]=c};a.l.i.prototype.data=function(b){if(1===arguments.length)return a.a.f.get(this.i,"templateSourceData_"+ +b);a.a.f.set(this.i,"templateSourceData_"+b,arguments[1])};a.l.M=function(a){this.i=a};a.l.M.prototype=new a.l.i;a.l.M.prototype.text=function(){if(0==arguments.length){var b=a.a.f.get(this.i,"__ko_anon_template__")||{};b.ua===n&&b.da&&(b.ua=b.da.innerHTML);return b.ua}a.a.f.set(this.i,"__ko_anon_template__",{ua:arguments[0]})};a.l.i.prototype.nodes=function(){if(0==arguments.length)return(a.a.f.get(this.i,"__ko_anon_template__")||{}).da;a.a.f.set(this.i,"__ko_anon_template__",{da:arguments[0]})}; +a.b("templateSources",a.l);a.b("templateSources.domElement",a.l.i);a.b("templateSources.anonymousTemplate",a.l.M)})();(function(){function b(b,c,d){for(var f,c=a.e.nextSibling(c);b&&(f=b)!==c;)b=a.e.nextSibling(f),(1===f.nodeType||8===f.nodeType)&&d(f)}function c(c,d){if(c.length){var f=c[0],g=c[c.length-1];b(f,g,function(b){a.xa(d,b)});b(f,g,function(b){a.s.Wa(b,[d])})}}function d(a){return a.nodeType?a:0a.a.ja)&&b.nodes?b.nodes():s; +if(c)return a.a.L(c.cloneNode(p).childNodes);b=b.text();return a.a.pa(b)};a.q.K=new a.q;a.ra(a.q.K);a.b("nativeTemplateEngine",a.q);(function(){a.ma=function(){var a=this.vb=function(){if("undefined"==typeof jQuery||!jQuery.tmpl)return 0;try{if(0<=jQuery.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(a){}return 1}();this.renderTemplateSource=function(b,f,g){g=g||{};2>a&&m(Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later."));var e=b.data("precompiled"); +e||(e=b.text()||"",e=jQuery.template(s,"{{ko_with $item.koBindingContext}}"+e+"{{/ko_with}}"),b.data("precompiled",e));b=[f.$data];f=jQuery.extend({koBindingContext:f},g.templateOptions);f=jQuery.tmpl(e,b,f);f.appendTo(document.createElement("div"));jQuery.fragments={};return f};this.createJavaScriptEvaluatorBlock=function(a){return"{{ko_code ((function() { return "+a+" })()) }}"};this.addTemplate=function(a,b){document.write(""); + }; + + if (jQueryTmplVersion > 0) { + jQuery['tmpl']['tag']['ko_code'] = { + open: "__.push($1 || '');" + }; + jQuery['tmpl']['tag']['ko_with'] = { + open: "with($1) {", + close: "} " + }; + } + }; + + ko.jqueryTmplTemplateEngine.prototype = new ko.templateEngine(); + + // Use this one by default *only if jquery.tmpl is referenced* + var jqueryTmplTemplateEngineInstance = new ko.jqueryTmplTemplateEngine(); + if (jqueryTmplTemplateEngineInstance.jQueryTmplVersion > 0) + ko.setTemplateEngine(jqueryTmplTemplateEngineInstance); + + ko.exportSymbol('jqueryTmplTemplateEngine', ko.jqueryTmplTemplateEngine); +})(); +}); +})(window,document,navigator); diff --git a/hollywood/src/packages/knockoutjs.2.1.0/Content/Scripts/knockout-2.1.0.js b/hollywood/src/packages/knockoutjs.2.1.0/Content/Scripts/knockout-2.1.0.js new file mode 100644 index 0000000..107026d --- /dev/null +++ b/hollywood/src/packages/knockoutjs.2.1.0/Content/Scripts/knockout-2.1.0.js @@ -0,0 +1,86 @@ +// Knockout JavaScript library v2.1.0 +// (c) Steven Sanderson - http://knockoutjs.com/ +// License: MIT (http://www.opensource.org/licenses/mit-license.php) + +(function(window,document,navigator,undefined){ +function m(w){throw w;}var n=void 0,p=!0,s=null,t=!1;function A(w){return function(){return w}};function E(w){function B(b,c,d){d&&c!==a.k.r(b)&&a.k.S(b,c);c!==a.k.r(b)&&a.a.va(b,"change")}var a="undefined"!==typeof w?w:{};a.b=function(b,c){for(var d=b.split("."),f=a,g=0;g",c[0];);return 4a.a.j(c,b[e])&&c.push(b[e]);return c},T:function(a,b){for(var a=a||[],c=[], +e=0,f=a.length;ea.length?t:a.substring(0,b.length)===b},eb:function(a,b){for(var c="return ("+a+")",e=0;e",""]||!d.indexOf("",""]||(!d.indexOf("",""]||[0,"",""];b="ignored
"+d[1]+b+d[2]+"
";for("function"==typeof window.innerShiv?c.appendChild(window.innerShiv(b)):c.innerHTML=b;d[0]--;)c=c.lastChild;c=a.a.L(c.lastChild.childNodes)}return c}; +a.a.Y=function(b,c){a.a.ga(b);if(c!==s&&c!==n)if("string"!=typeof c&&(c=c.toString()),"undefined"!=typeof jQuery)jQuery(b).html(c);else for(var d=a.a.pa(c),f=0;f"},Va:function(a,b){var c=d[a];c===n&&m(Error("Couldn't find any memo with ID "+a+". Perhaps it's already been unmemoized."));try{return c.apply(s,b||[]),p}finally{delete d[a]}},Wa:function(b,d){var e=[];c(b,e);for(var h=0,j=e.length;hc;c++)b=b();return b})};a.toJSON=function(b,c,e){b=a.Ta(b);return a.a.sa(b,c,e)}})();a.b("toJS",a.Ta);a.b("toJSON",a.toJSON);(function(){a.k={r:function(b){switch(a.a.o(b)){case "option":return b.__ko__hasDomDataOptionValue__===p?a.a.f.get(b,a.c.options.oa):b.getAttribute("value");case "select":return 0<=b.selectedIndex?a.k.r(b.options[b.selectedIndex]):n;default:return b.value}},S:function(b,c){switch(a.a.o(b)){case "option":switch(typeof c){case "string":a.a.f.set(b,a.c.options.oa, +n);"__ko__hasDomDataOptionValue__"in b&&delete b.__ko__hasDomDataOptionValue__;b.value=c;break;default:a.a.f.set(b,a.c.options.oa,c),b.__ko__hasDomDataOptionValue__=p,b.value="number"===typeof c?c:""}break;case "select":for(var d=b.options.length-1;0<=d;d--)if(a.k.r(b.options[d])==c){b.selectedIndex=d;break}break;default:if(c===s||c===n)c="";b.value=c}}}})();a.b("selectExtensions",a.k);a.b("selectExtensions.readValue",a.k.r);a.b("selectExtensions.writeValue",a.k.S);a.g=function(){function b(a,b){for(var d= +s;a!=d;)d=a,a=a.replace(c,function(a,c){return b[c]});return a}var c=/\@ko_token_(\d+)\@/g,d=/^[\_$a-z][\_$a-z0-9]*(\[.*?\])*(\.[\_$a-z][\_$a-z0-9]*(\[.*?\])*)*$/i,f=["true","false"];return{D:[],W:function(c){var e=a.a.w(c);if(3>e.length)return[];"{"===e.charAt(0)&&(e=e.substring(1,e.length-1));for(var c=[],d=s,f,k=0;k$/: +/^\s*ko\s+(.*\:.*)\s*$/,h=g?/^<\!--\s*\/ko\s*--\>$/:/^\s*\/ko\s*$/,j={ul:p,ol:p};a.e={C:{},childNodes:function(a){return b(a)?d(a):a.childNodes},ha:function(c){if(b(c))for(var c=a.e.childNodes(c),e=0,d=c.length;e"),t))}};a.c.uniqueName.gb=0;a.c.checked={init:function(b,c,d){a.a.n(b,"click",function(){var f;if("checkbox"==b.type)f=b.checked;else if("radio"==b.type&&b.checked)f=b.value;else return;var g=c();"checkbox"==b.type&&a.a.d(g)instanceof Array?(f=a.a.j(a.a.d(g),b.value), +b.checked&&0>f?g.push(b.value):!b.checked&&0<=f&&g.splice(f,1)):a.g.$(g,d,"checked",f,p)});"radio"==b.type&&!b.name&&a.c.uniqueName.init(b,A(p))},update:function(b,c){var d=a.a.d(c());"checkbox"==b.type?b.checked=d instanceof Array?0<=a.a.j(d,b.value):d:"radio"==b.type&&(b.checked=b.value==d)}};var F={"class":"className","for":"htmlFor"};a.c.attr={update:function(b,c){var d=a.a.d(c())||{},f;for(f in d)if("string"==typeof f){var g=a.a.d(d[f]),e=g===t||g===s||g===n;e&&b.removeAttribute(f);8>=a.a.ja&& +f in F?(f=F[f],e?b.removeAttribute(f):b[f]=g):e||b.setAttribute(f,g.toString())}}};a.c.hasfocus={init:function(b,c,d){function f(b){var e=c();a.g.$(e,d,"hasfocus",b,p)}a.a.n(b,"focus",function(){f(p)});a.a.n(b,"focusin",function(){f(p)});a.a.n(b,"blur",function(){f(t)});a.a.n(b,"focusout",function(){f(t)})},update:function(b,c){var d=a.a.d(c());d?b.focus():b.blur();a.a.va(b,d?"focusin":"focusout")}};a.c["with"]={p:function(b){return function(){var c=b();return{"if":c,data:c,templateEngine:a.q.K}}}, +init:function(b,c){return a.c.template.init(b,a.c["with"].p(c))},update:function(b,c,d,f,g){return a.c.template.update(b,a.c["with"].p(c),d,f,g)}};a.g.D["with"]=t;a.e.C["with"]=p;a.c["if"]={p:function(b){return function(){return{"if":b(),templateEngine:a.q.K}}},init:function(b,c){return a.c.template.init(b,a.c["if"].p(c))},update:function(b,c,d,f,g){return a.c.template.update(b,a.c["if"].p(c),d,f,g)}};a.g.D["if"]=t;a.e.C["if"]=p;a.c.ifnot={p:function(b){return function(){return{ifnot:b(),templateEngine:a.q.K}}}, +init:function(b,c){return a.c.template.init(b,a.c.ifnot.p(c))},update:function(b,c,d,f,g){return a.c.template.update(b,a.c.ifnot.p(c),d,f,g)}};a.g.D.ifnot=t;a.e.C.ifnot=p;a.c.foreach={p:function(b){return function(){var c=a.a.d(b());return!c||"number"==typeof c.length?{foreach:c,templateEngine:a.q.K}:{foreach:c.data,includeDestroyed:c.includeDestroyed,afterAdd:c.afterAdd,beforeRemove:c.beforeRemove,afterRender:c.afterRender,templateEngine:a.q.K}}},init:function(b,c){return a.c.template.init(b,a.c.foreach.p(c))}, +update:function(b,c,d,f,g){return a.c.template.update(b,a.c.foreach.p(c),d,f,g)}};a.g.D.foreach=t;a.e.C.foreach=p;a.t=function(){};a.t.prototype.renderTemplateSource=function(){m(Error("Override renderTemplateSource"))};a.t.prototype.createJavaScriptEvaluatorBlock=function(){m(Error("Override createJavaScriptEvaluatorBlock"))};a.t.prototype.makeTemplateSource=function(b,c){if("string"==typeof b){var c=c||document,d=c.getElementById(b);d||m(Error("Cannot find template with ID "+b));return new a.l.i(d)}if(1== +b.nodeType||8==b.nodeType)return new a.l.M(b);m(Error("Unknown template type: "+b))};a.t.prototype.renderTemplate=function(a,c,d,f){return this.renderTemplateSource(this.makeTemplateSource(a,f),c,d)};a.t.prototype.isTemplateRewritten=function(a,c){return this.allowTemplateRewriting===t||!(c&&c!=document)&&this.V&&this.V[a]?p:this.makeTemplateSource(a,c).data("isRewritten")};a.t.prototype.rewriteTemplate=function(a,c,d){var f=this.makeTemplateSource(a,d),c=c(f.text());f.text(c);f.data("isRewritten", +p);!(d&&d!=document)&&"string"==typeof a&&(this.V=this.V||{},this.V[a]=p)};a.b("templateEngine",a.t);a.Z=function(){function b(b,c,e){for(var b=a.g.W(b),d=a.g.D,j=0;j/g;return{mb:function(b,c,e){c.isTemplateRewritten(b,e)||c.rewriteTemplate(b,function(b){return a.Z.zb(b,c)},e)},zb:function(a,g){return a.replace(c,function(a,c,d,f,i,l,q){return b(q,c,g)}).replace(d,function(a,c){return b(c,"<\!-- ko --\>",g)})},Za:function(b){return a.s.na(function(c, +e){c.nextSibling&&a.ya(c.nextSibling,b,e)})}}}();a.b("templateRewriting",a.Z);a.b("templateRewriting.applyMemoizedBindingsToNextSibling",a.Z.Za);(function(){a.l={};a.l.i=function(a){this.i=a};a.l.i.prototype.text=function(){var b=a.a.o(this.i),b="script"===b?"text":"textarea"===b?"value":"innerHTML";if(0==arguments.length)return this.i[b];var c=arguments[0];"innerHTML"===b?a.a.Y(this.i,c):this.i[b]=c};a.l.i.prototype.data=function(b){if(1===arguments.length)return a.a.f.get(this.i,"templateSourceData_"+ +b);a.a.f.set(this.i,"templateSourceData_"+b,arguments[1])};a.l.M=function(a){this.i=a};a.l.M.prototype=new a.l.i;a.l.M.prototype.text=function(){if(0==arguments.length){var b=a.a.f.get(this.i,"__ko_anon_template__")||{};b.ua===n&&b.da&&(b.ua=b.da.innerHTML);return b.ua}a.a.f.set(this.i,"__ko_anon_template__",{ua:arguments[0]})};a.l.i.prototype.nodes=function(){if(0==arguments.length)return(a.a.f.get(this.i,"__ko_anon_template__")||{}).da;a.a.f.set(this.i,"__ko_anon_template__",{da:arguments[0]})}; +a.b("templateSources",a.l);a.b("templateSources.domElement",a.l.i);a.b("templateSources.anonymousTemplate",a.l.M)})();(function(){function b(b,c,d){for(var f,c=a.e.nextSibling(c);b&&(f=b)!==c;)b=a.e.nextSibling(f),(1===f.nodeType||8===f.nodeType)&&d(f)}function c(c,d){if(c.length){var f=c[0],g=c[c.length-1];b(f,g,function(b){a.xa(d,b)});b(f,g,function(b){a.s.Wa(b,[d])})}}function d(a){return a.nodeType?a:0a.a.ja)&&b.nodes?b.nodes():s; +if(c)return a.a.L(c.cloneNode(p).childNodes);b=b.text();return a.a.pa(b)};a.q.K=new a.q;a.ra(a.q.K);a.b("nativeTemplateEngine",a.q);(function(){a.ma=function(){var a=this.vb=function(){if("undefined"==typeof jQuery||!jQuery.tmpl)return 0;try{if(0<=jQuery.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(a){}return 1}();this.renderTemplateSource=function(b,f,g){g=g||{};2>a&&m(Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later."));var e=b.data("precompiled"); +e||(e=b.text()||"",e=jQuery.template(s,"{{ko_with $item.koBindingContext}}"+e+"{{/ko_with}}"),b.data("precompiled",e));b=[f.$data];f=jQuery.extend({koBindingContext:f},g.templateOptions);f=jQuery.tmpl(e,b,f);f.appendTo(document.createElement("div"));jQuery.fragments={};return f};this.createJavaScriptEvaluatorBlock=function(a){return"{{ko_code ((function() { return "+a+" })()) }}"};this.addTemplate=function(a,b){document.write("."); + } + }; + + _pageWindow.load(function () { _pageLoaded = true; }); + + function validateTransport(requestedTransport, connection) { + /// Validates the requested transport by cross checking it with the pre-defined signalR.transports + /// The designated transports that the user has specified. + /// The connection that will be using the requested transports. Used for logging purposes. + /// + if ($.isArray(requestedTransport)) { + // Go through transport array and remove an "invalid" tranports + for (var i = requestedTransport.length - 1; i >= 0; i--) { + var transport = requestedTransport[i]; + if ($.type(requestedTransport) !== "object" && ($.type(transport) !== "string" || !signalR.transports[transport])) { + connection.log("Invalid transport: " + transport + ", removing it from the transports list."); + requestedTransport.splice(i, 1); + } + } + + // Verify we still have transports left, if we dont then we have invalid transports + if (requestedTransport.length === 0) { + connection.log("No transports remain within the specified transport array."); + requestedTransport = null; + } + } else if ($.type(requestedTransport) !== "object" && !signalR.transports[requestedTransport] && requestedTransport !== "auto") { + connection.log("Invalid transport: " + requestedTransport.toString()); + requestedTransport = null; + } + + return requestedTransport; + } + + function getDefaultPort(protocol) { + if(protocol === "http:") { + return 80; + } + else if (protocol === "https:") { + return 443; + } + } + + function addDefaultPort(protocol, url) { + // Remove ports from url. We have to check if there's a / or end of line + // following the port in order to avoid removing ports such as 8080. + if(url.match(/:\d+$/)) { + return url; + } else { + return url + ":" + getDefaultPort(protocol); + } + } + + signalR.fn = signalR.prototype = { + init: function (url, qs, logging) { + this.url = url; + this.qs = qs; + this._ = {}; + if (typeof (logging) === "boolean") { + this.logging = logging; + } + }, + + isCrossDomain: function (url, against) { + /// Checks if url is cross domain + /// The base URL + /// + /// An optional argument to compare the URL against, if not specified it will be set to window.location. + /// If specified it must contain a protocol and a host property. + /// + var link; + + url = $.trim(url); + if (url.indexOf("http") !== 0) { + return false; + } + + against = against || window.location; + + // Create an anchor tag. + link = window.document.createElement("a"); + link.href = url; + + // When checking for cross domain we have to special case port 80 because the window.location will remove the + return link.protocol + addDefaultPort(link.protocol, link.host) !== against.protocol + addDefaultPort(against.protocol, against.host); + }, + + ajaxDataType: "json", + + logging: false, + + state: signalR.connectionState.disconnected, + + keepAliveData: {}, + + reconnectDelay: 2000, + + disconnectTimeout: 40000, // This should be set by the server in response to the negotiate request (40s default) + + keepAliveWarnAt: 2 / 3, // Warn user of slow connection if we breach the X% mark of the keep alive timeout + + start: function (options, callback) { + /// Starts the connection + /// Options map + /// A callback function to execute when the connection has started + var connection = this, + config = { + waitForPageLoad: true, + transport: "auto", + jsonp: false + }, + initialize, + deferred = connection._deferral || $.Deferred(), // Check to see if there is a pre-existing deferral that's being built on, if so we want to keep using it + parser = window.document.createElement("a"); + + if ($.type(options) === "function") { + // Support calling with single callback parameter + callback = options; + } else if ($.type(options) === "object") { + $.extend(config, options); + if ($.type(config.callback) === "function") { + callback = config.callback; + } + } + + config.transport = validateTransport(config.transport, connection); + + // If the transport is invalid throw an error and abort start + if (!config.transport) { + throw new Error("SignalR: Invalid transport(s) specified, aborting start."); + } + + // Check to see if start is being called prior to page load + // If waitForPageLoad is true we then want to re-direct function call to the window load event + if (!_pageLoaded && config.waitForPageLoad === true) { + _pageWindow.load(function () { + connection._deferral = deferred; + connection.start(options, callback); + }); + return deferred.promise(); + } + + configureStopReconnectingTimeout(connection); + + if (changeState(connection, + signalR.connectionState.disconnected, + signalR.connectionState.connecting) === false) { + // Already started, just return + deferred.resolve(connection); + return deferred.promise(); + } + + // Resolve the full url + parser.href = connection.url; + if (!parser.protocol || parser.protocol === ":") { + connection.protocol = window.document.location.protocol; + connection.host = window.document.location.host; + connection.baseUrl = connection.protocol + "//" + connection.host; + } + else { + connection.protocol = parser.protocol; + connection.host = parser.host; + connection.baseUrl = parser.protocol + "//" + parser.host; + } + + // Set the websocket protocol + connection.wsProtocol = connection.protocol === "https:" ? "wss://" : "ws://"; + + // If jsonp with no/auto transport is specified, then set the transport to long polling + // since that is the only transport for which jsonp really makes sense. + // Some developers might actually choose to specify jsonp for same origin requests + // as demonstrated by Issue #623. + if (config.transport === "auto" && config.jsonp === true) { + config.transport = "longPolling"; + } + + if (this.isCrossDomain(connection.url)) { + connection.log("Auto detected cross domain url."); + + if (config.transport === "auto") { + // Try webSockets and longPolling since SSE doesn't support CORS + // TODO: Support XDM with foreverFrame + config.transport = ["webSockets", "longPolling"]; + } + + // Determine if jsonp is the only choice for negotiation, ajaxSend and ajaxAbort. + // i.e. if the browser doesn't supports CORS + // If it is, ignore any preference to the contrary, and switch to jsonp. + if (!config.jsonp) { + config.jsonp = !$.support.cors; + + if (config.jsonp) { + connection.log("Using jsonp because this browser doesn't support CORS"); + } + } + } + + connection.ajaxDataType = config.jsonp ? "jsonp" : "json"; + + $(connection).bind(events.onStart, function (e, data) { + if ($.type(callback) === "function") { + callback.call(connection); + } + deferred.resolve(connection); + }); + + initialize = function (transports, index) { + index = index || 0; + if (index >= transports.length) { + if (!connection.transport) { + // No transport initialized successfully + $(connection).triggerHandler(events.onError, "SignalR: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization."); + deferred.reject("SignalR: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization."); + // Stop the connection if it has connected and move it into the disconnected state + connection.stop(); + } + return; + } + + var transportName = transports[index], + transport = $.type(transportName) === "object" ? transportName : signalR.transports[transportName]; + + if (transportName.indexOf("_") === 0) { + // Private member + initialize(transports, index + 1); + return; + } + + transport.start(connection, function () { // success + if (transport.supportsKeepAlive && connection.keepAliveData.activated) { + signalR.transports._logic.monitorKeepAlive(connection); + } + + connection.transport = transport; + + changeState(connection, + signalR.connectionState.connecting, + signalR.connectionState.connected); + + $(connection).triggerHandler(events.onStart); + + _pageWindow.unload(function () { // failure + connection.stop(false /* async */); + }); + + }, function () { + initialize(transports, index + 1); + }); + }; + + var url = connection.url + "/negotiate"; + connection.log("Negotiating with '" + url + "'."); + $.ajax({ + url: url, + global: false, + cache: false, + type: "GET", + data: {}, + dataType: connection.ajaxDataType, + error: function (error) { + $(connection).triggerHandler(events.onError, [error.responseText]); + deferred.reject("SignalR: Error during negotiation request: " + error.responseText); + // Stop the connection if negotiate failed + connection.stop(); + }, + success: function (res) { + var keepAliveData = connection.keepAliveData; + + connection.appRelativeUrl = res.Url; + connection.id = res.ConnectionId; + connection.token = res.ConnectionToken; + connection.webSocketServerUrl = res.WebSocketServerUrl; + + // Once the server has labeled the PersistentConnection as Disconnected, we should stop attempting to reconnect + // after res.DisconnectTimeout seconds. + connection.disconnectTimeout = res.DisconnectTimeout * 1000; // in ms + + + // If we have a keep alive + if (res.KeepAliveTimeout) { + // Register the keep alive data as activated + keepAliveData.activated = true; + + // Timeout to designate when to force the connection into reconnecting converted to milliseconds + keepAliveData.timeout = res.KeepAliveTimeout * 1000; + + // Timeout to designate when to warn the developer that the connection may be dead or is hanging. + keepAliveData.timeoutWarning = keepAliveData.timeout * connection.keepAliveWarnAt; + + // Instantiate the frequency in which we check the keep alive. It must be short in order to not miss/pick up any changes + keepAliveData.checkInterval = (keepAliveData.timeout - keepAliveData.timeoutWarning) / 3; + } + else { + keepAliveData.activated = false; + } + + if (!res.ProtocolVersion || res.ProtocolVersion !== "1.2") { + $(connection).triggerHandler(events.onError, "SignalR: Incompatible protocol version."); + deferred.reject("SignalR: Incompatible protocol version."); + return; + } + + $(connection).triggerHandler(events.onStarting); + + var transports = [], + supportedTransports = []; + + $.each(signalR.transports, function (key) { + if (key === "webSockets" && !res.TryWebSockets) { + // Server said don't even try WebSockets, but keep processing the loop + return true; + } + supportedTransports.push(key); + }); + + if ($.isArray(config.transport)) { + // ordered list provided + $.each(config.transport, function () { + var transport = this; + if ($.type(transport) === "object" || ($.type(transport) === "string" && $.inArray("" + transport, supportedTransports) >= 0)) { + transports.push($.type(transport) === "string" ? "" + transport : transport); + } + }); + } else if ($.type(config.transport) === "object" || + $.inArray(config.transport, supportedTransports) >= 0) { + // specific transport provided, as object or a named transport, e.g. "longPolling" + transports.push(config.transport); + } else { // default "auto" + transports = supportedTransports; + } + initialize(transports); + } + }); + + return deferred.promise(); + }, + + starting: function (callback) { + /// Adds a callback that will be invoked before anything is sent over the connection + /// A callback function to execute before each time data is sent on the connection + /// + var connection = this; + $(connection).bind(events.onStarting, function (e, data) { + callback.call(connection); + }); + return connection; + }, + + send: function (data) { + /// Sends data over the connection + /// The data to send over the connection + /// + var connection = this; + + if (connection.state === signalR.connectionState.disconnected) { + // Connection hasn't been started yet + throw new Error("SignalR: Connection must be started before data can be sent. Call .start() before .send()"); + } + + if (connection.state === signalR.connectionState.connecting) { + // Connection hasn't been started yet + throw new Error("SignalR: Connection has not been fully initialized. Use .start().done() or .start().fail() to run logic after the connection has started."); + } + + connection.transport.send(connection, data); + // REVIEW: Should we return deferred here? + return connection; + }, + + received: function (callback) { + /// Adds a callback that will be invoked after anything is received over the connection + /// A callback function to execute when any data is received on the connection + /// + var connection = this; + $(connection).bind(events.onReceived, function (e, data) { + callback.call(connection, data); + }); + return connection; + }, + + stateChanged: function (callback) { + /// Adds a callback that will be invoked when the connection state changes + /// A callback function to execute when the connection state changes + /// + var connection = this; + $(connection).bind(events.onStateChanged, function (e, data) { + callback.call(connection, data); + }); + return connection; + }, + + error: function (callback) { + /// Adds a callback that will be invoked after an error occurs with the connection + /// A callback function to execute when an error occurs on the connection + /// + var connection = this; + $(connection).bind(events.onError, function (e, data) { + callback.call(connection, data); + }); + return connection; + }, + + disconnected: function (callback) { + /// Adds a callback that will be invoked when the client disconnects + /// A callback function to execute when the connection is broken + /// + var connection = this; + $(connection).bind(events.onDisconnect, function (e, data) { + callback.call(connection); + }); + return connection; + }, + + connectionSlow: function (callback) { + /// Adds a callback that will be invoked when the client detects a slow connection + /// A callback function to execute when the connection is slow + /// + var connection = this; + $(connection).bind(events.onConnectionSlow, function(e, data) { + callback.call(connection); + }); + + return connection; + }, + + reconnecting: function (callback) { + /// Adds a callback that will be invoked when the underlying transport begins reconnecting + /// A callback function to execute when the connection enters a reconnecting state + /// + var connection = this; + $(connection).bind(events.onReconnecting, function (e, data) { + callback.call(connection); + }); + return connection; + }, + + reconnected: function (callback) { + /// Adds a callback that will be invoked when the underlying transport reconnects + /// A callback function to execute when the connection is restored + /// + var connection = this; + $(connection).bind(events.onReconnect, function (e, data) { + callback.call(connection); + }); + return connection; + }, + + stop: function (async, notifyServer) { + /// Stops listening + /// Whether or not to asynchronously abort the connection + /// Whether we want to notify the server that we are aborting the connection + /// + var connection = this; + + if (connection.state === signalR.connectionState.disconnected) { + return; + } + + try { + if (connection.transport) { + if (notifyServer !== false) { + connection.transport.abort(connection, async); + } + + if (connection.transport.supportsKeepAlive && connection.keepAliveData.activated) { + signalR.transports._logic.stopMonitoringKeepAlive(connection); + } + + connection.transport.stop(connection); + connection.transport = null; + } + + // Trigger the disconnect event + $(connection).triggerHandler(events.onDisconnect); + + delete connection.messageId; + delete connection.groupsToken; + + // Remove the ID and the deferral on stop, this is to ensure that if a connection is restarted it takes on a new id/deferral. + delete connection.id; + delete connection._deferral; + } + finally { + changeState(connection, connection.state, signalR.connectionState.disconnected); + } + + return connection; + }, + + log: function (msg) { + log(msg, this.logging); + } + }; + + signalR.fn.init.prototype = signalR.fn; + + signalR.noConflict = function () { + /// Reinstates the original value of $.connection and returns the signalR object for manual assignment + /// + if ($.connection === signalR) { + $.connection = _connection; + } + return signalR; + }; + + if ($.connection) { + _connection = $.connection; + } + + $.connection = $.signalR = signalR; + +}(window.jQuery, window)); +/* jquery.signalR.transports.common.js */ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. + +/*global window:false */ +/// + +(function ($, window) { + "use strict"; + + var signalR = $.signalR, + events = $.signalR.events, + changeState = $.signalR.changeState; + + signalR.transports = {}; + + function checkIfAlive(connection) { + var keepAliveData = connection.keepAliveData, + diff, + timeElapsed; + + // Only check if we're connected + if (connection.state === signalR.connectionState.connected) { + diff = new Date(); + + diff.setTime(diff - keepAliveData.lastKeepAlive); + timeElapsed = diff.getTime(); + + // Check if the keep alive has completely timed out + if (timeElapsed >= keepAliveData.timeout) { + connection.log("Keep alive timed out. Notifying transport that connection has been lost."); + + // Notify transport that the connection has been lost + connection.transport.lostConnection(connection); + } + else if (timeElapsed >= keepAliveData.timeoutWarning) { + // This is to assure that the user only gets a single warning + if (!keepAliveData.userNotified) { + connection.log("Keep alive has been missed, connection may be dead/slow."); + $(connection).triggerHandler(events.onConnectionSlow); + keepAliveData.userNotified = true; + } + } + else { + keepAliveData.userNotified = false; + } + } + + // Verify we're monitoring the keep alive + // We don't want this as a part of the inner if statement above because we want keep alives to continue to be checked + // in the event that the server comes back online (if it goes offline). + if (keepAliveData.monitoring) { + window.setTimeout(function () { + checkIfAlive(connection); + }, keepAliveData.checkInterval); + } + } + + signalR.transports._logic = { + pingServer: function (connection, transport) { + /// Pings the server + /// Connection associated with the server ping + /// + var baseUrl = transport === "webSockets" ? "" : connection.baseUrl, + url = baseUrl + connection.appRelativeUrl + "/ping", + deferral = $.Deferred(); + + $.ajax({ + url: url, + global: false, + cache: false, + type: "GET", + data: {}, + dataType: connection.ajaxDataType, + success: function (data) { + if (data.Response === "pong") { + deferral.resolve(); + } + else { + deferral.reject("SignalR: Invalid ping response when pinging server: " + (data.responseText || data.statusText)); + } + }, + error: function (data) { + deferral.reject("SignalR: Error pinging server: " + (data.responseText || data.statusText)); + } + }); + + return deferral.promise(); + }, + + addQs: function (url, connection) { + if (!connection.qs) { + return url; + } + + if (typeof (connection.qs) === "object") { + return url + "&" + $.param(connection.qs); + } + + if (typeof (connection.qs) === "string") { + return url + "&" + connection.qs; + } + + return url + "&" + window.encodeURIComponent(connection.qs.toString()); + }, + + getUrl: function (connection, transport, reconnecting, appendReconnectUrl) { + /// Gets the url for making a GET based connect request + var baseUrl = transport === "webSockets" ? "" : connection.baseUrl, + url = baseUrl + connection.appRelativeUrl, + qs = "transport=" + transport + "&connectionToken=" + window.encodeURIComponent(connection.token); + + if (connection.data) { + qs += "&connectionData=" + window.encodeURIComponent(connection.data); + } + + if (connection.groupsToken) { + qs += "&groupsToken=" + window.encodeURIComponent(connection.groupsToken); + } + + if (!reconnecting) { + url = url + "/connect"; + } else { + if (appendReconnectUrl) { + url = url + "/reconnect"; + } + if (connection.messageId) { + qs += "&messageId=" + window.encodeURIComponent(connection.messageId); + } + } + url += "?" + qs; + url = this.addQs(url, connection); + url += "&tid=" + Math.floor(Math.random() * 11); + return url; + }, + + maximizePersistentResponse: function (minPersistentResponse) { + return { + MessageId: minPersistentResponse.C, + Messages: minPersistentResponse.M, + Disconnect: typeof (minPersistentResponse.D) !== "undefined" ? true : false, + TimedOut: typeof (minPersistentResponse.T) !== "undefined" ? true : false, + LongPollDelay: minPersistentResponse.L, + GroupsToken: minPersistentResponse.G + }; + }, + + updateGroups: function (connection, groupsToken) { + if (groupsToken) { + connection.groupsToken = groupsToken; + } + }, + + ajaxSend: function (connection, data) { + var url = connection.url + "/send" + "?transport=" + connection.transport.name + "&connectionToken=" + window.encodeURIComponent(connection.token); + url = this.addQs(url, connection); + return $.ajax({ + url: url, + global: false, + type: connection.ajaxDataType === "jsonp" ? "GET" : "POST", + dataType: connection.ajaxDataType, + data: { + data: data + }, + success: function (result) { + if (result) { + $(connection).triggerHandler(events.onReceived, [result]); + } + }, + error: function (errData, textStatus) { + if (textStatus === "abort" || + (textStatus === "parsererror" && connection.ajaxDataType === "jsonp")) { + // The parsererror happens for sends that don't return any data, and hence + // don't write the jsonp callback to the response. This is harder to fix on the server + // so just hack around it on the client for now. + return; + } + $(connection).triggerHandler(events.onError, [errData]); + } + }); + }, + + ajaxAbort: function (connection, async) { + if (typeof (connection.transport) === "undefined") { + return; + } + + // Async by default unless explicitly overidden + async = typeof async === "undefined" ? true : async; + + var url = connection.url + "/abort" + "?transport=" + connection.transport.name + "&connectionToken=" + window.encodeURIComponent(connection.token); + url = this.addQs(url, connection); + $.ajax({ + url: url, + async: async, + timeout: 1000, + global: false, + type: "POST", + dataType: connection.ajaxDataType, + data: {} + }); + + connection.log("Fired ajax abort async = " + async); + }, + + processMessages: function (connection, minData) { + var data; + // Transport can be null if we've just closed the connection + if (connection.transport) { + var $connection = $(connection); + + // If our transport supports keep alive then we need to update the last keep alive time stamp. + // Very rarely the transport can be null. + if (connection.transport.supportsKeepAlive && connection.keepAliveData.activated) { + this.updateKeepAlive(connection); + } + + if (!minData) { + return; + } + + data = this.maximizePersistentResponse(minData); + + if (data.Disconnect) { + connection.log("Disconnect command received from server"); + + // Disconnected by the server + connection.stop(false, false); + return; + } + + this.updateGroups(connection, data.GroupsToken); + + if (data.Messages) { + $.each(data.Messages, function () { + try { + $connection.triggerHandler(events.onReceived, [this]); + } + catch (e) { + connection.log("Error raising received " + e); + $(connection).triggerHandler(events.onError, [e]); + } + }); + } + + if (data.MessageId) { + connection.messageId = data.MessageId; + } + } + }, + + monitorKeepAlive: function (connection) { + var keepAliveData = connection.keepAliveData, + that = this; + + // If we haven't initiated the keep alive timeouts then we need to + if (!keepAliveData.monitoring) { + keepAliveData.monitoring = true; + + // Initialize the keep alive time stamp ping + that.updateKeepAlive(connection); + + // Save the function so we can unbind it on stop + connection.keepAliveData.reconnectKeepAliveUpdate = function () { + that.updateKeepAlive(connection); + }; + + // Update Keep alive on reconnect + $(connection).bind(events.onReconnect, connection.keepAliveData.reconnectKeepAliveUpdate); + + connection.log("Now monitoring keep alive with a warning timeout of " + keepAliveData.timeoutWarning + " and a connection lost timeout of " + keepAliveData.timeout); + // Start the monitoring of the keep alive + checkIfAlive(connection); + } + else { + connection.log("Tried to monitor keep alive but it's already being monitored"); + } + }, + + stopMonitoringKeepAlive: function (connection) { + var keepAliveData = connection.keepAliveData; + + // Only attempt to stop the keep alive monitoring if its being monitored + if (keepAliveData.monitoring) { + // Stop monitoring + keepAliveData.monitoring = false; + + // Remove the updateKeepAlive function from the reconnect event + $(connection).unbind(events.onReconnect, connection.keepAliveData.reconnectKeepAliveUpdate); + + // Clear all the keep alive data + keepAliveData = {}; + connection.log("Stopping the monitoring of the keep alive"); + } + }, + + updateKeepAlive: function (connection) { + connection.keepAliveData.lastKeepAlive = new Date(); + }, + + ensureReconnectingState: function (connection) { + if (changeState(connection, + signalR.connectionState.connected, + signalR.connectionState.reconnecting) === true) { + $(connection).triggerHandler(events.onReconnecting); + } + return connection.state === signalR.connectionState.reconnecting; + }, + + foreverFrame: { + count: 0, + connections: {} + } + }; + +}(window.jQuery, window)); +/* jquery.signalR.transports.webSockets.js */ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. + +/*global window:false */ +/// + +(function ($, window) { + "use strict"; + + var signalR = $.signalR, + events = $.signalR.events, + changeState = $.signalR.changeState, + transportLogic = signalR.transports._logic; + + signalR.transports.webSockets = { + name: "webSockets", + + supportsKeepAlive: true, + + attemptingReconnect: false, + + currentSocketID: 0, + + send: function (connection, data) { + connection.socket.send(data); + }, + + start: function (connection, onSuccess, onFailed) { + var url, + opened = false, + that = this, + reconnecting = !onSuccess, + $connection = $(connection); + + if (!window.WebSocket) { + onFailed(); + return; + } + + if (!connection.socket) { + if (connection.webSocketServerUrl) { + url = connection.webSocketServerUrl; + } + else { + url = connection.wsProtocol + connection.host; + } + + url += transportLogic.getUrl(connection, this.name, reconnecting); + + connection.log("Connecting to websocket endpoint '" + url + "'"); + connection.socket = new window.WebSocket(url); + connection.socket.ID = ++that.currentSocketID; + connection.socket.onopen = function () { + opened = true; + connection.log("Websocket opened"); + + if (that.attemptingReconnect) { + that.attemptingReconnect = false; + } + + if (onSuccess) { + onSuccess(); + } else if (changeState(connection, + signalR.connectionState.reconnecting, + signalR.connectionState.connected) === true) { + $connection.triggerHandler(events.onReconnect); + } + }; + + connection.socket.onclose = function (event) { + // Only handle a socket close if the close is from the current socket. + // Sometimes on disconnect the server will push down an onclose event + // to an expired socket. + if (this.ID === that.currentSocketID) { + if (!opened) { + if (onFailed) { + onFailed(); + } + else if (reconnecting) { + that.reconnect(connection); + } + return; + } + else if (typeof event.wasClean !== "undefined" && event.wasClean === false) { + // Ideally this would use the websocket.onerror handler (rather than checking wasClean in onclose) but + // I found in some circumstances Chrome won't call onerror. This implementation seems to work on all browsers. + $(connection).triggerHandler(events.onError, [event.reason]); + connection.log("Unclean disconnect from websocket." + event.reason); + } + else { + connection.log("Websocket closed"); + } + + that.reconnect(connection); + } + }; + + connection.socket.onmessage = function (event) { + var data = window.JSON.parse(event.data), + $connection = $(connection); + + if (data) { + // data.M is PersistentResponse.Messages + if ($.isEmptyObject(data) || data.M) { + transportLogic.processMessages(connection, data); + } else { + // For websockets we need to trigger onReceived + // for callbacks to outgoing hub calls. + $connection.triggerHandler(events.onReceived, [data]); + } + } + }; + } + }, + + reconnect: function (connection) { + var that = this; + + if (connection.state !== signalR.connectionState.disconnected) { + if (!that.attemptingReconnect) { + that.attemptingReconnect = true; + } + + window.setTimeout(function () { + if (that.attemptingReconnect) { + that.stop(connection); + } + + if (transportLogic.ensureReconnectingState(connection)) { + connection.log("Websocket reconnecting"); + that.start(connection); + } + }, connection.reconnectDelay); + } + }, + + lostConnection: function (connection) { + this.reconnect(connection); + + }, + + stop: function (connection) { + if (connection.socket !== null) { + connection.log("Closing the Websocket"); + connection.socket.close(); + connection.socket = null; + } + }, + + abort: function (connection) { + } + }; + +}(window.jQuery, window)); +/* jquery.signalR.transports.serverSentEvents.js */ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. + +/*global window:false */ +/// + +(function ($, window) { + "use strict"; + + var signalR = $.signalR, + events = $.signalR.events, + changeState = $.signalR.changeState, + transportLogic = signalR.transports._logic; + + signalR.transports.serverSentEvents = { + name: "serverSentEvents", + + supportsKeepAlive: true, + + reconnectTimeout: false, + + currentEventSourceID: 0, + + timeOut: 3000, + + start: function (connection, onSuccess, onFailed) { + var that = this, + opened = false, + $connection = $(connection), + reconnecting = !onSuccess, + url, + connectTimeOut; + + if (connection.eventSource) { + connection.log("The connection already has an event source. Stopping it."); + connection.stop(); + } + + if (!window.EventSource) { + if (onFailed) { + connection.log("This browser doesn't support SSE."); + onFailed(); + } + return; + } + + url = transportLogic.getUrl(connection, this.name, reconnecting); + + try { + connection.log("Attempting to connect to SSE endpoint '" + url + "'"); + connection.eventSource = new window.EventSource(url); + connection.eventSource.ID = ++that.currentEventSourceID; + } + catch (e) { + connection.log("EventSource failed trying to connect with error " + e.Message); + if (onFailed) { + // The connection failed, call the failed callback + onFailed(); + } + else { + $connection.triggerHandler(events.onError, [e]); + if (reconnecting) { + // If we were reconnecting, rather than doing initial connect, then try reconnect again + that.reconnect(connection); + } + } + return; + } + + // After connecting, if after the specified timeout there's no response stop the connection + // and raise on failed + connectTimeOut = window.setTimeout(function () { + if (opened === false) { + connection.log("EventSource timed out trying to connect"); + connection.log("EventSource readyState: " + connection.eventSource.readyState); + + if (!reconnecting) { + that.stop(connection); + } + + if (reconnecting) { + // If we're reconnecting and the event source is attempting to connect, + // don't keep retrying. This causes duplicate connections to spawn. + if (connection.eventSource.readyState !== window.EventSource.CONNECTING && + connection.eventSource.readyState !== window.EventSource.OPEN) { + // If we were reconnecting, rather than doing initial connect, then try reconnect again + that.reconnect(connection); + } + } else if (onFailed) { + onFailed(); + } + } + }, + that.timeOut); + + connection.eventSource.addEventListener("open", function (e) { + connection.log("EventSource connected"); + + if (connectTimeOut) { + window.clearTimeout(connectTimeOut); + } + + if (that.reconnectTimeout) { + window.clearTimeout(that.reconnectTimeout); + } + + if (opened === false) { + opened = true; + + if (onSuccess) { + onSuccess(); + } else if (changeState(connection, + signalR.connectionState.reconnecting, + signalR.connectionState.connected) === true) { + // If there's no onSuccess handler we assume this is a reconnect + $connection.triggerHandler(events.onReconnect); + } + } + }, false); + + connection.eventSource.addEventListener("message", function (e) { + // process messages + if (e.data === "initialized") { + return; + } + + transportLogic.processMessages(connection, window.JSON.parse(e.data)); + }, false); + + connection.eventSource.addEventListener("error", function (e) { + // Only handle an error if the error is from the current Event Source. + // Sometimes on disconnect the server will push down an error event + // to an expired Event Source. + if (this.ID === that.currentEventSourceID) { + if (!opened) { + if (onFailed) { + onFailed(); + } + + return; + } + + connection.log("EventSource readyState: " + connection.eventSource.readyState); + + if (e.eventPhase === window.EventSource.CLOSED) { + // We don't use the EventSource's native reconnect function as it + // doesn't allow us to change the URL when reconnecting. We need + // to change the URL to not include the /connect suffix, and pass + // the last message id we received. + connection.log("EventSource reconnecting due to the server connection ending"); + that.reconnect(connection); + } else { + // connection error + connection.log("EventSource error"); + $connection.triggerHandler(events.onError); + } + } + }, false); + }, + + reconnect: function (connection) { + var that = this; + + that.reconnectTimeout = window.setTimeout(function () { + that.stop(connection); + + if (transportLogic.ensureReconnectingState(connection)) { + connection.log("EventSource reconnecting"); + that.start(connection); + } + }, connection.reconnectDelay); + }, + + lostConnection: function (connection) { + this.reconnect(connection); + }, + + send: function (connection, data) { + transportLogic.ajaxSend(connection, data); + }, + + stop: function (connection) { + if (connection && connection.eventSource) { + connection.log("EventSource calling close()"); + connection.eventSource.close(); + connection.eventSource = null; + delete connection.eventSource; + } + }, + abort: function (connection, async) { + transportLogic.ajaxAbort(connection, async); + } + }; + +}(window.jQuery, window)); +/* jquery.signalR.transports.foreverFrame.js */ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. + +/*global window:false */ +/// + +(function ($, window) { + "use strict"; + + var signalR = $.signalR, + events = $.signalR.events, + changeState = $.signalR.changeState, + transportLogic = signalR.transports._logic; + + signalR.transports.foreverFrame = { + name: "foreverFrame", + + supportsKeepAlive: true, + + timeOut: 3000, + + start: function (connection, onSuccess, onFailed) { + var that = this, + frameId = (transportLogic.foreverFrame.count += 1), + url, + frame = $(""); + + if (window.EventSource) { + // If the browser supports SSE, don't use Forever Frame + if (onFailed) { + connection.log("This browser supports SSE, skipping Forever Frame."); + onFailed(); + } + return; + } + + + // Build the url + url = transportLogic.getUrl(connection, this.name); + url += "&frameId=" + frameId; + + // Set body prior to setting URL to avoid caching issues. + $("body").append(frame); + + frame.prop("src", url); + transportLogic.foreverFrame.connections[frameId] = connection; + + connection.log("Binding to iframe's readystatechange event."); + frame.bind("readystatechange", function () { + if ($.inArray(this.readyState, ["loaded", "complete"]) >= 0) { + connection.log("Forever frame iframe readyState changed to " + this.readyState + ", reconnecting"); + + that.reconnect(connection); + } + }); + + connection.frame = frame[0]; + connection.frameId = frameId; + + if (onSuccess) { + connection.onSuccess = onSuccess; + } + + // After connecting, if after the specified timeout there's no response stop the connection + // and raise on failed + window.setTimeout(function () { + if (connection.onSuccess) { + connection.log("Failed to connect using forever frame source, it timed out after " + that.timeOut + "ms."); + that.stop(connection); + + if (onFailed) { + onFailed(); + } + } + }, that.timeOut); + }, + + reconnect: function (connection) { + var that = this; + window.setTimeout(function () { + if (connection.frame && transportLogic.ensureReconnectingState(connection)) { + var frame = connection.frame, + src = transportLogic.getUrl(connection, that.name, true) + "&frameId=" + connection.frameId; + connection.log("Updating iframe src to '" + src + "'."); + frame.src = src; + } + }, connection.reconnectDelay); + }, + + lostConnection: function (connection) { + this.reconnect(connection); + }, + + send: function (connection, data) { + transportLogic.ajaxSend(connection, data); + }, + + receive: function (connection, data) { + var cw; + + transportLogic.processMessages(connection, data); + // Delete the script & div elements + connection.frameMessageCount = (connection.frameMessageCount || 0) + 1; + if (connection.frameMessageCount > 50) { + connection.frameMessageCount = 0; + cw = connection.frame.contentWindow || connection.frame.contentDocument; + if (cw && cw.document) { + $("body", cw.document).empty(); + } + } + }, + + stop: function (connection) { + var cw = null; + if (connection.frame) { + if (connection.frame.stop) { + connection.frame.stop(); + } else { + try { + cw = connection.frame.contentWindow || connection.frame.contentDocument; + if (cw.document && cw.document.execCommand) { + cw.document.execCommand("Stop"); + } + } + catch (e) { + connection.log("SignalR: Error occured when stopping foreverFrame transport. Message = " + e.message); + } + } + $(connection.frame).remove(); + delete transportLogic.foreverFrame.connections[connection.frameId]; + connection.frame = null; + connection.frameId = null; + delete connection.frame; + delete connection.frameId; + connection.log("Stopping forever frame"); + } + }, + + abort: function (connection, async) { + transportLogic.ajaxAbort(connection, async); + }, + + getConnection: function (id) { + return transportLogic.foreverFrame.connections[id]; + }, + + started: function (connection) { + if (connection.onSuccess) { + connection.onSuccess(); + connection.onSuccess = null; + delete connection.onSuccess; + } else if (changeState(connection, + signalR.connectionState.reconnecting, + signalR.connectionState.connected) === true) { + // If there's no onSuccess handler we assume this is a reconnect + $(connection).triggerHandler(events.onReconnect); + } + } + }; + +}(window.jQuery, window)); +/* jquery.signalR.transports.longPolling.js */ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. + +/*global window:false */ +/// + +(function ($, window) { + "use strict"; + + var signalR = $.signalR, + events = $.signalR.events, + changeState = $.signalR.changeState, + isDisconnecting = $.signalR.isDisconnecting, + transportLogic = signalR.transports._logic; + + signalR.transports.longPolling = { + name: "longPolling", + + supportsKeepAlive: false, + + reconnectDelay: 3000, + + init: function (connection, onComplete) { + /// Pings the server to ensure availability + /// Connection associated with the server ping + /// Callback to call once initialization has completed + + var that = this, + pingLoop, + // pingFail is used to loop the re-ping behavior. When we fail we want to re-try. + pingFail = function (reason) { + if (isDisconnecting(connection) === false) { + connection.log("SignalR: Server ping failed because '" + reason + "', re-trying ping."); + window.setTimeout(pingLoop, that.reconnectDelay); + } + }; + + connection.log("SignalR: Initializing long polling connection with server."); + pingLoop = function () { + // Ping the server, on successful ping call the onComplete method, otherwise if we fail call the pingFail + transportLogic.pingServer(connection, that.name).done(onComplete).fail(pingFail); + }; + + pingLoop(); + }, + + start: function (connection, onSuccess, onFailed) { + /// Starts the long polling connection + /// The SignalR connection to start + var that = this, + initialConnectedFired = false, + fireConnect = function () { + if (initialConnectedFired) { + return; + } + initialConnectedFired = true; + onSuccess(); + connection.log("Longpolling connected"); + }; + + if (connection.pollXhr) { + connection.log("Polling xhr requests already exists, aborting."); + connection.stop(); + } + + // We start with an initialization procedure which pings the server to verify that it is there. + // On scucessful initialization we'll then proceed with starting the transport. + that.init(connection, function () { + connection.messageId = null; + + window.setTimeout(function () { + (function poll(instance, raiseReconnect) { + var messageId = instance.messageId, + connect = (messageId === null), + reconnecting = !connect, + url = transportLogic.getUrl(instance, that.name, reconnecting, raiseReconnect); + + // If we've disconnected during the time we've tried to re-instantiate the poll then stop. + if (isDisconnecting(instance) === true) { + return; + } + + connection.log("Attempting to connect to '" + url + "' using longPolling."); + instance.pollXhr = $.ajax({ + url: url, + global: false, + cache: false, + type: "GET", + dataType: connection.ajaxDataType, + success: function (minData) { + var delay = 0, + data; + + fireConnect(); + + if (minData) { + data = transportLogic.maximizePersistentResponse(minData); + } + + transportLogic.processMessages(instance, minData); + + if (data && + $.type(data.LongPollDelay) === "number") { + delay = data.LongPollDelay; + } + + if (data && data.Disconnect) { + return; + } + + if (isDisconnecting(instance) === true) { + return; + } + + // We never want to pass a raiseReconnect flag after a successful poll. This is handled via the error function + if (delay > 0) { + window.setTimeout(function () { + poll(instance, false); + }, delay); + } else { + poll(instance, false); + } + }, + + error: function (data, textStatus) { + if (textStatus === "abort") { + connection.log("Aborted xhr requst."); + return; + } + + if (connection.state !== signalR.connectionState.reconnecting) { + connection.log("An error occurred using longPolling. Status = " + textStatus + ". " + data.responseText); + $(instance).triggerHandler(events.onError, [data.responseText]); + } + + // Transition into the reconnecting state + transportLogic.ensureReconnectingState(instance); + + // If we've errored out we need to verify that the server is still there, so re-start initialization process + // This will ping the server until it successfully gets a response. + that.init(instance, function () { + // Call poll with the raiseReconnect flag as true + poll(instance, true); + }); + } + }); + + // This will only ever pass after an error has occured via the poll ajax procedure. + if (reconnecting && raiseReconnect === true) { + if (changeState(connection, + signalR.connectionState.reconnecting, + signalR.connectionState.connected) === true) { + // Successfully reconnected! + connection.log("Raising the reconnect event"); + $(instance).triggerHandler(events.onReconnect); + } + } + }(connection)); + + // Set an arbitrary timeout to trigger onSuccess, this will alot for enough time on the server to wire up the connection. + // Will be fixed by #1189 and this code can be modified to not be a timeout + window.setTimeout(function () { + // Trigger the onSuccess() method because we've now instantiated a connection + fireConnect(); + }, 250); + }, 250); // Have to delay initial poll so Chrome doesn't show loader spinner in tab + }); + }, + + lostConnection: function (connection) { + throw new Error("Lost Connection not handled for LongPolling"); + }, + + send: function (connection, data) { + transportLogic.ajaxSend(connection, data); + }, + + stop: function (connection) { + /// Stops the long polling connection + /// The SignalR connection to stop + if (connection.pollXhr) { + connection.pollXhr.abort(); + connection.pollXhr = null; + delete connection.pollXhr; + } + }, + + abort: function (connection, async) { + transportLogic.ajaxAbort(connection, async); + } + }; + +}(window.jQuery, window)); +/* jquery.signalR.hubs.js */ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. + +/*global window:false */ +/// + +(function ($, window) { + "use strict"; + + // we use a global id for tracking callbacks so the server doesn't have to send extra info like hub name + var callbackId = 0, + callbacks = {}, + eventNamespace = ".hubProxy"; + + function makeEventName(event) { + return event + eventNamespace; + } + + // Array.prototype.map + if (!Array.prototype.hasOwnProperty("map")) { + Array.prototype.map = function (fun, thisp) { + var arr = this, + i, + length = arr.length, + result = []; + for (i = 0; i < length; i += 1) { + if (arr.hasOwnProperty(i)) { + result[i] = fun.call(thisp, arr[i], i, arr); + } + } + return result; + }; + } + + function getArgValue(a) { + return $.isFunction(a) ? null : ($.type(a) === "undefined" ? null : a); + } + + function hasMembers(obj) { + for (var key in obj) { + // If we have any properties in our callback map then we have callbacks and can exit the loop via return + if (obj.hasOwnProperty(key)) { + return true; + } + } + + return false; + } + + // hubProxy + function hubProxy(hubConnection, hubName) { + /// + /// Creates a new proxy object for the given hub connection that can be used to invoke + /// methods on server hubs and handle client method invocation requests from the server. + /// + return new hubProxy.fn.init(hubConnection, hubName); + } + + hubProxy.fn = hubProxy.prototype = { + init: function (connection, hubName) { + this.state = {}; + this.connection = connection; + this.hubName = hubName; + this._ = { + callbackMap: {} + }; + }, + + hasSubscriptions: function () { + return hasMembers(this._.callbackMap); + }, + + on: function (eventName, callback) { + /// Wires up a callback to be invoked when a invocation request is received from the server hub. + /// The name of the hub event to register the callback for. + /// The callback to be invoked. + var self = this, + callbackMap = self._.callbackMap; + + // Normalize the event name to lowercase + eventName = eventName.toLowerCase(); + + // If there is not an event registered for this callback yet we want to create its event space in the callback map. + if (!callbackMap[eventName]) { + callbackMap[eventName] = {}; + } + + // Map the callback to our encompassed function + callbackMap[eventName][callback] = function (e, data) { + callback.apply(self, data); + }; + + $(self).bind(makeEventName(eventName), callbackMap[eventName][callback]); + + return self; + }, + + off: function (eventName, callback) { + /// Removes the callback invocation request from the server hub for the given event name. + /// The name of the hub event to unregister the callback for. + /// The callback to be invoked. + var self = this, + callbackMap = self._.callbackMap, + callbackSpace; + + // Normalize the event name to lowercase + eventName = eventName.toLowerCase(); + + callbackSpace = callbackMap[eventName]; + + // Verify that there is an event space to unbind + if (callbackSpace) { + // Only unbind if there's an event bound with eventName and a callback with the specified callback + if (callbackSpace[callback]) { + $(self).unbind(makeEventName(eventName), callbackSpace[callback]); + + // Remove the callback from the callback map + delete callbackSpace[callback]; + + // Check if there are any members left on the event, if not we need to destroy it. + if (!hasMembers(callbackSpace)) { + delete callbackMap[eventName]; + } + } + else if (!callback) { // Check if we're removing the whole event and we didn't error because of an invalid callback + $(self).unbind(makeEventName(eventName)); + + delete callbackMap[eventName]; + } + } + + return self; + }, + + invoke: function (methodName) { + /// Invokes a server hub method with the given arguments. + /// The name of the server hub method. + + var self = this, + args = $.makeArray(arguments).slice(1), + argValues = args.map(getArgValue), + data = { H: self.hubName, M: methodName, A: argValues, I: callbackId }, + d = $.Deferred(), + callback = function (minResult) { + var result = self._maximizeHubResponse(minResult); + + // Update the hub state + $.extend(self.state, result.State); + + if (result.Error) { + // Server hub method threw an exception, log it & reject the deferred + if (result.StackTrace) { + self.connection.log(result.Error + "\n" + result.StackTrace); + } + d.rejectWith(self, [result.Error]); + } else { + // Server invocation succeeded, resolve the deferred + d.resolveWith(self, [result.Result]); + } + }; + + callbacks[callbackId.toString()] = { scope: self, method: callback }; + callbackId += 1; + + if (!$.isEmptyObject(self.state)) { + data.S = self.state; + } + + self.connection.send(window.JSON.stringify(data)); + + return d.promise(); + }, + + _maximizeHubResponse: function (minHubResponse) { + return { + State: minHubResponse.S, + Result: minHubResponse.R, + Id: minHubResponse.I, + Error: minHubResponse.E, + StackTrace: minHubResponse.T + }; + } + }; + + hubProxy.fn.init.prototype = hubProxy.fn; + + // hubConnection + function hubConnection(url, options) { + /// Creates a new hub connection. + /// [Optional] The hub route url, defaults to "/signalr". + /// [Optional] Settings to use when creating the hubConnection. + var settings = { + qs: null, + logging: false, + useDefaultPath: true + }; + + $.extend(settings, options); + + if (!url || settings.useDefaultPath) { + url = (url || "") + "/signalr"; + } + return new hubConnection.fn.init(url, settings); + } + + hubConnection.fn = hubConnection.prototype = $.connection(); + + hubConnection.fn.init = function (url, options) { + var settings = { + qs: null, + logging: false, + useDefaultPath: true + }, + connection = this; + + $.extend(settings, options); + + // Call the base constructor + $.signalR.fn.init.call(connection, url, settings.qs, settings.logging); + + // Object to store hub proxies for this connection + connection.proxies = {}; + + // Wire up the received handler + connection.received(function (minData) { + var data, proxy, dataCallbackId, callback, hubName, eventName; + if (!minData) { + return; + } + + if (typeof (minData.I) !== "undefined") { + // We received the return value from a server method invocation, look up callback by id and call it + dataCallbackId = minData.I.toString(); + callback = callbacks[dataCallbackId]; + if (callback) { + // Delete the callback from the proxy + callbacks[dataCallbackId] = null; + delete callbacks[dataCallbackId]; + + // Invoke the callback + callback.method.call(callback.scope, minData); + } + } else { + data = this._maximizeClientHubInvocation(minData); + + // We received a client invocation request, i.e. broadcast from server hub + connection.log("Triggering client hub event '" + data.Method + "' on hub '" + data.Hub + "'."); + + // Normalize the names to lowercase + hubName = data.Hub.toLowerCase(); + eventName = data.Method.toLowerCase(); + + // Trigger the local invocation event + proxy = this.proxies[hubName]; + + // Update the hub state + $.extend(proxy.state, data.State); + $(proxy).triggerHandler(makeEventName(eventName), [data.Args]); + } + }); + }; + + hubConnection.fn._maximizeClientHubInvocation = function (minClientHubInvocation) { + return { + Hub: minClientHubInvocation.H, + Method: minClientHubInvocation.M, + Args: minClientHubInvocation.A, + State: minClientHubInvocation.S + }; + }; + + hubConnection.fn._registerSubscribedHubs = function () { + /// + /// Sets the starting event to loop through the known hubs and register any new hubs + /// that have been added to the proxy. + /// + + if (!this._subscribedToHubs) { + this._subscribedToHubs = true; + this.starting(function () { + // Set the connection's data object with all the hub proxies with active subscriptions. + // These proxies will receive notifications from the server. + var subscribedHubs = []; + + $.each(this.proxies, function (key) { + if (this.hasSubscriptions()) { + subscribedHubs.push({ name: key }); + } + }); + + this.data = window.JSON.stringify(subscribedHubs); + }); + } + }; + + hubConnection.fn.createHubProxy = function (hubName) { + /// + /// Creates a new proxy object for the given hub connection that can be used to invoke + /// methods on server hubs and handle client method invocation requests from the server. + /// + /// + /// The name of the hub on the server to create the proxy for. + /// + + // Normalize the name to lowercase + hubName = hubName.toLowerCase(); + + var proxy = this.proxies[hubName]; + if (!proxy) { + proxy = hubProxy(this, hubName); + this.proxies[hubName] = proxy; + } + + this._registerSubscribedHubs(); + + return proxy; + }; + + hubConnection.fn.init.prototype = hubConnection.fn; + + $.hubConnection = hubConnection; + +}(window.jQuery, window)); +/* jquery.signalR.version.js */ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. + +/*global window:false */ +/// +(function ($) { + $.signalR.version = "1.0.0.rc1"; +}(window.jQuery)); diff --git a/linger/src/linger.Mvc.Demo/Scripts/jquery.signalR-1.0.0.min.js b/linger/src/linger.Mvc.Demo/Scripts/jquery.signalR-1.0.0.min.js new file mode 100644 index 0000000..6f14d9d --- /dev/null +++ b/linger/src/linger.Mvc.Demo/Scripts/jquery.signalR-1.0.0.min.js @@ -0,0 +1,10 @@ +/*! + * ASP.NET SignalR JavaScript Library v1.0.0 + * http://signalr.net/ + * + * Copyright Microsoft Open Technologies, Inc. All rights reserved. + * Licensed under the Apache 2.0 + * https://github.com/SignalR/SignalR/blob/master/LICENSE.md + * + */ +(function(n,t){"use strict";function l(t,r){var u,f;if(n.isArray(t)){for(u=t.length-1;u>=0;u--)f=t[u],n.type(t)==="object"||n.type(f)==="string"&&i.transports[f]||(r.log("Invalid transport: "+f+", removing it from the transports list."),t.splice(u,1));t.length===0&&(r.log("No transports remain within the specified transport array."),t=null)}else n.type(t)==="object"||i.transports[t]||t==="auto"||(r.log("Invalid transport: "+t.toString()),t=null);return t}function h(n){return n==="http:"?80:n==="https:"?443:void 0}function o(n,t){return t.match(/:\d+$/)?t:t+":"+h(n)}if(typeof n!="function")throw new Error("SignalR: jQuery not found. Please ensure jQuery is referenced before the SignalR.js file.");if(!t.JSON)throw new Error("SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.");var i,s,e=t.document.readyState==="complete",f=n(t),r={onStart:"onStart",onStarting:"onStarting",onReceived:"onReceived",onError:"onError",onConnectionSlow:"onConnectionSlow",onReconnecting:"onReconnecting",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},c=function(n,i){if(i!==!1){var r;typeof t.console!="undefined"&&(r="["+(new Date).toTimeString()+"] SignalR: "+n,t.console.debug?t.console.debug(r):t.console.log&&t.console.log(r))}},u=function(t,i,u){return i===t.state?(t.state=u,n(t).triggerHandler(r.onStateChanged,[{oldState:i,newState:u}]),!0):!1},a=function(n){return n.state===i.connectionState.disconnected},v=function(n){var u,r;n._.configuredStopReconnectingTimeout||(r=function(n){n.log("Couldn't reconnect within the configured timeout ("+n.disconnectTimeout+"ms), disconnecting."),n.stop(!1,!1)},n.reconnecting(function(){var n=this;u=t.setTimeout(function(){r(n)},n.disconnectTimeout)}),n.stateChanged(function(n){n.oldState===i.connectionState.reconnecting&&t.clearTimeout(u)}),n._.configuredStopReconnectingTimeout=!0)};i=function(n,t,r){return new i.fn.init(n,t,r)},i.events=r,i.changeState=u,i.isDisconnecting=a,i.connectionState={connecting:0,connected:1,reconnecting:2,disconnected:4},i.hub={start:function(){throw new Error("SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g. "); + }; + + if (jQueryTmplVersion > 0) { + jQuery['tmpl']['tag']['ko_code'] = { + open: "__.push($1 || '');" + }; + jQuery['tmpl']['tag']['ko_with'] = { + open: "with($1) {", + close: "} " + }; + } + }; + + ko.jqueryTmplTemplateEngine.prototype = new ko.templateEngine(); + + // Use this one by default *only if jquery.tmpl is referenced* + var jqueryTmplTemplateEngineInstance = new ko.jqueryTmplTemplateEngine(); + if (jqueryTmplTemplateEngineInstance.jQueryTmplVersion > 0) + ko.setTemplateEngine(jqueryTmplTemplateEngineInstance); + + ko.exportSymbol('jqueryTmplTemplateEngine', ko.jqueryTmplTemplateEngine); +})(); +}); +})(window,document,navigator,window["jQuery"]); +})(); diff --git a/linger/src/linger.Mvc.Demo/Scripts/knockout-2.2.1.js b/linger/src/linger.Mvc.Demo/Scripts/knockout-2.2.1.js new file mode 100644 index 0000000..d93e497 --- /dev/null +++ b/linger/src/linger.Mvc.Demo/Scripts/knockout-2.2.1.js @@ -0,0 +1,85 @@ +// Knockout JavaScript library v2.2.1 +// (c) Steven Sanderson - http://knockoutjs.com/ +// License: MIT (http://www.opensource.org/licenses/mit-license.php) + +(function() {function j(w){throw w;}var m=!0,p=null,r=!1;function u(w){return function(){return w}};var x=window,y=document,ga=navigator,F=window.jQuery,I=void 0; +function L(w){function ha(a,d,c,e,f){var g=[];a=b.j(function(){var a=d(c,f)||[];0b.a.i(d,a[c])&&d.push(a[c]);return d},V:function(a,b){a=a||[];for(var d=[],c=0,e=a.length;cn?a.setAttribute("selected",b):a.selected=b},D:function(a){return(a||"").replace(d,"")},Rb:function(a,d){for(var c=[],e=(a||"").split(d),f=0,g=e.length;fa.length?r:a.substring(0,b.length)===b},tb:function(a,b){if(b.compareDocumentPosition)return 16== +(b.compareDocumentPosition(a)&16);for(;a!=p;){if(a==b)return m;a=a.parentNode}return r},X:function(a){return b.a.tb(a,a.ownerDocument)},u:function(a){return a&&a.tagName&&a.tagName.toLowerCase()},n:function(b,d,c){var e=n&&l[d];if(!e&&"undefined"!=typeof F){if(a(b,d)){var f=c;c=function(a,b){var d=this.checked;b&&(this.checked=b.nb!==m);f.call(this,a);this.checked=d}}F(b).bind(d,c)}else!e&&"function"==typeof b.addEventListener?b.addEventListener(d,c,r):"undefined"!=typeof b.attachEvent?b.attachEvent("on"+ +d,function(a){c.call(b,a)}):j(Error("Browser doesn't support addEventListener or attachEvent"))},Ba:function(b,d){(!b||!b.nodeType)&&j(Error("element must be a DOM node when calling triggerEvent"));if("undefined"!=typeof F){var c=[];a(b,d)&&c.push({nb:b.checked});F(b).trigger(d,c)}else"function"==typeof y.createEvent?"function"==typeof b.dispatchEvent?(c=y.createEvent(e[d]||"HTMLEvents"),c.initEvent(d,m,m,x,0,0,0,0,0,r,r,r,r,0,b),b.dispatchEvent(c)):j(Error("The supplied element doesn't support dispatchEvent")): +"undefined"!=typeof b.fireEvent?(a(b,d)&&(b.checked=b.checked!==m),b.fireEvent("on"+d)):j(Error("Browser doesn't support triggering events"))},d:function(a){return b.$(a)?a():a},ua:function(a){return b.$(a)?a.t():a},da:function(a,d,c){if(d){var e=/[\w-]+/g,f=a.className.match(e)||[];b.a.o(d.match(e),function(a){var d=b.a.i(f,a);0<=d?c||f.splice(d,1):c&&f.push(a)});a.className=f.join(" ")}},cb:function(a,d){var c=b.a.d(d);if(c===p||c===I)c="";if(3===a.nodeType)a.data=c;else{var e=b.e.firstChild(a); +!e||3!=e.nodeType||b.e.nextSibling(e)?b.e.N(a,[y.createTextNode(c)]):e.data=c;b.a.wb(a)}},ab:function(a,b){a.name=b;if(7>=n)try{a.mergeAttributes(y.createElement(""),r)}catch(d){}},wb:function(a){9<=n&&(a=1==a.nodeType?a:a.parentNode,a.style&&(a.style.zoom=a.style.zoom))},ub:function(a){if(9<=n){var b=a.style.width;a.style.width=0;a.style.width=b}},Lb:function(a,d){a=b.a.d(a);d=b.a.d(d);for(var c=[],e=a;e<=d;e++)c.push(e);return c},L:function(a){for(var b=[],d=0,c=a.length;d< +c;d++)b.push(a[d]);return b},Pb:6===n,Qb:7===n,Z:n,Oa:function(a,d){for(var c=b.a.L(a.getElementsByTagName("input")).concat(b.a.L(a.getElementsByTagName("textarea"))),e="string"==typeof d?function(a){return a.name===d}:function(a){return d.test(a.name)},f=[],g=c.length-1;0<=g;g--)e(c[g])&&f.push(c[g]);return f},Ib:function(a){return"string"==typeof a&&(a=b.a.D(a))?x.JSON&&x.JSON.parse?x.JSON.parse(a):(new Function("return "+a))():p},xa:function(a,d,c){("undefined"==typeof JSON||"undefined"==typeof JSON.stringify)&& +j(Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js"));return JSON.stringify(b.a.d(a),d,c)},Jb:function(a,d,c){c=c||{};var e=c.params||{},f=c.includeFields||this.Na,g=a;if("object"==typeof a&&"form"===b.a.u(a))for(var g=a.action,h=f.length-1;0<=h;h--)for(var k=b.a.Oa(a,f[h]),l=k.length-1;0<=l;l--)e[k[l].name]=k[l].value;d=b.a.d(d);var n=y.createElement("form"); +n.style.display="none";n.action=g;n.method="post";for(var w in d)a=y.createElement("input"),a.name=w,a.value=b.a.xa(b.a.d(d[w])),n.appendChild(a);for(w in e)a=y.createElement("input"),a.name=w,a.value=e[w],n.appendChild(a);y.body.appendChild(n);c.submitter?c.submitter(n):n.submit();setTimeout(function(){n.parentNode.removeChild(n)},0)}}};b.b("utils",b.a);b.b("utils.arrayForEach",b.a.o);b.b("utils.arrayFirst",b.a.lb);b.b("utils.arrayFilter",b.a.fa);b.b("utils.arrayGetDistinctValues",b.a.Ga);b.b("utils.arrayIndexOf", +b.a.i);b.b("utils.arrayMap",b.a.V);b.b("utils.arrayPushAll",b.a.P);b.b("utils.arrayRemoveItem",b.a.ga);b.b("utils.extend",b.a.extend);b.b("utils.fieldsIncludedWithJsonPost",b.a.Na);b.b("utils.getFormFields",b.a.Oa);b.b("utils.peekObservable",b.a.ua);b.b("utils.postJson",b.a.Jb);b.b("utils.parseJson",b.a.Ib);b.b("utils.registerEventHandler",b.a.n);b.b("utils.stringifyJson",b.a.xa);b.b("utils.range",b.a.Lb);b.b("utils.toggleDomNodeCssClass",b.a.da);b.b("utils.triggerEvent",b.a.Ba);b.b("utils.unwrapObservable", +b.a.d);Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Array.prototype.slice.call(arguments);a=c.shift();return function(){return b.apply(a,c.concat(Array.prototype.slice.call(arguments)))}});b.a.f=new function(){var a=0,d="__ko__"+(new Date).getTime(),c={};return{get:function(a,d){var c=b.a.f.la(a,r);return c===I?I:c[d]},set:function(a,d,c){c===I&&b.a.f.la(a,r)===I||(b.a.f.la(a,m)[d]=c)},la:function(b,f){var g=b[d];if(!g||!("null"!==g&&c[g])){if(!f)return I;g=b[d]="ko"+ +a++;c[g]={}}return c[g]},clear:function(a){var b=a[d];return b?(delete c[b],a[d]=p,m):r}}};b.b("utils.domData",b.a.f);b.b("utils.domData.clear",b.a.f.clear);b.a.F=new function(){function a(a,d){var e=b.a.f.get(a,c);e===I&&d&&(e=[],b.a.f.set(a,c,e));return e}function d(c){var e=a(c,r);if(e)for(var e=e.slice(0),k=0;k",""]||!c.indexOf("",""]||(!c.indexOf("",""]||[0,"",""];a="ignored
"+c[1]+a+c[2]+"
";for("function"==typeof x.innerShiv?d.appendChild(x.innerShiv(a)):d.innerHTML=a;c[0]--;)d=d.lastChild;d=b.a.L(d.lastChild.childNodes)}return d};b.a.ca=function(a,d){b.a.ka(a);d=b.a.d(d);if(d!==p&&d!==I)if("string"!=typeof d&&(d=d.toString()), +"undefined"!=typeof F)F(a).html(d);else for(var c=b.a.ta(d),e=0;ec;c++)a=a();return a})};b.toJSON=function(a,d,c){a=b.gb(a);return b.a.xa(a,d,c)};b.b("toJS",b.gb);b.b("toJSON",b.toJSON);b.k={q:function(a){switch(b.a.u(a)){case "option":return a.__ko__hasDomDataOptionValue__=== +m?b.a.f.get(a,b.c.options.sa):7>=b.a.Z?a.getAttributeNode("value").specified?a.value:a.text:a.value;case "select":return 0<=a.selectedIndex?b.k.q(a.options[a.selectedIndex]):I;default:return a.value}},T:function(a,d){switch(b.a.u(a)){case "option":switch(typeof d){case "string":b.a.f.set(a,b.c.options.sa,I);"__ko__hasDomDataOptionValue__"in a&&delete a.__ko__hasDomDataOptionValue__;a.value=d;break;default:b.a.f.set(a,b.c.options.sa,d),a.__ko__hasDomDataOptionValue__=m,a.value="number"===typeof d? +d:""}break;case "select":for(var c=a.options.length-1;0<=c;c--)if(b.k.q(a.options[c])==d){a.selectedIndex=c;break}break;default:if(d===p||d===I)d="";a.value=d}}};b.b("selectExtensions",b.k);b.b("selectExtensions.readValue",b.k.q);b.b("selectExtensions.writeValue",b.k.T);var ka=/\@ko_token_(\d+)\@/g,na=["true","false"],oa=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i;b.g={Q:[],aa:function(a){var d=b.a.D(a);if(3>d.length)return[];"{"===d.charAt(0)&&(d=d.substring(1,d.length-1));a=[];for(var c= +p,e,f=0;f=b.a.Z&&e in fa?(e=fa[e],g?a.removeAttribute(e): +a[e]=f):g||a.setAttribute(e,f.toString());"name"===e&&b.a.ab(a,g?"":f.toString())}}};b.c.checked={init:function(a,d,c){b.a.n(a,"click",function(){var e;if("checkbox"==a.type)e=a.checked;else if("radio"==a.type&&a.checked)e=a.value;else return;var f=d(),g=b.a.d(f);"checkbox"==a.type&&g instanceof Array?(e=b.a.i(g,a.value),a.checked&&0>e?f.push(a.value):!a.checked&&0<=e&&f.splice(e,1)):b.g.ea(f,c,"checked",e,m)});"radio"==a.type&&!a.name&&b.c.uniqueName.init(a,u(m))},update:function(a,d){var c=b.a.d(d()); +"checkbox"==a.type?a.checked=c instanceof Array?0<=b.a.i(c,a.value):c:"radio"==a.type&&(a.checked=a.value==c)}};b.c.css={update:function(a,d){var c=b.a.d(d());if("object"==typeof c)for(var e in c){var f=b.a.d(c[e]);b.a.da(a,e,f)}else c=String(c||""),b.a.da(a,a.__ko__cssValue,r),a.__ko__cssValue=c,b.a.da(a,c,m)}};b.c.enable={update:function(a,d){var c=b.a.d(d());c&&a.disabled?a.removeAttribute("disabled"):!c&&!a.disabled&&(a.disabled=m)}};b.c.disable={update:function(a,d){b.c.enable.update(a,function(){return!b.a.d(d())})}}; +b.c.event={init:function(a,d,c,e){var f=d()||{},g;for(g in f)(function(){var f=g;"string"==typeof f&&b.a.n(a,f,function(a){var g,n=d()[f];if(n){var q=c();try{var s=b.a.L(arguments);s.unshift(e);g=n.apply(e,s)}finally{g!==m&&(a.preventDefault?a.preventDefault():a.returnValue=r)}q[f+"Bubble"]===r&&(a.cancelBubble=m,a.stopPropagation&&a.stopPropagation())}})})()}};b.c.foreach={Sa:function(a){return function(){var d=a(),c=b.a.ua(d);if(!c||"number"==typeof c.length)return{foreach:d,templateEngine:b.C.oa}; +b.a.d(d);return{foreach:c.data,as:c.as,includeDestroyed:c.includeDestroyed,afterAdd:c.afterAdd,beforeRemove:c.beforeRemove,afterRender:c.afterRender,beforeMove:c.beforeMove,afterMove:c.afterMove,templateEngine:b.C.oa}}},init:function(a,d){return b.c.template.init(a,b.c.foreach.Sa(d))},update:function(a,d,c,e,f){return b.c.template.update(a,b.c.foreach.Sa(d),c,e,f)}};b.g.Q.foreach=r;b.e.I.foreach=m;b.c.hasfocus={init:function(a,d,c){function e(e){a.__ko_hasfocusUpdating=m;var f=a.ownerDocument;"activeElement"in +f&&(e=f.activeElement===a);f=d();b.g.ea(f,c,"hasfocus",e,m);a.__ko_hasfocusUpdating=r}var f=e.bind(p,m),g=e.bind(p,r);b.a.n(a,"focus",f);b.a.n(a,"focusin",f);b.a.n(a,"blur",g);b.a.n(a,"focusout",g)},update:function(a,d){var c=b.a.d(d());a.__ko_hasfocusUpdating||(c?a.focus():a.blur(),b.r.K(b.a.Ba,p,[a,c?"focusin":"focusout"]))}};b.c.html={init:function(){return{controlsDescendantBindings:m}},update:function(a,d){b.a.ca(a,d())}};var da="__ko_withIfBindingData";Q("if");Q("ifnot",r,m);Q("with",m,r,function(a, +b){return a.createChildContext(b)});b.c.options={update:function(a,d,c){"select"!==b.a.u(a)&&j(Error("options binding applies only to SELECT elements"));for(var e=0==a.length,f=b.a.V(b.a.fa(a.childNodes,function(a){return a.tagName&&"option"===b.a.u(a)&&a.selected}),function(a){return b.k.q(a)||a.innerText||a.textContent}),g=a.scrollTop,h=b.a.d(d());0b.a.Z)&&a.nodes?a.nodes():p;if(d)return b.a.L(d.cloneNode(m).childNodes);a=a.text();return b.a.ta(a)};b.C.oa=new b.C;b.wa(b.C.oa);b.b("nativeTemplateEngine",b.C);b.qa=function(){var a=this.Db=function(){if("undefined"==typeof F||!F.tmpl)return 0;try{if(0<=F.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(a){}return 1}();this.renderTemplateSource=function(b,c,e){e=e||{};2>a&&j(Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.")); +var f=b.data("precompiled");f||(f=b.text()||"",f=F.template(p,"{{ko_with $item.koBindingContext}}"+f+"{{/ko_with}}"),b.data("precompiled",f));b=[c.$data];c=F.extend({koBindingContext:c},e.templateOptions);c=F.tmpl(f,b,c);c.appendTo(y.createElement("div"));F.fragments={};return c};this.createJavaScriptEvaluatorBlock=function(a){return"{{ko_code ((function() { return "+a+" })()) }}"};this.addTemplate=function(a,b){y.write(" + + + + + + + + + diff --git a/linger/src/linger.Mvc.Demo/Views/Web.config b/linger/src/linger.Mvc.Demo/Views/Web.config new file mode 100644 index 0000000..826ce19 --- /dev/null +++ b/linger/src/linger.Mvc.Demo/Views/Web.config @@ -0,0 +1,58 @@ + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/linger/src/linger.Mvc.Demo/Web.Debug.config b/linger/src/linger.Mvc.Demo/Web.Debug.config new file mode 100644 index 0000000..3e2a97c --- /dev/null +++ b/linger/src/linger.Mvc.Demo/Web.Debug.config @@ -0,0 +1,30 @@ + + + + + + + + + + \ No newline at end of file diff --git a/linger/src/linger.Mvc.Demo/Web.Release.config b/linger/src/linger.Mvc.Demo/Web.Release.config new file mode 100644 index 0000000..9fd481f --- /dev/null +++ b/linger/src/linger.Mvc.Demo/Web.Release.config @@ -0,0 +1,31 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/linger/src/linger.Mvc.Demo/Web.config b/linger/src/linger.Mvc.Demo/Web.config new file mode 100644 index 0000000..1043568 --- /dev/null +++ b/linger/src/linger.Mvc.Demo/Web.config @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/linger/src/linger.Mvc.Demo/linger.Mvc.Demo.csproj b/linger/src/linger.Mvc.Demo/linger.Mvc.Demo.csproj new file mode 100644 index 0000000..235286e --- /dev/null +++ b/linger/src/linger.Mvc.Demo/linger.Mvc.Demo.csproj @@ -0,0 +1,248 @@ + + + + + Debug + AnyCPU + + + 2.0 + {95719B60-C166-4CF7-911E-EB5D82ABD6E7} + {E3E379DF-F4C6-4180-9B81-6769533ABE47};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + linger.Mvc.Demo + linger.Mvc.Demo + v4.0 + false + true + + + + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + + ..\packages\tophat.1.0.7\lib\net40\container.dll + + + ..\packages\DotLiquid.1.7.0\lib\NET40\DotLiquid.dll + + + ..\packages\tophat.1.0.7\lib\net40\FluentMigrator.dll + + + ..\packages\tophat.1.0.7\lib\net40\FluentMigrator.Runner.dll + + + ..\packages\Microsoft.AspNet.SignalR.Core.1.0.0\lib\net40\Microsoft.AspNet.SignalR.Core.dll + + + ..\packages\Microsoft.AspNet.SignalR.Owin.1.0.0\lib\net40\Microsoft.AspNet.SignalR.Owin.dll + + + ..\packages\Microsoft.AspNet.SignalR.SystemWeb.1.0.0\lib\net40\Microsoft.AspNet.SignalR.SystemWeb.dll + + + + ..\packages\Microsoft.Owin.Host.SystemWeb.1.0.0\lib\net40\Microsoft.Owin.Host.SystemWeb.dll + + + False + ..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll + + + ..\packages\Owin.1.0\lib\net40\Owin.dll + + + + + ..\packages\System.Data.SQLite.1.0.84.0\lib\net40\System.Data.SQLite.dll + + + ..\packages\System.Data.SQLite.1.0.84.0\lib\net40\System.Data.SQLite.Linq.dll + + + + + + + + + + + + + + + + + + + True + ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll + + + True + ..\packages\Microsoft.Net.Http.2.0.20710.0\lib\net40\System.Net.Http.dll + + + ..\packages\Microsoft.AspNet.WebApi.Client.4.0.20710.0\lib\net40\System.Net.Http.Formatting.dll + + + True + ..\packages\Microsoft.Net.Http.2.0.20710.0\lib\net40\System.Net.Http.WebRequest.dll + + + True + ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.Helpers.dll + + + ..\packages\Microsoft.AspNet.WebApi.Core.4.0.20710.0\lib\net40\System.Web.Http.dll + + + ..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.20710.0\lib\net40\System.Web.Http.WebHost.dll + + + True + ..\packages\Microsoft.AspNet.Mvc.4.0.20710.0\lib\net40\System.Web.Mvc.dll + + + True + ..\packages\Microsoft.AspNet.Razor.2.0.20710.0\lib\net40\System.Web.Razor.dll + + + True + ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.dll + + + True + ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Deployment.dll + + + True + ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Razor.dll + + + ..\packages\tophat.1.0.7\lib\net40\tophat.dll + + + ..\packages\tophat.1.0.7\lib\net40\tophat.FluentMigrator.dll + + + + + + + Global.asax + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Web.config + + + Web.config + + + + Always + + + Always + + + + + + + + + + + + + {92dfdda0-1604-420f-842c-c04cffb3079b} + linger + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + + + + True + True + 0 + / + http://localhost:2690/ + False + False + + + False + + + + + + \ No newline at end of file diff --git a/linger/src/linger.Mvc.Demo/packages.config b/linger/src/linger.Mvc.Demo/packages.config new file mode 100644 index 0000000..01821b7 --- /dev/null +++ b/linger/src/linger.Mvc.Demo/packages.config @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/linger/src/linger.Tests/DatabaseJobRepositoryTests.cs b/linger/src/linger.Tests/DatabaseJobRepositoryTests.cs new file mode 100644 index 0000000..6588b4f --- /dev/null +++ b/linger/src/linger.Tests/DatabaseJobRepositoryTests.cs @@ -0,0 +1,114 @@ +using System; +using System.Linq; +using NUnit.Framework; + +namespace linger.Tests +{ + public class DatabaseJobRepositoryTests + { + private readonly DatabaseJobRepository _repository; + + public DatabaseJobRepositoryTests(DatabaseJobRepository repository) + { + _repository = repository; + } + + public void Saves_job() + { + Assert.DoesNotThrow(() => SaveJob()); + } + + public void Updates_job() + { + Assert.DoesNotThrow(() => + { + var job = SaveJob(); + job.SucceededAt = DateTime.Now; + job.LastError = "Too good of shape"; + _repository.Save(job); + }); + } + + public void Loads_job() + { + Assert.DoesNotThrow(() => + { + var scheduled = SaveJob(); + var loaded = _repository.Load(scheduled.Id); + Assert.IsNotNull(loaded); + }); + } + + public void Fetches_and_locks_job() + { + var scheduled = SaveJob(); + var fetched = _repository.GetNextAvailable(1); + + Assert.AreEqual(1, fetched.Count); + Assert.AreEqual(scheduled.Id, fetched[0].Id); + Assert.IsNotNull(fetched[0].LockedAt, "Did not set lock date"); + Assert.IsNotNull(fetched[0].LockedBy, "Did not set lock user"); + } + + public void Fetches_all_jobs() + { + Assert.DoesNotThrow(() => + { + var scheduled = SaveJob(); + var loaded = _repository.GetAll(); + Assert.IsNotNull(loaded); + Assert.AreEqual(1, loaded.Count); + Assert.AreEqual(scheduled, loaded.First()); + }); + } + + public void Creates_a_batch() + { + Assert.DoesNotThrow(() => + { + var scheduled = SaveJob(); + var batch = _repository.CreateBatch("test", new []{ scheduled }); + + Assert.IsNotNull(batch); + Assert.IsNotNull(batch.Jobs); + Assert.AreEqual("test", batch.Name); + Assert.AreEqual(1, batch.Id); + Assert.AreEqual(1, batch.Jobs.Count()); + Assert.AreEqual(scheduled, batch.Jobs.First()); + }); + } + + public void Jobs_in_batches_arent_fetched() + { + Assert.DoesNotThrow(() => + { + var scheduled1 = Linger.CreateScheduledJob(new HelloWorldJob(), 0, null); + _repository.Save(scheduled1); + + var scheduled2 = Linger.CreateScheduledJob(new HelloWorldJob(), 0, null); + _repository.Save(scheduled2); + + var batch = _repository.CreateBatch("test", new[] {scheduled2}); + Assert.IsNotNull(batch); + Assert.IsTrue(batch.Jobs.Contains(scheduled2)); + + var all = _repository.GetAll(); + Assert.IsNotNull(all); + Assert.AreEqual(1, all.Count); + + var available = _repository.GetNextAvailable(2); + Assert.IsNotNull(available); + Assert.AreEqual(1, available.Count); + }); + } + + private ScheduledJob SaveJob() + { + var job = new HelloWorldJob(); + var scheduled = Linger.CreateScheduledJob(job, 0, null); + _repository.Save(scheduled); + Assert.AreEqual(1, scheduled.Id); + return scheduled; + } + } +} \ No newline at end of file diff --git a/linger/src/linger.Tests/EveryTests.cs b/linger/src/linger.Tests/EveryTests.cs new file mode 100644 index 0000000..88213b5 --- /dev/null +++ b/linger/src/linger.Tests/EveryTests.cs @@ -0,0 +1,36 @@ +using System; +using System.Linq; +using NUnit.Framework; + +namespace linger.Tests +{ + [TestFixture] + public class EveryTests + { + [Test] + public void Periods_with_undefined_endings_have_infinite_occurrences() + { + var job = new ScheduledJob(); + var info = new Every(job).Hour(); + Assert.Throws(() => { info.AllOccurrences.ToList(); }); + Assert.IsNull(info.LastOccurrence); + + var next = info.NextOccurrence; + Assert.IsNotNull(next); + Console.WriteLine(next); + } + + [Test] + public void Periods_with_defined_endings_have_finite_occurrences() + { + var job = new ScheduledJob(); + var info = new Every(job).Hour().For(6).Days(); + Assert.AreEqual(24 * 6, info.AllOccurrences.Count()); + + Assert.IsNotNull(info.NextOccurrence); + Assert.IsNotNull(info.LastOccurrence); + Assert.AreEqual(info.NextOccurrence, info.AllOccurrences.First()); + Assert.AreEqual(info.LastOccurrence, info.AllOccurrences.Last()); + } + } +} \ No newline at end of file diff --git a/linger/src/linger.Tests/HelloWorldJob.cs b/linger/src/linger.Tests/HelloWorldJob.cs new file mode 100644 index 0000000..d767534 --- /dev/null +++ b/linger/src/linger.Tests/HelloWorldJob.cs @@ -0,0 +1,14 @@ +using System; + +namespace linger.Tests +{ + [Serializable] + public class HelloWorldJob + { + public bool Perform() + { + Console.WriteLine("Hello, world!"); + return true; + } + } +} \ No newline at end of file diff --git a/linger/src/linger.Tests/LingerTests.cs b/linger/src/linger.Tests/LingerTests.cs new file mode 100644 index 0000000..0a56588 --- /dev/null +++ b/linger/src/linger.Tests/LingerTests.cs @@ -0,0 +1,39 @@ +using System; +using System.Diagnostics; +using NUnit.Framework; + +namespace linger.Tests +{ + [TestFixture] + public class LingerTests : SqliteFixture + { + [Test] + public void Job_is_executed_when_attempted() + { + Linger.DelayJobs = false; + var success = Linger.QueueForExecution(new HelloWorldJob(), 0); + Assert.IsTrue(success); + Linger.DelayJobs = true; + } + + [Test] + public void Dumps_json_on_request() + { + Linger.DelayJobs = true; + Linger.QueueForExecution(new HelloWorldJob(), runAt: DateTime.Now.AddYears(100)); + var json = Linger.Dump(); + Assert.IsNotNullOrEmpty(json); + Trace.WriteLine(json); + } + + [Test] + public void Respects_repeat_information_when_present() + { + Linger.DelayJobs = true; + Linger.QueueForExecution(new HelloWorldJob(), runAt: DateTime.Now.AddYears(100), repeat: job => job.Every().Day()); + var json = Linger.Dump(); + Assert.IsNotNullOrEmpty(json); + Trace.WriteLine(json); + } + } +} \ No newline at end of file diff --git a/linger/src/linger.Tests/MigrationHelper.cs b/linger/src/linger.Tests/MigrationHelper.cs new file mode 100644 index 0000000..a882cd9 --- /dev/null +++ b/linger/src/linger.Tests/MigrationHelper.cs @@ -0,0 +1,59 @@ +using System; +using System.IO; +using System.Reflection; +using FluentMigrator.Runner.Announcers; +using FluentMigrator.Runner.Initialization; + +namespace linger.Tests +{ + public class MigrationHelper + { + private readonly string _databaseType; + + public MigrationHelper(string databaseType) + { + _databaseType = databaseType; + } + + public virtual void Migrate(string connectionString, Assembly assembly = null) + { + if (_databaseType == "sqlite") + { + CopyInteropAssemblyByPlatform(); + } + assembly = assembly ?? Assembly.GetExecutingAssembly(); + var announcer = new TextWriterAnnouncer(Console.Out) {ShowSql = true, ShowElapsedTime = false}; + var context = new RunnerContext(announcer) + { + Connection = connectionString, + Database = _databaseType, + Target = assembly.FullName, + Profile = "linger", + }; + var executor = new TaskExecutor(context); + executor.Execute(); + } + + private const string SQLiteAssembly = "SQLite.Interop.dll"; + public static void CopyInteropAssemblyByPlatform() + { + var baseDir = WhereAmI(); + var destination = Path.Combine(baseDir, SQLiteAssembly); + if (File.Exists(destination)) + { + return; + } + var arch = Environment.Is64BitProcess ? "x64" : "x86"; + var path = Path.Combine(arch, SQLiteAssembly); + var source = Path.Combine(baseDir, path); + File.Copy(source, destination, true); + } + + internal static string WhereAmI() + { + var dir = new Uri(Assembly.GetExecutingAssembly().CodeBase); + var fi = new FileInfo(dir.AbsolutePath); + return fi.Directory != null ? fi.Directory.FullName : null; + } + } +} \ No newline at end of file diff --git a/linger/src/linger.Tests/MigrationTests.cs b/linger/src/linger.Tests/MigrationTests.cs new file mode 100644 index 0000000..f87f246 --- /dev/null +++ b/linger/src/linger.Tests/MigrationTests.cs @@ -0,0 +1,34 @@ +using System; +using NUnit.Framework; + +namespace linger.Tests +{ + [TestFixture, Ignore("One offs for SQL generation only")] + public class MigrationTests + { + [Test] + public void Emit_mssql() + { + var cs = "Data Source=(local);Initial Catalog=Linger;Integrated Security=true"; + var svc = new MigrationHelper("sqlserver"); + svc.Migrate(cs); + } + + [Test] + public void Emit_sqlite() + { + var database = string.Format("{0}.s3db", Guid.NewGuid()); + var cs = string.Format("Data Source={0};Version=3;New=True;", database); + var svc = new MigrationHelper("sqlite"); + svc.Migrate(cs); + } + + [Test] + public void Emit_mysql() + { + var cs = string.Format("Database=Linger;User=root;Password=password"); + var svc = new MigrationHelper("mysql"); + svc.Migrate(cs); + } + } +} diff --git a/linger/src/linger.Tests/Migrations/001_AddScheduledJob.cs b/linger/src/linger.Tests/Migrations/001_AddScheduledJob.cs new file mode 100644 index 0000000..4e83bee --- /dev/null +++ b/linger/src/linger.Tests/Migrations/001_AddScheduledJob.cs @@ -0,0 +1,25 @@ +using FluentMigrator; + +namespace linger.Tests.Migrations +{ + [Profile("linger")] + public class AddScheduledJob : AutoReversingMigration + { + public override void Up() + { + Create.Table("ScheduledJob") + .WithColumn("Id").AsInt32().Identity().PrimaryKey() + .WithColumn("Priority").AsInt32().NotNullable().WithDefaultValue(0) + .WithColumn("Attempts").AsInt32().NotNullable().WithDefaultValue(0) + .WithColumn("Handler").AsBinary().NotNullable() + .WithColumn("LastError").AsString().Nullable() + .WithColumn("RunAt").AsDateTime().Nullable() + .WithColumn("FailedAt").AsDateTime().Nullable() + .WithColumn("SucceededAt").AsDateTime().Nullable() + .WithColumn("LockedAt").AsDateTime().Nullable() + .WithColumn("LockedBy").AsString().Nullable() + .WithColumn("CreatedAt").AsDateTime().NotNullable().WithDefault(SystemMethods.CurrentDateTime) + .WithColumn("UpdatedAt").AsDateTime().Nullable(); + } + } +} \ No newline at end of file diff --git a/linger/src/linger.Tests/Migrations/002_AddBatches.cs b/linger/src/linger.Tests/Migrations/002_AddBatches.cs new file mode 100644 index 0000000..510a7d2 --- /dev/null +++ b/linger/src/linger.Tests/Migrations/002_AddBatches.cs @@ -0,0 +1,25 @@ +using FluentMigrator; + +namespace linger.Tests.Migrations +{ + [Profile("linger")] + public class AddBatches : AutoReversingMigration + { + public override void Up() + { + Create.Table("Batch") + .WithColumn("Id").AsInt32().Identity().PrimaryKey() + .WithColumn("Name").AsString() + .WithColumn("CreatedAt").AsDateTime().NotNullable().WithDefault(SystemMethods.CurrentDateTime) + .WithColumn("StartedAt").AsDateTime().Nullable() + .WithColumn("Priority").AsInt32().NotNullable().WithDefaultValue(0) + ; + + Create.Table("BatchJob") + .WithColumn("Id").AsInt32().Identity().PrimaryKey() + .WithColumn("BatchId").AsInt32().ForeignKey("Batch", "Id") + .WithColumn("ScheduledJobId").AsInt32().ForeignKey("ScheduledJob", "Id") + ; + } + } +} \ No newline at end of file diff --git a/linger/src/linger.Tests/Migrations/003_AddRepeatInfo.cs b/linger/src/linger.Tests/Migrations/003_AddRepeatInfo.cs new file mode 100644 index 0000000..7b5c897 --- /dev/null +++ b/linger/src/linger.Tests/Migrations/003_AddRepeatInfo.cs @@ -0,0 +1,19 @@ +using FluentMigrator; + +namespace linger.Tests.Migrations +{ + [Profile("linger")] + public class AddRepeatInfo : AutoReversingMigration + { + public override void Up() + { + Create.Table("RepeatInfo") + .WithColumn("ScheduledJobId").AsInt32().Identity().ForeignKey("ScheduledJob", "Id") + .WithColumn("PeriodFrequency").AsInt32().NotNullable() + .WithColumn("PeriodQuantifier").AsInt32().NotNullable() + .WithColumn("Start").AsDateTime().NotNullable() + .WithColumn("IncludeWeekends").AsBoolean().NotNullable().WithDefaultValue(false) + ; + } + } +} \ No newline at end of file diff --git a/linger/src/linger.Tests/Properties/AssemblyInfo.cs b/linger/src/linger.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..9f86db5 --- /dev/null +++ b/linger/src/linger.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("linger.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("linger.Tests")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("160c3011-5d97-43f8-8062-5ee13f01fa06")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/linger/src/linger.Tests/RepeatInfoTests.cs b/linger/src/linger.Tests/RepeatInfoTests.cs new file mode 100644 index 0000000..576544e --- /dev/null +++ b/linger/src/linger.Tests/RepeatInfoTests.cs @@ -0,0 +1,19 @@ +using System; +using Dates; +using NUnit.Framework; + +namespace linger.Tests +{ + [TestFixture] + public class RepeatInfoTests + { + [Test] + public void Is_serializable() + { + var repeatInfo = new RepeatInfo(DateTime.Now, DatePeriod.Daily); + var json = JsonSerializer.Serialize(repeatInfo); + Assert.IsNotNullOrEmpty(json); + Console.WriteLine(json); + } + } +} \ No newline at end of file diff --git a/linger/src/linger.Tests/SchemaTests.cs b/linger/src/linger.Tests/SchemaTests.cs new file mode 100644 index 0000000..504ca54 --- /dev/null +++ b/linger/src/linger.Tests/SchemaTests.cs @@ -0,0 +1,17 @@ +using NUnit.Framework; +using tophat; + +namespace linger.Tests +{ + [TestFixture] + public class SchemaTests : SqliteFixture + { + [Test] + public void Can_safely_call_create() + { + Schema.Install(DatabaseDialect.Sqlite, UnitOfWork.Current); + Schema.Install(DatabaseDialect.Sqlite, UnitOfWork.Current); + Schema.Install(DatabaseDialect.Sqlite, UnitOfWork.Current); + } + } +} \ No newline at end of file diff --git a/linger/src/linger.Tests/SqlServerDatabaseJobRepositoryTests.cs b/linger/src/linger.Tests/SqlServerDatabaseJobRepositoryTests.cs new file mode 100644 index 0000000..3be71aa --- /dev/null +++ b/linger/src/linger.Tests/SqlServerDatabaseJobRepositoryTests.cs @@ -0,0 +1,63 @@ +using NUnit.Framework; +using tophat; + +namespace linger.Tests +{ + [TestFixture] + public class SqlServerDatabaseJobRepositoryTests : SqlServerFixture + { + private readonly DatabaseJobRepositoryTests _repositoryTests; + + public SqlServerDatabaseJobRepositoryTests() + { + _repositoryTests = new DatabaseJobRepositoryTests(CreateRepository()); + } + + [Test] + public void Saves_job() + { + _repositoryTests.Saves_job(); + } + + [Test] + public void Updates_job() + { + _repositoryTests.Updates_job(); + } + + [Test] + public void Loads_job() + { + _repositoryTests.Loads_job(); + } + + [Test] + public void Fetches_and_locks_job() + { + _repositoryTests.Fetches_and_locks_job(); + } + + [Test] + public void Fetches_all_jobs() + { + _repositoryTests.Fetches_all_jobs(); + } + + [Test] + public void Creates_a_batch() + { + _repositoryTests.Creates_a_batch(); + } + + [Test] + public void Jobs_in_batches_arent_fetched() + { + _repositoryTests.Jobs_in_batches_arent_fetched(); + } + + public DatabaseJobRepository CreateRepository() + { + return new DatabaseJobRepository(DatabaseDialect.SqlServer, () => UnitOfWork.Current); + } + } +} \ No newline at end of file diff --git a/linger/src/linger.Tests/SqlServerFixture.cs b/linger/src/linger.Tests/SqlServerFixture.cs new file mode 100644 index 0000000..c21847c --- /dev/null +++ b/linger/src/linger.Tests/SqlServerFixture.cs @@ -0,0 +1,65 @@ +using System; +using Dapper; +using NUnit.Framework; +using tophat; + +namespace linger.Tests +{ + public abstract class SqlServerFixture + { + protected string Database; + protected string ConnectionString; + + [SetUp] + public void SetUp() + { + UnitOfWork.Purge(); + ConnectionString = ConfigureTestDatabase(); + } + + [TearDown] + public void TearDown() + { + DropDatabaseUnderTest(); + } + + private void DropDatabaseUnderTest() + { + UnitOfWork.Current.Execute("USE master"); + UnitOfWork.Current.Execute(string.Format("ALTER DATABASE [{0}] SET SINGLE_USER WITH ROLLBACK IMMEDIATE", Database)); + UnitOfWork.Current.Execute(string.Format("DROP DATABASE [{0}]", Database)); + UnitOfWork.Purge(); + } + + private string ConfigureTestDatabase() + { + var database = CreateDatabase(); + var connectionString = string.Format("Data Source=localhost;Initial Catalog={0};Integrated Security=true", database); + tophat.Database.Install(connectionString, ConnectionScope.ByThread); + Database = database.ToString(); + + var factory = new SqlServerConnectionFactory { ConnectionString = connectionString }; + using (var connection = factory.CreateConnection()) + { + connection.Open(); + Schema.Install(DatabaseDialect.SqlServer, connection); + } + + return connectionString; + } + + private static Guid CreateDatabase() + { + var database = Guid.NewGuid(); + var connectionString = string.Format("Data Source=localhost;Integrated Security=true;"); + var factory = new SqlServerConnectionFactory { ConnectionString = connectionString }; + using (var connection = factory.CreateConnection()) + { + connection.Open(); + var sql = string.Format("CREATE DATABASE [{0}]", database); + connection.Execute(sql); + } + return database; + } + } +} \ No newline at end of file diff --git a/linger/src/linger.Tests/SqliteConnectionFactory.cs b/linger/src/linger.Tests/SqliteConnectionFactory.cs new file mode 100644 index 0000000..b869fa1 --- /dev/null +++ b/linger/src/linger.Tests/SqliteConnectionFactory.cs @@ -0,0 +1,14 @@ +using System.Data; +using System.Data.SQLite; +using tophat; + +namespace linger.Tests +{ + public class SqliteConnectionFactory : ConnectionFactory + { + public override IDbConnection CreateConnection() + { + return new SQLiteConnection(ConnectionString); + } + } +} \ No newline at end of file diff --git a/linger/src/linger.Tests/SqliteDataContext.cs b/linger/src/linger.Tests/SqliteDataContext.cs new file mode 100644 index 0000000..c6630f8 --- /dev/null +++ b/linger/src/linger.Tests/SqliteDataContext.cs @@ -0,0 +1,12 @@ +using tophat; + +namespace linger.Tests.Sqlite +{ + public class SqliteDataContext : DataContext + { + public SqliteDataContext(string connectionString) : base(connectionString) + { + + } + } +} \ No newline at end of file diff --git a/linger/src/linger.Tests/SqliteDatabaseJobRepositoryTests.cs b/linger/src/linger.Tests/SqliteDatabaseJobRepositoryTests.cs new file mode 100644 index 0000000..0f81b09 --- /dev/null +++ b/linger/src/linger.Tests/SqliteDatabaseJobRepositoryTests.cs @@ -0,0 +1,63 @@ +using NUnit.Framework; +using tophat; + +namespace linger.Tests +{ + [TestFixture] + public class SqliteDatabaseJobRepositoryTests : SqliteFixture + { + private readonly DatabaseJobRepositoryTests _repositoryTests; + + public SqliteDatabaseJobRepositoryTests() + { + _repositoryTests = new DatabaseJobRepositoryTests(CreateRepository()); + } + + [Test] + public void Saves_job() + { + _repositoryTests.Saves_job(); + } + + [Test] + public void Updates_job() + { + _repositoryTests.Updates_job(); + } + + [Test] + public void Loads_job() + { + _repositoryTests.Loads_job(); + } + + [Test] + public void Fetches_and_locks_job() + { + _repositoryTests.Fetches_and_locks_job(); + } + + [Test] + public void Fetches_all_jobs() + { + _repositoryTests.Fetches_all_jobs(); + } + + [Test] + public void Creates_a_batch() + { + _repositoryTests.Creates_a_batch(); + } + + [Test] + public void Jobs_in_batches_arent_fetched() + { + _repositoryTests.Jobs_in_batches_arent_fetched(); + } + + public DatabaseJobRepository CreateRepository() + { + return new DatabaseJobRepository(DatabaseDialect.Sqlite, () => UnitOfWork.Current); + } + } +} diff --git a/linger/src/linger.Tests/SqliteFixture.cs b/linger/src/linger.Tests/SqliteFixture.cs new file mode 100644 index 0000000..ef019df --- /dev/null +++ b/linger/src/linger.Tests/SqliteFixture.cs @@ -0,0 +1,85 @@ +using System; +using System.IO; +using System.Threading; +using NUnit.Framework; +using linger.Tests.Sqlite; +using tophat; + +namespace linger.Tests +{ + public abstract class SqliteFixture + { + [TestFixtureSetUp] + public void TestFixtureSetUp() + { + foreach (var database in Directory.GetFiles(Utils.WhereAmI(), "*.s3db")) + { + DeleteDatabase(database); + } + } + + [SetUp] + public void SetUp() + { + CreateTestDatabase(); + } + + [TearDown] + public void TearDown() + { + UnitOfWork.Purge(); + } + + private static void DeleteDatabase(string databaseName) + { + if (!File.Exists(databaseName)) + { + return; + } + var i = 10; + while (IsDatabaseInUse(databaseName) && i > 0) + { + i--; + Thread.Sleep(1000); + } + if (i > 0) + { + File.Delete(databaseName); + } + } + + private static bool IsDatabaseInUse(string databaseName) + { + FileStream fs = null; + try + { + var fi = new FileInfo(databaseName); + fs = fi.Open(FileMode.Open, FileAccess.ReadWrite, FileShare.None); + return false; + } + catch (Exception) + { + return true; + } + finally + { + if (fs != null) + { + fs.Close(); + } + } + } + + private static void CreateTestDatabase() + { + var database = string.Format("{0}.s3db", Guid.NewGuid()); + var connectionString = string.Format("Data Source={0};Version=3;New=True;", database); + Database.Install(connectionString, ConnectionScope.ByThread); + + Schema.Install(DatabaseDialect.Sqlite, UnitOfWork.Current); + var repository = new DatabaseJobRepository(DatabaseDialect.Sqlite, () => UnitOfWork.Current); + Linger.Backend = repository; + repository.InstallSchema(); + } + } +} diff --git a/linger/src/linger.Tests/Utils.cs b/linger/src/linger.Tests/Utils.cs new file mode 100644 index 0000000..bb429b1 --- /dev/null +++ b/linger/src/linger.Tests/Utils.cs @@ -0,0 +1,16 @@ +using System; +using System.IO; +using System.Reflection; + +namespace linger.Tests +{ + public class Utils + { + public static string WhereAmI() + { + var dir = new Uri(Assembly.GetExecutingAssembly().CodeBase); + var fi = new FileInfo(dir.AbsolutePath); + return fi.Directory != null ? fi.Directory.FullName : null; + } + } +} \ No newline at end of file diff --git a/linger/src/linger.Tests/linger.Tests.csproj b/linger/src/linger.Tests/linger.Tests.csproj new file mode 100644 index 0000000..34629e4 --- /dev/null +++ b/linger/src/linger.Tests/linger.Tests.csproj @@ -0,0 +1,130 @@ + + + + + Debug + AnyCPU + {72724E67-2D3E-487E-AA0F-8BC60138BDB6} + Library + Properties + linger.Tests + linger.Tests + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\packages\tophat.1.0.7\lib\net40\container.dll + + + ..\packages\Dapper.1.12.1\lib\net40\Dapper.dll + + + ..\packages\Dates.1.0.1\lib\net40\Dates.dll + + + False + ..\packages\tophat.1.0.7\lib\net40\FluentMigrator.dll + + + False + ..\packages\tophat.1.0.7\lib\net40\FluentMigrator.Runner.dll + + + ..\packages\ImpromptuInterface.6.0.6\lib\net40\ImpromptuInterface.dll + + + ..\packages\MySql.Data.6.6.4\lib\net40\MySql.Data.dll + + + ..\packages\NUnit.2.6.2\lib\nunit.framework.dll + + + + + ..\packages\System.Data.SQLite.1.0.84.0\lib\net40\System.Data.SQLite.dll + + + ..\packages\System.Data.SQLite.1.0.84.0\lib\net40\System.Data.SQLite.Linq.dll + + + + + + + + + False + ..\packages\tophat.1.0.7\lib\net40\tophat.dll + + + False + ..\packages\tophat.1.0.7\lib\net40\tophat.FluentMigrator.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {92DFDDA0-1604-420F-842C-C04CFFB3079B} + linger + + + + + Always + + + Always + + + + + + \ No newline at end of file diff --git a/linger/src/linger.Tests/packages.config b/linger/src/linger.Tests/packages.config new file mode 100644 index 0000000..2d5e855 --- /dev/null +++ b/linger/src/linger.Tests/packages.config @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/linger/src/linger.sln b/linger/src/linger.sln new file mode 100644 index 0000000..be76e0b --- /dev/null +++ b/linger/src/linger.sln @@ -0,0 +1,41 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "linger", "linger\linger.csproj", "{92DFDDA0-1604-420F-842C-C04CFFB3079B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "linger.Tests", "linger.Tests\linger.Tests.csproj", "{72724E67-2D3E-487E-AA0F-8BC60138BDB6}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D0A2ED6C-E85D-4B0B-9293-AC459AE6F792}" + ProjectSection(SolutionItems) = preProject + ..\LICENSE.md = ..\LICENSE.md + ..\linger.nuspec = ..\linger.nuspec + ..\pack-nuget.bat = ..\pack-nuget.bat + ..\push-nuget.bat = ..\push-nuget.bat + ..\README.md = ..\README.md + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "linger.Mvc.Demo", "linger.Mvc.Demo\linger.Mvc.Demo.csproj", "{95719B60-C166-4CF7-911E-EB5D82ABD6E7}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {92DFDDA0-1604-420F-842C-C04CFFB3079B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {92DFDDA0-1604-420F-842C-C04CFFB3079B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {92DFDDA0-1604-420F-842C-C04CFFB3079B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {92DFDDA0-1604-420F-842C-C04CFFB3079B}.Release|Any CPU.Build.0 = Release|Any CPU + {72724E67-2D3E-487E-AA0F-8BC60138BDB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {72724E67-2D3E-487E-AA0F-8BC60138BDB6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {72724E67-2D3E-487E-AA0F-8BC60138BDB6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {72724E67-2D3E-487E-AA0F-8BC60138BDB6}.Release|Any CPU.Build.0 = Release|Any CPU + {95719B60-C166-4CF7-911E-EB5D82ABD6E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {95719B60-C166-4CF7-911E-EB5D82ABD6E7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {95719B60-C166-4CF7-911E-EB5D82ABD6E7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {95719B60-C166-4CF7-911E-EB5D82ABD6E7}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/linger/src/linger/Batch.cs b/linger/src/linger/Batch.cs new file mode 100644 index 0000000..f87cf99 --- /dev/null +++ b/linger/src/linger/Batch.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +namespace linger +{ + [Serializable] + public class Batch + { + public int Id { get; set; } + public string Name { get; set; } + public DateTime? CreatedAt { get; set; } + public DateTime? StartedAt { get; set; } + public IEnumerable Jobs { get; set; } + public int Priority { get; set; } + + public Batch() + { + Jobs = new List(); + } + } +} \ No newline at end of file diff --git a/linger/src/linger/DatabaseDialect.cs b/linger/src/linger/DatabaseDialect.cs new file mode 100644 index 0000000..cd5cc1a --- /dev/null +++ b/linger/src/linger/DatabaseDialect.cs @@ -0,0 +1,9 @@ +namespace linger +{ + public enum DatabaseDialect + { + SqlServer, + MySql, + Sqlite + } +} \ No newline at end of file diff --git a/linger/src/linger/DatabaseJobRepository.cs b/linger/src/linger/DatabaseJobRepository.cs new file mode 100644 index 0000000..5271c3a --- /dev/null +++ b/linger/src/linger/DatabaseJobRepository.cs @@ -0,0 +1,110 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; + +namespace linger +{ + /// + /// Stores the job queue in an ADO-NET supported database. Currently supports SQL Server, MySQL, and SQLite dialects. + /// + public class DatabaseJobRepository : IScheduledJobRepository + { + private static readonly object Sync = new object(); + private readonly DatabaseDialect _dialect; + private readonly Func _connectionBuilder; + + public DatabaseJobRepository(DatabaseDialect dialect, Func connectionBuilder) + { + _dialect = dialect; + _connectionBuilder = connectionBuilder; + } + + public void InstallSchema() + { + Schema.Install(_dialect, _connectionBuilder()); + } + + public void Save(ScheduledJob job, RepeatInfo info = null) + { + var db = _connectionBuilder(); + if(job.Id == 0) + { + Queries.InsertJob(db, _dialect, job); + } + else + { + job.UpdatedAt = DateTime.Now; + Queries.UpdateJob(db, job); + } + + var existing = Queries.GetRepeatInfo(db, job); + if(existing == null) + { + Queries.InsertRepeatInfo(db, _dialect, job, info); + } + else + { + Queries.UpdateRepeatInfo(db, _dialect, job, info); + } + } + + public ScheduledJob Load(int id) + { + var db = _connectionBuilder(); + var job = Queries.GetJob(db, id); + if(job != null) + { + job.RepeatInfo = Queries.GetRepeatInfo(db, job); + } + return job; + } + + public void Delete(ScheduledJob job) + { + var db = _connectionBuilder(); + Queries.DeleteJob(db, job); + } + + public IList GetNextAvailable(int readAhead) + { + var db = _connectionBuilder(); + lock (Sync) + { + var jobs = Queries.GetNextAvailable(db, _dialect, readAhead).ToList(); + if(jobs.Any()) + { + Queries.LockJobs(db, jobs); + } + return jobs; + } + } + + public IList GetAll() + { + var db = _connectionBuilder(); + lock (Sync) + { + var jobs = Queries.GetAll(db).ToList(); + return jobs; + } + } + + public Batch CreateBatch(string name, IEnumerable jobs) + { + var db = _connectionBuilder(); + var batch = new Batch { Name = name, Jobs = jobs }; + Queries.InsertBatch(db, _dialect, batch); + foreach(var job in batch.Jobs) + { + if (job.Priority != batch.Priority) + { + job.Priority = batch.Priority; + Save(job); + } + Queries.AddToBatch(db, _dialect, batch, job); + } + return batch; + } + } +} \ No newline at end of file diff --git a/linger/src/linger/DelegateJob.cs b/linger/src/linger/DelegateJob.cs new file mode 100644 index 0000000..4a60831 --- /dev/null +++ b/linger/src/linger/DelegateJob.cs @@ -0,0 +1,20 @@ +using System; + +namespace linger +{ + [Serializable] + public class DelegateJob + { + private readonly Func _delegate; + + public DelegateJob(Func @delegate) + { + _delegate = @delegate; + } + + public bool Perform() + { + return _delegate(); + } + } +} \ No newline at end of file diff --git a/linger/src/linger/Every.cs b/linger/src/linger/Every.cs new file mode 100644 index 0000000..cdc2963 --- /dev/null +++ b/linger/src/linger/Every.cs @@ -0,0 +1,51 @@ +using Dates; + +namespace linger +{ + public class Every + { + private readonly ScheduledJob _job; + private readonly int _n; + + public Every(ScheduledJob job) : this(job, 1) + { + _job = job; + } + + public Every(ScheduledJob job, int n) + { + _job = job; + _n = n; + } + + public RepeatInfo Second() + { + return new RepeatInfo(_job.RunAt, new DatePeriod(DatePeriodFrequency.Seconds, _n)); + } + + public RepeatInfo Minute() + { + return new RepeatInfo(_job.RunAt, new DatePeriod(DatePeriodFrequency.Minutes, _n)); + } + + public RepeatInfo Hour() + { + return new RepeatInfo(_job.RunAt, new DatePeriod(DatePeriodFrequency.Hours, _n)); + } + + public RepeatInfo Day() + { + return new RepeatInfo(_job.RunAt, new DatePeriod(DatePeriodFrequency.Days, _n)); + } + + public RepeatInfo Month() + { + return new RepeatInfo(_job.RunAt, new DatePeriod(DatePeriodFrequency.Months, _n)); + } + + public RepeatInfo Year() + { + return new RepeatInfo(_job.RunAt, new DatePeriod(DatePeriodFrequency.Years, _n)); + } + } +} \ No newline at end of file diff --git a/linger/src/linger/EveryExtensions.cs b/linger/src/linger/EveryExtensions.cs new file mode 100644 index 0000000..a99f59c --- /dev/null +++ b/linger/src/linger/EveryExtensions.cs @@ -0,0 +1,15 @@ +namespace linger +{ + public static class EveryExtensions + { + public static Every Every(this ScheduledJob job) + { + return new Every(job); + } + + public static Every Every(this ScheduledJob job, int n) + { + return new Every(job, n); + } + } +} \ No newline at end of file diff --git a/linger/src/linger/For.cs b/linger/src/linger/For.cs new file mode 100644 index 0000000..3b88904 --- /dev/null +++ b/linger/src/linger/For.cs @@ -0,0 +1,70 @@ +using Dates; + +namespace linger +{ + public class For + { + private readonly RepeatInfo _info; + private readonly int _count; + + public For(RepeatInfo info, int count) + { + _info = info; + _count = count; + } + + public RepeatInfo Seconds() + { + _info.EndPeriod = new DatePeriod(DatePeriodFrequency.Seconds, _count); + return _info; + } + + public RepeatInfo Minutes() + { + _info.EndPeriod = new DatePeriod(DatePeriodFrequency.Minutes, _count); + return _info; + } + + public RepeatInfo Hours() + { + _info.EndPeriod = new DatePeriod(DatePeriodFrequency.Hours, _count); + return _info; + } + + public RepeatInfo Days() + { + _info.EndPeriod = new DatePeriod(DatePeriodFrequency.Days, _count); + return _info; + } + + public RepeatInfo Weeks() + { + _info.EndPeriod = new DatePeriod(DatePeriodFrequency.Weeks, _count); + return _info; + } + + public RepeatInfo Months() + { + _info.EndPeriod = new DatePeriod(DatePeriodFrequency.Months, _count); + return _info; + } + + public RepeatInfo Years() + { + _info.EndPeriod = new DatePeriod(DatePeriodFrequency.Years, _count); + return _info; + } + + public RepeatInfo IncludingWeekends() + { + _info.IncludeWeekends = true; + return _info; + } + + public RepeatInfo ExcludingWeekends() + { + _info.IncludeWeekends = false; + return _info; + } + } +} \ No newline at end of file diff --git a/linger/src/linger/HandlerSerializer.cs b/linger/src/linger/HandlerSerializer.cs new file mode 100644 index 0000000..750d48d --- /dev/null +++ b/linger/src/linger/HandlerSerializer.cs @@ -0,0 +1,32 @@ +using System.IO; +using System.Runtime.Serialization.Formatters.Binary; + +namespace linger +{ + internal static class HandlerSerializer + { + private static readonly BinaryFormatter Formatter; + + static HandlerSerializer() + { + Formatter = new BinaryFormatter(); + } + + public static byte[] Serialize(T obj) where T : class + { + using (var ms = new MemoryStream()) + { + Formatter.Serialize(ms, obj); + return ms.ToArray(); + } + } + + public static T Deserialize(byte[] data) where T : class + { + using (var ms = new MemoryStream(data)) + { + return (T)Formatter.Deserialize(ms); + } + } + } +} \ No newline at end of file diff --git a/linger/src/linger/HashExtensions.cs b/linger/src/linger/HashExtensions.cs new file mode 100644 index 0000000..aec8511 --- /dev/null +++ b/linger/src/linger/HashExtensions.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Dynamic; +using System.Reflection; +using DotLiquid; + +namespace linger +{ + internal static class HashExtensions + { + private static readonly IDictionary CachedStatics = new Dictionary(); + + public static Hash FromDynamic(dynamic source) + { + var result = new Hash(); + if (source != null) + { + if (source is ExpandoObject) + { + return Hash.FromDictionary((IDictionary)source); + } + var type = (Type)source.GetType(); + if (typeof(IDynamicMetaObjectProvider).IsAssignableFrom(type)) + { + throw new NotImplementedException("I don't feel like coding this up right now; use a static type?"); + } + PropertyInfo[] properties; + if (CachedStatics.ContainsKey(type)) + { + properties = CachedStatics[type]; + } + else + { + properties = type.GetProperties(); + CachedStatics.Add(type, properties); + } + foreach (var property in properties) + { + result[property.Name] = property.GetValue(source, null); + } + } + return result; + } + } +} \ No newline at end of file diff --git a/linger/src/linger/IScheduledJobRepository.cs b/linger/src/linger/IScheduledJobRepository.cs new file mode 100644 index 0000000..8bf25b0 --- /dev/null +++ b/linger/src/linger/IScheduledJobRepository.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; + +namespace linger +{ + /// + /// Manages backend operations for a job queue + /// + public interface IScheduledJobRepository + { + void Save(ScheduledJob job, RepeatInfo info = null); + void Delete(ScheduledJob job); + IList GetNextAvailable(int readAhead); + IList GetAll(); + Batch CreateBatch(string name, IEnumerable jobs); + } +} \ No newline at end of file diff --git a/linger/src/linger/Interfaces.cs b/linger/src/linger/Interfaces.cs new file mode 100644 index 0000000..e166295 --- /dev/null +++ b/linger/src/linger/Interfaces.cs @@ -0,0 +1,39 @@ +using System; + +namespace linger +{ + public interface Before + { + void Before(); + } + + public interface Perform + { + bool Perform(); + } + + public interface After + { + void After(); + } + + public interface Success + { + void Success(); + } + + public interface Error + { + void Error(Exception error); + } + + public interface Failure + { + void Failure(); + } + + public interface Halt + { + void Halt(bool immediate); + } +} \ No newline at end of file diff --git a/linger/src/linger/JsonSerializer.cs b/linger/src/linger/JsonSerializer.cs new file mode 100644 index 0000000..d5bccf5 --- /dev/null +++ b/linger/src/linger/JsonSerializer.cs @@ -0,0 +1,28 @@ +using System.Collections.Generic; +using ServiceStack.Text; + +namespace linger +{ + public static class JsonSerializer + { + static JsonSerializer() + { + JsConfig.PropertyConvention = JsonPropertyConvention.Lenient; + JsConfig.EmitLowercaseUnderscoreNames = true; + JsConfig.ExcludeTypeInfo = true; + JsConfig.DateHandler = JsonDateHandler.ISO8601; + } + + public static string Serialize(T value) + { + var json = ServiceStack.Text.JsonSerializer.SerializeToString(value); + return json; + } + + public static string SerializeJobs(IEnumerable value) + { + var json = ServiceStack.Text.JsonSerializer.SerializeToString(new { Jobs = value }); + return json; + } + } +} \ No newline at end of file diff --git a/linger/src/linger/Linger.Settings.cs b/linger/src/linger/Linger.Settings.cs new file mode 100644 index 0000000..c3ba20e --- /dev/null +++ b/linger/src/linger/Linger.Settings.cs @@ -0,0 +1,81 @@ +using System; + +namespace linger +{ + partial class Linger + { + /// + /// The maximum time each task is allowed before being cancelled; default is 4 hours + /// + public static TimeSpan MaximumRuntime { get; set; } + + /// + /// The maximum number of attempts made before failing a job permanently; default is 25 + /// + public static int MaximumAttempts { get; set; } + + /// + /// Whether or not failed jobs are deleted from the backend store; default is false + /// + public static bool DeleteFailedJobs { get; set; } + + /// + /// Whether or not successful jobs are deleted from the backend store; default is false + /// + public static bool DeleteSuccessfulJobs { get; set; } + + /// + /// The function responsible for calculating the next attempt date after a job fails; + /// default is 5 seconds + N.Pow(4), where N is the number of retries + /// + public static Func IntervalFunction { get; set; } + + /// + /// The number of jobs to pull at once when searching for available jobs; default is 5 + /// + public static int ReadAhead { get; set; } + + /// + /// The number of seconds to delay before checking for available jobs in the backing store + /// + public static int SleepDelay { get; set; } + + /// + /// Whether or not jobs are delayed or executed immediately; default is true + /// + public static bool DelayJobs { get; set; } + + /// + /// The default priority level for newly created scheduled jobs that don't specify a priority; + /// default is 0, or highest priority + /// + public static int DefaultPriority { get; set; } + + /// + /// The number of threads available for performing jobs; default is 5 + /// + public static int Concurrency { get; set; } + + /// + /// The backend used to coordinate jobs; there is no default + /// + /// Linger.Backend = new DatabaseJobRepository(DatabaseDialect.Sqlite, () => UnitOfWork.Current); + /// + /// + public static IScheduledJobRepository Backend { get; set; } + + static Linger() + { + MaximumAttempts = 25; + MaximumRuntime = TimeSpan.FromHours(4); + DeleteFailedJobs = false; + DeleteSuccessfulJobs = false; + IntervalFunction = i => TimeSpan.FromSeconds(5 + (Math.Pow(i, 4))); + ReadAhead = 5; + SleepDelay = 60; + DelayJobs = true; + DefaultPriority = 0; + Concurrency = 5; + } + } +} diff --git a/linger/src/linger/Linger.Status.cs b/linger/src/linger/Linger.Status.cs new file mode 100644 index 0000000..852c513 --- /dev/null +++ b/linger/src/linger/Linger.Status.cs @@ -0,0 +1,11 @@ +namespace linger +{ + public partial class Linger + { + public static string Dump() + { + var jobs = Backend.GetAll(); + return JsonSerializer.SerializeJobs(jobs); + } + } +} diff --git a/linger/src/linger/Linger.cs b/linger/src/linger/Linger.cs new file mode 100644 index 0000000..3c2b114 --- /dev/null +++ b/linger/src/linger/Linger.cs @@ -0,0 +1,80 @@ +using System; +using System.Web.Hosting; + +namespace linger +{ + public partial class Linger + { + private static LingerWorker _worker; + + public static void StartWorker() + { + EnsureBackend(); + StopWorker(); + CreateAndStartWorker(); + } + + private static void CreateAndStartWorker() + { + if(_worker != null) + { + throw new LingerException("Worker already exists, and was not properly stopped"); + } + _worker = new LingerWorker(Concurrency); + if (HostingEnvironment.IsHosted) + { + HostingEnvironment.RegisterObject(_worker); + } + _worker.Start(); + } + + public static void StopWorker() + { + if (_worker == null) return; + if (HostingEnvironment.IsHosted) + { + HostingEnvironment.UnregisterObject(_worker); + } + _worker.Stop(); + _worker.Dispose(true); + _worker = null; + } + + public static bool QueueForExecution(dynamic job, int? priority = null, DateTime? runAt = null, Func repeat = null) + { + var scheduledJob = CreateScheduledJob(job, priority ?? DefaultPriority, runAt); + var repeatInfo = repeat != null ? repeat(scheduledJob) : null; + + if(DelayJobs) + { + EnsureBackend(); + Backend.Save(scheduledJob, repeatInfo); + return true; + } + if (_worker == null) + { + CreateAndStartWorker(); + } + return _worker != null && _worker.AttemptJob(scheduledJob, persist: false); + } + + private static void EnsureBackend() + { + if (Backend == null) + { + throw new LingerException("No backend function found."); + } + } + + internal static ScheduledJob CreateScheduledJob(dynamic job, int priority, DateTime? runAt) + { + var scheduled = new ScheduledJob + { + Priority = priority, + Handler = HandlerSerializer.Serialize(job), + RunAt = runAt + }; + return scheduled; + } + } +} \ No newline at end of file diff --git a/linger/src/linger/LingerException.cs b/linger/src/linger/LingerException.cs new file mode 100644 index 0000000..a7d0a6e --- /dev/null +++ b/linger/src/linger/LingerException.cs @@ -0,0 +1,13 @@ +using System; + +namespace linger +{ + [Serializable] + public class LingerException : Exception + { + public LingerException(string message) : base(message) + { + + } + } +} \ No newline at end of file diff --git a/linger/src/linger/LingerExtensions.cs b/linger/src/linger/LingerExtensions.cs new file mode 100644 index 0000000..f9362a3 --- /dev/null +++ b/linger/src/linger/LingerExtensions.cs @@ -0,0 +1,39 @@ +using System; + +namespace linger +{ + public static class LingerExtensions + { + public static void PerformAsync(this Perform perform, int? priority = null) + { + Linger.QueueForExecution(perform, priority ?? Linger.DefaultPriority); + } + + public static void PerformAsync(this Perform perform, DateTime runAt, int? priority = null) + { + Linger.QueueForExecution(perform, priority ?? Linger.DefaultPriority, runAt); + } + + public static void PerformAsync(this Func job, int? priority = null) + { + Linger.QueueForExecution(new DelegateJob(job), priority ?? Linger.DefaultPriority); + } + + public static void PerformAsync(this Func job, DateTime runAt, int? priority = null) + { + Linger.QueueForExecution(new DelegateJob(job), priority ?? Linger.DefaultPriority, runAt); + } + + public static void PerformAsync(this Action job, int? priority = null) + { + var inner = new DelegateJob(() => { job(); return true; }); + Linger.QueueForExecution(inner, priority ?? Linger.DefaultPriority); + } + + public static void PerformAsync(this Action job, DateTime runAt, int? priority = null) + { + var inner = new DelegateJob(() => { job(); return true; }); + Linger.QueueForExecution(inner, priority ?? Linger.DefaultPriority, runAt); + } + } +} \ No newline at end of file diff --git a/linger/src/linger/LingerWorker.cs b/linger/src/linger/LingerWorker.cs new file mode 100644 index 0000000..d993c0a --- /dev/null +++ b/linger/src/linger/LingerWorker.cs @@ -0,0 +1,292 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using System.Threading.Tasks.Schedulers; +using System.Web.Hosting; +using ImpromptuInterface; +using Timer = System.Threading.Timer; + +namespace linger +{ + /// + /// A task worker that watches a job queue and performs work. Jobs are scheduled by priority. + /// + public class LingerWorker : IRegisteredObject + { + private static readonly IDictionary> Cache = new ConcurrentDictionary>(); + + private readonly ConcurrentDictionary _schedulers; + private readonly ConcurrentDictionary _factories; + private readonly ConcurrentDictionary> _pending; + + private QueuedTaskScheduler _queue; + private CancellationTokenSource _cancel; + private readonly int _threads; + private static IDisposable _background; + + public LingerWorker(int threads) + { + _threads = threads; + _schedulers = new ConcurrentDictionary(); + _factories = new ConcurrentDictionary(); + _pending = new ConcurrentDictionary>(); + _cancel = new CancellationTokenSource(); + } + + public void Start() + { + if(_queue == null) + { + _queue = new QueuedTaskScheduler(_threads); + } + + // This probaby uses a worker pool thread, so should be replaced eventually + _background = new Timer(state => SeedJobsFromQueue(), null, 0, Linger.SleepDelay * 1000); + } + + public void Stop(bool immediate) + { + foreach (var entry in _pending.Where(entry => entry.Value.Contains("Halt"))) + { + entry.Key.ActLike().Halt(immediate); + } + if (immediate) + { + Stop(); + } + } + + public void Stop() + { + if(_queue != null) + { + _queue.Dispose(); + _queue = null; + } + if(_background != null) + { + _background.Dispose(); + _background = null; + } + } + + private void SeedJobsFromQueue() + { + var jobs = Linger.Backend.GetNextAvailable(Linger.ReadAhead); + + var pending = new Dictionary(); + foreach(var job in jobs) + { + var scheduler = AcquireScheduler(job); + var scheduled = job; + + var cancel = new CancellationTokenSource(); + var performer = _factories[scheduler].StartNew(() => + { + AttemptJob(scheduled); + }, cancel.Token); + + pending.Add(performer, cancel); + } + + // This is effectively giving all tasks below the current as much time as the current... + foreach(var performer in pending) + { + if (!Task.WaitAll(new[] { performer.Key }, Linger.MaximumRuntime)) + { + performer.Value.Cancel(); + } + } + } + + internal bool AttemptJob(ScheduledJob job, bool persist = true) + { + if(_cancel.IsCancellationRequested) + { + return false; + } + + var success = AttemptCycle(job); + + if(persist) + { + SaveJobChanges(job, success); + } + + _cancel.Token.ThrowIfCancellationRequested(); + + return success; + } + + private bool AttemptCycle(ScheduledJob job) + { + job.Attempts++; + var success = Perform(job); + if (!success) + { + var dueTime = DateTime.Now + Linger.IntervalFunction(job.Attempts); + job.RunAt = dueTime; + } + return success; + } + + private static void SaveJobChanges(ScheduledJob job, bool success) + { + if (!success) + { + if(JobWillFail(job)) + { + if (Linger.DeleteFailedJobs) + { + Linger.Backend.Delete(job); + return; + } + job.FailedAt = DateTime.Now; + } + } + else + { + if(Linger.DeleteSuccessfulJobs) + { + Linger.Backend.Delete(job); + return; + } + job.SucceededAt = DateTime.Now; + } + + job.LockedAt = null; + job.LockedBy = null; + Linger.Backend.Save(job); + + // Spawn a new scheduled job using the repeat data + if (success && job.RepeatInfo != null && job.RepeatInfo.NextOccurrence.HasValue) + { + job.Id = 0; + job.RunAt = job.RepeatInfo.NextOccurrence; + job.RepeatInfo.Start = job.RunAt; + Linger.Backend.Save(job, job.RepeatInfo); + } + } + + private static bool JobWillFail(ScheduledJob job) + { + return job.Attempts >= Linger.MaximumAttempts; + } + + private bool Perform(ScheduledJob job) + { + var success = false; + Perform handler = null; + IList methods = null; + + try + { + // Acquire the handler + handler = HandlerSerializer.Deserialize(job.Handler).ActLike(); + if (handler == null) + { + job.LastError = "Missing handler"; + return false; + } + + // Acquire and cache method manifest + var handlerType = handler.GetType(); + if (!Cache.TryGetValue(handlerType, out methods)) + { + methods = handlerType.GetMethods().Select(m => m.Name).ToList(); + Cache.Add(handlerType, methods); + } + + _pending.TryAdd(handler, methods); + + // Before + if(methods.Contains("Before")) + { + handler.ActLike().Before(); + } + + // Perform + success = handler.Perform(); + + if(success) + { + if (methods.Contains("Success")) + { + handler.ActLike().Success(); + } + } + + // Failure + if(JobWillFail(job) && methods.Contains("Failure")) + { + { + handler.ActLike().Failure(); + } + } + + // After + if(methods.Contains("After")) + { + handler.ActLike().After(); + } + + _pending.TryRemove(handler, out methods); + } + catch (OperationCanceledException) + { + job.LastError = "Cancelled"; + } + catch (Exception ex) + { + job.LastError = ex.Message; + if (methods != null && methods.Contains("Error")) + { + handler.ActLike().Error(ex); + } + } + return success; + } + + private TaskScheduler AcquireScheduler(ScheduledJob job) + { + TaskScheduler scheduler; + if (!_schedulers.TryGetValue(job.Priority, out scheduler)) + { + scheduler = _queue.ActivateNewQueue(job.Priority); + var factory = new TaskFactory( + _cancel.Token, TaskCreationOptions.LongRunning, TaskContinuationOptions.LongRunning, scheduler + ); + _schedulers.TryAdd(job.Priority, scheduler); + _factories.TryAdd(scheduler, factory); + } + return scheduler; + } + + public void Dispose(bool disposing) + { + if (!disposing) + { + return; + } + if(_cancel != null) + { + _cancel.Cancel(); + _cancel.Token.WaitHandle.WaitOne(); + _cancel.Dispose(); + _cancel = null; + } + _factories.Clear(); + _schedulers.Clear(); + if (_queue == null) + { + return; + } + _queue.Dispose(); + _queue = null; + } + } +} + diff --git a/linger/src/linger/Properties/AssemblyInfo.cs b/linger/src/linger/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3467465 --- /dev/null +++ b/linger/src/linger/Properties/AssemblyInfo.cs @@ -0,0 +1,37 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("linger")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("linger")] +[assembly: AssemblyCopyright("Copyright © Conatus Creative Inc. 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: InternalsVisibleTo("linger.Tests")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("264de3d4-48c5-4360-9570-0f03bf18a3d2")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/linger/src/linger/Queries.cs b/linger/src/linger/Queries.cs new file mode 100644 index 0000000..3d7127e --- /dev/null +++ b/linger/src/linger/Queries.cs @@ -0,0 +1,184 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Security.Principal; +using Dapper; +using Dates; + +namespace linger +{ + internal static class Queries + { + public static ScheduledJob GetJob(IDbConnection db, int id) + { + const string sql = "SELECT * FROM ScheduledJob WHERE Id = @Id"; + return db.Query(sql, new { Id = id }).FirstOrDefault(); + } + + public static void DeleteJob(IDbConnection db, ScheduledJob job) + { + const string sql = "DELETE FROM ScheduledJob WHERE Id = @Id; DELETE FROM RepeatInfo WHERE ScheduledJobId = @Id;"; + db.Execute(sql, job); + } + + public static void InsertJob(IDbConnection db, DatabaseDialect dialect, ScheduledJob job) + { + var sql = "INSERT INTO ScheduledJob " + + "(Priority, Attempts, Handler, RunAt) " + + "VALUES (@Priority, @Attempts, @Handler, @RunAt); "; + + sql = AddInsertIdentity(dialect, sql); + job.Id = db.Execute(sql, job); + job.CreatedAt = db.Query("SELECT CreatedAt FROM ScheduledJob WHERE Id = @Id", new {job.Id}).Single(); + } + + private static string AddInsertIdentity(DatabaseDialect dialect, string sql) + { + switch (dialect) + { + case DatabaseDialect.SqlServer: + sql += "SELECT SCOPE_IDENTITY() AS [Id]"; + break; + case DatabaseDialect.MySql: + sql += "SELECT LAST_INSERT_ID() AS `Id`"; + break; + case DatabaseDialect.Sqlite: + sql += "SELECT LAST_INSERT_ROWID() AS \"Id\""; + break; + default: + throw new NotSupportedException(); + } + return sql; + } + + public static void UpdateJob(IDbConnection db, ScheduledJob job) + { + const string sql = "UPDATE ScheduledJob SET " + + "Priority = @Priority, Attempts = @Attempts, LastError = @LastError, RunAt = @RunAt, " + + "FailedAt = @FailedAt, SucceededAt = @SucceededAt, LockedAt = @LockedAt, " + + "LockedBy = @LockedBy, UpdatedAt = @UpdatedAt " + + "WHERE Id = @Id"; + + db.Execute(sql, job); + } + + public static IEnumerable GetNextAvailable(IDbConnection db, DatabaseDialect dialect, int count) + { + // - None failed or succeeded, none locked, none in batches, RunAt sorted, Priority sorted + string sql; + switch(dialect) + { + case DatabaseDialect.SqlServer: + sql = + "SELECT TOP " + count + " * FROM [ScheduledJob] j " + + "WHERE NOT EXISTS (SELECT 1 FROM BatchJob WHERE ScheduledJobId = j.Id)" + + "AND [LockedAt] IS NULL AND [FailedAt] IS NULL AND [SucceededAt] IS NULL " + + "AND [RunAt] IS NULL OR GETDATE() >= [RunAt] " + + "ORDER BY [Priority], [RunAt] ASC"; + return db.Query(sql).ToList(); + case DatabaseDialect.MySql: + sql = + "SELECT * FROM ScheduledJob j " + + "WHERE NOT EXISTS (SELECT 1 FROM BatchJob WHERE ScheduledJobId = j.Id)" + + "AND LockedAt IS NULL AND FailedAt IS NULL AND SucceededAt IS NULL " + + "AND RunAt IS NULL OR NOW() >= RunAt" + + "ORDER BY Priority, RunAt ASC " + + "LIMIT @Count"; + return db.Query(sql, new { Count = count }).ToList(); + case DatabaseDialect.Sqlite: + sql = + "SELECT * FROM ScheduledJob j " + + "WHERE NOT EXISTS (SELECT 1 FROM BatchJob WHERE ScheduledJobId = j.Id) " + + "AND LockedAt IS NULL AND FailedAt IS NULL AND SucceededAt IS NULL " + + "AND RunAt IS NULL OR CURRENT_TIMESTAMP >= RunAt " + + "ORDER BY Priority, RunAt ASC " + + "LIMIT @Count"; + return db.Query(sql, new { Count = count }).ToList(); + default: + throw new ArgumentOutOfRangeException("dialect"); + } + } + + public static IEnumerable GetAll(IDbConnection db) + { + return db.Query("SELECT * FROM ScheduledJob j WHERE NOT EXISTS (SELECT 1 FROM BatchJob WHERE ScheduledJobId = j.Id)"); + } + + public static void LockJobs(IDbConnection db, IList jobs) + { + const string sql = "UPDATE ScheduledJob SET LockedAt = @Now, LockedBy = @User WHERE Id IN @Ids"; + var now = DateTime.Now; + var identity = WindowsIdentity.GetCurrent(); + var user = identity == null ? "Unknown" : identity.Name; + db.Execute(sql, new + { + Now = now, + Ids = jobs.Select(j => j.Id), + User = user + }); + foreach (var job in jobs) + { + job.LockedAt = now; + job.LockedBy = user; + } + } + + public static void InsertBatch(IDbConnection db, DatabaseDialect dialect, Batch batch) + { + var sql = "INSERT INTO Batch (Name) VALUES (@Name);"; + sql = AddInsertIdentity(dialect, sql); + batch.Id = db.Execute(sql, batch); + batch.CreatedAt = db.Query("SELECT CreatedAt FROM Batch WHERE Id = @Id", new { batch.Id }).Single(); + } + + public static void AddToBatch(IDbConnection db, DatabaseDialect dialect, Batch batch, ScheduledJob job) + { + const string sql = "INSERT INTO BatchJob (BatchId, ScheduledJobId) VALUES (@BatchId, @ScheduledJobId)"; + db.Execute(sql, new { BatchId = batch.Id, ScheduledJobId = job.Id }); + } + + public static RepeatInfo GetRepeatInfo(IDbConnection db, ScheduledJob job) + { + var result = db.Query("SELECT * FROM RepeatInfo WHERE ScheduledJobId = @Id", job).SingleOrDefault(); + if (result == null) return null; + var repeatInfo = new RepeatInfo(result.Start, new DatePeriod(result.PeriodFrequency, result.PeriodQuantifier)); + return repeatInfo; + } + + public static void InsertRepeatInfo(IDbConnection db, DatabaseDialect dialect, ScheduledJob job, RepeatInfo info) + { + const string sql = "INSERT INTO RepeatInfo " + + "(ScheduledJobId, PeriodFrequency, PeriodQuantifier, Start, IncludeWeekends) " + + "VALUES (@ScheduledJobId, @PeriodFrequency, @PeriodQuantifier, @Start, @IncludeWeekends);"; + + db.Execute(sql, new + { + ScheduledJobId = job.Id, + info.PeriodFrequency, + info.PeriodQuantifier, + info.Start, + info.IncludeWeekends + }); + } + + public static void UpdateRepeatInfo(IDbConnection db, DatabaseDialect dialect, ScheduledJob job, RepeatInfo info) + { + const string sql = "UPDATE RepeatInfo SET " + + "PeriodFrequency = @PeriodFrequency, " + + "PeriodQuantifier = @PeriodQuantifier, " + + "Start = @Start, " + + "IncludeWeekends = @IncludeWeekends " + + "WHERE ScheduledJobId = @ScheduledJobId;"; + + db.Execute(sql, new + { + ScheduledJobId = job.Id, + info.PeriodFrequency, + info.PeriodQuantifier, + info.Start, + info.IncludeWeekends + }); + } + } +} \ No newline at end of file diff --git a/linger/src/linger/QueuedTaskScheduler.cs b/linger/src/linger/QueuedTaskScheduler.cs new file mode 100644 index 0000000..c028ed1 --- /dev/null +++ b/linger/src/linger/QueuedTaskScheduler.cs @@ -0,0 +1,616 @@ +//-------------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// File: QueuedTaskScheduler.cs +// +//-------------------------------------------------------------------------- + +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; + +namespace System.Threading.Tasks.Schedulers +{ + /// + /// Provides a TaskScheduler that provides control over priorities, fairness, and the underlying threads utilized. + /// + [DebuggerTypeProxy(typeof(QueuedTaskSchedulerDebugView))] + [DebuggerDisplay("Id={Id}, Queues={DebugQueueCount}, ScheduledTasks = {DebugTaskCount}")] + public sealed class QueuedTaskScheduler : TaskScheduler, IDisposable + { + /// Debug view for the QueuedTaskScheduler. + private class QueuedTaskSchedulerDebugView + { + /// The scheduler. + private QueuedTaskScheduler _scheduler; + + /// Initializes the debug view. + /// The scheduler. + public QueuedTaskSchedulerDebugView(QueuedTaskScheduler scheduler) + { + if (scheduler == null) throw new ArgumentNullException("scheduler"); + _scheduler = scheduler; + } + + /// Gets all of the Tasks queued to the scheduler directly. + public IEnumerable ScheduledTasks + { + get + { + var tasks = (_scheduler._targetScheduler != null) ? + (IEnumerable)_scheduler._nonthreadsafeTaskQueue : + (IEnumerable)_scheduler._blockingTaskQueue; + return tasks.Where(t => t != null).ToList(); + } + } + + /// Gets the prioritized and fair queues. + public IEnumerable Queues + { + get + { + List queues = new List(); + foreach (var group in _scheduler._queueGroups) queues.AddRange(group.Value); + return queues; + } + } + } + + /// + /// A sorted list of round-robin queue lists. Tasks with the smallest priority value + /// are preferred. Priority groups are round-robin'd through in order of priority. + /// + private readonly SortedList _queueGroups = new SortedList(); + /// Cancellation token used for disposal. + private readonly CancellationTokenSource _disposeCancellation = new CancellationTokenSource(); + /// + /// The maximum allowed concurrency level of this scheduler. If custom threads are + /// used, this represents the number of created threads. + /// + private readonly int _concurrencyLevel; + /// Whether we're processing tasks on the current thread. + private static ThreadLocal _taskProcessingThread = new ThreadLocal(); + + // *** + // *** For when using a target scheduler + // *** + + /// The scheduler onto which actual work is scheduled. + private readonly TaskScheduler _targetScheduler; + /// The queue of tasks to process when using an underlying target scheduler. + private readonly Queue _nonthreadsafeTaskQueue; + /// The number of Tasks that have been queued or that are running whiel using an underlying scheduler. + private int _delegatesQueuedOrRunning = 0; + + // *** + // *** For when using our own threads + // *** + + /// The threads used by the scheduler to process work. + private readonly Thread[] _threads; + /// The collection of tasks to be executed on our custom threads. + private readonly BlockingCollection _blockingTaskQueue; + + // *** + + /// Initializes the scheduler. + public QueuedTaskScheduler() : this(TaskScheduler.Default, 0) { } + + /// Initializes the scheduler. + /// The target underlying scheduler onto which this sceduler's work is queued. + public QueuedTaskScheduler(TaskScheduler targetScheduler) : this(targetScheduler, 0) { } + + /// Initializes the scheduler. + /// The target underlying scheduler onto which this sceduler's work is queued. + /// The maximum degree of concurrency allowed for this scheduler's work. + public QueuedTaskScheduler( + TaskScheduler targetScheduler, + int maxConcurrencyLevel) + { + // Validate arguments + if (targetScheduler == null) throw new ArgumentNullException("underlyingScheduler"); + if (maxConcurrencyLevel < 0) throw new ArgumentOutOfRangeException("concurrencyLevel"); + + // Initialize only those fields relevant to use an underlying scheduler. We don't + // initialize the fields relevant to using our own custom threads. + _targetScheduler = targetScheduler; + _nonthreadsafeTaskQueue = new Queue(); + + // If 0, use the number of logical processors. But make sure whatever value we pick + // is not greater than the degree of parallelism allowed by the underlying scheduler. + _concurrencyLevel = maxConcurrencyLevel != 0 ? maxConcurrencyLevel : Environment.ProcessorCount; + if (targetScheduler.MaximumConcurrencyLevel > 0 && + targetScheduler.MaximumConcurrencyLevel < _concurrencyLevel) + { + _concurrencyLevel = targetScheduler.MaximumConcurrencyLevel; + } + } + + /// Initializes the scheduler. + /// The number of threads to create and use for processing work items. + public QueuedTaskScheduler(int threadCount) : this(threadCount, string.Empty, false, ThreadPriority.Normal, ApartmentState.MTA, 0, null, null) { } + + /// Initializes the scheduler. + /// The number of threads to create and use for processing work items. + /// The name to use for each of the created threads. + /// A Boolean value that indicates whether to use foreground threads instead of background. + /// The priority to assign to each thread. + /// The apartment state to use for each thread. + /// The stack size to use for each thread. + /// An initialization routine to run on each thread. + /// A finalization routine to run on each thread. + public QueuedTaskScheduler( + int threadCount, + string threadName = "", + bool useForegroundThreads = false, + ThreadPriority threadPriority = ThreadPriority.Normal, + ApartmentState threadApartmentState = ApartmentState.MTA, + int threadMaxStackSize = 0, + Action threadInit = null, + Action threadFinally = null) + { + // Validates arguments (some validation is left up to the Thread type itself). + // If the thread count is 0, default to the number of logical processors. + if (threadCount < 0) throw new ArgumentOutOfRangeException("concurrencyLevel"); + else if (threadCount == 0) _concurrencyLevel = Environment.ProcessorCount; + else _concurrencyLevel = threadCount; + + // Initialize the queue used for storing tasks + _blockingTaskQueue = new BlockingCollection(); + + // Create all of the threads + _threads = new Thread[threadCount]; + for (int i = 0; i < threadCount; i++) + { + _threads[i] = new Thread(() => ThreadBasedDispatchLoop(threadInit, threadFinally), threadMaxStackSize) + { + Priority = threadPriority, + IsBackground = !useForegroundThreads, + }; + if (threadName != null) _threads[i].Name = threadName + " (" + i + ")"; + _threads[i].SetApartmentState(threadApartmentState); + } + + // Start all of the threads + foreach (var thread in _threads) thread.Start(); + } + + /// The dispatch loop run by all threads in this scheduler. + /// An initialization routine to run when the thread begins. + /// A finalization routine to run before the thread ends. + private void ThreadBasedDispatchLoop(Action threadInit, Action threadFinally) + { + _taskProcessingThread.Value = true; + if (threadInit != null) threadInit(); + try + { + // If the scheduler is disposed, the cancellation token will be set and + // we'll receive an OperationCanceledException. That OCE should not crash the process. + try + { + // If a thread abort occurs, we'll try to reset it and continue running. + while (true) + { + try + { + // For each task queued to the scheduler, try to execute it. + foreach (var task in _blockingTaskQueue.GetConsumingEnumerable(_disposeCancellation.Token)) + { + // If the task is not null, that means it was queued to this scheduler directly. + // Run it. + if (task != null) + { + TryExecuteTask(task); + } + // If the task is null, that means it's just a placeholder for a task + // queued to one of the subschedulers. Find the next task based on + // priority and fairness and run it. + else + { + // Find the next task based on our ordering rules... + Task targetTask; + QueuedTaskSchedulerQueue queueForTargetTask; + lock (_queueGroups) FindNextTask_NeedsLock(out targetTask, out queueForTargetTask); + + // ... and if we found one, run it + if (targetTask != null) queueForTargetTask.ExecuteTask(targetTask); + } + } + } + catch (ThreadAbortException) + { + // If we received a thread abort, and that thread abort was due to shutting down + // or unloading, let it pass through. Otherwise, reset the abort so we can + // continue processing work items. + if (!Environment.HasShutdownStarted && !AppDomain.CurrentDomain.IsFinalizingForUnload()) + { + Thread.ResetAbort(); + } + } + } + } + catch (OperationCanceledException) { } + } + finally + { + // Run a cleanup routine if there was one + if (threadFinally != null) threadFinally(); + _taskProcessingThread.Value = false; + } + } + + /// Gets the number of queues currently activated. + private int DebugQueueCount + { + get + { + int count = 0; + foreach (var group in _queueGroups) count += group.Value.Count; + return count; + } + } + + /// Gets the number of tasks currently scheduled. + private int DebugTaskCount + { + get + { + return (_targetScheduler != null + ? _nonthreadsafeTaskQueue + : (IEnumerable) _blockingTaskQueue).Count(t => t != null); + } + } + + /// Find the next task that should be executed, based on priorities and fairness and the like. + /// The found task, or null if none was found. + /// + /// The scheduler associated with the found task. Due to security checks inside of TPL, + /// this scheduler needs to be used to execute that task. + /// + private void FindNextTask_NeedsLock(out Task targetTask, out QueuedTaskSchedulerQueue queueForTargetTask) + { + targetTask = null; + queueForTargetTask = null; + + // Look through each of our queue groups in sorted order. + // This ordering is based on the priority of the queues. + foreach (var queueGroup in _queueGroups) + { + var queues = queueGroup.Value; + + // Within each group, iterate through the queues in a round-robin + // fashion. Every time we iterate again and successfully find a task, + // we'll start in the next location in the group. + foreach (int i in queues.CreateSearchOrder()) + { + queueForTargetTask = queues[i]; + var items = queueForTargetTask.WorkItems; + if (items.Count > 0) + { + targetTask = items.Dequeue(); + if (queueForTargetTask.Disposed && items.Count == 0) + { + RemoveQueueNeedsLock(queueForTargetTask); + } + queues.NextQueueIndex = (queues.NextQueueIndex + 1) % queueGroup.Value.Count; + return; + } + } + } + } + + /// Queues a task to the scheduler. + /// The task to be queued. + protected override void QueueTask(Task task) + { + // If we've been disposed, no one should be queueing + if (_disposeCancellation.IsCancellationRequested) throw new ObjectDisposedException(GetType().Name); + + // If the target scheduler is null (meaning we're using our own threads), + // add the task to the blocking queue + if (_targetScheduler == null) + { + _blockingTaskQueue.Add(task); + } + // Otherwise, add the task to the non-blocking queue, + // and if there isn't already an executing processing task, + // start one up + else + { + // Queue the task and check whether we should launch a processing + // task (noting it if we do, so that other threads don't result + // in queueing up too many). + bool launchTask = false; + lock (_nonthreadsafeTaskQueue) + { + _nonthreadsafeTaskQueue.Enqueue(task); + if (_delegatesQueuedOrRunning < _concurrencyLevel) + { + ++_delegatesQueuedOrRunning; + launchTask = true; + } + } + + // If necessary, start processing asynchronously + if (launchTask) + { + Task.Factory.StartNew(ProcessPrioritizedAndBatchedTasks, + CancellationToken.None, TaskCreationOptions.None, _targetScheduler); + } + } + } + + /// + /// Process tasks one at a time in the best order. + /// This should be run in a Task generated by QueueTask. + /// It's been separated out into its own method to show up better in Parallel Tasks. + /// + private void ProcessPrioritizedAndBatchedTasks() + { + bool continueProcessing = true; + while (!_disposeCancellation.IsCancellationRequested && continueProcessing) + { + try + { + // Note that we're processing tasks on this thread + _taskProcessingThread.Value = true; + + // Until there are no more tasks to process + while (!_disposeCancellation.IsCancellationRequested) + { + // Try to get the next task. If there aren't any more, we're done. + Task targetTask; + lock (_nonthreadsafeTaskQueue) + { + if (_nonthreadsafeTaskQueue.Count == 0) break; + targetTask = _nonthreadsafeTaskQueue.Dequeue(); + } + + // If the task is null, it's a placeholder for a task in the round-robin queues. + // Find the next one that should be processed. + QueuedTaskSchedulerQueue queueForTargetTask = null; + if (targetTask == null) + { + lock (_queueGroups) FindNextTask_NeedsLock(out targetTask, out queueForTargetTask); + } + + // Now if we finally have a task, run it. If the task + // was associated with one of the round-robin schedulers, we need to use it + // as a thunk to execute its task. + if (targetTask != null) + { + if (queueForTargetTask != null) queueForTargetTask.ExecuteTask(targetTask); + else TryExecuteTask(targetTask); + } + } + } + finally + { + // Now that we think we're done, verify that there really is + // no more work to do. If there's not, highlight + // that we're now less parallel than we were a moment ago. + lock (_nonthreadsafeTaskQueue) + { + if (_nonthreadsafeTaskQueue.Count == 0) + { + _delegatesQueuedOrRunning--; + continueProcessing = false; + _taskProcessingThread.Value = false; + } + } + } + } + } + + /// Notifies the pool that there's a new item to be executed in one of the round-robin queues. + private void NotifyNewWorkItem() { QueueTask(null); } + + /// Tries to execute a task synchronously on the current thread. + /// The task to execute. + /// Whether the task was previously queued. + /// true if the task was executed; otherwise, false. + protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued) + { + // If we're already running tasks on this threads, enable inlining + return _taskProcessingThread.Value && TryExecuteTask(task); + } + + /// Gets the tasks scheduled to this scheduler. + /// An enumerable of all tasks queued to this scheduler. + /// This does not include the tasks on sub-schedulers. Those will be retrieved by the debugger separately. + protected override IEnumerable GetScheduledTasks() + { + // If we're running on our own threads, get the tasks from the blocking queue... + if (_targetScheduler == null) + { + // Get all of the tasks, filtering out nulls, which are just placeholders + // for tasks in other sub-schedulers + return _blockingTaskQueue.Where(t => t != null).ToList(); + } + // otherwise get them from the non-blocking queue... + else + { + return _nonthreadsafeTaskQueue.Where(t => t != null).ToList(); + } + } + + /// Gets the maximum concurrency level to use when processing tasks. + public override int MaximumConcurrencyLevel { get { return _concurrencyLevel; } } + + /// Initiates shutdown of the scheduler. + public void Dispose() + { + _disposeCancellation.Cancel(); + + // [DC]: Called out by code analysis, but will likely mess with shutdown + //_disposeCancellation.Dispose(); + //_blockingTaskQueue.Dispose(); + } + + /// Creates and activates a new scheduling queue for this scheduler. + /// The newly created and activated queue at priority 0. + public TaskScheduler ActivateNewQueue() { return ActivateNewQueue(0); } + + /// Creates and activates a new scheduling queue for this scheduler. + /// The priority level for the new queue. + /// The newly created and activated queue at the specified priority. + public TaskScheduler ActivateNewQueue(int priority) + { + // Create the queue + var createdQueue = new QueuedTaskSchedulerQueue(priority, this); + + // Add the queue to the appropriate queue group based on priority + lock (_queueGroups) + { + QueueGroup list; + if (!_queueGroups.TryGetValue(priority, out list)) + { + list = new QueueGroup(); + _queueGroups.Add(priority, list); + } + list.Add(createdQueue); + } + + // Hand the new queue back + return createdQueue; + } + + /// Removes a scheduler from the group. + /// The scheduler to be removed. + private void RemoveQueueNeedsLock(QueuedTaskSchedulerQueue queue) + { + // Find the group that contains the queue and the queue's index within the group + var queueGroup = _queueGroups[queue.Priority]; + int index = queueGroup.IndexOf(queue); + + // We're about to remove the queue, so adjust the index of the next + // round-robin starting location if it'll be affected by the removal + if (queueGroup.NextQueueIndex >= index) queueGroup.NextQueueIndex--; + + // Remove it + queueGroup.RemoveAt(index); + } + + /// A group of queues a the same priority level. + private class QueueGroup : List + { + /// The starting index for the next round-robin traversal. + public int NextQueueIndex = 0; + + /// Creates a search order through this group. + /// An enumerable of indices for this group. + public IEnumerable CreateSearchOrder() + { + for (int i = NextQueueIndex; i < Count; i++) yield return i; + for (int i = 0; i < NextQueueIndex; i++) yield return i; + } + } + + /// Provides a scheduling queue associatd with a QueuedTaskScheduler. + [DebuggerDisplay("QueuePriority = {_priority}, WaitingTasks = {WaitingTasks}")] + [DebuggerTypeProxy(typeof(QueuedTaskSchedulerQueueDebugView))] + private sealed class QueuedTaskSchedulerQueue : TaskScheduler, IDisposable + { + /// A debug view for the queue. + private sealed class QueuedTaskSchedulerQueueDebugView + { + /// The queue. + private readonly QueuedTaskSchedulerQueue _queue; + + /// Initializes the debug view. + /// The queue to be debugged. + public QueuedTaskSchedulerQueueDebugView(QueuedTaskSchedulerQueue queue) + { + if (queue == null) throw new ArgumentNullException("queue"); + _queue = queue; + } + + /// Gets the priority of this queue in its associated scheduler. + public int Priority { get { return _queue.Priority; } } + /// Gets the ID of this scheduler. + public int Id { get { return _queue.Id; } } + /// Gets all of the tasks scheduled to this queue. + public IEnumerable ScheduledTasks { get { return _queue.GetScheduledTasks(); } } + /// Gets the QueuedTaskScheduler with which this queue is associated. + public QueuedTaskScheduler AssociatedScheduler { get { return _queue._pool; } } + } + + /// The scheduler with which this pool is associated. + private readonly QueuedTaskScheduler _pool; + /// The work items stored in this queue. + internal readonly Queue WorkItems; + /// Whether this queue has been disposed. + internal bool Disposed; + /// Gets the priority for this queue. + internal readonly int Priority; + + /// Initializes the queue. + /// The priority associated with this queue. + /// The scheduler with which this queue is associated. + internal QueuedTaskSchedulerQueue(int priority, QueuedTaskScheduler pool) + { + Priority = priority; + _pool = pool; + WorkItems = new Queue(); + } + + /// Gets the number of tasks waiting in this scheduler. + internal int WaitingTasks { get { return WorkItems.Count; } } + + /// Gets the tasks scheduled to this scheduler. + /// An enumerable of all tasks queued to this scheduler. + protected override IEnumerable GetScheduledTasks() { return WorkItems.ToList(); } + + /// Queues a task to the scheduler. + /// The task to be queued. + protected override void QueueTask(Task task) + { + if (Disposed) throw new ObjectDisposedException(GetType().Name); + + // Queue up the task locally to this queue, and then notify + // the parent scheduler that there's work available + lock (_pool._queueGroups) WorkItems.Enqueue(task); + _pool.NotifyNewWorkItem(); + } + + /// Tries to execute a task synchronously on the current thread. + /// The task to execute. + /// Whether the task was previously queued. + /// true if the task was executed; otherwise, false. + protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued) + { + // If we're using our own threads and if this is being called from one of them, + // or if we're currently processing another task on this thread, try running it inline. + return _taskProcessingThread.Value && TryExecuteTask(task); + } + + /// Runs the specified ask. + /// The task to execute. + internal void ExecuteTask(Task task) { TryExecuteTask(task); } + + /// Gets the maximum concurrency level to use when processing tasks. + public override int MaximumConcurrencyLevel { get { return _pool.MaximumConcurrencyLevel; } } + + /// Signals that the queue should be removed from the scheduler as soon as the queue is empty. + public void Dispose() + { + if (!Disposed) + { + lock (_pool._queueGroups) + { + // We only remove the queue if it's empty. If it's not empty, + // we still mark it as disposed, and the associated QueuedTaskScheduler + // will remove the queue when its count hits 0 and its _disposed is true. + if (WorkItems.Count == 0) + { + _pool.RemoveQueueNeedsLock(this); + } + } + Disposed = true; + } + } + } + } +} \ No newline at end of file diff --git a/linger/src/linger/RepeatExtensions.cs b/linger/src/linger/RepeatExtensions.cs new file mode 100644 index 0000000..ca982c9 --- /dev/null +++ b/linger/src/linger/RepeatExtensions.cs @@ -0,0 +1,10 @@ +namespace linger +{ + public static class RepeatExtensions + { + public static For For(this RepeatInfo info, int n) + { + return new For(info, n); + } + } +} \ No newline at end of file diff --git a/linger/src/linger/RepeatInfo.cs b/linger/src/linger/RepeatInfo.cs new file mode 100644 index 0000000..14b1c93 --- /dev/null +++ b/linger/src/linger/RepeatInfo.cs @@ -0,0 +1,115 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using Dates; + +namespace linger +{ + public class RepeatInfo + { + private static readonly IDictionary> Cache = new Dictionary>(); + + [IgnoreDataMember] + public DatePeriod Period { get; set; } + + [IgnoreDataMember] + public DatePeriod? EndPeriod { get; set; } + + [IgnoreDataMember] + public IEnumerable AllOccurrences + { + get { return GetSeriesOccurrences(); } + } + + public DatePeriodFrequency PeriodFrequency { get { return Period.Frequency; } } + public int PeriodQuantifier { get { return Period.Quantifier; } } + + public DatePeriodFrequency? EndPeriodFrequency { get { return EndPeriod.HasValue ? EndPeriod.Value.Frequency : default(DatePeriodFrequency?); }} + public int? EndPeriodQuantifier { get { return EndPeriod.HasValue ? EndPeriod.Value.Quantifier : default(int?); }} + + public DateTime? Start { get; set; } + public bool IncludeWeekends { get; set; } + + internal RepeatInfo(DateTime? start, DatePeriod period) + { + Start = start; + Period = period; + } + + public DateTime? NextOccurrence + { + get + { + if(!EndPeriod.HasValue) + { + return GetSeriesOccurrences(new DatePeriod(DatePeriodFrequency.Years, 100)).FirstOrDefault(); + } + var occurrence = GetSeriesOccurrences().FirstOrDefault(); + return occurrence; + } + } + + public DateTime? LastOccurrence + { + get { return EndPeriod.HasValue ? GetSeriesOccurrences().Last() : (DateTime?)null; } + } + + private IEnumerable GetSeriesOccurrences(DatePeriod? endPeriod = null) + { + endPeriod = endPeriod.HasValue ? endPeriod.Value : EndPeriod.HasValue ? EndPeriod.Value : (DatePeriod?)null; + if (!endPeriod.HasValue) + { + throw new ArgumentException("You cannot request the occurrences for an infinite series"); + } + + var cacheKey = string.Format( + "frequency:{0}_quantifier:{1}_end:{2}_start:{3}_skip:{4}", Period.Frequency, + Period.Quantifier, + EndPeriod.HasValue ? string.Format("{0}_{1}", EndPeriod.Value.Frequency, EndPeriod.Value.Quantifier) : null, + Start, + !IncludeWeekends + ); + + IEnumerable occurrences; + if(Cache.TryGetValue(cacheKey, out occurrences)) + { + return occurrences; + } + + var start = Start.HasValue ? Start.Value : DateTime.Now; + DateTime end; + + // Get the last occurrence + switch (endPeriod.Value.Frequency) + { + case DatePeriodFrequency.Years: + end = start.AddYears(endPeriod.Value.Quantifier); + break; + case DatePeriodFrequency.Weeks: + end = start.AddDays(endPeriod.Value.Quantifier * 7); + break; + case DatePeriodFrequency.Days: + end = start.AddDays(endPeriod.Value.Quantifier); + break; + case DatePeriodFrequency.Hours: + end = start.AddHours(endPeriod.Value.Quantifier); + break; + case DatePeriodFrequency.Minutes: + end = start.AddHours(endPeriod.Value.Quantifier); + break; + case DatePeriodFrequency.Seconds: + end = start.AddSeconds(endPeriod.Value.Quantifier); + break; + case DatePeriodFrequency.Months: + end = start.AddMonths(endPeriod.Value.Quantifier); + break; + default: + throw new ArgumentException("DatePeriodFrequency"); + } + occurrences = Period.GetOccurrences(start, end, !IncludeWeekends).ToList(); + Cache.Add(cacheKey, occurrences); + return occurrences; + } + } +} \ No newline at end of file diff --git a/linger/src/linger/ScheduledJob.cs b/linger/src/linger/ScheduledJob.cs new file mode 100644 index 0000000..a26572b --- /dev/null +++ b/linger/src/linger/ScheduledJob.cs @@ -0,0 +1,115 @@ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace linger +{ + [Serializable] + public class ScheduledJob : IEquatable + { + public int Id { get; set; } + public int Priority { get; set; } + public int Attempts { get; set; } + + [IgnoreDataMember] + public byte[] Handler { get; set; } + public string LastError { get; set; } + public DateTime? RunAt { get; set; } + public DateTime? FailedAt { get; set; } + public DateTime? SucceededAt { get; set; } + public DateTime? LockedAt { get; set; } + public string LockedBy { get; set; } + public DateTime CreatedAt { get; set; } + public DateTime? UpdatedAt { get; set; } + public RepeatInfo RepeatInfo { get; internal set; } + + public bool Equals(ScheduledJob other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return Id == other.Id && Priority == other.Priority && Attempts == other.Attempts && + string.Equals(LastError, other.LastError) && + RunAt.Equals(other.RunAt) && SucceededAt.Equals(other.SucceededAt) && FailedAt.Equals(other.FailedAt) && + LockedAt.Equals(other.LockedAt) && string.Equals(LockedBy, other.LockedBy) && + CreatedAt.Equals(other.CreatedAt) && UpdatedAt.Equals(other.UpdatedAt); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((ScheduledJob) obj); + } + + public override int GetHashCode() + { + unchecked + { + var hashCode = Id; + hashCode = (hashCode*397) ^ Priority; + hashCode = (hashCode*397) ^ Attempts; + hashCode = (hashCode*397) ^ (LastError != null ? LastError.GetHashCode() : 0); + hashCode = (hashCode*397) ^ RunAt.GetHashCode(); + hashCode = (hashCode*397) ^ SucceededAt.GetHashCode(); + hashCode = (hashCode*397) ^ FailedAt.GetHashCode(); + hashCode = (hashCode*397) ^ LockedAt.GetHashCode(); + hashCode = (hashCode*397) ^ (LockedBy != null ? LockedBy.GetHashCode() : 0); + hashCode = (hashCode*397) ^ CreatedAt.GetHashCode(); + hashCode = (hashCode*397) ^ UpdatedAt.GetHashCode(); + return hashCode; + } + } + + public static bool operator ==(ScheduledJob left, ScheduledJob right) + { + return Equals(left, right); + } + + public static bool operator !=(ScheduledJob left, ScheduledJob right) + { + return !Equals(left, right); + } + + private sealed class ScheduledJobEqualityComparer : IEqualityComparer + { + public bool Equals(ScheduledJob x, ScheduledJob y) + { + if (ReferenceEquals(x, y)) return true; + if (ReferenceEquals(x, null)) return false; + if (ReferenceEquals(y, null)) return false; + if (x.GetType() != y.GetType()) return false; + return x.Id == y.Id && x.Priority == y.Priority && x.Attempts == y.Attempts && + string.Equals(x.LastError, y.LastError) && x.RunAt.Equals(y.RunAt) && + x.FailedAt.Equals(y.FailedAt) && x.SucceededAt.Equals(y.SucceededAt) && + x.LockedAt.Equals(y.LockedAt) && string.Equals(x.LockedBy, y.LockedBy) && + x.CreatedAt.Equals(y.CreatedAt) && x.UpdatedAt.Equals(y.UpdatedAt); + } + + public int GetHashCode(ScheduledJob obj) + { + unchecked + { + var hashCode = obj.Id; + hashCode = (hashCode*397) ^ obj.Priority; + hashCode = (hashCode*397) ^ obj.Attempts; + hashCode = (hashCode*397) ^ (obj.LastError != null ? obj.LastError.GetHashCode() : 0); + hashCode = (hashCode*397) ^ obj.RunAt.GetHashCode(); + hashCode = (hashCode*397) ^ obj.FailedAt.GetHashCode(); + hashCode = (hashCode*397) ^ obj.SucceededAt.GetHashCode(); + hashCode = (hashCode*397) ^ obj.LockedAt.GetHashCode(); + hashCode = (hashCode*397) ^ (obj.LockedBy != null ? obj.LockedBy.GetHashCode() : 0); + hashCode = (hashCode*397) ^ obj.CreatedAt.GetHashCode(); + hashCode = (hashCode*397) ^ obj.UpdatedAt.GetHashCode(); + return hashCode; + } + } + } + + private static readonly IEqualityComparer ScheduledJobComparerInstance = new ScheduledJobEqualityComparer(); + + public static IEqualityComparer ScheduledJobComparer + { + get { return ScheduledJobComparerInstance; } + } + } +} \ No newline at end of file diff --git a/linger/src/linger/Schema.cs b/linger/src/linger/Schema.cs new file mode 100644 index 0000000..6086d1f --- /dev/null +++ b/linger/src/linger/Schema.cs @@ -0,0 +1,123 @@ +using System; +using System.Data; +using Dapper; + +namespace linger +{ + internal static class Schema + { + public static void Install(DatabaseDialect dialect, IDbConnection db) + { + string sql; + switch(dialect) + { + case DatabaseDialect.SqlServer: + sql = "IF NOT EXISTS (SELECT [name] FROM sys.tables WHERE [name] = 'ScheduledJob')\n" + + "CREATE TABLE [dbo].[ScheduledJob]\n" + + "(\n" + + " [Id] INT NOT NULL IDENTITY(1,1), \n" + + " [Name] NVARCHAR(255), \n" + + " [Priority] INT NOT NULL CONSTRAINT [DF_ScheduledJob_Priority] DEFAULT 0, \n" + + " [Attempts] INT NOT NULL CONSTRAINT [DF_ScheduledJob_Attempts] DEFAULT 0, \n" + + " [Handler] VARBINARY(8000) NOT NULL, \n" + + " [LastError] NVARCHAR(255), \n" + + " [RunAt] DATETIME, \n" + + " [FailedAt] DATETIME, \n" + + " [SucceededAt] DATETIME, \n" + + " [LockedAt] DATETIME, \n" + + " [LockedBy] NVARCHAR(255), \n" + + " [CreatedAt] DATETIME NOT NULL CONSTRAINT [DF_ScheduledJob_CreatedAt] DEFAULT GETDATE(), \n" + + " [UpdatedAt] DATETIME, \n" + + " CONSTRAINT [PK_ScheduledJob] PRIMARY KEY ([Id])\n" + + ");\n"; + + sql += "IF NOT EXISTS (SELECT [name] FROM sys.tables WHERE [name] = 'Batch' )\n" + + "CREATE TABLE [dbo].[Batch]\n" + + "(\n" + + " [Id] INT NOT NULL IDENTITY(1,1), \n" + + " [Name] NVARCHAR(255) NOT NULL, \n" + + " [StartedAt] DATETIME, \n" + + " [CreatedAt] DATETIME NOT NULL CONSTRAINT [DF_Batch_CreatedAt] DEFAULT GETDATE(), \n" + + " CONSTRAINT [PK_Batch] PRIMARY KEY ([Id])\n" + + ");\n"; + + sql += "IF NOT EXISTS (SELECT [name] FROM sys.tables WHERE [name] = 'BatchJob')\n" + + "CREATE TABLE [dbo].[BatchJob]\n" + + "(\n" + + " [Id] INT NOT NULL IDENTITY(1,1), \n" + + " [BatchId] INT NOT NULL, \n" + + " [ScheduledJobId] INT NOT NULL, \n" + + " CONSTRAINT [PK_BatchJob] PRIMARY KEY ([Id])\n" + + ");\n"; + + sql += "IF NOT EXISTS (SELECT [name] FROM sys.objects WHERE [name] = 'FK_BatchJob_BatchId_Batch_Id')\n" + + "ALTER TABLE [dbo].[BatchJob] ADD CONSTRAINT [FK_BatchJob_BatchId_Batch_Id] FOREIGN KEY ([BatchId]) REFERENCES [dbo].[Batch] ([Id]);\n"; + + sql += "IF NOT EXISTS (SELECT [name] FROM sys.objects WHERE [name] = 'FK_BatchJob_ScheduledJobId_ScheduledJob_Id')\n" + + "ALTER TABLE [dbo].[BatchJob] ADD CONSTRAINT [FK_BatchJob_ScheduledJobId_ScheduledJob_Id] FOREIGN KEY ([ScheduledJobId]) REFERENCES [dbo].[ScheduledJob] ([Id]);\n"; + + sql += "IF NOT EXISTS (SELECT [name] FROM sys.tables WHERE [name] = 'RepeatInfo')\n" + + "CREATE TABLE [dbo].[RepeatInfo] \n" + + "(\n" + + " [ScheduledJobId] INT NOT NULL IDENTITY(1,1), \n" + + " [PeriodFrequency] INT NOT NULL, \n" + + " [PeriodQuantifier] INT NOT NULL, \n" + + " [Start] DATETIME NOT NULL, \n" + + " [IncludeWeekends] BIT NOT NULL CONSTRAINT [DF_RepeatInfo_IncludeWeekends] DEFAULT 0\n" + + ");\n"; + + sql += "IF NOT EXISTS ( SELECT [name] FROM sys.objects WHERE [name] = 'FK_RepeatInfo_ScheduledJobId_ScheduledJob_Id')\n" + + "ALTER TABLE [dbo].[RepeatInfo] ADD CONSTRAINT [FK_RepeatInfo_ScheduledJobId_ScheduledJob_Id] FOREIGN KEY ([ScheduledJobId]) REFERENCES [dbo].[ScheduledJob] ([Id]);\n"; + break; + + case DatabaseDialect.MySql: + throw new NotImplementedException(); + case DatabaseDialect.Sqlite: + sql = "CREATE TABLE IF NOT EXISTS 'ScheduledJob' " + + "(" + + " 'Id' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, " + + " 'Name' TEXT, " + + " 'Priority' INTEGER NOT NULL DEFAULT 0, " + + " 'Attempts' INTEGER NOT NULL DEFAULT 0, " + + " 'Handler' BLOB NOT NULL, " + + " 'LastError' TEXT, " + + " 'RunAt' DATETIME, " + + " 'FailedAt' DATETIME, " + + " 'SucceededAt' DATETIME, " + + " 'LockedAt' DATETIME, " + + " 'LockedBy' TEXT, " + + " 'CreatedAt' DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, " + + " 'UpdatedAt' DATETIME " + + ");"; + + sql += "CREATE TABLE IF NOT EXISTS 'Batch' (" + + " 'Id' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, " + + " 'Name' TEXT NOT NULL, " + + " 'StartedAt' DATETIME," + + " 'CreatedAt' DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP " + + ");"; + + sql += "CREATE TABLE IF NOT EXISTS 'BatchJob' " + + "(" + + " 'Id' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, " + + " 'BatchId' INTEGER NOT NULL, " + + " 'ScheduledJobId' INTEGER NOT NULL" + + ");"; + + sql += "CREATE TABLE IF NOT EXISTS 'RepeatInfo' " + + "(" + + " 'ScheduledJobId' INTEGER NOT NULL, " + + " 'PeriodFrequency' INTEGER NOT NULL, " + + " 'PeriodQuantifier' INTEGER NOT NULL, " + + " 'Start' DATETIME NOT NULL, " + + " 'IncludeWeekends' INTEGER NOT NULL DEFAULT 0" + + ")"; + break; + default: + throw new NotSupportedException(); + } + + db.Execute(sql); + } + } +} \ No newline at end of file diff --git a/linger/src/linger/linger.csproj b/linger/src/linger/linger.csproj new file mode 100644 index 0000000..7bec7c2 --- /dev/null +++ b/linger/src/linger/linger.csproj @@ -0,0 +1,101 @@ + + + + + Debug + AnyCPU + {92DFDDA0-1604-420F-842C-C04CFFB3079B} + Library + Properties + linger + linger + v4.0 + 512 + + + true + full + false + ..\..\bin\lib\net40\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\bin\lib\net40\ + TRACE + prompt + 4 + + + + False + ..\packages\Dapper.1.12.1\lib\net40\Dapper.dll + + + ..\packages\Dates.1.0.1\lib\net40\Dates.dll + + + ..\packages\DotLiquid.1.7.0\lib\NET40\DotLiquid.dll + + + ..\packages\ImpromptuInterface.6.0.6\lib\net40\ImpromptuInterface.dll + + + ..\packages\Microsoft.AspNet.SignalR.Core.1.0.0\lib\net40\Microsoft.AspNet.SignalR.Core.dll + + + ..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll + + + ..\packages\ServiceStack.Text.3.9.37\lib\net35\ServiceStack.Text.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/linger/src/linger/packages.config b/linger/src/linger/packages.config new file mode 100644 index 0000000..dd03466 --- /dev/null +++ b/linger/src/linger/packages.config @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/linger/src/packages/Dapper.1.12.1/Dapper.1.12.1.nuspec b/linger/src/packages/Dapper.1.12.1/Dapper.1.12.1.nuspec new file mode 100644 index 0000000..bd88bc4 --- /dev/null +++ b/linger/src/packages/Dapper.1.12.1/Dapper.1.12.1.nuspec @@ -0,0 +1,34 @@ + + + + Dapper + 1.12.1 + Dapper dot net + Sam Saffron, Marc Gravell + Sam Saffron, Marc Gravell + http://www.apache.org/licenses/LICENSE-2.0 + http://code.google.com/p/dapper-dot-net/ + false + A high performance Micro-ORM supporting Sql Server, MySQL, Sqlite, SqlCE, Firebird etc.. + A high performance Micro-ORM + * 1.12.1 - Minor deploy glitch (should now include intellisense files!) + * 1.12 - Better automatic type-mapping (int vs long, float vs double, etc) + * Fixed: bug with indexer properties + * 1.11 - Custom type-map support + * 1.10 - Fixed: error-handling could lose original exception if reader closed + * 1.9 - Added: better schema change detection + * Fixed: enum support for T in Query-of-T + * Added: dictionary support for parameters + * 1.8 - Started release notes + * Important: Dapper is now shipping as a DLL which will work on .net 3.5 or .net 4.0, + * This improves the debugging experience as you no longer break into dapper when SQL fails. + * Added: ParameterNames on DynamicParameters + orm sql micro-orm + + + + + + + + \ No newline at end of file diff --git a/linger/src/packages/Dapper.1.12.1/lib/net35/Dapper.xml b/linger/src/packages/Dapper.1.12.1/lib/net35/Dapper.xml new file mode 100644 index 0000000..51ab9ef --- /dev/null +++ b/linger/src/packages/Dapper.1.12.1/lib/net35/Dapper.xml @@ -0,0 +1,680 @@ + + + + Dapper + + + + + Dapper, a light weight object mapper for ADO.NET + + + + + Purge the query cache + + + + + Execute parameterized SQL + + Number of rows affected + + + + Execute parameterized SQL + + Number of rows affected + + + + Execute parameterized SQL + + Number of rows affected + + + + Execute parameterized SQL + + Number of rows affected + + + + Executes a query, returning the data typed as per T + + A sequence of data of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is + created per row, and a direct column-name===member-name mapping is assumed (case insensitive). + + + + + Executes a query, returning the data typed as per T + + A sequence of data of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is + created per row, and a direct column-name===member-name mapping is assumed (case insensitive). + + + + + Executes a query, returning the data typed as per T + + A sequence of data of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is + created per row, and a direct column-name===member-name mapping is assumed (case insensitive). + + + + + Executes a query, returning the data typed as per T + + A sequence of data of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is + created per row, and a direct column-name===member-name mapping is assumed (case insensitive). + + + + + Execute a command that returns multiple result sets, and access each in turn + + + + + Execute a command that returns multiple result sets, and access each in turn + + + + + Execute a command that returns multiple result sets, and access each in turn + + + + + Execute parameterized SQL + + Number of rows affected + + + + Return a list of dynamic objects, reader is closed after the call + + + + + Return a list of dynamic objects, reader is closed after the call + + + + + Return a list of dynamic objects, reader is closed after the call + + + + + Return a list of dynamic objects, reader is closed after the call + + + + + Return a list of dynamic objects, reader is closed after the call + + + + + Executes a query, returning the data typed as per T + + the dynamic param may seem a bit odd, but this works around a major usability issue in vs, if it is Object vs completion gets annoying. Eg type new [space] get new object + A sequence of data of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is + created per row, and a direct column-name===member-name mapping is assumed (case insensitive). + + + + + Execute a command that returns multiple result sets, and access each in turn + + + + + Return a typed list of objects, reader is closed after the call + + + + + Maps a query to objects + + The first type in the recordset + The second type in the recordset + The return type + + + + + + + The Field we should split and read the second object from (default: id) + Number of seconds before command execution timeout + Is it a stored proc or a batch? + + + + + Maps a query to objects + + + + + + + + + + + + The Field we should split and read the second object from (default: id) + Number of seconds before command execution timeout + + + + + + Perform a multi mapping query with 4 input parameters + + + + + + + + + + + + + + + + + + + + Internal use only + + + + + + + Internal use only + + + + + Internal use only + + + + + Internal use only + + + + + Gets type-map for the given type + + Type map implementation, DefaultTypeMap instance if no override present + + + + Set custom mapping for type deserializers + + Entity type to override + Mapping rules impementation, null to remove custom map + + + + Internal use only + + + + + + + + + + + Throws a data exception, only used internally + + + + + + + + Called if the query cache is purged via PurgeQueryCache + + + + + Implement this interface to pass an arbitrary db specific set of parameters to Dapper + + + + + Add all the parameters needed to the command just before it executes + + The raw command prior to execution + Information about the query + + + + Implement this interface to change default mapping of reader columns to type memebers + + + + + Finds best constructor + + DataReader column names + DataReader column types + Matching constructor or default one + + + + Gets mapping for constructor parameter + + Constructor to resolve + DataReader column name + Mapping implementation + + + + Gets member mapping for column + + DataReader column name + Mapping implementation + + + + Implements this interface to provide custom member mapping + + + + + Source DataReader column name + + + + + Target member type + + + + + Target property + + + + + Target field + + + + + Target constructor parameter + + + + + This is a micro-cache; suitable when the number of terms is controllable (a few hundred, for example), + and strictly append-only; you cannot change existing values. All key matches are on **REFERENCE** + equality. The type is fully thread-safe. + + + + + Identity of a cached query in Dapper, used for extensability + + + + + Create an identity for use with DynamicParameters, internal use only + + + + + + + + + + + + + + The sql + + + + + The command type + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Compare 2 Identity objects + + + + + + + The grid reader provides interfaces for reading multiple result sets from a Dapper query + + + + + Read the next grid of results + + + + + Read multiple objects from a single recordset on the grid + + + + + + + + + + + Read multiple objects from a single recordset on the grid + + + + + + + + + + + + Read multiple objects from a single record set on the grid + + + + + + + + + + + + + Dispose the grid, closing and disposing both the underlying reader and command. + + + + + A bag of parameters that can be passed to the Dapper Query and Execute methods + + + + + construct a dynamic parameter bag + + + + + construct a dynamic parameter bag + + can be an anonymous type or a DynamicParameters bag + + + + Append a whole object full of params to the dynamic + EG: AddDynamicParams(new {A = 1, B = 2}) // will add property A and B to the dynamic + + + + + + Add a parameter to this dynamic parameter list + + + + + + + + + + Add all the parameters needed to the command just before it executes + + The raw command prior to execution + Information about the query + + + + Get the value of a parameter + + + + The value, note DBNull.Value is not returned, instead the value is returned as null + + + + All the names of the param in the bag, use Get to yank them out + + + + + This class represents a SQL string, it can be used if you need to denote your parameter is a Char vs VarChar vs nVarChar vs nChar + + + + + Create a new DbString + + + + + Add the parameter to the command... internal use only + + + + + + + Ansi vs Unicode + + + + + Fixed length + + + + + Length of the string -1 for max + + + + + The value of the string + + + + + Handles variances in features per DBMS + + + + + Dictionary of supported features index by connection type name + + + + + Gets the featureset based on the passed connection + + + + + True if the db supports array columns e.g. Postgresql + + + + + Represents simple memeber map for one of target parameter or property or field to source DataReader column + + + + + Creates instance for simple property mapping + + DataReader column name + Target property + + + + Creates instance for simple field mapping + + DataReader column name + Target property + + + + Creates instance for simple constructor parameter mapping + + DataReader column name + Target constructor parameter + + + + DataReader column name + + + + + Target member type + + + + + Target property + + + + + Target field + + + + + Target constructor parameter + + + + + Represents default type mapping strategy used by Dapper + + + + + Creates default type map + + Entity type + + + + Finds best constructor + + DataReader column names + DataReader column types + Matching constructor or default one + + + + Gets mapping for constructor parameter + + Constructor to resolve + DataReader column name + Mapping implementation + + + + Gets member mapping for column + + DataReader column name + Mapping implementation + + + + Implements custom property mapping by user provided criteria (usually presence of some custom attribute with column to member mapping) + + + + + Creates custom property mapping + + Target entity type + Property selector based on target type and DataReader column name + + + + Always returns default constructor + + DataReader column names + DataReader column types + Default constructor + + + + Not impelmeneted as far as default constructor used for all cases + + + + + + + + Returns property based on selector strategy + + DataReader column name + Poperty member map + + + diff --git a/linger/src/packages/Dapper.1.12.1/lib/net40/Dapper.xml b/linger/src/packages/Dapper.1.12.1/lib/net40/Dapper.xml new file mode 100644 index 0000000..601e500 --- /dev/null +++ b/linger/src/packages/Dapper.1.12.1/lib/net40/Dapper.xml @@ -0,0 +1,648 @@ + + + + Dapper + + + + + Dapper, a light weight object mapper for ADO.NET + + + + + Purge the query cache + + + + + Return a count of all the cached queries by dapper + + + + + + Return a list of all the queries cached by dapper + + + + + + + Deep diagnostics only: find any hash collisions in the cache + + + + + + Execute parameterized SQL + + Number of rows affected + + + + Return a list of dynamic objects, reader is closed after the call + + + + + Executes a query, returning the data typed as per T + + the dynamic param may seem a bit odd, but this works around a major usability issue in vs, if it is Object vs completion gets annoying. Eg type new [space] get new object + A sequence of data of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is + created per row, and a direct column-name===member-name mapping is assumed (case insensitive). + + + + + Execute a command that returns multiple result sets, and access each in turn + + + + + Return a typed list of objects, reader is closed after the call + + + + + Maps a query to objects + + The first type in the recordset + The second type in the recordset + The return type + + + + + + + The Field we should split and read the second object from (default: id) + Number of seconds before command execution timeout + Is it a stored proc or a batch? + + + + + Maps a query to objects + + + + + + + + + + + + The Field we should split and read the second object from (default: id) + Number of seconds before command execution timeout + + + + + + Perform a multi mapping query with 4 input parameters + + + + + + + + + + + + + + + + + + + + Perform a multi mapping query with 5 input parameters + + + + + + + + + + + + + + + + + + + + + Internal use only + + + + + + + Internal use only + + + + + Internal use only + + + + + Internal use only + + + + + Gets type-map for the given type + + Type map implementation, DefaultTypeMap instance if no override present + + + + Set custom mapping for type deserializers + + Entity type to override + Mapping rules impementation, null to remove custom map + + + + Internal use only + + + + + + + + + + + Throws a data exception, only used internally + + + + + + + + Called if the query cache is purged via PurgeQueryCache + + + + + Implement this interface to pass an arbitrary db specific set of parameters to Dapper + + + + + Add all the parameters needed to the command just before it executes + + The raw command prior to execution + Information about the query + + + + Implement this interface to change default mapping of reader columns to type memebers + + + + + Finds best constructor + + DataReader column names + DataReader column types + Matching constructor or default one + + + + Gets mapping for constructor parameter + + Constructor to resolve + DataReader column name + Mapping implementation + + + + Gets member mapping for column + + DataReader column name + Mapping implementation + + + + Implements this interface to provide custom member mapping + + + + + Source DataReader column name + + + + + Target member type + + + + + Target property + + + + + Target field + + + + + Target constructor parameter + + + + + This is a micro-cache; suitable when the number of terms is controllable (a few hundred, for example), + and strictly append-only; you cannot change existing values. All key matches are on **REFERENCE** + equality. The type is fully thread-safe. + + + + + Identity of a cached query in Dapper, used for extensability + + + + + Create an identity for use with DynamicParameters, internal use only + + + + + + + + + + + + + + The sql + + + + + The command type + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Compare 2 Identity objects + + + + + + + The grid reader provides interfaces for reading multiple result sets from a Dapper query + + + + + Read the next grid of results, returned as a dynamic object + + + + + Read the next grid of results + + + + + Read multiple objects from a single recordset on the grid + + + + + + + + + + + Read multiple objects from a single recordset on the grid + + + + + + + + + + + + Read multiple objects from a single record set on the grid + + + + + + + + + + + + + Read multiple objects from a single record set on the grid + + + + + + + + + + + + + + Dispose the grid, closing and disposing both the underlying reader and command. + + + + + A bag of parameters that can be passed to the Dapper Query and Execute methods + + + + + construct a dynamic parameter bag + + + + + construct a dynamic parameter bag + + can be an anonymous type or a DynamicParameters bag + + + + Append a whole object full of params to the dynamic + EG: AddDynamicParams(new {A = 1, B = 2}) // will add property A and B to the dynamic + + + + + + Add a parameter to this dynamic parameter list + + + + + + + + + + Add all the parameters needed to the command just before it executes + + The raw command prior to execution + Information about the query + + + + Get the value of a parameter + + + + The value, note DBNull.Value is not returned, instead the value is returned as null + + + + All the names of the param in the bag, use Get to yank them out + + + + + This class represents a SQL string, it can be used if you need to denote your parameter is a Char vs VarChar vs nVarChar vs nChar + + + + + Create a new DbString + + + + + Add the parameter to the command... internal use only + + + + + + + Ansi vs Unicode + + + + + Fixed length + + + + + Length of the string -1 for max + + + + + The value of the string + + + + + Handles variances in features per DBMS + + + + + Dictionary of supported features index by connection type name + + + + + Gets the featureset based on the passed connection + + + + + True if the db supports array columns e.g. Postgresql + + + + + Represents simple memeber map for one of target parameter or property or field to source DataReader column + + + + + Creates instance for simple property mapping + + DataReader column name + Target property + + + + Creates instance for simple field mapping + + DataReader column name + Target property + + + + Creates instance for simple constructor parameter mapping + + DataReader column name + Target constructor parameter + + + + DataReader column name + + + + + Target member type + + + + + Target property + + + + + Target field + + + + + Target constructor parameter + + + + + Represents default type mapping strategy used by Dapper + + + + + Creates default type map + + Entity type + + + + Finds best constructor + + DataReader column names + DataReader column types + Matching constructor or default one + + + + Gets mapping for constructor parameter + + Constructor to resolve + DataReader column name + Mapping implementation + + + + Gets member mapping for column + + DataReader column name + Mapping implementation + + + + Implements custom property mapping by user provided criteria (usually presence of some custom attribute with column to member mapping) + + + + + Creates custom property mapping + + Target entity type + Property selector based on target type and DataReader column name + + + + Always returns default constructor + + DataReader column names + DataReader column types + Default constructor + + + + Not impelmeneted as far as default constructor used for all cases + + + + + + + + Returns property based on selector strategy + + DataReader column name + Poperty member map + + + diff --git a/linger/src/packages/Dates.1.0.1/LICENSE b/linger/src/packages/Dates.1.0.1/LICENSE new file mode 100644 index 0000000..c0dfbd5 --- /dev/null +++ b/linger/src/packages/Dates.1.0.1/LICENSE @@ -0,0 +1,15 @@ +Dates (http://github.com/danielcrenna/money) +-------------------------------------- +Copyright (c) 2011-2013 Daniel Crenna + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/linger/src/packages/Dates.1.0.1/lib/net40/Dates.xml b/linger/src/packages/Dates.1.0.1/lib/net40/Dates.xml new file mode 100644 index 0000000..19f1a93 --- /dev/null +++ b/linger/src/packages/Dates.1.0.1/lib/net40/Dates.xml @@ -0,0 +1,215 @@ + + + + Dates + + + + + Used when calculating the difference between two instances + with the class. + + + + + Years + + + + + Months + + + + + Weeks + + + + + Days + + + + + Hours + + + + + Minutes + + + + + Seconds + + + + + A struct similar to that stores the elapsed time between two dates, + but does so in a way that respects the number of actual days in the elapsed years and months. + + + + The start date + The end date + If true, the span is exclusive of the end date + + + + Gets the scalar difference between two dates given a value. + + The interval to calculate + The start date + The end date + If true, the difference is exclusive of the end date + + + + + The number of discrete years occurring in this span + + + + + The number of discrete months occurring in this span + + + + + The number of discrete weeks occurring in this span + + + + + The number of discrete days occurring in this span + + + + + The number of discrete hours occurring in this span + + + + + The number of discrete minutes occurring in this span + + + + + The number of discrete seconds occurring in this span + + + + + A period of time used in date calculations. + + + + The period frequency, paired with the quantifier + The period quantifier, paired with frequency + + + + Gets the date occurrences in this period, between a start and end date. + If an occurrence falls on a weekend, it is deferred to the start + of the next week. + + The starting date. + The ending date. + If true, occurrences scheduled for a weekend are deferred to the following weekday + A list of dates representing period occurrences. + + + + The period frequency, paired with + + + + + The period quantifier, paired with + + + + + A period of time occurring hourly + + + + + A period of time occurring every day + + + + + A period of time occurring every month + + + + + A period of time occurring every other month + + + + + A period of time occurring every week + + + + + A period of time occurring every other week + + + + + A period of time occurring every year + + + + + A period of time occurring every other year + + + + + The frequency interval between occurrences in a . + + + + + Seconds + + + + + Minutes + + + + + Hours + + + + + Days + + + + + Weeks + + + + + Months + + + + + Years + + + + diff --git a/linger/src/packages/DotLiquid.1.7.0/LICENSE.txt b/linger/src/packages/DotLiquid.1.7.0/LICENSE.txt new file mode 100644 index 0000000..b0b0279 --- /dev/null +++ b/linger/src/packages/DotLiquid.1.7.0/LICENSE.txt @@ -0,0 +1,175 @@ +DotLiquid is intended to be used in both open-source and commercial environments. To allow its use in as many +situations as possible, DotLiquid is dual-licensed. You may choose to use DotLiquid under either the Apache License, +Version 2.0, or the Microsoft Public License (Ms-PL). These licenses are essentially identical, but you are +encouraged to evaluate both to determine which best fits your intended use. + +----- + +Apache License, Version 2.0 + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 +through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, +or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, +direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or +(ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source +code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, +including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, +as indicated by a copyright notice that is included in or attached to the work (an example is provided in the +Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) +the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, +as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include +works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative +Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications +or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion +in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the +copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written +communication sent to the Licensor or its representatives, including but not limited to communication on electronic +mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, +the Licensor for the purpose of discussing and improving the Work, but excluding communication that is +conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been +received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, +non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or +Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, +non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, +have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to +those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone +or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You +institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging +that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent +infringement, then any patent licenses granted to You under this License for that Work shall terminate as of +the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without +modifications, and in Source or Object form, provided that You meet the following conditions: + + 1. You must give any other recipients of the Work or Derivative Works a copy of this License; and + 2. You must cause any modified files to carry prominent notices stating that You changed the files; and + 3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, + trademark, and attribution notices from the Source form of the Work, excluding those notices that do not + pertain to any part of the Derivative Works; and + 4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You + distribute must include a readable copy of the attribution notices contained within such NOTICE file, + excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the + following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source + form or documentation, if provided along with the Derivative Works; or, within a display generated by the + Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file + are for informational purposes only and do not modify the License. You may add Your own attribution notices + within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, + provided that such additional attribution notices cannot be construed as modifying the License. + 5. You may add Your own copyright statement to Your modifications and may provide additional or different license + terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative + Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the + conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You +to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you +may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the +Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing +the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides +its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, +including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS +FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing +the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless +required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any +Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential +damages of any character arising as a result of this License or out of the use or inability to use the Work +(including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, +or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility +of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, +acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this +License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole +responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold +each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason +of your accepting any such warranty or additional liability. + +----- + +Microsoft Public License (Ms-PL) + +This license governs use of the accompanying software. If you use the software, you +accept this license. If you do not accept the license, do not use the software. + +1. Definitions +The terms "reproduce," "reproduction," "derivative works," and "distribution" have the +same meaning here as under U.S. copyright law. +A "contribution" is the original software, or any additions or changes to the software. +A "contributor" is any person that distributes its contribution under this license. +"Licensed patents" are a contributor's patent claims that read directly on its contribution. + +2. Grant of Rights +(A) Copyright Grant- Subject to the terms of this license, including the license conditions and + limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free + copyright license to reproduce its contribution, prepare derivative works of its contribution, + and distribute its contribution or any derivative works that you create. +(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations + in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under + its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose + of its contribution in the software or derivative works of the contribution in the software. + +3. Conditions and Limitations +(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, + or trademarks. +(B) If you bring a patent claim against any contributor over patents that you claim are infringed by + the software, your patent license from such contributor to the software ends automatically. +(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, + and attribution notices that are present in the software. +(D) If you distribute any portion of the software in source code form, you may do so only under this + license by including a complete copy of this license with your distribution. If you distribute + any portion of the software in compiled or object code form, you may only do so under a license + that complies with this license. +(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express + warranties, guarantees or conditions. You may have additional consumer rights under your local laws + which this license cannot change. To the extent permitted under your local laws, the contributors + exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement. \ No newline at end of file diff --git a/linger/src/packages/FluentMigrator.1.0.6.0/FluentMigrator.1.0.6.0.nuspec b/linger/src/packages/FluentMigrator.1.0.6.0/FluentMigrator.1.0.6.0.nuspec new file mode 100644 index 0000000..770680b --- /dev/null +++ b/linger/src/packages/FluentMigrator.1.0.6.0/FluentMigrator.1.0.6.0.nuspec @@ -0,0 +1,17 @@ + + + + FluentMigrator + 1.0.6.0 + Fluent Migrator + Josh Coffman + Josh Coffman + https://github.com/schambers/fluentmigrator/wiki/ + false + FluentMigrator is a database migration framework for .NET written in C#. The basic idea is that you can create migrations which are simply classes that derive from the Migration base class and have a Migration attribute with a unique version number attached to them. Upon executing FluentMigrator, you tell it which version to migrate to and it will run all necessary migrations in order to bring your database up to that version. + In addition to forward migration support, FluentMigrator also supports different ways to execute the migrations along with selective migrations called profiles and executing arbitrary SQL. + + + en-US + + \ No newline at end of file diff --git a/linger/src/packages/FluentMigrator.1.0.6.0/lib/35/FluentMigrator.xml b/linger/src/packages/FluentMigrator.1.0.6.0/lib/35/FluentMigrator.xml new file mode 100644 index 0000000..d338db4 --- /dev/null +++ b/linger/src/packages/FluentMigrator.1.0.6.0/lib/35/FluentMigrator.xml @@ -0,0 +1,149 @@ + + + + FluentMigrator + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Allows for conditional inclusion of expresions based on the migration context + + + + + Defines fluent expressions that can be conditionally executed + + + + + The context to add expressions into + + If the database type doe snot apply then this will be a new context that is not used by the caller + + + + Constricts a new instance of a that will only add expressions to the provided if matches the migration processor + + If the database type does not apply then a will be used as a container to void any fluent expressions that would have been executed + The context to add expressions to if the database type applies + The database type that the expressions relate to + + + + Checks if the database type matches the name of the context migration processor + + The context to evaluate + The type to be checked + True if the database type applies, False if not + + + + Alter the schema of an existing object + + + + + Create a new database object + + + + + Delete a database object, table, or row + + + + + Rename tables / columns + + + + + Insert data into a table + + + + + Execute SQL statements + + + + + Update an existing row + + + + + Provides a null implmentation of a procesor that does not do any work + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + The arbitrary application context passed to the task runner. + + + The arbitrary application context passed to the task runner. + + + + Initializes a new instance of the class. + + + + + Used to filter which migrations are run. + + + + + Deletes an index + + the name of the index + + + + + Deletes an index, based on the naming convention in effect + + + + + + Deletes a named Primary Key from a table + + + + + + + Deletes a named Unique Constraint From a table + + + + + + The arbitrary application context passed to the task runner. + + + The arbitrary application context passed to the task runner. + + + diff --git a/linger/src/packages/FluentMigrator.1.0.6.0/lib/40/FluentMigrator.xml b/linger/src/packages/FluentMigrator.1.0.6.0/lib/40/FluentMigrator.xml new file mode 100644 index 0000000..d338db4 --- /dev/null +++ b/linger/src/packages/FluentMigrator.1.0.6.0/lib/40/FluentMigrator.xml @@ -0,0 +1,149 @@ + + + + FluentMigrator + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Allows for conditional inclusion of expresions based on the migration context + + + + + Defines fluent expressions that can be conditionally executed + + + + + The context to add expressions into + + If the database type doe snot apply then this will be a new context that is not used by the caller + + + + Constricts a new instance of a that will only add expressions to the provided if matches the migration processor + + If the database type does not apply then a will be used as a container to void any fluent expressions that would have been executed + The context to add expressions to if the database type applies + The database type that the expressions relate to + + + + Checks if the database type matches the name of the context migration processor + + The context to evaluate + The type to be checked + True if the database type applies, False if not + + + + Alter the schema of an existing object + + + + + Create a new database object + + + + + Delete a database object, table, or row + + + + + Rename tables / columns + + + + + Insert data into a table + + + + + Execute SQL statements + + + + + Update an existing row + + + + + Provides a null implmentation of a procesor that does not do any work + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + The arbitrary application context passed to the task runner. + + + The arbitrary application context passed to the task runner. + + + + Initializes a new instance of the class. + + + + + Used to filter which migrations are run. + + + + + Deletes an index + + the name of the index + + + + + Deletes an index, based on the naming convention in effect + + + + + + Deletes a named Primary Key from a table + + + + + + + Deletes a named Unique Constraint From a table + + + + + + The arbitrary application context passed to the task runner. + + + The arbitrary application context passed to the task runner. + + + diff --git a/linger/src/packages/FluentMigrator.1.0.6.0/tools/FluentMigrator.xml b/linger/src/packages/FluentMigrator.1.0.6.0/tools/FluentMigrator.xml new file mode 100644 index 0000000..d338db4 --- /dev/null +++ b/linger/src/packages/FluentMigrator.1.0.6.0/tools/FluentMigrator.xml @@ -0,0 +1,149 @@ + + + + FluentMigrator + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Allows for conditional inclusion of expresions based on the migration context + + + + + Defines fluent expressions that can be conditionally executed + + + + + The context to add expressions into + + If the database type doe snot apply then this will be a new context that is not used by the caller + + + + Constricts a new instance of a that will only add expressions to the provided if matches the migration processor + + If the database type does not apply then a will be used as a container to void any fluent expressions that would have been executed + The context to add expressions to if the database type applies + The database type that the expressions relate to + + + + Checks if the database type matches the name of the context migration processor + + The context to evaluate + The type to be checked + True if the database type applies, False if not + + + + Alter the schema of an existing object + + + + + Create a new database object + + + + + Delete a database object, table, or row + + + + + Rename tables / columns + + + + + Insert data into a table + + + + + Execute SQL statements + + + + + Update an existing row + + + + + Provides a null implmentation of a procesor that does not do any work + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + The arbitrary application context passed to the task runner. + + + The arbitrary application context passed to the task runner. + + + + Initializes a new instance of the class. + + + + + Used to filter which migrations are run. + + + + + Deletes an index + + the name of the index + + + + + Deletes an index, based on the naming convention in effect + + + + + + Deletes a named Primary Key from a table + + + + + + + Deletes a named Unique Constraint From a table + + + + + + The arbitrary application context passed to the task runner. + + + The arbitrary application context passed to the task runner. + + + diff --git a/linger/src/packages/FluentMigrator.1.0.6.0/tools/Migrate.exe.config b/linger/src/packages/FluentMigrator.1.0.6.0/tools/Migrate.exe.config new file mode 100644 index 0000000..899bb3e --- /dev/null +++ b/linger/src/packages/FluentMigrator.1.0.6.0/tools/Migrate.exe.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/linger/src/packages/FluentMigrator.1.0.6.0/tools/Npgsql.XML b/linger/src/packages/FluentMigrator.1.0.6.0/tools/Npgsql.XML new file mode 100644 index 0000000..1f94085 --- /dev/null +++ b/linger/src/packages/FluentMigrator.1.0.6.0/tools/Npgsql.XML @@ -0,0 +1,4079 @@ + + + + Npgsql + + + + + This class represents a parameter to a command that will be sent to server + + + + + Initializes a new instance of the NpgsqlParameter class. + + + + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name and a value of the new NpgsqlParameter. + + The m_Name of the parameter to map. + An Object that is the value of the NpgsqlParameter. + +

When you specify an Object + in the value parameter, the DbType is + inferred from the .NET Framework type of the Object.

+

When using this constructor, you must be aware of a possible misuse of the constructor which takes a DbType parameter. + This happens when calling this constructor passing an int 0 and the compiler thinks you are passing a value of DbType. + Use Convert.ToInt32(value) for example to have compiler calling the correct constructor.

+
+
+ + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name and the data type. + + The m_Name of the parameter to map. + One of the DbType values. + + + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name, the DbType, and the size. + + The m_Name of the parameter to map. + One of the DbType values. + The length of the parameter. + + + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name, the DbType, the size, + and the source column m_Name. + + The m_Name of the parameter to map. + One of the DbType values. + The length of the parameter. + The m_Name of the source column. + + + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name, the DbType, the size, + the source column m_Name, a ParameterDirection, + the precision of the parameter, the scale of the parameter, a + DataRowVersion to use, and the + value of the parameter. + + The m_Name of the parameter to map. + One of the DbType values. + The length of the parameter. + The m_Name of the source column. + One of the ParameterDirection values. + true if the value of the field can be null, otherwise false. + The total number of digits to the left and right of the decimal point to which + Value is resolved. + The total number of decimal places to which + Value is resolved. + One of the DataRowVersion values. + An Object that is the value + of the NpgsqlParameter. + + + + Creates a new NpgsqlParameter that + is a copy of the current instance. + + A new NpgsqlParameter that is a copy of this instance. + + + + Gets or sets the maximum number of digits used to represent the + Value property. + + The maximum number of digits used to represent the + Value property. + The default value is 0, which indicates that the data provider + sets the precision for Value. + + + + Gets or sets the number of decimal places to which + Value is resolved. + + The number of decimal places to which + Value is resolved. The default is 0. + + + + Gets or sets the maximum size, in bytes, of the data within the column. + + The maximum size, in bytes, of the data within the column. + The default value is inferred from the parameter value. + + + + Gets or sets the DbType of the parameter. + + One of the DbType values. The default is String. + + + + Gets or sets the DbType of the parameter. + + One of the DbType values. The default is String. + + + + Gets or sets a value indicating whether the parameter is input-only, + output-only, bidirectional, or a stored procedure return value parameter. + + One of the ParameterDirection + values. The default is Input. + + + + Gets or sets a value indicating whether the parameter accepts null values. + + true if null values are accepted; otherwise, false. The default is false. + + + + Gets or sets the m_Name of the NpgsqlParameter. + + The m_Name of the NpgsqlParameter. + The default is an empty string. + + + + The m_Name scrubbed of any optional marker + + + + + Gets or sets the m_Name of the source column that is mapped to the + DataSet and used for loading or + returning the Value. + + The m_Name of the source column that is mapped to the + DataSet. The default is an empty string. + + + + Gets or sets the DataRowVersion + to use when loading Value. + + One of the DataRowVersion values. + The default is Current. + + + + Gets or sets the value of the parameter. + + An Object that is the value of the parameter. + The default value is null. + + + + Gets or sets the value of the parameter. + + An Object that is the value of the parameter. + The default value is null. + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + For classes representing messages sent from the client to the server. + + + + + Writes given objects into a stream for PostgreSQL COPY in default copy format (not CSV or BINARY). + + + + + Return an exact copy of this NpgsqlConnectionString. + + + + + This function will set value for known key, both private member and base[key]. + + + + + + + The function will modify private member only, not base[key]. + + + + + + + Clear the member and assign them to the default value. + + + + + Compatibilty version. When possible, behaviour caused by breaking changes will be preserved + if this version is less than that where the breaking change was introduced. + + + + + Case insensative accessor for indivual connection string values. + + + + + Common base class for all derived MD5 implementations. + + + + + Called from constructor of derived class. + + + + + Finalizer for HashAlgorithm + + + + + Computes the entire hash of all the bytes in the byte array. + + + + + When overridden in a derived class, drives the hashing function. + + + + + + + + When overridden in a derived class, this pads and hashes whatever data might be left in the buffers and then returns the hash created. + + + + + When overridden in a derived class, initializes the object to prepare for hashing. + + + + + Used for stream chaining. Computes hash as data passes through it. + + The buffer from which to grab the data to be copied. + The offset into the input buffer to start reading at. + The number of bytes to be copied. + The buffer to write the copied data to. + At what point in the outputBuffer to write the data at. + + + + Used for stream chaining. Computes hash as data passes through it. Finishes off the hash. + + The buffer from which to grab the data to be copied. + The offset into the input buffer to start reading at. + The number of bytes to be copied. + + + + Get whether or not the hash can transform multiple blocks at a time. + Note: MUST be overriden if descendant can transform multiple block + on a single call! + + + + + Gets the previously computed hash. + + + + + Returns the size in bits of the hash. + + + + + Must be overriden if not 1 + + + + + Must be overriden if not 1 + + + + + Called from constructor of derived class. + + + + + Creates the default derived class. + + + + + Given a join expression and a projection, fetch all columns in the projection + that reference columns in the join. + + + + + Given an InputExpression append all from names (including nested joins) to the list. + + + + + Get new ColumnExpression that will be used in projection that had it's existing columns moved. + These should be simple references to the inner column + + + + + Every property accessed in the list of columns must be adjusted for a new scope + + + + + This class provides many util methods to handle + reading and writing of PostgreSQL protocol messages. + + + + + This method takes a ProtocolVersion and returns an integer + version number that the Postgres backend will recognize in a + startup packet. + + + + + This method takes a version string as returned by SELECT VERSION() and returns + a valid version string ("7.2.2" for example). + This is only needed when running protocol version 2. + This does not do any validity checks. + + + + + This method gets a C NULL terminated string from the network stream. + It keeps reading a byte in each time until a NULL byte is returned. + It returns the resultant string of bytes read. + This string is sent from backend. + + + + + Reads requested number of bytes from stream with retries until Stream.Read returns 0 or count is reached. + + Stream to read + byte buffer to fill + starting position to fill the buffer + number of bytes to read + The number of bytes read. May be less than count if no more bytes are available. + + + + This method writes a C NULL terminated string to the network stream. + It appends a NULL terminator to the end of the String. + + + This method writes a C NULL terminated string to the network stream. + It appends a NULL terminator to the end of the String. + + + + + This method writes a C NULL terminated string limited in length to the + backend server. + It pads the string with null bytes to the size specified. + + + + + Write a 32-bit integer to the given stream in the correct byte order. + + + + + Read a 32-bit integer from the given stream in the correct byte order. + + + + + Write a 16-bit integer to the given stream in the correct byte order. + + + + + Read a 16-bit integer from the given stream in the correct byte order. + + + + + Represent the frontend/backend protocol version. + + + + + Represent the backend server version. + As this class offers no functionality beyond that offered by it has been + deprecated in favour of that class. + + + + + + Returns the string representation of this version in three place dot notation (Major.Minor.Patch). + + + + + Server version major number. + + + + + Server version minor number. + + + + + Server version patch level number. + + + + + Represents a PostgreSQL COPY TO STDOUT operation with a corresponding SQL statement + to execute against a PostgreSQL database + and an associated stream used to write results to (if provided by user) + or for reading the results (when generated by driver). + Eg. new NpgsqlCopyOut("COPY (SELECT * FROM mytable) TO STDOUT", connection, streamToWrite).Start(); + + + + + Creates NpgsqlCommand to run given query upon Start(), after which CopyStream provides data from database as requested in the query. + + + + + Given command is run upon Start(), after which CopyStream provides data from database as requested in the query. + + + + + Given command is executed upon Start() and all requested copy data is written to toStream immediately. + + + + + Returns true if this operation is currently active and field at given location is in binary format. + + + + + Command specified upon creation is executed as a non-query. + If CopyStream is set upon creation, all copy data from server will be written to it, and operation will be finished immediately. + Otherwise the CopyStream member can be used for reading copy data from server until no more data is available. + + + + + Flush generated CopyStream at once. Effectively reads and discard all the rest of copy data from server. + + + + + Returns true if the connection is currently reserved for this operation. + + + + + The stream provided by user or generated upon Start() + + + + + The Command used to execute this copy operation. + + + + + Returns true if this operation is currently active and in binary format. + + + + + Returns number of fields if this operation is currently active, otherwise -1 + + + + + Faster alternative to using the generated CopyStream. + + + + + This class manages all connector objects, pooled AND non-pooled. + + + + Unique static instance of the connector pool + mamager. + + + Map of index to unused pooled connectors, avaliable to the + next RequestConnector() call. + This hashmap will be indexed by connection string. + This key will hold a list of queues of pooled connectors available to be used. + + + Timer for tracking unused connections in pools. + + + + Searches the shared and pooled connector lists for a + matching connector object or creates a new one. + + The NpgsqlConnection that is requesting + the connector. Its ConnectionString will be used to search the + pool for available connectors. + A connector object. + + + + Find a pooled connector. Handle locking and timeout here. + + + + + Find a pooled connector. Handle shared/non-shared here. + + + + + Releases a connector, possibly back to the pool for future use. + + + Pooled connectors will be put back into the pool if there is room. + Shared connectors should just have their use count decremented + since they always stay in the shared pool. + + The connector to release. + + + + Release a pooled connector. Handle locking here. + + + + + Release a pooled connector. Handle shared/non-shared here. + + + + + Create a connector without any pooling functionality. + + + + + Find an available pooled connector in the non-shared pool, or create + a new one if none found. + + + + + This method is only called when NpgsqlConnection.Dispose(false) is called which means a + finalization. This also means, an NpgsqlConnection was leak. We clear pool count so that + client doesn't end running out of connections from pool. When the connection is finalized, its underlying + socket is closed. + + + + + Close the connector. + + + Connector to release + + + + Put a pooled connector into the pool queue. + + Connector to pool + + + + A queue with an extra Int32 for keeping track of busy connections. + + + + + The number of pooled Connectors that belong to this queue but + are currently in use. + + + + + This class represents a BackEndKeyData message received + from PostgreSQL + + + + + Used when a connection is closed + + + + + Summary description for NpgsqlQuery + + + + + Represents the method that handles the Notice events. + + A NpgsqlNoticeEventArgs that contains the event data. + + + + Represents the method that handles the Notification events. + + The source of the event. + A NpgsqlNotificationEventArgs that contains the event data. + + + + This class represents a connection to a + PostgreSQL server. + + + + + Initializes a new instance of the + NpgsqlConnection class. + + + + + Initializes a new instance of the + NpgsqlConnection class + and sets the ConnectionString. + + The connection used to open the PostgreSQL database. + + + + Begins a database transaction with the specified isolation level. + + The isolation level under which the transaction should run. + An DbTransaction + object representing the new transaction. + + Currently the IsolationLevel ReadCommitted and Serializable are supported by the PostgreSQL backend. + There's no support for nested transactions. + + + + + Begins a database transaction. + + A NpgsqlTransaction + object representing the new transaction. + + Currently there's no support for nested transactions. + + + + + Begins a database transaction with the specified isolation level. + + The isolation level under which the transaction should run. + A NpgsqlTransaction + object representing the new transaction. + + Currently the IsolationLevel ReadCommitted and Serializable are supported by the PostgreSQL backend. + There's no support for nested transactions. + + + + + Opens a database connection with the property settings specified by the + ConnectionString. + + + + + This method changes the current database by disconnecting from the actual + database and connecting to the specified. + + The name of the database to use in place of the current database. + + + + Releases the connection to the database. If the connection is pooled, it will be + made available for re-use. If it is non-pooled, the actual connection will be shutdown. + + + + + Creates and returns a DbCommand + object associated with the IDbConnection. + + A DbCommand object. + + + + Creates and returns a NpgsqlCommand + object associated with the NpgsqlConnection. + + A NpgsqlCommand object. + + + + Releases all resources used by the + NpgsqlConnection. + + true when called from Dispose(); + false when being called from the finalizer. + + + + Create a new connection based on this one. + + A new NpgsqlConnection object. + + + + Create a new connection based on this one. + + A new NpgsqlConnection object. + + + + Default SSL CertificateSelectionCallback implementation. + + + + + Default SSL CertificateValidationCallback implementation. + + + + + Default SSL PrivateKeySelectionCallback implementation. + + + + + Default SSL ProvideClientCertificatesCallback implementation. + + + + + Write each key/value pair in the connection string to the log. + + + + + Returns the supported collections + + + + + Returns the schema collection specified by the collection name. + + The collection name. + The collection specified. + + + + Returns the schema collection specified by the collection name filtered by the restrictions. + + The collection name. + + The restriction values to filter the results. A description of the restrictions is contained + in the Restrictions collection. + + The collection specified. + + + + Occurs on NoticeResponses from the PostgreSQL backend. + + + + + Occurs on NotificationResponses from the PostgreSQL backend. + + + + + Called to provide client certificates for SSL handshake. + + + + + Mono.Security.Protocol.Tls.CertificateSelectionCallback delegate. + + + + + Mono.Security.Protocol.Tls.CertificateValidationCallback delegate. + + + + + Mono.Security.Protocol.Tls.PrivateKeySelectionCallback delegate. + + + + + Gets or sets the string used to connect to a PostgreSQL database. + Valid values are: +
    +
  • + Server: Address/Name of Postgresql Server; +
  • +
  • + Port: Port to connect to; +
  • +
  • + Protocol: Protocol version to use, instead of automatic; Integer 2 or 3; +
  • +
  • + Database: Database name. Defaults to user name if not specified; +
  • +
  • + User Id: User name; +
  • +
  • + Password: Password for clear text authentication; +
  • +
  • + SSL: True or False. Controls whether to attempt a secure connection. Default = False; +
  • +
  • + Pooling: True or False. Controls whether connection pooling is used. Default = True; +
  • +
  • + MinPoolSize: Min size of connection pool; +
  • +
  • + MaxPoolSize: Max size of connection pool; +
  • +
  • + Timeout: Time to wait for connection open in seconds. Default is 15. +
  • +
  • + CommandTimeout: Time to wait for command to finish execution before throw an exception. In seconds. Default is 20. +
  • +
  • + Sslmode: Mode for ssl connection control. Can be Prefer, Require, Allow or Disable. Default is Disable. Check user manual for explanation of values. +
  • +
  • + ConnectionLifeTime: Time to wait before closing unused connections in the pool in seconds. Default is 15. +
  • +
  • + SyncNotification: Specifies if Npgsql should use synchronous notifications. +
  • +
  • + SearchPath: Changes search path to specified and public schemas. +
  • +
+
+ The connection string that includes the server name, + the database name, and other parameters needed to establish + the initial connection. The default value is an empty string. + +
+ + + Backend server host name. + + + + + Backend server port. + + + + + If true, the connection will attempt to use SSL. + + + + + Gets the time to wait while trying to establish a connection + before terminating the attempt and generating an error. + + The time (in seconds) to wait for a connection to open. The default value is 15 seconds. + + + + Gets the time to wait while trying to execute a command + before terminating the attempt and generating an error. + + The time (in seconds) to wait for a command to complete. The default value is 20 seconds. + + + + Gets the time to wait before closing unused connections in the pool if the count + of all connections exeeds MinPoolSize. + + + If connection pool contains unused connections for ConnectionLifeTime seconds, + the half of them will be closed. If there will be unused connections in a second + later then again the half of them will be closed and so on. + This strategy provide smooth change of connection count in the pool. + + The time (in seconds) to wait. The default value is 15 seconds. + + + + Gets the name of the current database or the database to be used after a connection is opened. + + The name of the current database or the name of the database to be + used after a connection is opened. The default value is the empty string. + + + + Whether datareaders are loaded in their entirety (for compatibility with earlier code). + + + + + Gets the database server name. + + + + + Gets flag indicating if we are using Synchronous notification or not. + The default value is false. + + + + + Gets the current state of the connection. + + A bitwise combination of the ConnectionState values. The default is Closed. + + + + Gets whether the current state of the connection is Open or Closed + + ConnectionState.Open or ConnectionState.Closed + + + + Version of the PostgreSQL backend. + This can only be called when there is an active connection. + + + + + Protocol version in use. + This can only be called when there is an active connection. + + + + + Process id of backend server. + This can only be called when there is an active connection. + + + + + The connector object connected to the backend. + + + + + Gets the NpgsqlConnectionStringBuilder containing the parsed connection string values. + + + + + User name. + + + + + Password. + + + + + Determine if connection pooling will be used for this connection. + + + + + This class represents the CancelRequest message sent to PostgreSQL + server. + + + + + + + + + + + + + + + + + + + A time period expressed in 100ns units. + + + A time period expressed in a + + + Number of 100ns units. + + + Number of seconds. + + + Number of milliseconds. + + + Number of milliseconds. + + + Number of milliseconds. + + + A d with the given number of ticks. + + + A d with the given number of microseconds. + + + A d with the given number of milliseconds. + + + A d with the given number of seconds. + + + A d with the given number of minutes. + + + A d with the given number of hours. + + + A d with the given number of days. + + + A d with the given number of months. + + + An whose values are the sums of the two instances. + + + An whose values are the differences of the two instances. + + + An whose value is the negated value of this instance. + + + An whose value is the absolute value of this instance. + + + + An based on this one, but with any days converted to multiples of ±24hours. + + + + An based on this one, but with any months converted to multiples of ±30days. + + + + An based on this one, but with any months converted to multiples of ±30days and then any days converted to multiples of ±24hours; + + + + An eqivalent, canonical, . + + + An equivalent . + + + + + + An signed integer. + + + + The argument is not an . + + + The string was not in a format that could be parsed to produce an . + + + true if the parsing succeeded, false otherwise. + + + The representation. + + + An whose values are the sum of the arguments. + + + An whose values are the difference of the arguments + + + true if the two arguments are exactly the same, false otherwise. + + + false if the two arguments are exactly the same, true otherwise. + + + true if the first is less than second, false otherwise. + + + true if the first is less than or equivalent to second, false otherwise. + + + true if the first is greater than second, false otherwise. + + + true if the first is greater than or equivalent to the second, false otherwise. + + + The argument. + + + The negation of the argument. + + + + + + + + + + + + + + + + + + + + This time, normalised + + + + + + + + + This time, normalised + + + An integer which is 0 if they are equal, < 0 if this is the smaller and > 0 if this is the larger. + + + + + + + + + A class to handle everything associated with SSPI authentication + + + + + Simplified SecBufferDesc struct with only one SecBuffer + + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + EventArgs class to send Notice parameters, which are just NpgsqlError's in a lighter context. + + + + + Notice information. + + + + + This class represents the ErrorResponse and NoticeResponse + message sent from PostgreSQL server. + + + + + Return a string representation of this error object. + + + + + Severity code. All versions. + + + + + Error code. PostgreSQL 7.4 and up. + + + + + Terse error message. All versions. + + + + + Detailed error message. PostgreSQL 7.4 and up. + + + + + Suggestion to help resolve the error. PostgreSQL 7.4 and up. + + + + + Position (one based) within the query string where the error was encounterd. PostgreSQL 7.4 and up. + + + + + Position (one based) within the query string where the error was encounterd. This position refers to an internal command executed for example inside a PL/pgSQL function. PostgreSQL 7.4 and up. + + + + + Internal query string where the error was encounterd. This position refers to an internal command executed for example inside a PL/pgSQL function. PostgreSQL 7.4 and up. + + + + + Trace back information. PostgreSQL 7.4 and up. + + + + + Source file (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Source file line number (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Source routine (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + String containing the sql sent which produced this error. + + + + + Backend protocol version in use. + + + + + Represents an ongoing COPY TO STDOUT operation. + Provides methods to read data from server or end the operation. + + + + This class represents the base class for the state pattern design pattern + implementation. + + + + + + This method is used by the states to change the state of the context. + + + + + This method is responsible to handle all protocol messages sent from the backend. + It holds all the logic to do it. + To exchange data, it uses a Mediator object from which it reads/writes information + to handle backend requests. + + + + + + This method is responsible to handle all protocol messages sent from the backend. + It holds all the logic to do it. + To exchange data, it uses a Mediator object from which it reads/writes information + to handle backend requests. + + + + + + Called from NpgsqlState.ProcessBackendResponses upon CopyOutResponse. + If CopyStream is already set, it is used to write data received from server, after which the copy ends. + Otherwise CopyStream is set to a readable NpgsqlCopyOutStream that receives data from server. + + + + + Called from NpgsqlOutStream.Read to read copy data from server. + + + + + Copy format information returned from server. + + + + + Handles serialisation of .NET array or IEnumeration to pg format. + Arrays of arrays, enumerations of enumerations, arrays of enumerations etc. + are treated as multi-dimensional arrays (in much the same manner as an array of arrays + is used to emulate multi-dimensional arrays in languages that lack native support for them). + If such an enumeration of enumerations is "jagged" (as opposed to rectangular, cuboid, + hypercuboid, hyperhypercuboid, etc) then this class will "correctly" serialise it, but pg + will raise an error as it doesn't allow jagged arrays. + + + + + Create an ArrayNativeToBackendTypeConverter with the element converter passed + + The that would be used to serialise the element type. + + + + Serialise the enumeration or array. + + + + + Handles parsing of pg arrays into .NET arrays. + + + + + Takes a string representation of a pg 1-dimensional array + (or a 1-dimensional row within an n-dimensional array) + and allows enumeration of the string represenations of each items. + + + + + Takes a string representation of a pg n-dimensional array + and allows enumeration of the string represenations of the next + lower level of rows (which in turn can be taken as (n-1)-dimensional arrays. + + + + + Takes an ArrayList which may be an ArrayList of ArrayLists, an ArrayList of ArrayLists of ArrayLists + and so on and enumerates the items that aren't ArrayLists (the leaf nodes if we think of the ArrayList + passed as a tree). Simply uses the ArrayLists' own IEnumerators to get that of the next, + pushing them onto a stack until we hit something that isn't an ArrayList. + ArrayList to enumerate + IEnumerable + + + + + Create a new ArrayBackendToNativeTypeConverter + + for the element type. + + + + Creates an array from pg representation. + + + + + Creates an array list from pg represenation of an array. + Multidimensional arrays are treated as ArrayLists of ArrayLists + + + + + Creates an n-dimensional array from an ArrayList of ArrayLists or + a 1-dimensional array from something else. + + to convert + produced. + + + + Takes an array of ints and treats them like the limits of a set of counters. + Retains a matching set of ints that is set to all zeros on the first ++ + On a ++ it increments the "right-most" int. If that int reaches it's + limit it is set to zero and the one before it is incremented, and so on. + + Making this a more general purpose class is pretty straight-forward, but we'll just put what we need here. + + + + + This class represents the ParameterStatus message sent from PostgreSQL + server. + + + + + + This class is responsible for serving as bridge between the backend + protocol handling and the core classes. It is used as the mediator for + exchanging data generated/sent from/to backend. + + + + + + This class is responsible to create database commands for automatic insert, update and delete operations. + + + + + + This method is reponsible to derive the command parameter list with values obtained from function definition. + It clears the Parameters collection of command. Also, if there is any parameter type which is not supported by Npgsql, an InvalidOperationException will be thrown. + Parameters name will be parameter1, parameter2, ... + For while, only parameter name and NpgsqlDbType are obtained. + + NpgsqlCommand whose function parameters will be obtained. + + + + Represents a completed response message. + + + + + + Marker interface which identifies a class which may take possession of a stream for the duration of + it's lifetime (possibly temporarily giving that possession to another class for part of that time. + + It inherits from IDisposable, since any such class must make sure it leaves the stream in a valid state. + + The most important such class is that compiler-generated from ProcessBackendResponsesEnum. Of course + we can't make that inherit from this interface, alas. + + + + + The exception that is thrown when the PostgreSQL backend reports errors. + + + + + Construct a backend error exception based on a list of one or more + backend errors. The basic Exception.Message will be built from the + first (usually the only) error in the list. + + + + + Format a .NET style exception string. + Include all errors in the list, including any hints. + + + + + Append a line to the given Stream, first checking for zero-length. + + + + + Provide access to the entire list of errors provided by the PostgreSQL backend. + + + + + Severity code. All versions. + + + + + Error code. PostgreSQL 7.4 and up. + + + + + Basic error message. All versions. + + + + + Detailed error message. PostgreSQL 7.4 and up. + + + + + Suggestion to help resolve the error. PostgreSQL 7.4 and up. + + + + + Position (one based) within the query string where the error was encounterd. PostgreSQL 7.4 and up. + + + + + Trace back information. PostgreSQL 7.4 and up. + + + + + Source file (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Source file line number (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Source routine (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + String containing the sql sent which produced this error. + + + + + Returns the entire list of errors provided by the PostgreSQL backend. + + + + + The level of verbosity of the NpgsqlEventLog + + + + + Don't log at all + + + + + Only log the most common issues + + + + + Log everything + + + + + This class handles all the Npgsql event and debug logging + + + + + Writes a string to the Npgsql event log if msglevel is bigger then NpgsqlEventLog.Level + + + This method is obsolete and should no longer be used. + It is likely to be removed in future versions of Npgsql + + The message to write to the event log + The minimum LogLevel for which this message should be logged. + + + + Writes a string to the Npgsql event log if msglevel is bigger then NpgsqlEventLog.Level + + The ResourceManager to get the localized resources + The name of the resource that should be fetched by the ResourceManager + The minimum LogLevel for which this message should be logged. + The additional parameters that shall be included into the log-message (must be compatible with the string in the resource): + + + + Writes the default log-message for the action of calling the Get-part of an Indexer to the log file. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Indexer + The parameter given to the Indexer + + + + Writes the default log-message for the action of calling the Set-part of an Indexer to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Indexer + The parameter given to the Indexer + The value the Indexer is set to + + + + Writes the default log-message for the action of calling the Get-part of a Property to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Property + The name of the Property + + + + Writes the default log-message for the action of calling the Set-part of a Property to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Property + The name of the Property + The value the Property is set to + + + + Writes the default log-message for the action of calling a Method without Arguments to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + + + + Writes the default log-message for the action of calling a Method with one Argument to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + The value of the Argument of the Method + + + + Writes the default log-message for the action of calling a Method with two Arguments to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + The value of the first Argument of the Method + The value of the second Argument of the Method + + + + Writes the default log-message for the action of calling a Method with three Arguments to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + The value of the first Argument of the Method + The value of the second Argument of the Method + The value of the third Argument of the Method + + + + Writes the default log-message for the action of calling a Method with more than three Arguments to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + A Object-Array with zero or more Ojects that are Arguments of the Method. + + + + Sets/Returns the level of information to log to the logfile. + + The current LogLevel + + + + Sets/Returns the filename to use for logging. + + The filename of the current Log file. + + + + Sets/Returns whether Log messages should be echoed to the console + + true if Log messages are echoed to the console, otherwise false + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + Represents a PostgreSQL COPY FROM STDIN operation with a corresponding SQL statement + to execute against a PostgreSQL database + and an associated stream used to read data from (if provided by user) + or for writing it (when generated by driver). + Eg. new NpgsqlCopyIn("COPY mytable FROM STDIN", connection, streamToRead).Start(); + + + + + Creates NpgsqlCommand to run given query upon Start(). Data for the requested COPY IN operation can then be written to CopyData stream followed by a call to End() or Cancel(). + + + + + Given command is run upon Start(). Data for the requested COPY IN operation can then be written to CopyData stream followed by a call to End() or Cancel(). + + + + + Given command is executed upon Start() and all data from fromStream is passed to it as copy data. + + + + + Returns true if this operation is currently active and field at given location is in binary format. + + + + + Command specified upon creation is executed as a non-query. + If CopyStream is set upon creation, it will be flushed to server as copy data, and operation will be finished immediately. + Otherwise the CopyStream member can be used for writing copy data to server and operation finished with a call to End() or Cancel(). + + + + + Called after writing all data to CopyStream to successfully complete this copy operation. + + + + + Withdraws an already started copy operation. The operation will fail with given error message. + Will do nothing if current operation is not active. + + + + + Returns true if the connection is currently reserved for this operation. + + + + + The stream provided by user or generated upon Start(). + User may provide a stream to constructor; it is used to pass to server all data read from it. + Otherwise, call to Start() sets this to a writable NpgsqlCopyInStream that passes all data written to it to server. + In latter case this is only available while the copy operation is active and null otherwise. + + + + + Returns true if this operation is currently active and in binary format. + + + + + Returns number of fields expected on each input row if this operation is currently active, otherwise -1 + + + + + The Command used to execute this copy operation. + + + + + Set before a COPY IN query to define size of internal buffer for reading from given CopyStream. + + + + + Represents information about COPY operation data transfer format as returned by server. + + + + + Only created when a CopyInResponse or CopyOutResponse is received by NpgsqlState.ProcessBackendResponses() + + + + + Returns true if this operation is currently active and field at given location is in binary format. + + + + + Returns true if this operation is currently active and in binary format. + + + + + Returns number of fields if this operation is currently active, otherwise -1 + + + + + + + + + Provide event handlers to convert all native supported basic data types from their backend + text representation to a .NET object. + + + + + Binary data. + + + + + Convert a postgresql boolean to a System.Boolean. + + + + + Convert a postgresql bit to a System.Boolean. + + + + + Convert a postgresql datetime to a System.DateTime. + + + + + Convert a postgresql date to a System.DateTime. + + + + + Convert a postgresql time to a System.DateTime. + + + + + Convert a postgresql money to a System.Decimal. + + + + + Provide event handlers to convert the basic native supported data types from + native form to backend representation. + + + + + Binary data. + + + + + Convert to a postgresql boolean. + + + + + Convert to a postgresql bit. + + + + + Convert to a postgresql timestamp. + + + + + Convert to a postgresql date. + + + + + Convert to a postgresql time. + + + + + Convert to a postgres money. + + + + + Provide event handlers to convert extended native supported data types from their backend + text representation to a .NET object. + + + + + Convert a postgresql point to a System.NpgsqlPoint. + + + + + Convert a postgresql point to a System.RectangleF. + + + + + LDeg. + + + + + Path. + + + + + Polygon. + + + + + Circle. + + + + + Inet. + + + + + interval + + + + + Provide event handlers to convert extended native supported data types from + native form to backend representation. + + + + + Point. + + + + + Box. + + + + + LSeg. + + + + + Open path. + + + + + Polygon. + + + + + Circle. + + + + + Convert to a postgres inet. + + + + + Convert to a postgres interval + + + + + EventArgs class to send Notification parameters. + + + + + Process ID of the PostgreSQL backend that sent this notification. + + + + + Condition that triggered that notification. + + + + + Additional Information From Notifiying Process (for future use, currently postgres always sets this to an empty string) + + + + + Resolve a host name or IP address. + This is needed because if you call Dns.Resolve() with an IP address, it will attempt + to resolve it as a host name, when it should just convert it to an IP address. + + + + + + This class represents a RowDescription message sent from + the PostgreSQL. + + + + + + This struct represents the internal data of the RowDescription message. + + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + A factory to create instances of various Npgsql objects. + + + + + Creates an NpgsqlCommand object. + + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + Represents the method that handles the RowUpdated events. + + The source of the event. + A NpgsqlRowUpdatedEventArgs that contains the event data. + + + + Represents the method that handles the RowUpdating events. + + The source of the event. + A NpgsqlRowUpdatingEventArgs that contains the event data. + + + + This class represents an adapter from many commands: select, update, insert and delete to fill Datasets. + + + + + Stream for reading data from a table or select on a PostgreSQL version 7.4 or newer database during an active COPY TO STDOUT operation. + Passes data exactly as provided by the server. + + + + + Created only by NpgsqlCopyOutState.StartCopy() + + + + + Discards copy data as long as server pushes it. Returns after operation is finished. + Does nothing if this stream is not the active copy operation reader. + + + + + Not writable. + + + + + Not flushable. + + + + + Copies data read from server to given byte buffer. + Since server returns data row by row, length will differ each time, but it is only zero once the operation ends. + Can be mixed with calls to the more efficient NpgsqlCopyOutStream.Read() : byte[] though that would not make much sense. + + + + + Not seekable + + + + + Not supported + + + + + Returns a whole row of data from server without extra work. + If standard Stream.Read(...) has been called before, it's internal buffers remains are returned. + + + + + True while this stream can be used to read copy data from server + + + + + True + + + + + False + + + + + False + + + + + Number of bytes read so far + + + + + Number of bytes read so far; can not be set. + + + + + This class represents the Bind message sent to PostgreSQL + server. + + + + + + Summary description for LargeObjectManager. + + + + + Represents a transaction to be made in a PostgreSQL database. This class cannot be inherited. + + + + + Commits the database transaction. + + + + + Rolls back a transaction from a pending state. + + + + + Rolls back a transaction from a pending savepoint state. + + + + + Creates a transaction save point. + + + + + Cancel the transaction without telling the backend about it. This is + used to make the transaction go away when closing a connection. + + + + + Gets the NpgsqlConnection + object associated with the transaction, or a null reference if the + transaction is no longer valid. + + The NpgsqlConnection + object associated with the transaction. + + + + Specifies the IsolationLevel for this transaction. + + The IsolationLevel for this transaction. + The default is ReadCommitted. + + + + This class represents a StartupPacket message of PostgreSQL + protocol. + + + + + + Provides a means of reading a forward-only stream of rows from a PostgreSQL backend. This class cannot be inherited. + + + + + Return the data type name of the column at index . + + + + + Return the data type of the column at index . + + + + + Return the Npgsql specific data type of the column at requested ordinal. + + column position + Appropriate Npgsql type for column. + + + + Return the column name of the column at index . + + + + + Return the data type OID of the column at index . + + FIXME: Why this method returns String? + + + + Return the column name of the column named . + + + + + Return the data DbType of the column at index . + + + + + Return the data NpgsqlDbType of the column at index . + + + + + Get the value of a column as a . + If the differences between and + in handling of days and months is not important to your application, use + instead. + + Index of the field to find. + value of the field. + + + + Gets the value of a column converted to a Guid. + + + + + Gets the value of a column as Int16. + + + + + Gets the value of a column as Int32. + + + + + Gets the value of a column as Int64. + + + + + Gets the value of a column as Single. + + + + + Gets the value of a column as Double. + + + + + Gets the value of a column as String. + + + + + Gets the value of a column as Decimal. + + + + + Copy values from each column in the current row into . + + The number of column values copied. + + + + Copy values from each column in the current row into . + + An array appropriately sized to store values from all columns. + The number of column values copied. + + + + Gets the value of a column as Boolean. + + + + + Gets the value of a column as Byte. Not implemented. + + + + + Gets the value of a column as Char. + + + + + Gets the value of a column as DateTime. + + + + + Returns a System.Data.DataTable that describes the column metadata of the DataReader. + + + + + This methods parses the command text and tries to get the tablename + from it. + + + + + Is raised whenever Close() is called. + + + + + Gets the number of columns in the current row. + + + + + Gets the value of a column in its native format. + + + + + Gets the value of a column in its native format. + + + + + Gets a value indicating the depth of nesting for the current row. Always returns zero. + + + + + Gets a value indicating whether the data reader is closed. + + + + + Contains the column names as the keys + + + + + Contains all unique columns + + + + + This is the primary implementation of NpgsqlDataReader. It is the one used in normal cases (where the + preload-reader option is not set in the connection string to resolve some potential backwards-compatibility + issues), the only implementation used internally, and in cases where CachingDataReader is used, it is still + used to do the actual "leg-work" of turning a response stream from the server into a datareader-style + object - with CachingDataReader then filling it's cache from here. + + + + + Iterate through the objects returned through from the server. + If it's a CompletedResponse the rowsaffected count is updated appropriately, + and we iterate again, otherwise we return it (perhaps updating our cache of pending + rows if appropriate). + + The next we will deal with. + + + + Advances the data reader to the next result, when multiple result sets were returned by the PostgreSQL backend. + + True if the reader was advanced, otherwise false. + + + + Releases the resources used by the NpgsqlCommand. + + + + + Closes the data reader object. + + + + + Advances the data reader to the next result, when multiple result sets were returned by the PostgreSQL backend. + + True if the reader was advanced, otherwise false. + + + + Advances the data reader to the next row. + + True if the reader was advanced, otherwise false. + + + + Return the value of the column at index . + + + + + Gets raw data from a column. + + + + + Gets raw data from a column. + + + + + Report whether the value in a column is DBNull. + + + + + Gets the number of rows changed, inserted, or deleted by execution of the SQL statement. + + + + + Indicates if NpgsqlDatareader has rows to be read. + + + + + Provides an implementation of NpgsqlDataReader in which all data is pre-loaded into memory. + This operates by first creating a ForwardsOnlyDataReader as usual, and then loading all of it's + Rows into memory. There is a general principle that when there is a trade-off between a class design that + is more efficient and/or scalable on the one hand and one that is less efficient but has more functionality + (in this case the internal-only functionality of caching results) that one can build the less efficent class + from the most efficient without significant extra loss in efficiency, but not the other way around. The relationship + between ForwardsOnlyDataReader and CachingDataReader is an example of this). + Since the interface presented to the user is still forwards-only, queues are used to + store this information, so that dequeueing as we go we give the garbage collector the best opportunity + possible to reclaim any memory that is no longer in use. + ForwardsOnlyDataReader being used to actually + obtain the information from the server means that the "leg-work" is still only done (and need only be + maintained) in one place. + This class exists to allow for certain potential backwards-compatibility issues to be resolved + with little effort on the part of affected users. It is considerably less efficient than ForwardsOnlyDataReader + and hence never used internally. + + + + + Represents the method that allows the application to provide a certificate collection to be used for SSL clien authentication + + A X509CertificateCollection to be filled with one or more client certificates. + + + + !!! Helper class, for compilation only. + Connector implements the logic for the Connection Objects to + access the physical connection to the database, and isolate + the application developer from connection pooling internals. + + + + + Constructor. + + Controls whether the connector can be shared. + + + + This method checks if the connector is still ok. + We try to send a simple query text, select 1 as ConnectionTest; + + + + + This method is responsible for releasing all resources associated with this Connector. + + + + + This method is responsible to release all portals used by this Connector. + + + + + Default SSL CertificateSelectionCallback implementation. + + + + + Default SSL CertificateValidationCallback implementation. + + + + + Default SSL PrivateKeySelectionCallback implementation. + + + + + Default SSL ProvideClientCertificatesCallback implementation. + + + + + This method is required to set all the version dependent features flags. + SupportsPrepare means the server can use prepared query plans (7.3+) + + + + + Opens the physical connection to the server. + + Usually called by the RequestConnector + Method of the connection pool manager. + + + + Closes the physical connection to the server. + + + + + Returns next portal index. + + + + + Returns next plan index. + + + + + Occurs on NoticeResponses from the PostgreSQL backend. + + + + + Occurs on NotificationResponses from the PostgreSQL backend. + + + + + Called to provide client certificates for SSL handshake. + + + + + Mono.Security.Protocol.Tls.CertificateSelectionCallback delegate. + + + + + Mono.Security.Protocol.Tls.CertificateValidationCallback delegate. + + + + + Mono.Security.Protocol.Tls.PrivateKeySelectionCallback delegate. + + + + + Gets the current state of the connection. + + + + + Return Connection String. + + + + + Version of backend server this connector is connected to. + + + + + Backend protocol version in use by this connector. + + + + + The physical connection stream to the backend. + + + + + The physical connection socket to the backend. + + + + + Reports if this connector is fully connected. + + + + + The connection mediator. + + + + + Report if the connection is in a transaction. + + + + + Report whether the current connection can support prepare functionality. + + + + + This class contains helper methods for type conversion between + the .Net type system and postgresql. + + + + + A cache of basic datatype mappings keyed by server version. This way we don't + have to load the basic type mappings for every connection. + + + + + Find a NpgsqlNativeTypeInfo in the default types map that can handle objects + of the given NpgsqlDbType. + + + + + Find a NpgsqlNativeTypeInfo in the default types map that can handle objects + of the given NpgsqlDbType. + + + + + Find a NpgsqlNativeTypeInfo in the default types map that can handle objects + of the given DbType. + + + + + Find a NpgsqlNativeTypeInfo in the default types map that can handle objects + of the given System.Type. + + + + + This method is responsible to convert the string received from the backend + to the corresponding NpgsqlType. + The given TypeInfo is called upon to do the conversion. + If no TypeInfo object is provided, no conversion is performed. + + + + + Create the one and only native to backend type map. + This map is used when formatting native data + types to backend representations. + + + + + This method creates (or retrieves from cache) a mapping between type and OID + of all natively supported postgresql data types. + This is needed as from one version to another, this mapping can be changed and + so we avoid hardcoding them. + + NpgsqlTypeMapping containing all known data types. The mapping must be + cloned before it is modified because it is cached; changes made by one connection may + effect another connection. + + + + Attempt to map types by issuing a query against pg_type. + This function takes a list of NpgsqlTypeInfo and attempts to resolve the OID field + of each by querying pg_type. If the mapping is found, the type info object is + updated (OID) and added to the provided NpgsqlTypeMapping object. + + NpgsqlConnector to send query through. + Mapping object to add types too. + List of types that need to have OID's mapped. + + + + Delegate called to convert the given backend data to its native representation. + + + + + Delegate called to convert the given native data to its backand representation. + + + + + Represents a backend data type. + This class can be called upon to convert a backend field representation to a native object. + + + + + Construct a new NpgsqlTypeInfo with the given attributes and conversion handlers. + + Type OID provided by the backend server. + Type name provided by the backend server. + NpgsqlDbType + System type to convert fields of this type to. + Data conversion handler. + + + + Perform a data conversion from a backend representation to + a native object. + + Data sent from the backend. + Type modifier field sent from the backend. + + + + Type OID provided by the backend server. + + + + + Type name provided by the backend server. + + + + + NpgsqlDbType. + + + + + NpgsqlDbType. + + + + + Provider type to convert fields of this type to. + + + + + System type to convert fields of this type to. + + + + + Represents a backend data type. + This class can be called upon to convert a native object to its backend field representation, + + + + + Returns an NpgsqlNativeTypeInfo for an array where the elements are of the type + described by the NpgsqlNativeTypeInfo supplied. + + + + + Construct a new NpgsqlTypeInfo with the given attributes and conversion handlers. + + Type name provided by the backend server. + NpgsqlDbType + Data conversion handler. + + + + Perform a data conversion from a native object to + a backend representation. + DBNull and null values are handled differently depending if a plain query is used + When + + Native .NET object to be converted. + Flag indicating if the conversion has to be done for + plain queries or extended queries + + + + Type name provided by the backend server. + + + + + NpgsqlDbType. + + + + + DbType. + + + + + Apply quoting. + + + + + Use parameter size information. + + + + + Provide mapping between type OID, type name, and a NpgsqlBackendTypeInfo object that represents it. + + + + + Construct an empty mapping. + + + + + Copy constuctor. + + + + + Add the given NpgsqlBackendTypeInfo to this mapping. + + + + + Add a new NpgsqlBackendTypeInfo with the given attributes and conversion handlers to this mapping. + + Type OID provided by the backend server. + Type name provided by the backend server. + NpgsqlDbType + System type to convert fields of this type to. + Data conversion handler. + + + + Make a shallow copy of this type mapping. + + + + + Determine if a NpgsqlBackendTypeInfo with the given backend type OID exists in this mapping. + + + + + Determine if a NpgsqlBackendTypeInfo with the given backend type name exists in this mapping. + + + + + Get the number of type infos held. + + + + + Retrieve the NpgsqlBackendTypeInfo with the given backend type OID, or null if none found. + + + + + Retrieve the NpgsqlBackendTypeInfo with the given backend type name, or null if none found. + + + + + Provide mapping between type Type, NpgsqlDbType and a NpgsqlNativeTypeInfo object that represents it. + + + + + Add the given NpgsqlNativeTypeInfo to this mapping. + + + + + Add a new NpgsqlNativeTypeInfo with the given attributes and conversion handlers to this mapping. + + Type name provided by the backend server. + NpgsqlDbType + Data conversion handler. + + + + Retrieve the NpgsqlNativeTypeInfo with the given NpgsqlDbType. + + + + + Retrieve the NpgsqlNativeTypeInfo with the given DbType. + + + + + Retrieve the NpgsqlNativeTypeInfo with the given Type. + + + + + Determine if a NpgsqlNativeTypeInfo with the given backend type name exists in this mapping. + + + + + Determine if a NpgsqlNativeTypeInfo with the given NpgsqlDbType exists in this mapping. + + + + + Determine if a NpgsqlNativeTypeInfo with the given Type name exists in this mapping. + + + + + Get the number of type infos held. + + + + + Implements for version 3 of the protocol. + + + + + Reads a row, field by field, allowing a DataRow to be built appropriately. + + + + + Reads part of a field, as needed (for + and + + + + + Adds further functionality to stream that is dependant upon the type of data read. + + + + + Completes the implementation of Streamer for char data. + + + + + Completes the implementation of Streamer for byte data. + + + + + Implements for version 2 of the protocol. + + + + + Encapsulates the null mapping bytes sent at the start of a version 2 + datarow message, and the process of identifying the nullity of the data + at a particular index + + + + + Provides the underlying mechanism for reading schema information. + + + + + Creates an NpgsqlSchema that can read schema information from the database. + + An open database connection for reading metadata. + + + + Returns the MetaDataCollections that lists all possible collections. + + The MetaDataCollections + + + + Returns the Restrictions that contains the meaning and position of the values in the restrictions array. + + The Restrictions + + + + Returns the Databases that contains a list of all accessable databases. + + The restrictions to filter the collection. + The Databases + + + + Returns the Tables that contains table and view names and the database and schema they come from. + + The restrictions to filter the collection. + The Tables + + + + Returns the Columns that contains information about columns in tables. + + The restrictions to filter the collection. + The Columns. + + + + Returns the Views that contains view names and the database and schema they come from. + + The restrictions to filter the collection. + The Views + + + + Returns the Users containing user names and the sysid of those users. + + The restrictions to filter the collection. + The Users. + + + + This is the abstract base class for NpgsqlAsciiRow and NpgsqlBinaryRow. + + + + + Implements a bit string; a collection of zero or more bits which can each be 1 or 0. + BitString's behave as a list of bools, though like most strings and unlike most collections the position + tends to be of as much significance as the value. + BitStrings are often used as masks, and are commonly cast to and from other values. + + + + + Represents the empty string. + + + + + Create a BitString from an enumeration of boolean values. The BitString will contain + those booleans in the order they came in. + + The boolean values. + + + + Creates a BitString filled with a given number of true or false values. + + The value to fill the string with. + The number of bits to fill. + + + + Creats a bitstring from a string. + The string to copy from. + + + + + + Creates a single-bit element from a boolean value. + + The bool value which determines whether + the bit is 1 or 0. + + + + Creates a bitstring from an unsigned integer value. The string will be the shortest required to + contain the integer (e.g. 1 bit for 0 or 1, 2 for 2 or 3, 3 for 4-7, and so on). + + The integer. + This method is not CLS Compliant, and may not be available to some languages. + + + + Creates a bitstring from an integer value. The string will be the shortest required to + contain the integer (e.g. 1 bit for 0 or 1, 2 for 2 or 3, 3 for 4-7, and so on). + + The integer. + + + + Finds the first instance of a given value + + The value - whether true or false - to search for. + The index of the value found, or -1 if none are present. + + + + True if there is at least one bit with the value looked for. + + The value - true or false - to detect. + True if at least one bit was the same as item, false otherwise. + + + + Copies the bitstring to an array of bools. + + The boolean array to copy to. + The index in the array to start copying from. + + + + Returns an enumerator that enumerates through the string. + + The enumerator. + + + + Creats a bitstring by concatenating another onto this one. + + The string to append to this one. + The combined strings. + + + + Returns a substring of this string. + + The position to start from, must be between 0 and the length of the string. + The length of the string to return, must be greater than zero, and may not be + so large that the start + length exceeds the bounds of this instance. + The Bitstring identified + + + + Returns a substring of this string. + + The position to start from, must be between 0 and the length of the string, + the rest of the string is returned. + The Bitstring identified + + + + A logical and between this string and another. The two strings must be the same length. + + Another BitString to AND with this one. + A bitstring with 1 where both BitStrings had 1 and 0 otherwise. + + + + A logical or between this string and another. The two strings must be the same length. + + Another BitString to OR with this one. + A bitstring with 1 where either BitString had 1 and 0 otherwise. + + + + A logical xor between this string and another. The two strings must be the same length. + + Another BitString to XOR with this one. + A bitstring with 1 where one BitStrings and the other had 0, + and 0 where they both had 1 or both had 0. + + + + A bitstring that is the logical inverse of this one. + + A bitstring of the same length as this with 1 where this has 0 and vice-versa. + + + + Shifts the string operand bits to the left, filling with zeros to produce a + string of the same length. + + The number of bits to shift to the left. + A left-shifted bitstring. + The behaviour of LShift is closer to what one would expect from dealing + with PostgreSQL bit-strings than in using the same operations on integers in .NET + In particular, negative operands result in a right-shift, and operands greater than + the length of the string will shift it entirely, resulting in a zero-filled string. + + + + + Shifts the string operand bits to the right, filling with zeros to produce a + string of the same length. + + The number of bits to shift to the right. + A right-shifted bitstring. + The behaviour of RShift is closer to what one would expect from dealing + with PostgreSQL bit-strings than in using the same operations on integers in .NET + In particular, negative operands result in a left-shift, and operands greater than + the length of the string will shift it entirely, resulting in a zero-filled string. It also performs + a logical shift, rather than an arithmetic shift, so it always sets the vacated bit positions to zero + (like PostgreSQL and like .NET for unsigned integers but not for signed integers). + + + + + Returns true if the this string is identical to the argument passed. + + + + + Compares two strings. Strings are compared as strings, so while 0 being less than 1 will + mean a comparison between two strings of the same size is the same as treating them as numbers, + in the case of two strings of differing lengths the comparison starts at the right-most (most significant) + bit, and if all bits of the shorter string are exhausted without finding a comparison, then the larger + string is deemed to be greater than the shorter (0010 is greater than 0001 but less than 00100). + + Another string to compare with this one. + A value if the two strings are identical, an integer less + than zero if this is less than the argument, and an integer greater + than zero otherwise. + + + + Compares the string with another object. + + The object to compare with. + If the object is null then this string is considered greater. If the object is another BitString + then they are compared as in the explicit comparison for BitStrings + in any other case a is thrown. + + + + Compares this BitString with an object for equality. + + + + + Returns a code for use in hashing operations. + + + + + Returns a string representation of the BitString. + + + A string which can contain a letter and optionally a number which sets a minimum size for the string + returned. In each case using the lower-case form of the letter will result in a lower-case string + being returned. + + + B + A string of 1s and 0s. + + + X + An hexadecimal string (will result in an error unless the string's length is divisible by 4). + + + G + A string of 1s and 0s in single-quotes preceded by 'B' (Postgres bit string literal syntax). + + Y + An hexadecimal string in single-quotes preceded by 'X' (Postgres bit literal syntax, will result in an error unless the string's length is divisible by 4. + + C + The format produced by format-string "Y" if legal, otherwise that produced by format-string "G". + E + The most compact safe representation for Postgres. If single bit will be either a 0 or a 1. Otherwise if it + can be that produce by format string "Y" it will, otherwise if there are less than 9bits in length it will be that + produced by format-string "G". For longer strings that cannot be represented in hexadecimal it will be a string + representing the first part of the string in format "Y" followed by the PostgreSQL concatenation operator, followed + by the final bits in the format "G". E.g. "X'13DCE'||B'110'" + If format is empty or null, it is treated as if "B" had been passed (the default repreesentation, and that + generally used by PostgreSQL for display). + + The formatted string. + + + + Returns a string representation for the Bitstring + + A string containing '0' and '1' characters. + + + + Returns the same string as . formatProvider is ignored. + + + + + Parses a string to produce a BitString. Most formats that can be produced by + can be accepted, but hexadecimal + can be interpreted with the preceding X' to mark the following characters as + being hexadecimal rather than binary. + + + + + Performs a logical AND on the two operands. + + + + + Performs a logcial OR on the two operands. + + + + + Perofrms a logical EXCLUSIVE-OR on the two operands + + + + + Performs a logical NOT on the operand. + + + + + Concatenates the operands. + + + + + Left-shifts the string BitString. + + + + + Right-shifts the string BitString. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Interprets the bitstring as a series of bits in an encoded character string, + encoded according to the Encoding passed, and returns that string. + The bitstring must contain a whole number of octets(bytes) and also be + valid according to the Encoding passed. + + The to use in producing the string. + The string that was encoded in the BitString. + + + + Interprets the bitstring as a series of octets (bytes) and returns those octets. Fails + if the Bitstring does not contain a whole number of octets (its length is not evenly + divisible by 8). + + + + + Interprets the bitstring as a series of signed octets (bytes) and returns those octets. Fails + if the Bitstring does not contain a whole number of octets (its length is not evenly + divisible by 8). + This method is not CLS-Compliant and may not be available to languages that cannot + handle signed bytes. + + + + + Interprets the bitstring as a series of unsigned 16-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 16. + This method is not CLS-Compliant and may not be available to languages that cannot + handle unsigned integers. + + + + + Interprets the bitstring as a series of 16-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 16. + + + + + Interprets the bitstring as a series of unsigned 32-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 32. + This method is not CLS-Compliant and may not be available to languages that cannot + handle unsigned integers. + + + + + Interprets the bitstring as a series of signed 32-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 32. + + + + + Interprets the bitstring as a series of unsigned 64-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 64. + This method is not CLS-Compliant and may not be available to languages that cannot + handle unsigned integers. + + + + + Interprets the bitstring as a series of signed 64-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 64. + + + + + The length of the string. + + + + + Retrieves the value of the bit at the given index. + + + + + C# implementation of the MD5 cryptographic hash function. + + + + + Creates a new MD5CryptoServiceProvider. + + + + + Drives the hashing function. + + Byte array containing the data to hash. + Where in the input buffer to start. + Size in bytes of the data in the buffer to hash. + + + + This finalizes the hash. Takes the data from the chaining variables and returns it. + + + + + Resets the class after use. Called automatically after hashing is done. + + + + + This is the meat of the hash function. It is what processes each block one at a time. + + Byte array to process data from. + Where in the byte array to start processing. + + + + Pads and then processes the final block. + + Buffer to grab data from. + Position in buffer in bytes to get data from. + How much data in bytes in the buffer to use. + + + + Stream for writing data to a table on a PostgreSQL version 7.4 or newer database during an active COPY FROM STDIN operation. + Passes data exactly as is and when given, so see to it that you use server encoding, correct format and reasonably sized writes! + + + + + Created only by NpgsqlCopyInState.StartCopy() + + + + + Successfully completes copying data to server. Returns after operation is finished. + Does nothing if this stream is not the active copy operation writer. + + + + + Withdraws an already started copy operation. The operation will fail with given error message. + Does nothing if this stream is not the active copy operation writer. + + + + + Writes given bytes to server. + Fails if this stream is not the active copy operation writer. + + + + + Flushes stream contents to server. + Fails if this stream is not the active copy operation writer. + + + + + Not readable + + + + + Not seekable + + + + + Not supported + + + + + True while this stream can be used to write copy data to server + + + + + False + + + + + True + + + + + False + + + + + Number of bytes written so far + + + + + Number of bytes written so far; not settable + + + + + Represents a SQL statement or function (stored procedure) to execute + against a PostgreSQL database. This class cannot be inherited. + + + + + Initializes a new instance of the NpgsqlCommand class. + + + + + Initializes a new instance of the NpgsqlCommand class with the text of the query. + + The text of the query. + + + + Initializes a new instance of the NpgsqlCommand class with the text of the query and a NpgsqlConnection. + + The text of the query. + A NpgsqlConnection that represents the connection to a PostgreSQL server. + + + + Initializes a new instance of the NpgsqlCommand class with the text of the query, a NpgsqlConnection, and the NpgsqlTransaction. + + The text of the query. + A NpgsqlConnection that represents the connection to a PostgreSQL server. + The NpgsqlTransaction in which the NpgsqlCommand executes. + + + + Used to execute internal commands. + + + + + Attempts to cancel the execution of a NpgsqlCommand. + + This Method isn't implemented yet. + + + + Create a new command based on this one. + + A new NpgsqlCommand object. + + + + Create a new command based on this one. + + A new NpgsqlCommand object. + + + + Creates a new instance of an DbParameter object. + + An DbParameter object. + + + + Creates a new instance of a NpgsqlParameter object. + + A NpgsqlParameter object. + + + + Slightly optimised version of ExecuteNonQuery() for internal ues in cases where the number + of affected rows is of no interest. + + + + + Executes a SQL statement against the connection and returns the number of rows affected. + + The number of rows affected if known; -1 otherwise. + + + + Sends the CommandText to + the Connection and builds a + NpgsqlDataReader + using one of the CommandBehavior values. + + One of the CommandBehavior values. + A NpgsqlDataReader object. + + + + Sends the CommandText to + the Connection and builds a + NpgsqlDataReader. + + A NpgsqlDataReader object. + + + + Sends the CommandText to + the Connection and builds a + NpgsqlDataReader + using one of the CommandBehavior values. + + One of the CommandBehavior values. + A NpgsqlDataReader object. + Currently the CommandBehavior parameter is ignored. + + + + This method binds the parameters from parameters collection to the bind + message. + + + + + Executes the query, and returns the first column of the first row + in the result set returned by the query. Extra columns or rows are ignored. + + The first column of the first row in the result set, + or a null reference if the result set is empty. + + + + Creates a prepared version of the command on a PostgreSQL server. + + + + + This method checks the connection state to see if the connection + is set or it is open. If one of this conditions is not met, throws + an InvalidOperationException + + + + + This method substitutes the Parameters, if exist, in the command + to their actual values. + The parameter name format is :ParameterName. + + A version of CommandText with the Parameters inserted. + + + + Gets or sets the SQL statement or function (stored procedure) to execute at the data source. + + The Transact-SQL statement or stored procedure to execute. The default is an empty string. + + + + Gets or sets the wait time before terminating the attempt + to execute a command and generating an error. + + The time (in seconds) to wait for the command to execute. + The default is 20 seconds. + + + + Gets or sets a value indicating how the + CommandText property is to be interpreted. + + One of the CommandType values. The default is CommandType.Text. + + + + Gets or sets the NpgsqlConnection + used by this instance of the NpgsqlCommand. + + The connection to a data source. The default value is a null reference. + + + + Gets the NpgsqlParameterCollection. + + The parameters of the SQL statement or function (stored procedure). The default is an empty collection. + + + + Gets or sets the NpgsqlTransaction + within which the NpgsqlCommand executes. + + The NpgsqlTransaction. + The default value is a null reference. + + + + Gets or sets how command results are applied to the DataRow + when used by the Update + method of the DbDataAdapter. + + One of the UpdateRowSource values. + + + + Returns oid of inserted row. This is only updated when using executenonQuery and when command inserts just a single row. If table is created without oids, this will always be 0. + + + + + Represents a collection of parameters relevant to a NpgsqlCommand + as well as their respective mappings to columns in a DataSet. + This class cannot be inherited. + + + + + Initializes a new instance of the NpgsqlParameterCollection class. + + + + + Adds the specified NpgsqlParameter object to the NpgsqlParameterCollection. + + The NpgsqlParameter to add to the collection. + The index of the new NpgsqlParameter object. + + + + Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified parameter name and value. + + The name of the NpgsqlParameter. + The Value of the NpgsqlParameter to add to the collection. + The index of the new NpgsqlParameter object. + + Use caution when using this overload of the + Add method to specify integer parameter values. + Because this overload takes a value of type Object, + you must convert the integral value to an Object + type when the value is zero, as the following C# example demonstrates. + parameters.Add(":pname", Convert.ToInt32(0)); + If you do not perform this conversion, the compiler will assume you + are attempting to call the NpgsqlParameterCollection.Add(string, DbType) overload. + + + + + Adds a NpgsqlParameter to the NpgsqlParameterCollection given the parameter name and the data type. + + The name of the parameter. + One of the DbType values. + The index of the new NpgsqlParameter object. + + + + Adds a NpgsqlParameter to the NpgsqlParameterCollection with the parameter name, the data type, and the column length. + + The name of the parameter. + One of the DbType values. + The length of the column. + The index of the new NpgsqlParameter object. + + + + Adds a NpgsqlParameter to the NpgsqlParameterCollection with the parameter name, the data type, the column length, and the source column name. + + The name of the parameter. + One of the DbType values. + The length of the column. + The name of the source column. + The index of the new NpgsqlParameter object. + + + + Removes the specified NpgsqlParameter from the collection using the parameter name. + + The name of the NpgsqlParameter object to retrieve. + + + + Gets a value indicating whether a NpgsqlParameter with the specified parameter name exists in the collection. + + The name of the NpgsqlParameter object to find. + true if the collection contains the parameter; otherwise, false. + + + + Gets the location of the NpgsqlParameter in the collection with a specific parameter name. + + The name of the NpgsqlParameter object to find. + The zero-based location of the NpgsqlParameter in the collection. + + + + Removes the specified NpgsqlParameter from the collection using a specific index. + + The zero-based index of the parameter. + + + + Inserts a NpgsqlParameter into the collection at the specified index. + + The zero-based index where the parameter is to be inserted within the collection. + The NpgsqlParameter to add to the collection. + + + + Removes the specified NpgsqlParameter from the collection. + + The NpgsqlParameter to remove from the collection. + + + + Gets a value indicating whether a NpgsqlParameter exists in the collection. + + The value of the NpgsqlParameter object to find. + true if the collection contains the NpgsqlParameter object; otherwise, false. + + + + Gets a value indicating whether a NpgsqlParameter with the specified parameter name exists in the collection. + + The name of the NpgsqlParameter object to find. + A reference to the requested parameter is returned in this out param if it is found in the list. This value is null if the parameter is not found. + true if the collection contains the parameter and param will contain the parameter; otherwise, false. + + + + Removes all items from the collection. + + + + + Gets the location of a NpgsqlParameter in the collection. + + The value of the NpgsqlParameter object to find. + The zero-based index of the NpgsqlParameter object in the collection. + + + + Adds the specified NpgsqlParameter object to the NpgsqlParameterCollection. + + The NpgsqlParameter to add to the collection. + The zero-based index of the new NpgsqlParameter object. + + + + Copies NpgsqlParameter objects from the NpgsqlParameterCollection to the specified array. + + An Array to which to copy the NpgsqlParameter objects in the collection. + The starting index of the array. + + + + Returns an enumerator that can iterate through the collection. + + An IEnumerator that can be used to iterate through the collection. + + + + In methods taking an object as argument this method is used to verify + that the argument has the type NpgsqlParameter + + The object to verify + + + + Gets the NpgsqlParameter with the specified name. + + The name of the NpgsqlParameter to retrieve. + The NpgsqlParameter with the specified name, or a null reference if the parameter is not found. + + + + Gets the NpgsqlParameter at the specified index. + + The zero-based index of the NpgsqlParameter to retrieve. + The NpgsqlParameter at the specified index. + + + + Gets the number of NpgsqlParameter objects in the collection. + + The number of NpgsqlParameter objects in the collection. + + + + Represents an ongoing COPY FROM STDIN operation. + Provides methods to push data to server and end or cancel the operation. + + + + + Called from NpgsqlState.ProcessBackendResponses upon CopyInResponse. + If CopyStream is already set, it is used to read data to push to server, after which the copy is completed. + Otherwise CopyStream is set to a writable NpgsqlCopyInStream that calls SendCopyData each time it is written to. + + + + + Sends given packet to server as a CopyData message. + Does not check for notifications! Use another thread for that. + + + + + Sends CopyDone message to server. Handles responses, ie. may throw an exception. + + + + + Sends CopyFail message to server. Handles responses, ie. should always throw an exception: + in CopyIn state the server responds to CopyFail with an error response; + outside of a CopyIn state the server responds to CopyFail with an error response; + without network connection or whatever, there's going to eventually be a failure, timeout or user intervention. + + + + + Copy format information returned from server. + + + + + Represents a PostgreSQL Point type + + + + + Represents a PostgreSQL Line Segment type. + + + + + Represents a PostgreSQL Path type. + + + + + Represents a PostgreSQL Polygon type. + + + + + Represents a PostgreSQL Circle type. + + + + + Represents a PostgreSQL inet type. + + + + + This class represents a PasswordPacket message sent to backend + PostgreSQL. + + +
+
diff --git a/linger/src/packages/FluentMigrator.1.0.6.0/tools/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest b/linger/src/packages/FluentMigrator.1.0.6.0/tools/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest new file mode 100644 index 0000000..47bd4a0 --- /dev/null +++ b/linger/src/packages/FluentMigrator.1.0.6.0/tools/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest @@ -0,0 +1,6 @@ + + + + + Vy8CgQgbu3qH5JHTK0op4kR8114= QTJu3Gttpt8hhCktGelNeXj4Yp8= 1ruqF7/L+m1tqnJVscaOtNRNHIE= + \ No newline at end of file diff --git a/linger/src/packages/FluentMigrator.1.0.6.0/tools/amd64/Microsoft.VC90.CRT/README_ENU.txt b/linger/src/packages/FluentMigrator.1.0.6.0/tools/amd64/Microsoft.VC90.CRT/README_ENU.txt new file mode 100644 index 0000000..fc38b36 Binary files /dev/null and b/linger/src/packages/FluentMigrator.1.0.6.0/tools/amd64/Microsoft.VC90.CRT/README_ENU.txt differ diff --git a/linger/src/packages/FluentMigrator.1.0.6.0/tools/policy.2.0.Npgsql.config b/linger/src/packages/FluentMigrator.1.0.6.0/tools/policy.2.0.Npgsql.config new file mode 100644 index 0000000..ac99fb8 --- /dev/null +++ b/linger/src/packages/FluentMigrator.1.0.6.0/tools/policy.2.0.Npgsql.config @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/linger/src/packages/FluentMigrator.1.0.6.0/tools/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest b/linger/src/packages/FluentMigrator.1.0.6.0/tools/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest new file mode 100644 index 0000000..bbd12cc --- /dev/null +++ b/linger/src/packages/FluentMigrator.1.0.6.0/tools/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest @@ -0,0 +1,6 @@ + + + + + +CXED+6HzJlSphyMNOn27ujadC0= MyKED+9DyS+1XcMeaC0Zlw2vFZ0= EeyDE7og6WoPd2oBhYbMEnpFHhY= + \ No newline at end of file diff --git a/linger/src/packages/FluentMigrator.1.0.6.0/tools/x86/Microsoft.VC90.CRT/README_ENU.txt b/linger/src/packages/FluentMigrator.1.0.6.0/tools/x86/Microsoft.VC90.CRT/README_ENU.txt new file mode 100644 index 0000000..fc38b36 Binary files /dev/null and b/linger/src/packages/FluentMigrator.1.0.6.0/tools/x86/Microsoft.VC90.CRT/README_ENU.txt differ diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/FluentMigrator.Tools.1.0.6.0.nuspec b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/FluentMigrator.Tools.1.0.6.0.nuspec new file mode 100644 index 0000000..fc384b4 --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/FluentMigrator.Tools.1.0.6.0.nuspec @@ -0,0 +1,20 @@ + + + + FluentMigrator.Tools + 1.0.6.0 + Fluent Migrator Tools + Josh Coffman + Josh Coffman + https://github.com/schambers/fluentmigrator/wiki/ + false + FluentMigrator is a database migration framework for .NET written in C#. The basic idea is that you can create migrations which are simply classes that derive from the Migration base class and have a Migration attribute with a unique version number attached to them. Upon executing FluentMigrator, you tell it which version to migrate to and it will run all necessary migrations in order to bring your database up to that version. + In addition to forward migration support, FluentMigrator also supports different ways to execute the migrations along with selective migrations called profiles and executing arbitrary SQL. + + + en-US + + + + + \ No newline at end of file diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/content/InstallationDummyFile.txt b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/content/InstallationDummyFile.txt new file mode 100644 index 0000000..a035ba7 --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/content/InstallationDummyFile.txt @@ -0,0 +1,2 @@ +This file is added as part of the NuGet package installation process for the FluentMigrator.Tools package. +It should be deleted automatically after installation is completed. If not, you can delete it manually. \ No newline at end of file diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/35/FluentMigrator.xml b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/35/FluentMigrator.xml new file mode 100644 index 0000000..d338db4 --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/35/FluentMigrator.xml @@ -0,0 +1,149 @@ + + + + FluentMigrator + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Allows for conditional inclusion of expresions based on the migration context + + + + + Defines fluent expressions that can be conditionally executed + + + + + The context to add expressions into + + If the database type doe snot apply then this will be a new context that is not used by the caller + + + + Constricts a new instance of a that will only add expressions to the provided if matches the migration processor + + If the database type does not apply then a will be used as a container to void any fluent expressions that would have been executed + The context to add expressions to if the database type applies + The database type that the expressions relate to + + + + Checks if the database type matches the name of the context migration processor + + The context to evaluate + The type to be checked + True if the database type applies, False if not + + + + Alter the schema of an existing object + + + + + Create a new database object + + + + + Delete a database object, table, or row + + + + + Rename tables / columns + + + + + Insert data into a table + + + + + Execute SQL statements + + + + + Update an existing row + + + + + Provides a null implmentation of a procesor that does not do any work + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + The arbitrary application context passed to the task runner. + + + The arbitrary application context passed to the task runner. + + + + Initializes a new instance of the class. + + + + + Used to filter which migrations are run. + + + + + Deletes an index + + the name of the index + + + + + Deletes an index, based on the naming convention in effect + + + + + + Deletes a named Primary Key from a table + + + + + + + Deletes a named Unique Constraint From a table + + + + + + The arbitrary application context passed to the task runner. + + + The arbitrary application context passed to the task runner. + + + diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/35/Migrate.exe.config b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/35/Migrate.exe.config new file mode 100644 index 0000000..e0aaca0 --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/35/Migrate.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/35/Npgsql.XML b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/35/Npgsql.XML new file mode 100644 index 0000000..1f94085 --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/35/Npgsql.XML @@ -0,0 +1,4079 @@ + + + + Npgsql + + + + + This class represents a parameter to a command that will be sent to server + + + + + Initializes a new instance of the NpgsqlParameter class. + + + + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name and a value of the new NpgsqlParameter. + + The m_Name of the parameter to map. + An Object that is the value of the NpgsqlParameter. + +

When you specify an Object + in the value parameter, the DbType is + inferred from the .NET Framework type of the Object.

+

When using this constructor, you must be aware of a possible misuse of the constructor which takes a DbType parameter. + This happens when calling this constructor passing an int 0 and the compiler thinks you are passing a value of DbType. + Use Convert.ToInt32(value) for example to have compiler calling the correct constructor.

+
+
+ + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name and the data type. + + The m_Name of the parameter to map. + One of the DbType values. + + + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name, the DbType, and the size. + + The m_Name of the parameter to map. + One of the DbType values. + The length of the parameter. + + + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name, the DbType, the size, + and the source column m_Name. + + The m_Name of the parameter to map. + One of the DbType values. + The length of the parameter. + The m_Name of the source column. + + + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name, the DbType, the size, + the source column m_Name, a ParameterDirection, + the precision of the parameter, the scale of the parameter, a + DataRowVersion to use, and the + value of the parameter. + + The m_Name of the parameter to map. + One of the DbType values. + The length of the parameter. + The m_Name of the source column. + One of the ParameterDirection values. + true if the value of the field can be null, otherwise false. + The total number of digits to the left and right of the decimal point to which + Value is resolved. + The total number of decimal places to which + Value is resolved. + One of the DataRowVersion values. + An Object that is the value + of the NpgsqlParameter. + + + + Creates a new NpgsqlParameter that + is a copy of the current instance. + + A new NpgsqlParameter that is a copy of this instance. + + + + Gets or sets the maximum number of digits used to represent the + Value property. + + The maximum number of digits used to represent the + Value property. + The default value is 0, which indicates that the data provider + sets the precision for Value. + + + + Gets or sets the number of decimal places to which + Value is resolved. + + The number of decimal places to which + Value is resolved. The default is 0. + + + + Gets or sets the maximum size, in bytes, of the data within the column. + + The maximum size, in bytes, of the data within the column. + The default value is inferred from the parameter value. + + + + Gets or sets the DbType of the parameter. + + One of the DbType values. The default is String. + + + + Gets or sets the DbType of the parameter. + + One of the DbType values. The default is String. + + + + Gets or sets a value indicating whether the parameter is input-only, + output-only, bidirectional, or a stored procedure return value parameter. + + One of the ParameterDirection + values. The default is Input. + + + + Gets or sets a value indicating whether the parameter accepts null values. + + true if null values are accepted; otherwise, false. The default is false. + + + + Gets or sets the m_Name of the NpgsqlParameter. + + The m_Name of the NpgsqlParameter. + The default is an empty string. + + + + The m_Name scrubbed of any optional marker + + + + + Gets or sets the m_Name of the source column that is mapped to the + DataSet and used for loading or + returning the Value. + + The m_Name of the source column that is mapped to the + DataSet. The default is an empty string. + + + + Gets or sets the DataRowVersion + to use when loading Value. + + One of the DataRowVersion values. + The default is Current. + + + + Gets or sets the value of the parameter. + + An Object that is the value of the parameter. + The default value is null. + + + + Gets or sets the value of the parameter. + + An Object that is the value of the parameter. + The default value is null. + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + For classes representing messages sent from the client to the server. + + + + + Writes given objects into a stream for PostgreSQL COPY in default copy format (not CSV or BINARY). + + + + + Return an exact copy of this NpgsqlConnectionString. + + + + + This function will set value for known key, both private member and base[key]. + + + + + + + The function will modify private member only, not base[key]. + + + + + + + Clear the member and assign them to the default value. + + + + + Compatibilty version. When possible, behaviour caused by breaking changes will be preserved + if this version is less than that where the breaking change was introduced. + + + + + Case insensative accessor for indivual connection string values. + + + + + Common base class for all derived MD5 implementations. + + + + + Called from constructor of derived class. + + + + + Finalizer for HashAlgorithm + + + + + Computes the entire hash of all the bytes in the byte array. + + + + + When overridden in a derived class, drives the hashing function. + + + + + + + + When overridden in a derived class, this pads and hashes whatever data might be left in the buffers and then returns the hash created. + + + + + When overridden in a derived class, initializes the object to prepare for hashing. + + + + + Used for stream chaining. Computes hash as data passes through it. + + The buffer from which to grab the data to be copied. + The offset into the input buffer to start reading at. + The number of bytes to be copied. + The buffer to write the copied data to. + At what point in the outputBuffer to write the data at. + + + + Used for stream chaining. Computes hash as data passes through it. Finishes off the hash. + + The buffer from which to grab the data to be copied. + The offset into the input buffer to start reading at. + The number of bytes to be copied. + + + + Get whether or not the hash can transform multiple blocks at a time. + Note: MUST be overriden if descendant can transform multiple block + on a single call! + + + + + Gets the previously computed hash. + + + + + Returns the size in bits of the hash. + + + + + Must be overriden if not 1 + + + + + Must be overriden if not 1 + + + + + Called from constructor of derived class. + + + + + Creates the default derived class. + + + + + Given a join expression and a projection, fetch all columns in the projection + that reference columns in the join. + + + + + Given an InputExpression append all from names (including nested joins) to the list. + + + + + Get new ColumnExpression that will be used in projection that had it's existing columns moved. + These should be simple references to the inner column + + + + + Every property accessed in the list of columns must be adjusted for a new scope + + + + + This class provides many util methods to handle + reading and writing of PostgreSQL protocol messages. + + + + + This method takes a ProtocolVersion and returns an integer + version number that the Postgres backend will recognize in a + startup packet. + + + + + This method takes a version string as returned by SELECT VERSION() and returns + a valid version string ("7.2.2" for example). + This is only needed when running protocol version 2. + This does not do any validity checks. + + + + + This method gets a C NULL terminated string from the network stream. + It keeps reading a byte in each time until a NULL byte is returned. + It returns the resultant string of bytes read. + This string is sent from backend. + + + + + Reads requested number of bytes from stream with retries until Stream.Read returns 0 or count is reached. + + Stream to read + byte buffer to fill + starting position to fill the buffer + number of bytes to read + The number of bytes read. May be less than count if no more bytes are available. + + + + This method writes a C NULL terminated string to the network stream. + It appends a NULL terminator to the end of the String. + + + This method writes a C NULL terminated string to the network stream. + It appends a NULL terminator to the end of the String. + + + + + This method writes a C NULL terminated string limited in length to the + backend server. + It pads the string with null bytes to the size specified. + + + + + Write a 32-bit integer to the given stream in the correct byte order. + + + + + Read a 32-bit integer from the given stream in the correct byte order. + + + + + Write a 16-bit integer to the given stream in the correct byte order. + + + + + Read a 16-bit integer from the given stream in the correct byte order. + + + + + Represent the frontend/backend protocol version. + + + + + Represent the backend server version. + As this class offers no functionality beyond that offered by it has been + deprecated in favour of that class. + + + + + + Returns the string representation of this version in three place dot notation (Major.Minor.Patch). + + + + + Server version major number. + + + + + Server version minor number. + + + + + Server version patch level number. + + + + + Represents a PostgreSQL COPY TO STDOUT operation with a corresponding SQL statement + to execute against a PostgreSQL database + and an associated stream used to write results to (if provided by user) + or for reading the results (when generated by driver). + Eg. new NpgsqlCopyOut("COPY (SELECT * FROM mytable) TO STDOUT", connection, streamToWrite).Start(); + + + + + Creates NpgsqlCommand to run given query upon Start(), after which CopyStream provides data from database as requested in the query. + + + + + Given command is run upon Start(), after which CopyStream provides data from database as requested in the query. + + + + + Given command is executed upon Start() and all requested copy data is written to toStream immediately. + + + + + Returns true if this operation is currently active and field at given location is in binary format. + + + + + Command specified upon creation is executed as a non-query. + If CopyStream is set upon creation, all copy data from server will be written to it, and operation will be finished immediately. + Otherwise the CopyStream member can be used for reading copy data from server until no more data is available. + + + + + Flush generated CopyStream at once. Effectively reads and discard all the rest of copy data from server. + + + + + Returns true if the connection is currently reserved for this operation. + + + + + The stream provided by user or generated upon Start() + + + + + The Command used to execute this copy operation. + + + + + Returns true if this operation is currently active and in binary format. + + + + + Returns number of fields if this operation is currently active, otherwise -1 + + + + + Faster alternative to using the generated CopyStream. + + + + + This class manages all connector objects, pooled AND non-pooled. + + + + Unique static instance of the connector pool + mamager. + + + Map of index to unused pooled connectors, avaliable to the + next RequestConnector() call. + This hashmap will be indexed by connection string. + This key will hold a list of queues of pooled connectors available to be used. + + + Timer for tracking unused connections in pools. + + + + Searches the shared and pooled connector lists for a + matching connector object or creates a new one. + + The NpgsqlConnection that is requesting + the connector. Its ConnectionString will be used to search the + pool for available connectors. + A connector object. + + + + Find a pooled connector. Handle locking and timeout here. + + + + + Find a pooled connector. Handle shared/non-shared here. + + + + + Releases a connector, possibly back to the pool for future use. + + + Pooled connectors will be put back into the pool if there is room. + Shared connectors should just have their use count decremented + since they always stay in the shared pool. + + The connector to release. + + + + Release a pooled connector. Handle locking here. + + + + + Release a pooled connector. Handle shared/non-shared here. + + + + + Create a connector without any pooling functionality. + + + + + Find an available pooled connector in the non-shared pool, or create + a new one if none found. + + + + + This method is only called when NpgsqlConnection.Dispose(false) is called which means a + finalization. This also means, an NpgsqlConnection was leak. We clear pool count so that + client doesn't end running out of connections from pool. When the connection is finalized, its underlying + socket is closed. + + + + + Close the connector. + + + Connector to release + + + + Put a pooled connector into the pool queue. + + Connector to pool + + + + A queue with an extra Int32 for keeping track of busy connections. + + + + + The number of pooled Connectors that belong to this queue but + are currently in use. + + + + + This class represents a BackEndKeyData message received + from PostgreSQL + + + + + Used when a connection is closed + + + + + Summary description for NpgsqlQuery + + + + + Represents the method that handles the Notice events. + + A NpgsqlNoticeEventArgs that contains the event data. + + + + Represents the method that handles the Notification events. + + The source of the event. + A NpgsqlNotificationEventArgs that contains the event data. + + + + This class represents a connection to a + PostgreSQL server. + + + + + Initializes a new instance of the + NpgsqlConnection class. + + + + + Initializes a new instance of the + NpgsqlConnection class + and sets the ConnectionString. + + The connection used to open the PostgreSQL database. + + + + Begins a database transaction with the specified isolation level. + + The isolation level under which the transaction should run. + An DbTransaction + object representing the new transaction. + + Currently the IsolationLevel ReadCommitted and Serializable are supported by the PostgreSQL backend. + There's no support for nested transactions. + + + + + Begins a database transaction. + + A NpgsqlTransaction + object representing the new transaction. + + Currently there's no support for nested transactions. + + + + + Begins a database transaction with the specified isolation level. + + The isolation level under which the transaction should run. + A NpgsqlTransaction + object representing the new transaction. + + Currently the IsolationLevel ReadCommitted and Serializable are supported by the PostgreSQL backend. + There's no support for nested transactions. + + + + + Opens a database connection with the property settings specified by the + ConnectionString. + + + + + This method changes the current database by disconnecting from the actual + database and connecting to the specified. + + The name of the database to use in place of the current database. + + + + Releases the connection to the database. If the connection is pooled, it will be + made available for re-use. If it is non-pooled, the actual connection will be shutdown. + + + + + Creates and returns a DbCommand + object associated with the IDbConnection. + + A DbCommand object. + + + + Creates and returns a NpgsqlCommand + object associated with the NpgsqlConnection. + + A NpgsqlCommand object. + + + + Releases all resources used by the + NpgsqlConnection. + + true when called from Dispose(); + false when being called from the finalizer. + + + + Create a new connection based on this one. + + A new NpgsqlConnection object. + + + + Create a new connection based on this one. + + A new NpgsqlConnection object. + + + + Default SSL CertificateSelectionCallback implementation. + + + + + Default SSL CertificateValidationCallback implementation. + + + + + Default SSL PrivateKeySelectionCallback implementation. + + + + + Default SSL ProvideClientCertificatesCallback implementation. + + + + + Write each key/value pair in the connection string to the log. + + + + + Returns the supported collections + + + + + Returns the schema collection specified by the collection name. + + The collection name. + The collection specified. + + + + Returns the schema collection specified by the collection name filtered by the restrictions. + + The collection name. + + The restriction values to filter the results. A description of the restrictions is contained + in the Restrictions collection. + + The collection specified. + + + + Occurs on NoticeResponses from the PostgreSQL backend. + + + + + Occurs on NotificationResponses from the PostgreSQL backend. + + + + + Called to provide client certificates for SSL handshake. + + + + + Mono.Security.Protocol.Tls.CertificateSelectionCallback delegate. + + + + + Mono.Security.Protocol.Tls.CertificateValidationCallback delegate. + + + + + Mono.Security.Protocol.Tls.PrivateKeySelectionCallback delegate. + + + + + Gets or sets the string used to connect to a PostgreSQL database. + Valid values are: +
    +
  • + Server: Address/Name of Postgresql Server; +
  • +
  • + Port: Port to connect to; +
  • +
  • + Protocol: Protocol version to use, instead of automatic; Integer 2 or 3; +
  • +
  • + Database: Database name. Defaults to user name if not specified; +
  • +
  • + User Id: User name; +
  • +
  • + Password: Password for clear text authentication; +
  • +
  • + SSL: True or False. Controls whether to attempt a secure connection. Default = False; +
  • +
  • + Pooling: True or False. Controls whether connection pooling is used. Default = True; +
  • +
  • + MinPoolSize: Min size of connection pool; +
  • +
  • + MaxPoolSize: Max size of connection pool; +
  • +
  • + Timeout: Time to wait for connection open in seconds. Default is 15. +
  • +
  • + CommandTimeout: Time to wait for command to finish execution before throw an exception. In seconds. Default is 20. +
  • +
  • + Sslmode: Mode for ssl connection control. Can be Prefer, Require, Allow or Disable. Default is Disable. Check user manual for explanation of values. +
  • +
  • + ConnectionLifeTime: Time to wait before closing unused connections in the pool in seconds. Default is 15. +
  • +
  • + SyncNotification: Specifies if Npgsql should use synchronous notifications. +
  • +
  • + SearchPath: Changes search path to specified and public schemas. +
  • +
+
+ The connection string that includes the server name, + the database name, and other parameters needed to establish + the initial connection. The default value is an empty string. + +
+ + + Backend server host name. + + + + + Backend server port. + + + + + If true, the connection will attempt to use SSL. + + + + + Gets the time to wait while trying to establish a connection + before terminating the attempt and generating an error. + + The time (in seconds) to wait for a connection to open. The default value is 15 seconds. + + + + Gets the time to wait while trying to execute a command + before terminating the attempt and generating an error. + + The time (in seconds) to wait for a command to complete. The default value is 20 seconds. + + + + Gets the time to wait before closing unused connections in the pool if the count + of all connections exeeds MinPoolSize. + + + If connection pool contains unused connections for ConnectionLifeTime seconds, + the half of them will be closed. If there will be unused connections in a second + later then again the half of them will be closed and so on. + This strategy provide smooth change of connection count in the pool. + + The time (in seconds) to wait. The default value is 15 seconds. + + + + Gets the name of the current database or the database to be used after a connection is opened. + + The name of the current database or the name of the database to be + used after a connection is opened. The default value is the empty string. + + + + Whether datareaders are loaded in their entirety (for compatibility with earlier code). + + + + + Gets the database server name. + + + + + Gets flag indicating if we are using Synchronous notification or not. + The default value is false. + + + + + Gets the current state of the connection. + + A bitwise combination of the ConnectionState values. The default is Closed. + + + + Gets whether the current state of the connection is Open or Closed + + ConnectionState.Open or ConnectionState.Closed + + + + Version of the PostgreSQL backend. + This can only be called when there is an active connection. + + + + + Protocol version in use. + This can only be called when there is an active connection. + + + + + Process id of backend server. + This can only be called when there is an active connection. + + + + + The connector object connected to the backend. + + + + + Gets the NpgsqlConnectionStringBuilder containing the parsed connection string values. + + + + + User name. + + + + + Password. + + + + + Determine if connection pooling will be used for this connection. + + + + + This class represents the CancelRequest message sent to PostgreSQL + server. + + + + + + + + + + + + + + + + + + + A time period expressed in 100ns units. + + + A time period expressed in a + + + Number of 100ns units. + + + Number of seconds. + + + Number of milliseconds. + + + Number of milliseconds. + + + Number of milliseconds. + + + A d with the given number of ticks. + + + A d with the given number of microseconds. + + + A d with the given number of milliseconds. + + + A d with the given number of seconds. + + + A d with the given number of minutes. + + + A d with the given number of hours. + + + A d with the given number of days. + + + A d with the given number of months. + + + An whose values are the sums of the two instances. + + + An whose values are the differences of the two instances. + + + An whose value is the negated value of this instance. + + + An whose value is the absolute value of this instance. + + + + An based on this one, but with any days converted to multiples of ±24hours. + + + + An based on this one, but with any months converted to multiples of ±30days. + + + + An based on this one, but with any months converted to multiples of ±30days and then any days converted to multiples of ±24hours; + + + + An eqivalent, canonical, . + + + An equivalent . + + + + + + An signed integer. + + + + The argument is not an . + + + The string was not in a format that could be parsed to produce an . + + + true if the parsing succeeded, false otherwise. + + + The representation. + + + An whose values are the sum of the arguments. + + + An whose values are the difference of the arguments + + + true if the two arguments are exactly the same, false otherwise. + + + false if the two arguments are exactly the same, true otherwise. + + + true if the first is less than second, false otherwise. + + + true if the first is less than or equivalent to second, false otherwise. + + + true if the first is greater than second, false otherwise. + + + true if the first is greater than or equivalent to the second, false otherwise. + + + The argument. + + + The negation of the argument. + + + + + + + + + + + + + + + + + + + + This time, normalised + + + + + + + + + This time, normalised + + + An integer which is 0 if they are equal, < 0 if this is the smaller and > 0 if this is the larger. + + + + + + + + + A class to handle everything associated with SSPI authentication + + + + + Simplified SecBufferDesc struct with only one SecBuffer + + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + EventArgs class to send Notice parameters, which are just NpgsqlError's in a lighter context. + + + + + Notice information. + + + + + This class represents the ErrorResponse and NoticeResponse + message sent from PostgreSQL server. + + + + + Return a string representation of this error object. + + + + + Severity code. All versions. + + + + + Error code. PostgreSQL 7.4 and up. + + + + + Terse error message. All versions. + + + + + Detailed error message. PostgreSQL 7.4 and up. + + + + + Suggestion to help resolve the error. PostgreSQL 7.4 and up. + + + + + Position (one based) within the query string where the error was encounterd. PostgreSQL 7.4 and up. + + + + + Position (one based) within the query string where the error was encounterd. This position refers to an internal command executed for example inside a PL/pgSQL function. PostgreSQL 7.4 and up. + + + + + Internal query string where the error was encounterd. This position refers to an internal command executed for example inside a PL/pgSQL function. PostgreSQL 7.4 and up. + + + + + Trace back information. PostgreSQL 7.4 and up. + + + + + Source file (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Source file line number (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Source routine (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + String containing the sql sent which produced this error. + + + + + Backend protocol version in use. + + + + + Represents an ongoing COPY TO STDOUT operation. + Provides methods to read data from server or end the operation. + + + + This class represents the base class for the state pattern design pattern + implementation. + + + + + + This method is used by the states to change the state of the context. + + + + + This method is responsible to handle all protocol messages sent from the backend. + It holds all the logic to do it. + To exchange data, it uses a Mediator object from which it reads/writes information + to handle backend requests. + + + + + + This method is responsible to handle all protocol messages sent from the backend. + It holds all the logic to do it. + To exchange data, it uses a Mediator object from which it reads/writes information + to handle backend requests. + + + + + + Called from NpgsqlState.ProcessBackendResponses upon CopyOutResponse. + If CopyStream is already set, it is used to write data received from server, after which the copy ends. + Otherwise CopyStream is set to a readable NpgsqlCopyOutStream that receives data from server. + + + + + Called from NpgsqlOutStream.Read to read copy data from server. + + + + + Copy format information returned from server. + + + + + Handles serialisation of .NET array or IEnumeration to pg format. + Arrays of arrays, enumerations of enumerations, arrays of enumerations etc. + are treated as multi-dimensional arrays (in much the same manner as an array of arrays + is used to emulate multi-dimensional arrays in languages that lack native support for them). + If such an enumeration of enumerations is "jagged" (as opposed to rectangular, cuboid, + hypercuboid, hyperhypercuboid, etc) then this class will "correctly" serialise it, but pg + will raise an error as it doesn't allow jagged arrays. + + + + + Create an ArrayNativeToBackendTypeConverter with the element converter passed + + The that would be used to serialise the element type. + + + + Serialise the enumeration or array. + + + + + Handles parsing of pg arrays into .NET arrays. + + + + + Takes a string representation of a pg 1-dimensional array + (or a 1-dimensional row within an n-dimensional array) + and allows enumeration of the string represenations of each items. + + + + + Takes a string representation of a pg n-dimensional array + and allows enumeration of the string represenations of the next + lower level of rows (which in turn can be taken as (n-1)-dimensional arrays. + + + + + Takes an ArrayList which may be an ArrayList of ArrayLists, an ArrayList of ArrayLists of ArrayLists + and so on and enumerates the items that aren't ArrayLists (the leaf nodes if we think of the ArrayList + passed as a tree). Simply uses the ArrayLists' own IEnumerators to get that of the next, + pushing them onto a stack until we hit something that isn't an ArrayList. + ArrayList to enumerate + IEnumerable + + + + + Create a new ArrayBackendToNativeTypeConverter + + for the element type. + + + + Creates an array from pg representation. + + + + + Creates an array list from pg represenation of an array. + Multidimensional arrays are treated as ArrayLists of ArrayLists + + + + + Creates an n-dimensional array from an ArrayList of ArrayLists or + a 1-dimensional array from something else. + + to convert + produced. + + + + Takes an array of ints and treats them like the limits of a set of counters. + Retains a matching set of ints that is set to all zeros on the first ++ + On a ++ it increments the "right-most" int. If that int reaches it's + limit it is set to zero and the one before it is incremented, and so on. + + Making this a more general purpose class is pretty straight-forward, but we'll just put what we need here. + + + + + This class represents the ParameterStatus message sent from PostgreSQL + server. + + + + + + This class is responsible for serving as bridge between the backend + protocol handling and the core classes. It is used as the mediator for + exchanging data generated/sent from/to backend. + + + + + + This class is responsible to create database commands for automatic insert, update and delete operations. + + + + + + This method is reponsible to derive the command parameter list with values obtained from function definition. + It clears the Parameters collection of command. Also, if there is any parameter type which is not supported by Npgsql, an InvalidOperationException will be thrown. + Parameters name will be parameter1, parameter2, ... + For while, only parameter name and NpgsqlDbType are obtained. + + NpgsqlCommand whose function parameters will be obtained. + + + + Represents a completed response message. + + + + + + Marker interface which identifies a class which may take possession of a stream for the duration of + it's lifetime (possibly temporarily giving that possession to another class for part of that time. + + It inherits from IDisposable, since any such class must make sure it leaves the stream in a valid state. + + The most important such class is that compiler-generated from ProcessBackendResponsesEnum. Of course + we can't make that inherit from this interface, alas. + + + + + The exception that is thrown when the PostgreSQL backend reports errors. + + + + + Construct a backend error exception based on a list of one or more + backend errors. The basic Exception.Message will be built from the + first (usually the only) error in the list. + + + + + Format a .NET style exception string. + Include all errors in the list, including any hints. + + + + + Append a line to the given Stream, first checking for zero-length. + + + + + Provide access to the entire list of errors provided by the PostgreSQL backend. + + + + + Severity code. All versions. + + + + + Error code. PostgreSQL 7.4 and up. + + + + + Basic error message. All versions. + + + + + Detailed error message. PostgreSQL 7.4 and up. + + + + + Suggestion to help resolve the error. PostgreSQL 7.4 and up. + + + + + Position (one based) within the query string where the error was encounterd. PostgreSQL 7.4 and up. + + + + + Trace back information. PostgreSQL 7.4 and up. + + + + + Source file (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Source file line number (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Source routine (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + String containing the sql sent which produced this error. + + + + + Returns the entire list of errors provided by the PostgreSQL backend. + + + + + The level of verbosity of the NpgsqlEventLog + + + + + Don't log at all + + + + + Only log the most common issues + + + + + Log everything + + + + + This class handles all the Npgsql event and debug logging + + + + + Writes a string to the Npgsql event log if msglevel is bigger then NpgsqlEventLog.Level + + + This method is obsolete and should no longer be used. + It is likely to be removed in future versions of Npgsql + + The message to write to the event log + The minimum LogLevel for which this message should be logged. + + + + Writes a string to the Npgsql event log if msglevel is bigger then NpgsqlEventLog.Level + + The ResourceManager to get the localized resources + The name of the resource that should be fetched by the ResourceManager + The minimum LogLevel for which this message should be logged. + The additional parameters that shall be included into the log-message (must be compatible with the string in the resource): + + + + Writes the default log-message for the action of calling the Get-part of an Indexer to the log file. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Indexer + The parameter given to the Indexer + + + + Writes the default log-message for the action of calling the Set-part of an Indexer to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Indexer + The parameter given to the Indexer + The value the Indexer is set to + + + + Writes the default log-message for the action of calling the Get-part of a Property to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Property + The name of the Property + + + + Writes the default log-message for the action of calling the Set-part of a Property to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Property + The name of the Property + The value the Property is set to + + + + Writes the default log-message for the action of calling a Method without Arguments to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + + + + Writes the default log-message for the action of calling a Method with one Argument to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + The value of the Argument of the Method + + + + Writes the default log-message for the action of calling a Method with two Arguments to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + The value of the first Argument of the Method + The value of the second Argument of the Method + + + + Writes the default log-message for the action of calling a Method with three Arguments to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + The value of the first Argument of the Method + The value of the second Argument of the Method + The value of the third Argument of the Method + + + + Writes the default log-message for the action of calling a Method with more than three Arguments to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + A Object-Array with zero or more Ojects that are Arguments of the Method. + + + + Sets/Returns the level of information to log to the logfile. + + The current LogLevel + + + + Sets/Returns the filename to use for logging. + + The filename of the current Log file. + + + + Sets/Returns whether Log messages should be echoed to the console + + true if Log messages are echoed to the console, otherwise false + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + Represents a PostgreSQL COPY FROM STDIN operation with a corresponding SQL statement + to execute against a PostgreSQL database + and an associated stream used to read data from (if provided by user) + or for writing it (when generated by driver). + Eg. new NpgsqlCopyIn("COPY mytable FROM STDIN", connection, streamToRead).Start(); + + + + + Creates NpgsqlCommand to run given query upon Start(). Data for the requested COPY IN operation can then be written to CopyData stream followed by a call to End() or Cancel(). + + + + + Given command is run upon Start(). Data for the requested COPY IN operation can then be written to CopyData stream followed by a call to End() or Cancel(). + + + + + Given command is executed upon Start() and all data from fromStream is passed to it as copy data. + + + + + Returns true if this operation is currently active and field at given location is in binary format. + + + + + Command specified upon creation is executed as a non-query. + If CopyStream is set upon creation, it will be flushed to server as copy data, and operation will be finished immediately. + Otherwise the CopyStream member can be used for writing copy data to server and operation finished with a call to End() or Cancel(). + + + + + Called after writing all data to CopyStream to successfully complete this copy operation. + + + + + Withdraws an already started copy operation. The operation will fail with given error message. + Will do nothing if current operation is not active. + + + + + Returns true if the connection is currently reserved for this operation. + + + + + The stream provided by user or generated upon Start(). + User may provide a stream to constructor; it is used to pass to server all data read from it. + Otherwise, call to Start() sets this to a writable NpgsqlCopyInStream that passes all data written to it to server. + In latter case this is only available while the copy operation is active and null otherwise. + + + + + Returns true if this operation is currently active and in binary format. + + + + + Returns number of fields expected on each input row if this operation is currently active, otherwise -1 + + + + + The Command used to execute this copy operation. + + + + + Set before a COPY IN query to define size of internal buffer for reading from given CopyStream. + + + + + Represents information about COPY operation data transfer format as returned by server. + + + + + Only created when a CopyInResponse or CopyOutResponse is received by NpgsqlState.ProcessBackendResponses() + + + + + Returns true if this operation is currently active and field at given location is in binary format. + + + + + Returns true if this operation is currently active and in binary format. + + + + + Returns number of fields if this operation is currently active, otherwise -1 + + + + + + + + + Provide event handlers to convert all native supported basic data types from their backend + text representation to a .NET object. + + + + + Binary data. + + + + + Convert a postgresql boolean to a System.Boolean. + + + + + Convert a postgresql bit to a System.Boolean. + + + + + Convert a postgresql datetime to a System.DateTime. + + + + + Convert a postgresql date to a System.DateTime. + + + + + Convert a postgresql time to a System.DateTime. + + + + + Convert a postgresql money to a System.Decimal. + + + + + Provide event handlers to convert the basic native supported data types from + native form to backend representation. + + + + + Binary data. + + + + + Convert to a postgresql boolean. + + + + + Convert to a postgresql bit. + + + + + Convert to a postgresql timestamp. + + + + + Convert to a postgresql date. + + + + + Convert to a postgresql time. + + + + + Convert to a postgres money. + + + + + Provide event handlers to convert extended native supported data types from their backend + text representation to a .NET object. + + + + + Convert a postgresql point to a System.NpgsqlPoint. + + + + + Convert a postgresql point to a System.RectangleF. + + + + + LDeg. + + + + + Path. + + + + + Polygon. + + + + + Circle. + + + + + Inet. + + + + + interval + + + + + Provide event handlers to convert extended native supported data types from + native form to backend representation. + + + + + Point. + + + + + Box. + + + + + LSeg. + + + + + Open path. + + + + + Polygon. + + + + + Circle. + + + + + Convert to a postgres inet. + + + + + Convert to a postgres interval + + + + + EventArgs class to send Notification parameters. + + + + + Process ID of the PostgreSQL backend that sent this notification. + + + + + Condition that triggered that notification. + + + + + Additional Information From Notifiying Process (for future use, currently postgres always sets this to an empty string) + + + + + Resolve a host name or IP address. + This is needed because if you call Dns.Resolve() with an IP address, it will attempt + to resolve it as a host name, when it should just convert it to an IP address. + + + + + + This class represents a RowDescription message sent from + the PostgreSQL. + + + + + + This struct represents the internal data of the RowDescription message. + + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + A factory to create instances of various Npgsql objects. + + + + + Creates an NpgsqlCommand object. + + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + Represents the method that handles the RowUpdated events. + + The source of the event. + A NpgsqlRowUpdatedEventArgs that contains the event data. + + + + Represents the method that handles the RowUpdating events. + + The source of the event. + A NpgsqlRowUpdatingEventArgs that contains the event data. + + + + This class represents an adapter from many commands: select, update, insert and delete to fill Datasets. + + + + + Stream for reading data from a table or select on a PostgreSQL version 7.4 or newer database during an active COPY TO STDOUT operation. + Passes data exactly as provided by the server. + + + + + Created only by NpgsqlCopyOutState.StartCopy() + + + + + Discards copy data as long as server pushes it. Returns after operation is finished. + Does nothing if this stream is not the active copy operation reader. + + + + + Not writable. + + + + + Not flushable. + + + + + Copies data read from server to given byte buffer. + Since server returns data row by row, length will differ each time, but it is only zero once the operation ends. + Can be mixed with calls to the more efficient NpgsqlCopyOutStream.Read() : byte[] though that would not make much sense. + + + + + Not seekable + + + + + Not supported + + + + + Returns a whole row of data from server without extra work. + If standard Stream.Read(...) has been called before, it's internal buffers remains are returned. + + + + + True while this stream can be used to read copy data from server + + + + + True + + + + + False + + + + + False + + + + + Number of bytes read so far + + + + + Number of bytes read so far; can not be set. + + + + + This class represents the Bind message sent to PostgreSQL + server. + + + + + + Summary description for LargeObjectManager. + + + + + Represents a transaction to be made in a PostgreSQL database. This class cannot be inherited. + + + + + Commits the database transaction. + + + + + Rolls back a transaction from a pending state. + + + + + Rolls back a transaction from a pending savepoint state. + + + + + Creates a transaction save point. + + + + + Cancel the transaction without telling the backend about it. This is + used to make the transaction go away when closing a connection. + + + + + Gets the NpgsqlConnection + object associated with the transaction, or a null reference if the + transaction is no longer valid. + + The NpgsqlConnection + object associated with the transaction. + + + + Specifies the IsolationLevel for this transaction. + + The IsolationLevel for this transaction. + The default is ReadCommitted. + + + + This class represents a StartupPacket message of PostgreSQL + protocol. + + + + + + Provides a means of reading a forward-only stream of rows from a PostgreSQL backend. This class cannot be inherited. + + + + + Return the data type name of the column at index . + + + + + Return the data type of the column at index . + + + + + Return the Npgsql specific data type of the column at requested ordinal. + + column position + Appropriate Npgsql type for column. + + + + Return the column name of the column at index . + + + + + Return the data type OID of the column at index . + + FIXME: Why this method returns String? + + + + Return the column name of the column named . + + + + + Return the data DbType of the column at index . + + + + + Return the data NpgsqlDbType of the column at index . + + + + + Get the value of a column as a . + If the differences between and + in handling of days and months is not important to your application, use + instead. + + Index of the field to find. + value of the field. + + + + Gets the value of a column converted to a Guid. + + + + + Gets the value of a column as Int16. + + + + + Gets the value of a column as Int32. + + + + + Gets the value of a column as Int64. + + + + + Gets the value of a column as Single. + + + + + Gets the value of a column as Double. + + + + + Gets the value of a column as String. + + + + + Gets the value of a column as Decimal. + + + + + Copy values from each column in the current row into . + + The number of column values copied. + + + + Copy values from each column in the current row into . + + An array appropriately sized to store values from all columns. + The number of column values copied. + + + + Gets the value of a column as Boolean. + + + + + Gets the value of a column as Byte. Not implemented. + + + + + Gets the value of a column as Char. + + + + + Gets the value of a column as DateTime. + + + + + Returns a System.Data.DataTable that describes the column metadata of the DataReader. + + + + + This methods parses the command text and tries to get the tablename + from it. + + + + + Is raised whenever Close() is called. + + + + + Gets the number of columns in the current row. + + + + + Gets the value of a column in its native format. + + + + + Gets the value of a column in its native format. + + + + + Gets a value indicating the depth of nesting for the current row. Always returns zero. + + + + + Gets a value indicating whether the data reader is closed. + + + + + Contains the column names as the keys + + + + + Contains all unique columns + + + + + This is the primary implementation of NpgsqlDataReader. It is the one used in normal cases (where the + preload-reader option is not set in the connection string to resolve some potential backwards-compatibility + issues), the only implementation used internally, and in cases where CachingDataReader is used, it is still + used to do the actual "leg-work" of turning a response stream from the server into a datareader-style + object - with CachingDataReader then filling it's cache from here. + + + + + Iterate through the objects returned through from the server. + If it's a CompletedResponse the rowsaffected count is updated appropriately, + and we iterate again, otherwise we return it (perhaps updating our cache of pending + rows if appropriate). + + The next we will deal with. + + + + Advances the data reader to the next result, when multiple result sets were returned by the PostgreSQL backend. + + True if the reader was advanced, otherwise false. + + + + Releases the resources used by the NpgsqlCommand. + + + + + Closes the data reader object. + + + + + Advances the data reader to the next result, when multiple result sets were returned by the PostgreSQL backend. + + True if the reader was advanced, otherwise false. + + + + Advances the data reader to the next row. + + True if the reader was advanced, otherwise false. + + + + Return the value of the column at index . + + + + + Gets raw data from a column. + + + + + Gets raw data from a column. + + + + + Report whether the value in a column is DBNull. + + + + + Gets the number of rows changed, inserted, or deleted by execution of the SQL statement. + + + + + Indicates if NpgsqlDatareader has rows to be read. + + + + + Provides an implementation of NpgsqlDataReader in which all data is pre-loaded into memory. + This operates by first creating a ForwardsOnlyDataReader as usual, and then loading all of it's + Rows into memory. There is a general principle that when there is a trade-off between a class design that + is more efficient and/or scalable on the one hand and one that is less efficient but has more functionality + (in this case the internal-only functionality of caching results) that one can build the less efficent class + from the most efficient without significant extra loss in efficiency, but not the other way around. The relationship + between ForwardsOnlyDataReader and CachingDataReader is an example of this). + Since the interface presented to the user is still forwards-only, queues are used to + store this information, so that dequeueing as we go we give the garbage collector the best opportunity + possible to reclaim any memory that is no longer in use. + ForwardsOnlyDataReader being used to actually + obtain the information from the server means that the "leg-work" is still only done (and need only be + maintained) in one place. + This class exists to allow for certain potential backwards-compatibility issues to be resolved + with little effort on the part of affected users. It is considerably less efficient than ForwardsOnlyDataReader + and hence never used internally. + + + + + Represents the method that allows the application to provide a certificate collection to be used for SSL clien authentication + + A X509CertificateCollection to be filled with one or more client certificates. + + + + !!! Helper class, for compilation only. + Connector implements the logic for the Connection Objects to + access the physical connection to the database, and isolate + the application developer from connection pooling internals. + + + + + Constructor. + + Controls whether the connector can be shared. + + + + This method checks if the connector is still ok. + We try to send a simple query text, select 1 as ConnectionTest; + + + + + This method is responsible for releasing all resources associated with this Connector. + + + + + This method is responsible to release all portals used by this Connector. + + + + + Default SSL CertificateSelectionCallback implementation. + + + + + Default SSL CertificateValidationCallback implementation. + + + + + Default SSL PrivateKeySelectionCallback implementation. + + + + + Default SSL ProvideClientCertificatesCallback implementation. + + + + + This method is required to set all the version dependent features flags. + SupportsPrepare means the server can use prepared query plans (7.3+) + + + + + Opens the physical connection to the server. + + Usually called by the RequestConnector + Method of the connection pool manager. + + + + Closes the physical connection to the server. + + + + + Returns next portal index. + + + + + Returns next plan index. + + + + + Occurs on NoticeResponses from the PostgreSQL backend. + + + + + Occurs on NotificationResponses from the PostgreSQL backend. + + + + + Called to provide client certificates for SSL handshake. + + + + + Mono.Security.Protocol.Tls.CertificateSelectionCallback delegate. + + + + + Mono.Security.Protocol.Tls.CertificateValidationCallback delegate. + + + + + Mono.Security.Protocol.Tls.PrivateKeySelectionCallback delegate. + + + + + Gets the current state of the connection. + + + + + Return Connection String. + + + + + Version of backend server this connector is connected to. + + + + + Backend protocol version in use by this connector. + + + + + The physical connection stream to the backend. + + + + + The physical connection socket to the backend. + + + + + Reports if this connector is fully connected. + + + + + The connection mediator. + + + + + Report if the connection is in a transaction. + + + + + Report whether the current connection can support prepare functionality. + + + + + This class contains helper methods for type conversion between + the .Net type system and postgresql. + + + + + A cache of basic datatype mappings keyed by server version. This way we don't + have to load the basic type mappings for every connection. + + + + + Find a NpgsqlNativeTypeInfo in the default types map that can handle objects + of the given NpgsqlDbType. + + + + + Find a NpgsqlNativeTypeInfo in the default types map that can handle objects + of the given NpgsqlDbType. + + + + + Find a NpgsqlNativeTypeInfo in the default types map that can handle objects + of the given DbType. + + + + + Find a NpgsqlNativeTypeInfo in the default types map that can handle objects + of the given System.Type. + + + + + This method is responsible to convert the string received from the backend + to the corresponding NpgsqlType. + The given TypeInfo is called upon to do the conversion. + If no TypeInfo object is provided, no conversion is performed. + + + + + Create the one and only native to backend type map. + This map is used when formatting native data + types to backend representations. + + + + + This method creates (or retrieves from cache) a mapping between type and OID + of all natively supported postgresql data types. + This is needed as from one version to another, this mapping can be changed and + so we avoid hardcoding them. + + NpgsqlTypeMapping containing all known data types. The mapping must be + cloned before it is modified because it is cached; changes made by one connection may + effect another connection. + + + + Attempt to map types by issuing a query against pg_type. + This function takes a list of NpgsqlTypeInfo and attempts to resolve the OID field + of each by querying pg_type. If the mapping is found, the type info object is + updated (OID) and added to the provided NpgsqlTypeMapping object. + + NpgsqlConnector to send query through. + Mapping object to add types too. + List of types that need to have OID's mapped. + + + + Delegate called to convert the given backend data to its native representation. + + + + + Delegate called to convert the given native data to its backand representation. + + + + + Represents a backend data type. + This class can be called upon to convert a backend field representation to a native object. + + + + + Construct a new NpgsqlTypeInfo with the given attributes and conversion handlers. + + Type OID provided by the backend server. + Type name provided by the backend server. + NpgsqlDbType + System type to convert fields of this type to. + Data conversion handler. + + + + Perform a data conversion from a backend representation to + a native object. + + Data sent from the backend. + Type modifier field sent from the backend. + + + + Type OID provided by the backend server. + + + + + Type name provided by the backend server. + + + + + NpgsqlDbType. + + + + + NpgsqlDbType. + + + + + Provider type to convert fields of this type to. + + + + + System type to convert fields of this type to. + + + + + Represents a backend data type. + This class can be called upon to convert a native object to its backend field representation, + + + + + Returns an NpgsqlNativeTypeInfo for an array where the elements are of the type + described by the NpgsqlNativeTypeInfo supplied. + + + + + Construct a new NpgsqlTypeInfo with the given attributes and conversion handlers. + + Type name provided by the backend server. + NpgsqlDbType + Data conversion handler. + + + + Perform a data conversion from a native object to + a backend representation. + DBNull and null values are handled differently depending if a plain query is used + When + + Native .NET object to be converted. + Flag indicating if the conversion has to be done for + plain queries or extended queries + + + + Type name provided by the backend server. + + + + + NpgsqlDbType. + + + + + DbType. + + + + + Apply quoting. + + + + + Use parameter size information. + + + + + Provide mapping between type OID, type name, and a NpgsqlBackendTypeInfo object that represents it. + + + + + Construct an empty mapping. + + + + + Copy constuctor. + + + + + Add the given NpgsqlBackendTypeInfo to this mapping. + + + + + Add a new NpgsqlBackendTypeInfo with the given attributes and conversion handlers to this mapping. + + Type OID provided by the backend server. + Type name provided by the backend server. + NpgsqlDbType + System type to convert fields of this type to. + Data conversion handler. + + + + Make a shallow copy of this type mapping. + + + + + Determine if a NpgsqlBackendTypeInfo with the given backend type OID exists in this mapping. + + + + + Determine if a NpgsqlBackendTypeInfo with the given backend type name exists in this mapping. + + + + + Get the number of type infos held. + + + + + Retrieve the NpgsqlBackendTypeInfo with the given backend type OID, or null if none found. + + + + + Retrieve the NpgsqlBackendTypeInfo with the given backend type name, or null if none found. + + + + + Provide mapping between type Type, NpgsqlDbType and a NpgsqlNativeTypeInfo object that represents it. + + + + + Add the given NpgsqlNativeTypeInfo to this mapping. + + + + + Add a new NpgsqlNativeTypeInfo with the given attributes and conversion handlers to this mapping. + + Type name provided by the backend server. + NpgsqlDbType + Data conversion handler. + + + + Retrieve the NpgsqlNativeTypeInfo with the given NpgsqlDbType. + + + + + Retrieve the NpgsqlNativeTypeInfo with the given DbType. + + + + + Retrieve the NpgsqlNativeTypeInfo with the given Type. + + + + + Determine if a NpgsqlNativeTypeInfo with the given backend type name exists in this mapping. + + + + + Determine if a NpgsqlNativeTypeInfo with the given NpgsqlDbType exists in this mapping. + + + + + Determine if a NpgsqlNativeTypeInfo with the given Type name exists in this mapping. + + + + + Get the number of type infos held. + + + + + Implements for version 3 of the protocol. + + + + + Reads a row, field by field, allowing a DataRow to be built appropriately. + + + + + Reads part of a field, as needed (for + and + + + + + Adds further functionality to stream that is dependant upon the type of data read. + + + + + Completes the implementation of Streamer for char data. + + + + + Completes the implementation of Streamer for byte data. + + + + + Implements for version 2 of the protocol. + + + + + Encapsulates the null mapping bytes sent at the start of a version 2 + datarow message, and the process of identifying the nullity of the data + at a particular index + + + + + Provides the underlying mechanism for reading schema information. + + + + + Creates an NpgsqlSchema that can read schema information from the database. + + An open database connection for reading metadata. + + + + Returns the MetaDataCollections that lists all possible collections. + + The MetaDataCollections + + + + Returns the Restrictions that contains the meaning and position of the values in the restrictions array. + + The Restrictions + + + + Returns the Databases that contains a list of all accessable databases. + + The restrictions to filter the collection. + The Databases + + + + Returns the Tables that contains table and view names and the database and schema they come from. + + The restrictions to filter the collection. + The Tables + + + + Returns the Columns that contains information about columns in tables. + + The restrictions to filter the collection. + The Columns. + + + + Returns the Views that contains view names and the database and schema they come from. + + The restrictions to filter the collection. + The Views + + + + Returns the Users containing user names and the sysid of those users. + + The restrictions to filter the collection. + The Users. + + + + This is the abstract base class for NpgsqlAsciiRow and NpgsqlBinaryRow. + + + + + Implements a bit string; a collection of zero or more bits which can each be 1 or 0. + BitString's behave as a list of bools, though like most strings and unlike most collections the position + tends to be of as much significance as the value. + BitStrings are often used as masks, and are commonly cast to and from other values. + + + + + Represents the empty string. + + + + + Create a BitString from an enumeration of boolean values. The BitString will contain + those booleans in the order they came in. + + The boolean values. + + + + Creates a BitString filled with a given number of true or false values. + + The value to fill the string with. + The number of bits to fill. + + + + Creats a bitstring from a string. + The string to copy from. + + + + + + Creates a single-bit element from a boolean value. + + The bool value which determines whether + the bit is 1 or 0. + + + + Creates a bitstring from an unsigned integer value. The string will be the shortest required to + contain the integer (e.g. 1 bit for 0 or 1, 2 for 2 or 3, 3 for 4-7, and so on). + + The integer. + This method is not CLS Compliant, and may not be available to some languages. + + + + Creates a bitstring from an integer value. The string will be the shortest required to + contain the integer (e.g. 1 bit for 0 or 1, 2 for 2 or 3, 3 for 4-7, and so on). + + The integer. + + + + Finds the first instance of a given value + + The value - whether true or false - to search for. + The index of the value found, or -1 if none are present. + + + + True if there is at least one bit with the value looked for. + + The value - true or false - to detect. + True if at least one bit was the same as item, false otherwise. + + + + Copies the bitstring to an array of bools. + + The boolean array to copy to. + The index in the array to start copying from. + + + + Returns an enumerator that enumerates through the string. + + The enumerator. + + + + Creats a bitstring by concatenating another onto this one. + + The string to append to this one. + The combined strings. + + + + Returns a substring of this string. + + The position to start from, must be between 0 and the length of the string. + The length of the string to return, must be greater than zero, and may not be + so large that the start + length exceeds the bounds of this instance. + The Bitstring identified + + + + Returns a substring of this string. + + The position to start from, must be between 0 and the length of the string, + the rest of the string is returned. + The Bitstring identified + + + + A logical and between this string and another. The two strings must be the same length. + + Another BitString to AND with this one. + A bitstring with 1 where both BitStrings had 1 and 0 otherwise. + + + + A logical or between this string and another. The two strings must be the same length. + + Another BitString to OR with this one. + A bitstring with 1 where either BitString had 1 and 0 otherwise. + + + + A logical xor between this string and another. The two strings must be the same length. + + Another BitString to XOR with this one. + A bitstring with 1 where one BitStrings and the other had 0, + and 0 where they both had 1 or both had 0. + + + + A bitstring that is the logical inverse of this one. + + A bitstring of the same length as this with 1 where this has 0 and vice-versa. + + + + Shifts the string operand bits to the left, filling with zeros to produce a + string of the same length. + + The number of bits to shift to the left. + A left-shifted bitstring. + The behaviour of LShift is closer to what one would expect from dealing + with PostgreSQL bit-strings than in using the same operations on integers in .NET + In particular, negative operands result in a right-shift, and operands greater than + the length of the string will shift it entirely, resulting in a zero-filled string. + + + + + Shifts the string operand bits to the right, filling with zeros to produce a + string of the same length. + + The number of bits to shift to the right. + A right-shifted bitstring. + The behaviour of RShift is closer to what one would expect from dealing + with PostgreSQL bit-strings than in using the same operations on integers in .NET + In particular, negative operands result in a left-shift, and operands greater than + the length of the string will shift it entirely, resulting in a zero-filled string. It also performs + a logical shift, rather than an arithmetic shift, so it always sets the vacated bit positions to zero + (like PostgreSQL and like .NET for unsigned integers but not for signed integers). + + + + + Returns true if the this string is identical to the argument passed. + + + + + Compares two strings. Strings are compared as strings, so while 0 being less than 1 will + mean a comparison between two strings of the same size is the same as treating them as numbers, + in the case of two strings of differing lengths the comparison starts at the right-most (most significant) + bit, and if all bits of the shorter string are exhausted without finding a comparison, then the larger + string is deemed to be greater than the shorter (0010 is greater than 0001 but less than 00100). + + Another string to compare with this one. + A value if the two strings are identical, an integer less + than zero if this is less than the argument, and an integer greater + than zero otherwise. + + + + Compares the string with another object. + + The object to compare with. + If the object is null then this string is considered greater. If the object is another BitString + then they are compared as in the explicit comparison for BitStrings + in any other case a is thrown. + + + + Compares this BitString with an object for equality. + + + + + Returns a code for use in hashing operations. + + + + + Returns a string representation of the BitString. + + + A string which can contain a letter and optionally a number which sets a minimum size for the string + returned. In each case using the lower-case form of the letter will result in a lower-case string + being returned. + + + B + A string of 1s and 0s. + + + X + An hexadecimal string (will result in an error unless the string's length is divisible by 4). + + + G + A string of 1s and 0s in single-quotes preceded by 'B' (Postgres bit string literal syntax). + + Y + An hexadecimal string in single-quotes preceded by 'X' (Postgres bit literal syntax, will result in an error unless the string's length is divisible by 4. + + C + The format produced by format-string "Y" if legal, otherwise that produced by format-string "G". + E + The most compact safe representation for Postgres. If single bit will be either a 0 or a 1. Otherwise if it + can be that produce by format string "Y" it will, otherwise if there are less than 9bits in length it will be that + produced by format-string "G". For longer strings that cannot be represented in hexadecimal it will be a string + representing the first part of the string in format "Y" followed by the PostgreSQL concatenation operator, followed + by the final bits in the format "G". E.g. "X'13DCE'||B'110'" + If format is empty or null, it is treated as if "B" had been passed (the default repreesentation, and that + generally used by PostgreSQL for display). + + The formatted string. + + + + Returns a string representation for the Bitstring + + A string containing '0' and '1' characters. + + + + Returns the same string as . formatProvider is ignored. + + + + + Parses a string to produce a BitString. Most formats that can be produced by + can be accepted, but hexadecimal + can be interpreted with the preceding X' to mark the following characters as + being hexadecimal rather than binary. + + + + + Performs a logical AND on the two operands. + + + + + Performs a logcial OR on the two operands. + + + + + Perofrms a logical EXCLUSIVE-OR on the two operands + + + + + Performs a logical NOT on the operand. + + + + + Concatenates the operands. + + + + + Left-shifts the string BitString. + + + + + Right-shifts the string BitString. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Interprets the bitstring as a series of bits in an encoded character string, + encoded according to the Encoding passed, and returns that string. + The bitstring must contain a whole number of octets(bytes) and also be + valid according to the Encoding passed. + + The to use in producing the string. + The string that was encoded in the BitString. + + + + Interprets the bitstring as a series of octets (bytes) and returns those octets. Fails + if the Bitstring does not contain a whole number of octets (its length is not evenly + divisible by 8). + + + + + Interprets the bitstring as a series of signed octets (bytes) and returns those octets. Fails + if the Bitstring does not contain a whole number of octets (its length is not evenly + divisible by 8). + This method is not CLS-Compliant and may not be available to languages that cannot + handle signed bytes. + + + + + Interprets the bitstring as a series of unsigned 16-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 16. + This method is not CLS-Compliant and may not be available to languages that cannot + handle unsigned integers. + + + + + Interprets the bitstring as a series of 16-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 16. + + + + + Interprets the bitstring as a series of unsigned 32-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 32. + This method is not CLS-Compliant and may not be available to languages that cannot + handle unsigned integers. + + + + + Interprets the bitstring as a series of signed 32-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 32. + + + + + Interprets the bitstring as a series of unsigned 64-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 64. + This method is not CLS-Compliant and may not be available to languages that cannot + handle unsigned integers. + + + + + Interprets the bitstring as a series of signed 64-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 64. + + + + + The length of the string. + + + + + Retrieves the value of the bit at the given index. + + + + + C# implementation of the MD5 cryptographic hash function. + + + + + Creates a new MD5CryptoServiceProvider. + + + + + Drives the hashing function. + + Byte array containing the data to hash. + Where in the input buffer to start. + Size in bytes of the data in the buffer to hash. + + + + This finalizes the hash. Takes the data from the chaining variables and returns it. + + + + + Resets the class after use. Called automatically after hashing is done. + + + + + This is the meat of the hash function. It is what processes each block one at a time. + + Byte array to process data from. + Where in the byte array to start processing. + + + + Pads and then processes the final block. + + Buffer to grab data from. + Position in buffer in bytes to get data from. + How much data in bytes in the buffer to use. + + + + Stream for writing data to a table on a PostgreSQL version 7.4 or newer database during an active COPY FROM STDIN operation. + Passes data exactly as is and when given, so see to it that you use server encoding, correct format and reasonably sized writes! + + + + + Created only by NpgsqlCopyInState.StartCopy() + + + + + Successfully completes copying data to server. Returns after operation is finished. + Does nothing if this stream is not the active copy operation writer. + + + + + Withdraws an already started copy operation. The operation will fail with given error message. + Does nothing if this stream is not the active copy operation writer. + + + + + Writes given bytes to server. + Fails if this stream is not the active copy operation writer. + + + + + Flushes stream contents to server. + Fails if this stream is not the active copy operation writer. + + + + + Not readable + + + + + Not seekable + + + + + Not supported + + + + + True while this stream can be used to write copy data to server + + + + + False + + + + + True + + + + + False + + + + + Number of bytes written so far + + + + + Number of bytes written so far; not settable + + + + + Represents a SQL statement or function (stored procedure) to execute + against a PostgreSQL database. This class cannot be inherited. + + + + + Initializes a new instance of the NpgsqlCommand class. + + + + + Initializes a new instance of the NpgsqlCommand class with the text of the query. + + The text of the query. + + + + Initializes a new instance of the NpgsqlCommand class with the text of the query and a NpgsqlConnection. + + The text of the query. + A NpgsqlConnection that represents the connection to a PostgreSQL server. + + + + Initializes a new instance of the NpgsqlCommand class with the text of the query, a NpgsqlConnection, and the NpgsqlTransaction. + + The text of the query. + A NpgsqlConnection that represents the connection to a PostgreSQL server. + The NpgsqlTransaction in which the NpgsqlCommand executes. + + + + Used to execute internal commands. + + + + + Attempts to cancel the execution of a NpgsqlCommand. + + This Method isn't implemented yet. + + + + Create a new command based on this one. + + A new NpgsqlCommand object. + + + + Create a new command based on this one. + + A new NpgsqlCommand object. + + + + Creates a new instance of an DbParameter object. + + An DbParameter object. + + + + Creates a new instance of a NpgsqlParameter object. + + A NpgsqlParameter object. + + + + Slightly optimised version of ExecuteNonQuery() for internal ues in cases where the number + of affected rows is of no interest. + + + + + Executes a SQL statement against the connection and returns the number of rows affected. + + The number of rows affected if known; -1 otherwise. + + + + Sends the CommandText to + the Connection and builds a + NpgsqlDataReader + using one of the CommandBehavior values. + + One of the CommandBehavior values. + A NpgsqlDataReader object. + + + + Sends the CommandText to + the Connection and builds a + NpgsqlDataReader. + + A NpgsqlDataReader object. + + + + Sends the CommandText to + the Connection and builds a + NpgsqlDataReader + using one of the CommandBehavior values. + + One of the CommandBehavior values. + A NpgsqlDataReader object. + Currently the CommandBehavior parameter is ignored. + + + + This method binds the parameters from parameters collection to the bind + message. + + + + + Executes the query, and returns the first column of the first row + in the result set returned by the query. Extra columns or rows are ignored. + + The first column of the first row in the result set, + or a null reference if the result set is empty. + + + + Creates a prepared version of the command on a PostgreSQL server. + + + + + This method checks the connection state to see if the connection + is set or it is open. If one of this conditions is not met, throws + an InvalidOperationException + + + + + This method substitutes the Parameters, if exist, in the command + to their actual values. + The parameter name format is :ParameterName. + + A version of CommandText with the Parameters inserted. + + + + Gets or sets the SQL statement or function (stored procedure) to execute at the data source. + + The Transact-SQL statement or stored procedure to execute. The default is an empty string. + + + + Gets or sets the wait time before terminating the attempt + to execute a command and generating an error. + + The time (in seconds) to wait for the command to execute. + The default is 20 seconds. + + + + Gets or sets a value indicating how the + CommandText property is to be interpreted. + + One of the CommandType values. The default is CommandType.Text. + + + + Gets or sets the NpgsqlConnection + used by this instance of the NpgsqlCommand. + + The connection to a data source. The default value is a null reference. + + + + Gets the NpgsqlParameterCollection. + + The parameters of the SQL statement or function (stored procedure). The default is an empty collection. + + + + Gets or sets the NpgsqlTransaction + within which the NpgsqlCommand executes. + + The NpgsqlTransaction. + The default value is a null reference. + + + + Gets or sets how command results are applied to the DataRow + when used by the Update + method of the DbDataAdapter. + + One of the UpdateRowSource values. + + + + Returns oid of inserted row. This is only updated when using executenonQuery and when command inserts just a single row. If table is created without oids, this will always be 0. + + + + + Represents a collection of parameters relevant to a NpgsqlCommand + as well as their respective mappings to columns in a DataSet. + This class cannot be inherited. + + + + + Initializes a new instance of the NpgsqlParameterCollection class. + + + + + Adds the specified NpgsqlParameter object to the NpgsqlParameterCollection. + + The NpgsqlParameter to add to the collection. + The index of the new NpgsqlParameter object. + + + + Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified parameter name and value. + + The name of the NpgsqlParameter. + The Value of the NpgsqlParameter to add to the collection. + The index of the new NpgsqlParameter object. + + Use caution when using this overload of the + Add method to specify integer parameter values. + Because this overload takes a value of type Object, + you must convert the integral value to an Object + type when the value is zero, as the following C# example demonstrates. + parameters.Add(":pname", Convert.ToInt32(0)); + If you do not perform this conversion, the compiler will assume you + are attempting to call the NpgsqlParameterCollection.Add(string, DbType) overload. + + + + + Adds a NpgsqlParameter to the NpgsqlParameterCollection given the parameter name and the data type. + + The name of the parameter. + One of the DbType values. + The index of the new NpgsqlParameter object. + + + + Adds a NpgsqlParameter to the NpgsqlParameterCollection with the parameter name, the data type, and the column length. + + The name of the parameter. + One of the DbType values. + The length of the column. + The index of the new NpgsqlParameter object. + + + + Adds a NpgsqlParameter to the NpgsqlParameterCollection with the parameter name, the data type, the column length, and the source column name. + + The name of the parameter. + One of the DbType values. + The length of the column. + The name of the source column. + The index of the new NpgsqlParameter object. + + + + Removes the specified NpgsqlParameter from the collection using the parameter name. + + The name of the NpgsqlParameter object to retrieve. + + + + Gets a value indicating whether a NpgsqlParameter with the specified parameter name exists in the collection. + + The name of the NpgsqlParameter object to find. + true if the collection contains the parameter; otherwise, false. + + + + Gets the location of the NpgsqlParameter in the collection with a specific parameter name. + + The name of the NpgsqlParameter object to find. + The zero-based location of the NpgsqlParameter in the collection. + + + + Removes the specified NpgsqlParameter from the collection using a specific index. + + The zero-based index of the parameter. + + + + Inserts a NpgsqlParameter into the collection at the specified index. + + The zero-based index where the parameter is to be inserted within the collection. + The NpgsqlParameter to add to the collection. + + + + Removes the specified NpgsqlParameter from the collection. + + The NpgsqlParameter to remove from the collection. + + + + Gets a value indicating whether a NpgsqlParameter exists in the collection. + + The value of the NpgsqlParameter object to find. + true if the collection contains the NpgsqlParameter object; otherwise, false. + + + + Gets a value indicating whether a NpgsqlParameter with the specified parameter name exists in the collection. + + The name of the NpgsqlParameter object to find. + A reference to the requested parameter is returned in this out param if it is found in the list. This value is null if the parameter is not found. + true if the collection contains the parameter and param will contain the parameter; otherwise, false. + + + + Removes all items from the collection. + + + + + Gets the location of a NpgsqlParameter in the collection. + + The value of the NpgsqlParameter object to find. + The zero-based index of the NpgsqlParameter object in the collection. + + + + Adds the specified NpgsqlParameter object to the NpgsqlParameterCollection. + + The NpgsqlParameter to add to the collection. + The zero-based index of the new NpgsqlParameter object. + + + + Copies NpgsqlParameter objects from the NpgsqlParameterCollection to the specified array. + + An Array to which to copy the NpgsqlParameter objects in the collection. + The starting index of the array. + + + + Returns an enumerator that can iterate through the collection. + + An IEnumerator that can be used to iterate through the collection. + + + + In methods taking an object as argument this method is used to verify + that the argument has the type NpgsqlParameter + + The object to verify + + + + Gets the NpgsqlParameter with the specified name. + + The name of the NpgsqlParameter to retrieve. + The NpgsqlParameter with the specified name, or a null reference if the parameter is not found. + + + + Gets the NpgsqlParameter at the specified index. + + The zero-based index of the NpgsqlParameter to retrieve. + The NpgsqlParameter at the specified index. + + + + Gets the number of NpgsqlParameter objects in the collection. + + The number of NpgsqlParameter objects in the collection. + + + + Represents an ongoing COPY FROM STDIN operation. + Provides methods to push data to server and end or cancel the operation. + + + + + Called from NpgsqlState.ProcessBackendResponses upon CopyInResponse. + If CopyStream is already set, it is used to read data to push to server, after which the copy is completed. + Otherwise CopyStream is set to a writable NpgsqlCopyInStream that calls SendCopyData each time it is written to. + + + + + Sends given packet to server as a CopyData message. + Does not check for notifications! Use another thread for that. + + + + + Sends CopyDone message to server. Handles responses, ie. may throw an exception. + + + + + Sends CopyFail message to server. Handles responses, ie. should always throw an exception: + in CopyIn state the server responds to CopyFail with an error response; + outside of a CopyIn state the server responds to CopyFail with an error response; + without network connection or whatever, there's going to eventually be a failure, timeout or user intervention. + + + + + Copy format information returned from server. + + + + + Represents a PostgreSQL Point type + + + + + Represents a PostgreSQL Line Segment type. + + + + + Represents a PostgreSQL Path type. + + + + + Represents a PostgreSQL Polygon type. + + + + + Represents a PostgreSQL Circle type. + + + + + Represents a PostgreSQL inet type. + + + + + This class represents a PasswordPacket message sent to backend + PostgreSQL. + + +
+
diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/35/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/35/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest new file mode 100644 index 0000000..47bd4a0 --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/35/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest @@ -0,0 +1,6 @@ + + + + + Vy8CgQgbu3qH5JHTK0op4kR8114= QTJu3Gttpt8hhCktGelNeXj4Yp8= 1ruqF7/L+m1tqnJVscaOtNRNHIE= + \ No newline at end of file diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/35/amd64/Microsoft.VC90.CRT/README_ENU.txt b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/35/amd64/Microsoft.VC90.CRT/README_ENU.txt new file mode 100644 index 0000000..fc38b36 Binary files /dev/null and b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/35/amd64/Microsoft.VC90.CRT/README_ENU.txt differ diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/35/policy.2.0.Npgsql.config b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/35/policy.2.0.Npgsql.config new file mode 100644 index 0000000..ac99fb8 --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/35/policy.2.0.Npgsql.config @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/35/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/35/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest new file mode 100644 index 0000000..bbd12cc --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/35/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest @@ -0,0 +1,6 @@ + + + + + +CXED+6HzJlSphyMNOn27ujadC0= MyKED+9DyS+1XcMeaC0Zlw2vFZ0= EeyDE7og6WoPd2oBhYbMEnpFHhY= + \ No newline at end of file diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/35/x86/Microsoft.VC90.CRT/README_ENU.txt b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/35/x86/Microsoft.VC90.CRT/README_ENU.txt new file mode 100644 index 0000000..fc38b36 Binary files /dev/null and b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/35/x86/Microsoft.VC90.CRT/README_ENU.txt differ diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/40/FluentMigrator.xml b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/40/FluentMigrator.xml new file mode 100644 index 0000000..d338db4 --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/40/FluentMigrator.xml @@ -0,0 +1,149 @@ + + + + FluentMigrator + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Allows for conditional inclusion of expresions based on the migration context + + + + + Defines fluent expressions that can be conditionally executed + + + + + The context to add expressions into + + If the database type doe snot apply then this will be a new context that is not used by the caller + + + + Constricts a new instance of a that will only add expressions to the provided if matches the migration processor + + If the database type does not apply then a will be used as a container to void any fluent expressions that would have been executed + The context to add expressions to if the database type applies + The database type that the expressions relate to + + + + Checks if the database type matches the name of the context migration processor + + The context to evaluate + The type to be checked + True if the database type applies, False if not + + + + Alter the schema of an existing object + + + + + Create a new database object + + + + + Delete a database object, table, or row + + + + + Rename tables / columns + + + + + Insert data into a table + + + + + Execute SQL statements + + + + + Update an existing row + + + + + Provides a null implmentation of a procesor that does not do any work + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + The arbitrary application context passed to the task runner. + + + The arbitrary application context passed to the task runner. + + + + Initializes a new instance of the class. + + + + + Used to filter which migrations are run. + + + + + Deletes an index + + the name of the index + + + + + Deletes an index, based on the naming convention in effect + + + + + + Deletes a named Primary Key from a table + + + + + + + Deletes a named Unique Constraint From a table + + + + + + The arbitrary application context passed to the task runner. + + + The arbitrary application context passed to the task runner. + + + diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/40/Migrate.exe.config b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/40/Migrate.exe.config new file mode 100644 index 0000000..899bb3e --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/40/Migrate.exe.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/40/Npgsql.XML b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/40/Npgsql.XML new file mode 100644 index 0000000..1f94085 --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/40/Npgsql.XML @@ -0,0 +1,4079 @@ + + + + Npgsql + + + + + This class represents a parameter to a command that will be sent to server + + + + + Initializes a new instance of the NpgsqlParameter class. + + + + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name and a value of the new NpgsqlParameter. + + The m_Name of the parameter to map. + An Object that is the value of the NpgsqlParameter. + +

When you specify an Object + in the value parameter, the DbType is + inferred from the .NET Framework type of the Object.

+

When using this constructor, you must be aware of a possible misuse of the constructor which takes a DbType parameter. + This happens when calling this constructor passing an int 0 and the compiler thinks you are passing a value of DbType. + Use Convert.ToInt32(value) for example to have compiler calling the correct constructor.

+
+
+ + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name and the data type. + + The m_Name of the parameter to map. + One of the DbType values. + + + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name, the DbType, and the size. + + The m_Name of the parameter to map. + One of the DbType values. + The length of the parameter. + + + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name, the DbType, the size, + and the source column m_Name. + + The m_Name of the parameter to map. + One of the DbType values. + The length of the parameter. + The m_Name of the source column. + + + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name, the DbType, the size, + the source column m_Name, a ParameterDirection, + the precision of the parameter, the scale of the parameter, a + DataRowVersion to use, and the + value of the parameter. + + The m_Name of the parameter to map. + One of the DbType values. + The length of the parameter. + The m_Name of the source column. + One of the ParameterDirection values. + true if the value of the field can be null, otherwise false. + The total number of digits to the left and right of the decimal point to which + Value is resolved. + The total number of decimal places to which + Value is resolved. + One of the DataRowVersion values. + An Object that is the value + of the NpgsqlParameter. + + + + Creates a new NpgsqlParameter that + is a copy of the current instance. + + A new NpgsqlParameter that is a copy of this instance. + + + + Gets or sets the maximum number of digits used to represent the + Value property. + + The maximum number of digits used to represent the + Value property. + The default value is 0, which indicates that the data provider + sets the precision for Value. + + + + Gets or sets the number of decimal places to which + Value is resolved. + + The number of decimal places to which + Value is resolved. The default is 0. + + + + Gets or sets the maximum size, in bytes, of the data within the column. + + The maximum size, in bytes, of the data within the column. + The default value is inferred from the parameter value. + + + + Gets or sets the DbType of the parameter. + + One of the DbType values. The default is String. + + + + Gets or sets the DbType of the parameter. + + One of the DbType values. The default is String. + + + + Gets or sets a value indicating whether the parameter is input-only, + output-only, bidirectional, or a stored procedure return value parameter. + + One of the ParameterDirection + values. The default is Input. + + + + Gets or sets a value indicating whether the parameter accepts null values. + + true if null values are accepted; otherwise, false. The default is false. + + + + Gets or sets the m_Name of the NpgsqlParameter. + + The m_Name of the NpgsqlParameter. + The default is an empty string. + + + + The m_Name scrubbed of any optional marker + + + + + Gets or sets the m_Name of the source column that is mapped to the + DataSet and used for loading or + returning the Value. + + The m_Name of the source column that is mapped to the + DataSet. The default is an empty string. + + + + Gets or sets the DataRowVersion + to use when loading Value. + + One of the DataRowVersion values. + The default is Current. + + + + Gets or sets the value of the parameter. + + An Object that is the value of the parameter. + The default value is null. + + + + Gets or sets the value of the parameter. + + An Object that is the value of the parameter. + The default value is null. + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + For classes representing messages sent from the client to the server. + + + + + Writes given objects into a stream for PostgreSQL COPY in default copy format (not CSV or BINARY). + + + + + Return an exact copy of this NpgsqlConnectionString. + + + + + This function will set value for known key, both private member and base[key]. + + + + + + + The function will modify private member only, not base[key]. + + + + + + + Clear the member and assign them to the default value. + + + + + Compatibilty version. When possible, behaviour caused by breaking changes will be preserved + if this version is less than that where the breaking change was introduced. + + + + + Case insensative accessor for indivual connection string values. + + + + + Common base class for all derived MD5 implementations. + + + + + Called from constructor of derived class. + + + + + Finalizer for HashAlgorithm + + + + + Computes the entire hash of all the bytes in the byte array. + + + + + When overridden in a derived class, drives the hashing function. + + + + + + + + When overridden in a derived class, this pads and hashes whatever data might be left in the buffers and then returns the hash created. + + + + + When overridden in a derived class, initializes the object to prepare for hashing. + + + + + Used for stream chaining. Computes hash as data passes through it. + + The buffer from which to grab the data to be copied. + The offset into the input buffer to start reading at. + The number of bytes to be copied. + The buffer to write the copied data to. + At what point in the outputBuffer to write the data at. + + + + Used for stream chaining. Computes hash as data passes through it. Finishes off the hash. + + The buffer from which to grab the data to be copied. + The offset into the input buffer to start reading at. + The number of bytes to be copied. + + + + Get whether or not the hash can transform multiple blocks at a time. + Note: MUST be overriden if descendant can transform multiple block + on a single call! + + + + + Gets the previously computed hash. + + + + + Returns the size in bits of the hash. + + + + + Must be overriden if not 1 + + + + + Must be overriden if not 1 + + + + + Called from constructor of derived class. + + + + + Creates the default derived class. + + + + + Given a join expression and a projection, fetch all columns in the projection + that reference columns in the join. + + + + + Given an InputExpression append all from names (including nested joins) to the list. + + + + + Get new ColumnExpression that will be used in projection that had it's existing columns moved. + These should be simple references to the inner column + + + + + Every property accessed in the list of columns must be adjusted for a new scope + + + + + This class provides many util methods to handle + reading and writing of PostgreSQL protocol messages. + + + + + This method takes a ProtocolVersion and returns an integer + version number that the Postgres backend will recognize in a + startup packet. + + + + + This method takes a version string as returned by SELECT VERSION() and returns + a valid version string ("7.2.2" for example). + This is only needed when running protocol version 2. + This does not do any validity checks. + + + + + This method gets a C NULL terminated string from the network stream. + It keeps reading a byte in each time until a NULL byte is returned. + It returns the resultant string of bytes read. + This string is sent from backend. + + + + + Reads requested number of bytes from stream with retries until Stream.Read returns 0 or count is reached. + + Stream to read + byte buffer to fill + starting position to fill the buffer + number of bytes to read + The number of bytes read. May be less than count if no more bytes are available. + + + + This method writes a C NULL terminated string to the network stream. + It appends a NULL terminator to the end of the String. + + + This method writes a C NULL terminated string to the network stream. + It appends a NULL terminator to the end of the String. + + + + + This method writes a C NULL terminated string limited in length to the + backend server. + It pads the string with null bytes to the size specified. + + + + + Write a 32-bit integer to the given stream in the correct byte order. + + + + + Read a 32-bit integer from the given stream in the correct byte order. + + + + + Write a 16-bit integer to the given stream in the correct byte order. + + + + + Read a 16-bit integer from the given stream in the correct byte order. + + + + + Represent the frontend/backend protocol version. + + + + + Represent the backend server version. + As this class offers no functionality beyond that offered by it has been + deprecated in favour of that class. + + + + + + Returns the string representation of this version in three place dot notation (Major.Minor.Patch). + + + + + Server version major number. + + + + + Server version minor number. + + + + + Server version patch level number. + + + + + Represents a PostgreSQL COPY TO STDOUT operation with a corresponding SQL statement + to execute against a PostgreSQL database + and an associated stream used to write results to (if provided by user) + or for reading the results (when generated by driver). + Eg. new NpgsqlCopyOut("COPY (SELECT * FROM mytable) TO STDOUT", connection, streamToWrite).Start(); + + + + + Creates NpgsqlCommand to run given query upon Start(), after which CopyStream provides data from database as requested in the query. + + + + + Given command is run upon Start(), after which CopyStream provides data from database as requested in the query. + + + + + Given command is executed upon Start() and all requested copy data is written to toStream immediately. + + + + + Returns true if this operation is currently active and field at given location is in binary format. + + + + + Command specified upon creation is executed as a non-query. + If CopyStream is set upon creation, all copy data from server will be written to it, and operation will be finished immediately. + Otherwise the CopyStream member can be used for reading copy data from server until no more data is available. + + + + + Flush generated CopyStream at once. Effectively reads and discard all the rest of copy data from server. + + + + + Returns true if the connection is currently reserved for this operation. + + + + + The stream provided by user or generated upon Start() + + + + + The Command used to execute this copy operation. + + + + + Returns true if this operation is currently active and in binary format. + + + + + Returns number of fields if this operation is currently active, otherwise -1 + + + + + Faster alternative to using the generated CopyStream. + + + + + This class manages all connector objects, pooled AND non-pooled. + + + + Unique static instance of the connector pool + mamager. + + + Map of index to unused pooled connectors, avaliable to the + next RequestConnector() call. + This hashmap will be indexed by connection string. + This key will hold a list of queues of pooled connectors available to be used. + + + Timer for tracking unused connections in pools. + + + + Searches the shared and pooled connector lists for a + matching connector object or creates a new one. + + The NpgsqlConnection that is requesting + the connector. Its ConnectionString will be used to search the + pool for available connectors. + A connector object. + + + + Find a pooled connector. Handle locking and timeout here. + + + + + Find a pooled connector. Handle shared/non-shared here. + + + + + Releases a connector, possibly back to the pool for future use. + + + Pooled connectors will be put back into the pool if there is room. + Shared connectors should just have their use count decremented + since they always stay in the shared pool. + + The connector to release. + + + + Release a pooled connector. Handle locking here. + + + + + Release a pooled connector. Handle shared/non-shared here. + + + + + Create a connector without any pooling functionality. + + + + + Find an available pooled connector in the non-shared pool, or create + a new one if none found. + + + + + This method is only called when NpgsqlConnection.Dispose(false) is called which means a + finalization. This also means, an NpgsqlConnection was leak. We clear pool count so that + client doesn't end running out of connections from pool. When the connection is finalized, its underlying + socket is closed. + + + + + Close the connector. + + + Connector to release + + + + Put a pooled connector into the pool queue. + + Connector to pool + + + + A queue with an extra Int32 for keeping track of busy connections. + + + + + The number of pooled Connectors that belong to this queue but + are currently in use. + + + + + This class represents a BackEndKeyData message received + from PostgreSQL + + + + + Used when a connection is closed + + + + + Summary description for NpgsqlQuery + + + + + Represents the method that handles the Notice events. + + A NpgsqlNoticeEventArgs that contains the event data. + + + + Represents the method that handles the Notification events. + + The source of the event. + A NpgsqlNotificationEventArgs that contains the event data. + + + + This class represents a connection to a + PostgreSQL server. + + + + + Initializes a new instance of the + NpgsqlConnection class. + + + + + Initializes a new instance of the + NpgsqlConnection class + and sets the ConnectionString. + + The connection used to open the PostgreSQL database. + + + + Begins a database transaction with the specified isolation level. + + The isolation level under which the transaction should run. + An DbTransaction + object representing the new transaction. + + Currently the IsolationLevel ReadCommitted and Serializable are supported by the PostgreSQL backend. + There's no support for nested transactions. + + + + + Begins a database transaction. + + A NpgsqlTransaction + object representing the new transaction. + + Currently there's no support for nested transactions. + + + + + Begins a database transaction with the specified isolation level. + + The isolation level under which the transaction should run. + A NpgsqlTransaction + object representing the new transaction. + + Currently the IsolationLevel ReadCommitted and Serializable are supported by the PostgreSQL backend. + There's no support for nested transactions. + + + + + Opens a database connection with the property settings specified by the + ConnectionString. + + + + + This method changes the current database by disconnecting from the actual + database and connecting to the specified. + + The name of the database to use in place of the current database. + + + + Releases the connection to the database. If the connection is pooled, it will be + made available for re-use. If it is non-pooled, the actual connection will be shutdown. + + + + + Creates and returns a DbCommand + object associated with the IDbConnection. + + A DbCommand object. + + + + Creates and returns a NpgsqlCommand + object associated with the NpgsqlConnection. + + A NpgsqlCommand object. + + + + Releases all resources used by the + NpgsqlConnection. + + true when called from Dispose(); + false when being called from the finalizer. + + + + Create a new connection based on this one. + + A new NpgsqlConnection object. + + + + Create a new connection based on this one. + + A new NpgsqlConnection object. + + + + Default SSL CertificateSelectionCallback implementation. + + + + + Default SSL CertificateValidationCallback implementation. + + + + + Default SSL PrivateKeySelectionCallback implementation. + + + + + Default SSL ProvideClientCertificatesCallback implementation. + + + + + Write each key/value pair in the connection string to the log. + + + + + Returns the supported collections + + + + + Returns the schema collection specified by the collection name. + + The collection name. + The collection specified. + + + + Returns the schema collection specified by the collection name filtered by the restrictions. + + The collection name. + + The restriction values to filter the results. A description of the restrictions is contained + in the Restrictions collection. + + The collection specified. + + + + Occurs on NoticeResponses from the PostgreSQL backend. + + + + + Occurs on NotificationResponses from the PostgreSQL backend. + + + + + Called to provide client certificates for SSL handshake. + + + + + Mono.Security.Protocol.Tls.CertificateSelectionCallback delegate. + + + + + Mono.Security.Protocol.Tls.CertificateValidationCallback delegate. + + + + + Mono.Security.Protocol.Tls.PrivateKeySelectionCallback delegate. + + + + + Gets or sets the string used to connect to a PostgreSQL database. + Valid values are: +
    +
  • + Server: Address/Name of Postgresql Server; +
  • +
  • + Port: Port to connect to; +
  • +
  • + Protocol: Protocol version to use, instead of automatic; Integer 2 or 3; +
  • +
  • + Database: Database name. Defaults to user name if not specified; +
  • +
  • + User Id: User name; +
  • +
  • + Password: Password for clear text authentication; +
  • +
  • + SSL: True or False. Controls whether to attempt a secure connection. Default = False; +
  • +
  • + Pooling: True or False. Controls whether connection pooling is used. Default = True; +
  • +
  • + MinPoolSize: Min size of connection pool; +
  • +
  • + MaxPoolSize: Max size of connection pool; +
  • +
  • + Timeout: Time to wait for connection open in seconds. Default is 15. +
  • +
  • + CommandTimeout: Time to wait for command to finish execution before throw an exception. In seconds. Default is 20. +
  • +
  • + Sslmode: Mode for ssl connection control. Can be Prefer, Require, Allow or Disable. Default is Disable. Check user manual for explanation of values. +
  • +
  • + ConnectionLifeTime: Time to wait before closing unused connections in the pool in seconds. Default is 15. +
  • +
  • + SyncNotification: Specifies if Npgsql should use synchronous notifications. +
  • +
  • + SearchPath: Changes search path to specified and public schemas. +
  • +
+
+ The connection string that includes the server name, + the database name, and other parameters needed to establish + the initial connection. The default value is an empty string. + +
+ + + Backend server host name. + + + + + Backend server port. + + + + + If true, the connection will attempt to use SSL. + + + + + Gets the time to wait while trying to establish a connection + before terminating the attempt and generating an error. + + The time (in seconds) to wait for a connection to open. The default value is 15 seconds. + + + + Gets the time to wait while trying to execute a command + before terminating the attempt and generating an error. + + The time (in seconds) to wait for a command to complete. The default value is 20 seconds. + + + + Gets the time to wait before closing unused connections in the pool if the count + of all connections exeeds MinPoolSize. + + + If connection pool contains unused connections for ConnectionLifeTime seconds, + the half of them will be closed. If there will be unused connections in a second + later then again the half of them will be closed and so on. + This strategy provide smooth change of connection count in the pool. + + The time (in seconds) to wait. The default value is 15 seconds. + + + + Gets the name of the current database or the database to be used after a connection is opened. + + The name of the current database or the name of the database to be + used after a connection is opened. The default value is the empty string. + + + + Whether datareaders are loaded in their entirety (for compatibility with earlier code). + + + + + Gets the database server name. + + + + + Gets flag indicating if we are using Synchronous notification or not. + The default value is false. + + + + + Gets the current state of the connection. + + A bitwise combination of the ConnectionState values. The default is Closed. + + + + Gets whether the current state of the connection is Open or Closed + + ConnectionState.Open or ConnectionState.Closed + + + + Version of the PostgreSQL backend. + This can only be called when there is an active connection. + + + + + Protocol version in use. + This can only be called when there is an active connection. + + + + + Process id of backend server. + This can only be called when there is an active connection. + + + + + The connector object connected to the backend. + + + + + Gets the NpgsqlConnectionStringBuilder containing the parsed connection string values. + + + + + User name. + + + + + Password. + + + + + Determine if connection pooling will be used for this connection. + + + + + This class represents the CancelRequest message sent to PostgreSQL + server. + + + + + + + + + + + + + + + + + + + A time period expressed in 100ns units. + + + A time period expressed in a + + + Number of 100ns units. + + + Number of seconds. + + + Number of milliseconds. + + + Number of milliseconds. + + + Number of milliseconds. + + + A d with the given number of ticks. + + + A d with the given number of microseconds. + + + A d with the given number of milliseconds. + + + A d with the given number of seconds. + + + A d with the given number of minutes. + + + A d with the given number of hours. + + + A d with the given number of days. + + + A d with the given number of months. + + + An whose values are the sums of the two instances. + + + An whose values are the differences of the two instances. + + + An whose value is the negated value of this instance. + + + An whose value is the absolute value of this instance. + + + + An based on this one, but with any days converted to multiples of ±24hours. + + + + An based on this one, but with any months converted to multiples of ±30days. + + + + An based on this one, but with any months converted to multiples of ±30days and then any days converted to multiples of ±24hours; + + + + An eqivalent, canonical, . + + + An equivalent . + + + + + + An signed integer. + + + + The argument is not an . + + + The string was not in a format that could be parsed to produce an . + + + true if the parsing succeeded, false otherwise. + + + The representation. + + + An whose values are the sum of the arguments. + + + An whose values are the difference of the arguments + + + true if the two arguments are exactly the same, false otherwise. + + + false if the two arguments are exactly the same, true otherwise. + + + true if the first is less than second, false otherwise. + + + true if the first is less than or equivalent to second, false otherwise. + + + true if the first is greater than second, false otherwise. + + + true if the first is greater than or equivalent to the second, false otherwise. + + + The argument. + + + The negation of the argument. + + + + + + + + + + + + + + + + + + + + This time, normalised + + + + + + + + + This time, normalised + + + An integer which is 0 if they are equal, < 0 if this is the smaller and > 0 if this is the larger. + + + + + + + + + A class to handle everything associated with SSPI authentication + + + + + Simplified SecBufferDesc struct with only one SecBuffer + + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + EventArgs class to send Notice parameters, which are just NpgsqlError's in a lighter context. + + + + + Notice information. + + + + + This class represents the ErrorResponse and NoticeResponse + message sent from PostgreSQL server. + + + + + Return a string representation of this error object. + + + + + Severity code. All versions. + + + + + Error code. PostgreSQL 7.4 and up. + + + + + Terse error message. All versions. + + + + + Detailed error message. PostgreSQL 7.4 and up. + + + + + Suggestion to help resolve the error. PostgreSQL 7.4 and up. + + + + + Position (one based) within the query string where the error was encounterd. PostgreSQL 7.4 and up. + + + + + Position (one based) within the query string where the error was encounterd. This position refers to an internal command executed for example inside a PL/pgSQL function. PostgreSQL 7.4 and up. + + + + + Internal query string where the error was encounterd. This position refers to an internal command executed for example inside a PL/pgSQL function. PostgreSQL 7.4 and up. + + + + + Trace back information. PostgreSQL 7.4 and up. + + + + + Source file (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Source file line number (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Source routine (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + String containing the sql sent which produced this error. + + + + + Backend protocol version in use. + + + + + Represents an ongoing COPY TO STDOUT operation. + Provides methods to read data from server or end the operation. + + + + This class represents the base class for the state pattern design pattern + implementation. + + + + + + This method is used by the states to change the state of the context. + + + + + This method is responsible to handle all protocol messages sent from the backend. + It holds all the logic to do it. + To exchange data, it uses a Mediator object from which it reads/writes information + to handle backend requests. + + + + + + This method is responsible to handle all protocol messages sent from the backend. + It holds all the logic to do it. + To exchange data, it uses a Mediator object from which it reads/writes information + to handle backend requests. + + + + + + Called from NpgsqlState.ProcessBackendResponses upon CopyOutResponse. + If CopyStream is already set, it is used to write data received from server, after which the copy ends. + Otherwise CopyStream is set to a readable NpgsqlCopyOutStream that receives data from server. + + + + + Called from NpgsqlOutStream.Read to read copy data from server. + + + + + Copy format information returned from server. + + + + + Handles serialisation of .NET array or IEnumeration to pg format. + Arrays of arrays, enumerations of enumerations, arrays of enumerations etc. + are treated as multi-dimensional arrays (in much the same manner as an array of arrays + is used to emulate multi-dimensional arrays in languages that lack native support for them). + If such an enumeration of enumerations is "jagged" (as opposed to rectangular, cuboid, + hypercuboid, hyperhypercuboid, etc) then this class will "correctly" serialise it, but pg + will raise an error as it doesn't allow jagged arrays. + + + + + Create an ArrayNativeToBackendTypeConverter with the element converter passed + + The that would be used to serialise the element type. + + + + Serialise the enumeration or array. + + + + + Handles parsing of pg arrays into .NET arrays. + + + + + Takes a string representation of a pg 1-dimensional array + (or a 1-dimensional row within an n-dimensional array) + and allows enumeration of the string represenations of each items. + + + + + Takes a string representation of a pg n-dimensional array + and allows enumeration of the string represenations of the next + lower level of rows (which in turn can be taken as (n-1)-dimensional arrays. + + + + + Takes an ArrayList which may be an ArrayList of ArrayLists, an ArrayList of ArrayLists of ArrayLists + and so on and enumerates the items that aren't ArrayLists (the leaf nodes if we think of the ArrayList + passed as a tree). Simply uses the ArrayLists' own IEnumerators to get that of the next, + pushing them onto a stack until we hit something that isn't an ArrayList. + ArrayList to enumerate + IEnumerable + + + + + Create a new ArrayBackendToNativeTypeConverter + + for the element type. + + + + Creates an array from pg representation. + + + + + Creates an array list from pg represenation of an array. + Multidimensional arrays are treated as ArrayLists of ArrayLists + + + + + Creates an n-dimensional array from an ArrayList of ArrayLists or + a 1-dimensional array from something else. + + to convert + produced. + + + + Takes an array of ints and treats them like the limits of a set of counters. + Retains a matching set of ints that is set to all zeros on the first ++ + On a ++ it increments the "right-most" int. If that int reaches it's + limit it is set to zero and the one before it is incremented, and so on. + + Making this a more general purpose class is pretty straight-forward, but we'll just put what we need here. + + + + + This class represents the ParameterStatus message sent from PostgreSQL + server. + + + + + + This class is responsible for serving as bridge between the backend + protocol handling and the core classes. It is used as the mediator for + exchanging data generated/sent from/to backend. + + + + + + This class is responsible to create database commands for automatic insert, update and delete operations. + + + + + + This method is reponsible to derive the command parameter list with values obtained from function definition. + It clears the Parameters collection of command. Also, if there is any parameter type which is not supported by Npgsql, an InvalidOperationException will be thrown. + Parameters name will be parameter1, parameter2, ... + For while, only parameter name and NpgsqlDbType are obtained. + + NpgsqlCommand whose function parameters will be obtained. + + + + Represents a completed response message. + + + + + + Marker interface which identifies a class which may take possession of a stream for the duration of + it's lifetime (possibly temporarily giving that possession to another class for part of that time. + + It inherits from IDisposable, since any such class must make sure it leaves the stream in a valid state. + + The most important such class is that compiler-generated from ProcessBackendResponsesEnum. Of course + we can't make that inherit from this interface, alas. + + + + + The exception that is thrown when the PostgreSQL backend reports errors. + + + + + Construct a backend error exception based on a list of one or more + backend errors. The basic Exception.Message will be built from the + first (usually the only) error in the list. + + + + + Format a .NET style exception string. + Include all errors in the list, including any hints. + + + + + Append a line to the given Stream, first checking for zero-length. + + + + + Provide access to the entire list of errors provided by the PostgreSQL backend. + + + + + Severity code. All versions. + + + + + Error code. PostgreSQL 7.4 and up. + + + + + Basic error message. All versions. + + + + + Detailed error message. PostgreSQL 7.4 and up. + + + + + Suggestion to help resolve the error. PostgreSQL 7.4 and up. + + + + + Position (one based) within the query string where the error was encounterd. PostgreSQL 7.4 and up. + + + + + Trace back information. PostgreSQL 7.4 and up. + + + + + Source file (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Source file line number (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Source routine (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + String containing the sql sent which produced this error. + + + + + Returns the entire list of errors provided by the PostgreSQL backend. + + + + + The level of verbosity of the NpgsqlEventLog + + + + + Don't log at all + + + + + Only log the most common issues + + + + + Log everything + + + + + This class handles all the Npgsql event and debug logging + + + + + Writes a string to the Npgsql event log if msglevel is bigger then NpgsqlEventLog.Level + + + This method is obsolete and should no longer be used. + It is likely to be removed in future versions of Npgsql + + The message to write to the event log + The minimum LogLevel for which this message should be logged. + + + + Writes a string to the Npgsql event log if msglevel is bigger then NpgsqlEventLog.Level + + The ResourceManager to get the localized resources + The name of the resource that should be fetched by the ResourceManager + The minimum LogLevel for which this message should be logged. + The additional parameters that shall be included into the log-message (must be compatible with the string in the resource): + + + + Writes the default log-message for the action of calling the Get-part of an Indexer to the log file. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Indexer + The parameter given to the Indexer + + + + Writes the default log-message for the action of calling the Set-part of an Indexer to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Indexer + The parameter given to the Indexer + The value the Indexer is set to + + + + Writes the default log-message for the action of calling the Get-part of a Property to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Property + The name of the Property + + + + Writes the default log-message for the action of calling the Set-part of a Property to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Property + The name of the Property + The value the Property is set to + + + + Writes the default log-message for the action of calling a Method without Arguments to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + + + + Writes the default log-message for the action of calling a Method with one Argument to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + The value of the Argument of the Method + + + + Writes the default log-message for the action of calling a Method with two Arguments to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + The value of the first Argument of the Method + The value of the second Argument of the Method + + + + Writes the default log-message for the action of calling a Method with three Arguments to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + The value of the first Argument of the Method + The value of the second Argument of the Method + The value of the third Argument of the Method + + + + Writes the default log-message for the action of calling a Method with more than three Arguments to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + A Object-Array with zero or more Ojects that are Arguments of the Method. + + + + Sets/Returns the level of information to log to the logfile. + + The current LogLevel + + + + Sets/Returns the filename to use for logging. + + The filename of the current Log file. + + + + Sets/Returns whether Log messages should be echoed to the console + + true if Log messages are echoed to the console, otherwise false + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + Represents a PostgreSQL COPY FROM STDIN operation with a corresponding SQL statement + to execute against a PostgreSQL database + and an associated stream used to read data from (if provided by user) + or for writing it (when generated by driver). + Eg. new NpgsqlCopyIn("COPY mytable FROM STDIN", connection, streamToRead).Start(); + + + + + Creates NpgsqlCommand to run given query upon Start(). Data for the requested COPY IN operation can then be written to CopyData stream followed by a call to End() or Cancel(). + + + + + Given command is run upon Start(). Data for the requested COPY IN operation can then be written to CopyData stream followed by a call to End() or Cancel(). + + + + + Given command is executed upon Start() and all data from fromStream is passed to it as copy data. + + + + + Returns true if this operation is currently active and field at given location is in binary format. + + + + + Command specified upon creation is executed as a non-query. + If CopyStream is set upon creation, it will be flushed to server as copy data, and operation will be finished immediately. + Otherwise the CopyStream member can be used for writing copy data to server and operation finished with a call to End() or Cancel(). + + + + + Called after writing all data to CopyStream to successfully complete this copy operation. + + + + + Withdraws an already started copy operation. The operation will fail with given error message. + Will do nothing if current operation is not active. + + + + + Returns true if the connection is currently reserved for this operation. + + + + + The stream provided by user or generated upon Start(). + User may provide a stream to constructor; it is used to pass to server all data read from it. + Otherwise, call to Start() sets this to a writable NpgsqlCopyInStream that passes all data written to it to server. + In latter case this is only available while the copy operation is active and null otherwise. + + + + + Returns true if this operation is currently active and in binary format. + + + + + Returns number of fields expected on each input row if this operation is currently active, otherwise -1 + + + + + The Command used to execute this copy operation. + + + + + Set before a COPY IN query to define size of internal buffer for reading from given CopyStream. + + + + + Represents information about COPY operation data transfer format as returned by server. + + + + + Only created when a CopyInResponse or CopyOutResponse is received by NpgsqlState.ProcessBackendResponses() + + + + + Returns true if this operation is currently active and field at given location is in binary format. + + + + + Returns true if this operation is currently active and in binary format. + + + + + Returns number of fields if this operation is currently active, otherwise -1 + + + + + + + + + Provide event handlers to convert all native supported basic data types from their backend + text representation to a .NET object. + + + + + Binary data. + + + + + Convert a postgresql boolean to a System.Boolean. + + + + + Convert a postgresql bit to a System.Boolean. + + + + + Convert a postgresql datetime to a System.DateTime. + + + + + Convert a postgresql date to a System.DateTime. + + + + + Convert a postgresql time to a System.DateTime. + + + + + Convert a postgresql money to a System.Decimal. + + + + + Provide event handlers to convert the basic native supported data types from + native form to backend representation. + + + + + Binary data. + + + + + Convert to a postgresql boolean. + + + + + Convert to a postgresql bit. + + + + + Convert to a postgresql timestamp. + + + + + Convert to a postgresql date. + + + + + Convert to a postgresql time. + + + + + Convert to a postgres money. + + + + + Provide event handlers to convert extended native supported data types from their backend + text representation to a .NET object. + + + + + Convert a postgresql point to a System.NpgsqlPoint. + + + + + Convert a postgresql point to a System.RectangleF. + + + + + LDeg. + + + + + Path. + + + + + Polygon. + + + + + Circle. + + + + + Inet. + + + + + interval + + + + + Provide event handlers to convert extended native supported data types from + native form to backend representation. + + + + + Point. + + + + + Box. + + + + + LSeg. + + + + + Open path. + + + + + Polygon. + + + + + Circle. + + + + + Convert to a postgres inet. + + + + + Convert to a postgres interval + + + + + EventArgs class to send Notification parameters. + + + + + Process ID of the PostgreSQL backend that sent this notification. + + + + + Condition that triggered that notification. + + + + + Additional Information From Notifiying Process (for future use, currently postgres always sets this to an empty string) + + + + + Resolve a host name or IP address. + This is needed because if you call Dns.Resolve() with an IP address, it will attempt + to resolve it as a host name, when it should just convert it to an IP address. + + + + + + This class represents a RowDescription message sent from + the PostgreSQL. + + + + + + This struct represents the internal data of the RowDescription message. + + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + A factory to create instances of various Npgsql objects. + + + + + Creates an NpgsqlCommand object. + + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + Represents the method that handles the RowUpdated events. + + The source of the event. + A NpgsqlRowUpdatedEventArgs that contains the event data. + + + + Represents the method that handles the RowUpdating events. + + The source of the event. + A NpgsqlRowUpdatingEventArgs that contains the event data. + + + + This class represents an adapter from many commands: select, update, insert and delete to fill Datasets. + + + + + Stream for reading data from a table or select on a PostgreSQL version 7.4 or newer database during an active COPY TO STDOUT operation. + Passes data exactly as provided by the server. + + + + + Created only by NpgsqlCopyOutState.StartCopy() + + + + + Discards copy data as long as server pushes it. Returns after operation is finished. + Does nothing if this stream is not the active copy operation reader. + + + + + Not writable. + + + + + Not flushable. + + + + + Copies data read from server to given byte buffer. + Since server returns data row by row, length will differ each time, but it is only zero once the operation ends. + Can be mixed with calls to the more efficient NpgsqlCopyOutStream.Read() : byte[] though that would not make much sense. + + + + + Not seekable + + + + + Not supported + + + + + Returns a whole row of data from server without extra work. + If standard Stream.Read(...) has been called before, it's internal buffers remains are returned. + + + + + True while this stream can be used to read copy data from server + + + + + True + + + + + False + + + + + False + + + + + Number of bytes read so far + + + + + Number of bytes read so far; can not be set. + + + + + This class represents the Bind message sent to PostgreSQL + server. + + + + + + Summary description for LargeObjectManager. + + + + + Represents a transaction to be made in a PostgreSQL database. This class cannot be inherited. + + + + + Commits the database transaction. + + + + + Rolls back a transaction from a pending state. + + + + + Rolls back a transaction from a pending savepoint state. + + + + + Creates a transaction save point. + + + + + Cancel the transaction without telling the backend about it. This is + used to make the transaction go away when closing a connection. + + + + + Gets the NpgsqlConnection + object associated with the transaction, or a null reference if the + transaction is no longer valid. + + The NpgsqlConnection + object associated with the transaction. + + + + Specifies the IsolationLevel for this transaction. + + The IsolationLevel for this transaction. + The default is ReadCommitted. + + + + This class represents a StartupPacket message of PostgreSQL + protocol. + + + + + + Provides a means of reading a forward-only stream of rows from a PostgreSQL backend. This class cannot be inherited. + + + + + Return the data type name of the column at index . + + + + + Return the data type of the column at index . + + + + + Return the Npgsql specific data type of the column at requested ordinal. + + column position + Appropriate Npgsql type for column. + + + + Return the column name of the column at index . + + + + + Return the data type OID of the column at index . + + FIXME: Why this method returns String? + + + + Return the column name of the column named . + + + + + Return the data DbType of the column at index . + + + + + Return the data NpgsqlDbType of the column at index . + + + + + Get the value of a column as a . + If the differences between and + in handling of days and months is not important to your application, use + instead. + + Index of the field to find. + value of the field. + + + + Gets the value of a column converted to a Guid. + + + + + Gets the value of a column as Int16. + + + + + Gets the value of a column as Int32. + + + + + Gets the value of a column as Int64. + + + + + Gets the value of a column as Single. + + + + + Gets the value of a column as Double. + + + + + Gets the value of a column as String. + + + + + Gets the value of a column as Decimal. + + + + + Copy values from each column in the current row into . + + The number of column values copied. + + + + Copy values from each column in the current row into . + + An array appropriately sized to store values from all columns. + The number of column values copied. + + + + Gets the value of a column as Boolean. + + + + + Gets the value of a column as Byte. Not implemented. + + + + + Gets the value of a column as Char. + + + + + Gets the value of a column as DateTime. + + + + + Returns a System.Data.DataTable that describes the column metadata of the DataReader. + + + + + This methods parses the command text and tries to get the tablename + from it. + + + + + Is raised whenever Close() is called. + + + + + Gets the number of columns in the current row. + + + + + Gets the value of a column in its native format. + + + + + Gets the value of a column in its native format. + + + + + Gets a value indicating the depth of nesting for the current row. Always returns zero. + + + + + Gets a value indicating whether the data reader is closed. + + + + + Contains the column names as the keys + + + + + Contains all unique columns + + + + + This is the primary implementation of NpgsqlDataReader. It is the one used in normal cases (where the + preload-reader option is not set in the connection string to resolve some potential backwards-compatibility + issues), the only implementation used internally, and in cases where CachingDataReader is used, it is still + used to do the actual "leg-work" of turning a response stream from the server into a datareader-style + object - with CachingDataReader then filling it's cache from here. + + + + + Iterate through the objects returned through from the server. + If it's a CompletedResponse the rowsaffected count is updated appropriately, + and we iterate again, otherwise we return it (perhaps updating our cache of pending + rows if appropriate). + + The next we will deal with. + + + + Advances the data reader to the next result, when multiple result sets were returned by the PostgreSQL backend. + + True if the reader was advanced, otherwise false. + + + + Releases the resources used by the NpgsqlCommand. + + + + + Closes the data reader object. + + + + + Advances the data reader to the next result, when multiple result sets were returned by the PostgreSQL backend. + + True if the reader was advanced, otherwise false. + + + + Advances the data reader to the next row. + + True if the reader was advanced, otherwise false. + + + + Return the value of the column at index . + + + + + Gets raw data from a column. + + + + + Gets raw data from a column. + + + + + Report whether the value in a column is DBNull. + + + + + Gets the number of rows changed, inserted, or deleted by execution of the SQL statement. + + + + + Indicates if NpgsqlDatareader has rows to be read. + + + + + Provides an implementation of NpgsqlDataReader in which all data is pre-loaded into memory. + This operates by first creating a ForwardsOnlyDataReader as usual, and then loading all of it's + Rows into memory. There is a general principle that when there is a trade-off between a class design that + is more efficient and/or scalable on the one hand and one that is less efficient but has more functionality + (in this case the internal-only functionality of caching results) that one can build the less efficent class + from the most efficient without significant extra loss in efficiency, but not the other way around. The relationship + between ForwardsOnlyDataReader and CachingDataReader is an example of this). + Since the interface presented to the user is still forwards-only, queues are used to + store this information, so that dequeueing as we go we give the garbage collector the best opportunity + possible to reclaim any memory that is no longer in use. + ForwardsOnlyDataReader being used to actually + obtain the information from the server means that the "leg-work" is still only done (and need only be + maintained) in one place. + This class exists to allow for certain potential backwards-compatibility issues to be resolved + with little effort on the part of affected users. It is considerably less efficient than ForwardsOnlyDataReader + and hence never used internally. + + + + + Represents the method that allows the application to provide a certificate collection to be used for SSL clien authentication + + A X509CertificateCollection to be filled with one or more client certificates. + + + + !!! Helper class, for compilation only. + Connector implements the logic for the Connection Objects to + access the physical connection to the database, and isolate + the application developer from connection pooling internals. + + + + + Constructor. + + Controls whether the connector can be shared. + + + + This method checks if the connector is still ok. + We try to send a simple query text, select 1 as ConnectionTest; + + + + + This method is responsible for releasing all resources associated with this Connector. + + + + + This method is responsible to release all portals used by this Connector. + + + + + Default SSL CertificateSelectionCallback implementation. + + + + + Default SSL CertificateValidationCallback implementation. + + + + + Default SSL PrivateKeySelectionCallback implementation. + + + + + Default SSL ProvideClientCertificatesCallback implementation. + + + + + This method is required to set all the version dependent features flags. + SupportsPrepare means the server can use prepared query plans (7.3+) + + + + + Opens the physical connection to the server. + + Usually called by the RequestConnector + Method of the connection pool manager. + + + + Closes the physical connection to the server. + + + + + Returns next portal index. + + + + + Returns next plan index. + + + + + Occurs on NoticeResponses from the PostgreSQL backend. + + + + + Occurs on NotificationResponses from the PostgreSQL backend. + + + + + Called to provide client certificates for SSL handshake. + + + + + Mono.Security.Protocol.Tls.CertificateSelectionCallback delegate. + + + + + Mono.Security.Protocol.Tls.CertificateValidationCallback delegate. + + + + + Mono.Security.Protocol.Tls.PrivateKeySelectionCallback delegate. + + + + + Gets the current state of the connection. + + + + + Return Connection String. + + + + + Version of backend server this connector is connected to. + + + + + Backend protocol version in use by this connector. + + + + + The physical connection stream to the backend. + + + + + The physical connection socket to the backend. + + + + + Reports if this connector is fully connected. + + + + + The connection mediator. + + + + + Report if the connection is in a transaction. + + + + + Report whether the current connection can support prepare functionality. + + + + + This class contains helper methods for type conversion between + the .Net type system and postgresql. + + + + + A cache of basic datatype mappings keyed by server version. This way we don't + have to load the basic type mappings for every connection. + + + + + Find a NpgsqlNativeTypeInfo in the default types map that can handle objects + of the given NpgsqlDbType. + + + + + Find a NpgsqlNativeTypeInfo in the default types map that can handle objects + of the given NpgsqlDbType. + + + + + Find a NpgsqlNativeTypeInfo in the default types map that can handle objects + of the given DbType. + + + + + Find a NpgsqlNativeTypeInfo in the default types map that can handle objects + of the given System.Type. + + + + + This method is responsible to convert the string received from the backend + to the corresponding NpgsqlType. + The given TypeInfo is called upon to do the conversion. + If no TypeInfo object is provided, no conversion is performed. + + + + + Create the one and only native to backend type map. + This map is used when formatting native data + types to backend representations. + + + + + This method creates (or retrieves from cache) a mapping between type and OID + of all natively supported postgresql data types. + This is needed as from one version to another, this mapping can be changed and + so we avoid hardcoding them. + + NpgsqlTypeMapping containing all known data types. The mapping must be + cloned before it is modified because it is cached; changes made by one connection may + effect another connection. + + + + Attempt to map types by issuing a query against pg_type. + This function takes a list of NpgsqlTypeInfo and attempts to resolve the OID field + of each by querying pg_type. If the mapping is found, the type info object is + updated (OID) and added to the provided NpgsqlTypeMapping object. + + NpgsqlConnector to send query through. + Mapping object to add types too. + List of types that need to have OID's mapped. + + + + Delegate called to convert the given backend data to its native representation. + + + + + Delegate called to convert the given native data to its backand representation. + + + + + Represents a backend data type. + This class can be called upon to convert a backend field representation to a native object. + + + + + Construct a new NpgsqlTypeInfo with the given attributes and conversion handlers. + + Type OID provided by the backend server. + Type name provided by the backend server. + NpgsqlDbType + System type to convert fields of this type to. + Data conversion handler. + + + + Perform a data conversion from a backend representation to + a native object. + + Data sent from the backend. + Type modifier field sent from the backend. + + + + Type OID provided by the backend server. + + + + + Type name provided by the backend server. + + + + + NpgsqlDbType. + + + + + NpgsqlDbType. + + + + + Provider type to convert fields of this type to. + + + + + System type to convert fields of this type to. + + + + + Represents a backend data type. + This class can be called upon to convert a native object to its backend field representation, + + + + + Returns an NpgsqlNativeTypeInfo for an array where the elements are of the type + described by the NpgsqlNativeTypeInfo supplied. + + + + + Construct a new NpgsqlTypeInfo with the given attributes and conversion handlers. + + Type name provided by the backend server. + NpgsqlDbType + Data conversion handler. + + + + Perform a data conversion from a native object to + a backend representation. + DBNull and null values are handled differently depending if a plain query is used + When + + Native .NET object to be converted. + Flag indicating if the conversion has to be done for + plain queries or extended queries + + + + Type name provided by the backend server. + + + + + NpgsqlDbType. + + + + + DbType. + + + + + Apply quoting. + + + + + Use parameter size information. + + + + + Provide mapping between type OID, type name, and a NpgsqlBackendTypeInfo object that represents it. + + + + + Construct an empty mapping. + + + + + Copy constuctor. + + + + + Add the given NpgsqlBackendTypeInfo to this mapping. + + + + + Add a new NpgsqlBackendTypeInfo with the given attributes and conversion handlers to this mapping. + + Type OID provided by the backend server. + Type name provided by the backend server. + NpgsqlDbType + System type to convert fields of this type to. + Data conversion handler. + + + + Make a shallow copy of this type mapping. + + + + + Determine if a NpgsqlBackendTypeInfo with the given backend type OID exists in this mapping. + + + + + Determine if a NpgsqlBackendTypeInfo with the given backend type name exists in this mapping. + + + + + Get the number of type infos held. + + + + + Retrieve the NpgsqlBackendTypeInfo with the given backend type OID, or null if none found. + + + + + Retrieve the NpgsqlBackendTypeInfo with the given backend type name, or null if none found. + + + + + Provide mapping between type Type, NpgsqlDbType and a NpgsqlNativeTypeInfo object that represents it. + + + + + Add the given NpgsqlNativeTypeInfo to this mapping. + + + + + Add a new NpgsqlNativeTypeInfo with the given attributes and conversion handlers to this mapping. + + Type name provided by the backend server. + NpgsqlDbType + Data conversion handler. + + + + Retrieve the NpgsqlNativeTypeInfo with the given NpgsqlDbType. + + + + + Retrieve the NpgsqlNativeTypeInfo with the given DbType. + + + + + Retrieve the NpgsqlNativeTypeInfo with the given Type. + + + + + Determine if a NpgsqlNativeTypeInfo with the given backend type name exists in this mapping. + + + + + Determine if a NpgsqlNativeTypeInfo with the given NpgsqlDbType exists in this mapping. + + + + + Determine if a NpgsqlNativeTypeInfo with the given Type name exists in this mapping. + + + + + Get the number of type infos held. + + + + + Implements for version 3 of the protocol. + + + + + Reads a row, field by field, allowing a DataRow to be built appropriately. + + + + + Reads part of a field, as needed (for + and + + + + + Adds further functionality to stream that is dependant upon the type of data read. + + + + + Completes the implementation of Streamer for char data. + + + + + Completes the implementation of Streamer for byte data. + + + + + Implements for version 2 of the protocol. + + + + + Encapsulates the null mapping bytes sent at the start of a version 2 + datarow message, and the process of identifying the nullity of the data + at a particular index + + + + + Provides the underlying mechanism for reading schema information. + + + + + Creates an NpgsqlSchema that can read schema information from the database. + + An open database connection for reading metadata. + + + + Returns the MetaDataCollections that lists all possible collections. + + The MetaDataCollections + + + + Returns the Restrictions that contains the meaning and position of the values in the restrictions array. + + The Restrictions + + + + Returns the Databases that contains a list of all accessable databases. + + The restrictions to filter the collection. + The Databases + + + + Returns the Tables that contains table and view names and the database and schema they come from. + + The restrictions to filter the collection. + The Tables + + + + Returns the Columns that contains information about columns in tables. + + The restrictions to filter the collection. + The Columns. + + + + Returns the Views that contains view names and the database and schema they come from. + + The restrictions to filter the collection. + The Views + + + + Returns the Users containing user names and the sysid of those users. + + The restrictions to filter the collection. + The Users. + + + + This is the abstract base class for NpgsqlAsciiRow and NpgsqlBinaryRow. + + + + + Implements a bit string; a collection of zero or more bits which can each be 1 or 0. + BitString's behave as a list of bools, though like most strings and unlike most collections the position + tends to be of as much significance as the value. + BitStrings are often used as masks, and are commonly cast to and from other values. + + + + + Represents the empty string. + + + + + Create a BitString from an enumeration of boolean values. The BitString will contain + those booleans in the order they came in. + + The boolean values. + + + + Creates a BitString filled with a given number of true or false values. + + The value to fill the string with. + The number of bits to fill. + + + + Creats a bitstring from a string. + The string to copy from. + + + + + + Creates a single-bit element from a boolean value. + + The bool value which determines whether + the bit is 1 or 0. + + + + Creates a bitstring from an unsigned integer value. The string will be the shortest required to + contain the integer (e.g. 1 bit for 0 or 1, 2 for 2 or 3, 3 for 4-7, and so on). + + The integer. + This method is not CLS Compliant, and may not be available to some languages. + + + + Creates a bitstring from an integer value. The string will be the shortest required to + contain the integer (e.g. 1 bit for 0 or 1, 2 for 2 or 3, 3 for 4-7, and so on). + + The integer. + + + + Finds the first instance of a given value + + The value - whether true or false - to search for. + The index of the value found, or -1 if none are present. + + + + True if there is at least one bit with the value looked for. + + The value - true or false - to detect. + True if at least one bit was the same as item, false otherwise. + + + + Copies the bitstring to an array of bools. + + The boolean array to copy to. + The index in the array to start copying from. + + + + Returns an enumerator that enumerates through the string. + + The enumerator. + + + + Creats a bitstring by concatenating another onto this one. + + The string to append to this one. + The combined strings. + + + + Returns a substring of this string. + + The position to start from, must be between 0 and the length of the string. + The length of the string to return, must be greater than zero, and may not be + so large that the start + length exceeds the bounds of this instance. + The Bitstring identified + + + + Returns a substring of this string. + + The position to start from, must be between 0 and the length of the string, + the rest of the string is returned. + The Bitstring identified + + + + A logical and between this string and another. The two strings must be the same length. + + Another BitString to AND with this one. + A bitstring with 1 where both BitStrings had 1 and 0 otherwise. + + + + A logical or between this string and another. The two strings must be the same length. + + Another BitString to OR with this one. + A bitstring with 1 where either BitString had 1 and 0 otherwise. + + + + A logical xor between this string and another. The two strings must be the same length. + + Another BitString to XOR with this one. + A bitstring with 1 where one BitStrings and the other had 0, + and 0 where they both had 1 or both had 0. + + + + A bitstring that is the logical inverse of this one. + + A bitstring of the same length as this with 1 where this has 0 and vice-versa. + + + + Shifts the string operand bits to the left, filling with zeros to produce a + string of the same length. + + The number of bits to shift to the left. + A left-shifted bitstring. + The behaviour of LShift is closer to what one would expect from dealing + with PostgreSQL bit-strings than in using the same operations on integers in .NET + In particular, negative operands result in a right-shift, and operands greater than + the length of the string will shift it entirely, resulting in a zero-filled string. + + + + + Shifts the string operand bits to the right, filling with zeros to produce a + string of the same length. + + The number of bits to shift to the right. + A right-shifted bitstring. + The behaviour of RShift is closer to what one would expect from dealing + with PostgreSQL bit-strings than in using the same operations on integers in .NET + In particular, negative operands result in a left-shift, and operands greater than + the length of the string will shift it entirely, resulting in a zero-filled string. It also performs + a logical shift, rather than an arithmetic shift, so it always sets the vacated bit positions to zero + (like PostgreSQL and like .NET for unsigned integers but not for signed integers). + + + + + Returns true if the this string is identical to the argument passed. + + + + + Compares two strings. Strings are compared as strings, so while 0 being less than 1 will + mean a comparison between two strings of the same size is the same as treating them as numbers, + in the case of two strings of differing lengths the comparison starts at the right-most (most significant) + bit, and if all bits of the shorter string are exhausted without finding a comparison, then the larger + string is deemed to be greater than the shorter (0010 is greater than 0001 but less than 00100). + + Another string to compare with this one. + A value if the two strings are identical, an integer less + than zero if this is less than the argument, and an integer greater + than zero otherwise. + + + + Compares the string with another object. + + The object to compare with. + If the object is null then this string is considered greater. If the object is another BitString + then they are compared as in the explicit comparison for BitStrings + in any other case a is thrown. + + + + Compares this BitString with an object for equality. + + + + + Returns a code for use in hashing operations. + + + + + Returns a string representation of the BitString. + + + A string which can contain a letter and optionally a number which sets a minimum size for the string + returned. In each case using the lower-case form of the letter will result in a lower-case string + being returned. + + + B + A string of 1s and 0s. + + + X + An hexadecimal string (will result in an error unless the string's length is divisible by 4). + + + G + A string of 1s and 0s in single-quotes preceded by 'B' (Postgres bit string literal syntax). + + Y + An hexadecimal string in single-quotes preceded by 'X' (Postgres bit literal syntax, will result in an error unless the string's length is divisible by 4. + + C + The format produced by format-string "Y" if legal, otherwise that produced by format-string "G". + E + The most compact safe representation for Postgres. If single bit will be either a 0 or a 1. Otherwise if it + can be that produce by format string "Y" it will, otherwise if there are less than 9bits in length it will be that + produced by format-string "G". For longer strings that cannot be represented in hexadecimal it will be a string + representing the first part of the string in format "Y" followed by the PostgreSQL concatenation operator, followed + by the final bits in the format "G". E.g. "X'13DCE'||B'110'" + If format is empty or null, it is treated as if "B" had been passed (the default repreesentation, and that + generally used by PostgreSQL for display). + + The formatted string. + + + + Returns a string representation for the Bitstring + + A string containing '0' and '1' characters. + + + + Returns the same string as . formatProvider is ignored. + + + + + Parses a string to produce a BitString. Most formats that can be produced by + can be accepted, but hexadecimal + can be interpreted with the preceding X' to mark the following characters as + being hexadecimal rather than binary. + + + + + Performs a logical AND on the two operands. + + + + + Performs a logcial OR on the two operands. + + + + + Perofrms a logical EXCLUSIVE-OR on the two operands + + + + + Performs a logical NOT on the operand. + + + + + Concatenates the operands. + + + + + Left-shifts the string BitString. + + + + + Right-shifts the string BitString. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Interprets the bitstring as a series of bits in an encoded character string, + encoded according to the Encoding passed, and returns that string. + The bitstring must contain a whole number of octets(bytes) and also be + valid according to the Encoding passed. + + The to use in producing the string. + The string that was encoded in the BitString. + + + + Interprets the bitstring as a series of octets (bytes) and returns those octets. Fails + if the Bitstring does not contain a whole number of octets (its length is not evenly + divisible by 8). + + + + + Interprets the bitstring as a series of signed octets (bytes) and returns those octets. Fails + if the Bitstring does not contain a whole number of octets (its length is not evenly + divisible by 8). + This method is not CLS-Compliant and may not be available to languages that cannot + handle signed bytes. + + + + + Interprets the bitstring as a series of unsigned 16-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 16. + This method is not CLS-Compliant and may not be available to languages that cannot + handle unsigned integers. + + + + + Interprets the bitstring as a series of 16-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 16. + + + + + Interprets the bitstring as a series of unsigned 32-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 32. + This method is not CLS-Compliant and may not be available to languages that cannot + handle unsigned integers. + + + + + Interprets the bitstring as a series of signed 32-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 32. + + + + + Interprets the bitstring as a series of unsigned 64-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 64. + This method is not CLS-Compliant and may not be available to languages that cannot + handle unsigned integers. + + + + + Interprets the bitstring as a series of signed 64-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 64. + + + + + The length of the string. + + + + + Retrieves the value of the bit at the given index. + + + + + C# implementation of the MD5 cryptographic hash function. + + + + + Creates a new MD5CryptoServiceProvider. + + + + + Drives the hashing function. + + Byte array containing the data to hash. + Where in the input buffer to start. + Size in bytes of the data in the buffer to hash. + + + + This finalizes the hash. Takes the data from the chaining variables and returns it. + + + + + Resets the class after use. Called automatically after hashing is done. + + + + + This is the meat of the hash function. It is what processes each block one at a time. + + Byte array to process data from. + Where in the byte array to start processing. + + + + Pads and then processes the final block. + + Buffer to grab data from. + Position in buffer in bytes to get data from. + How much data in bytes in the buffer to use. + + + + Stream for writing data to a table on a PostgreSQL version 7.4 or newer database during an active COPY FROM STDIN operation. + Passes data exactly as is and when given, so see to it that you use server encoding, correct format and reasonably sized writes! + + + + + Created only by NpgsqlCopyInState.StartCopy() + + + + + Successfully completes copying data to server. Returns after operation is finished. + Does nothing if this stream is not the active copy operation writer. + + + + + Withdraws an already started copy operation. The operation will fail with given error message. + Does nothing if this stream is not the active copy operation writer. + + + + + Writes given bytes to server. + Fails if this stream is not the active copy operation writer. + + + + + Flushes stream contents to server. + Fails if this stream is not the active copy operation writer. + + + + + Not readable + + + + + Not seekable + + + + + Not supported + + + + + True while this stream can be used to write copy data to server + + + + + False + + + + + True + + + + + False + + + + + Number of bytes written so far + + + + + Number of bytes written so far; not settable + + + + + Represents a SQL statement or function (stored procedure) to execute + against a PostgreSQL database. This class cannot be inherited. + + + + + Initializes a new instance of the NpgsqlCommand class. + + + + + Initializes a new instance of the NpgsqlCommand class with the text of the query. + + The text of the query. + + + + Initializes a new instance of the NpgsqlCommand class with the text of the query and a NpgsqlConnection. + + The text of the query. + A NpgsqlConnection that represents the connection to a PostgreSQL server. + + + + Initializes a new instance of the NpgsqlCommand class with the text of the query, a NpgsqlConnection, and the NpgsqlTransaction. + + The text of the query. + A NpgsqlConnection that represents the connection to a PostgreSQL server. + The NpgsqlTransaction in which the NpgsqlCommand executes. + + + + Used to execute internal commands. + + + + + Attempts to cancel the execution of a NpgsqlCommand. + + This Method isn't implemented yet. + + + + Create a new command based on this one. + + A new NpgsqlCommand object. + + + + Create a new command based on this one. + + A new NpgsqlCommand object. + + + + Creates a new instance of an DbParameter object. + + An DbParameter object. + + + + Creates a new instance of a NpgsqlParameter object. + + A NpgsqlParameter object. + + + + Slightly optimised version of ExecuteNonQuery() for internal ues in cases where the number + of affected rows is of no interest. + + + + + Executes a SQL statement against the connection and returns the number of rows affected. + + The number of rows affected if known; -1 otherwise. + + + + Sends the CommandText to + the Connection and builds a + NpgsqlDataReader + using one of the CommandBehavior values. + + One of the CommandBehavior values. + A NpgsqlDataReader object. + + + + Sends the CommandText to + the Connection and builds a + NpgsqlDataReader. + + A NpgsqlDataReader object. + + + + Sends the CommandText to + the Connection and builds a + NpgsqlDataReader + using one of the CommandBehavior values. + + One of the CommandBehavior values. + A NpgsqlDataReader object. + Currently the CommandBehavior parameter is ignored. + + + + This method binds the parameters from parameters collection to the bind + message. + + + + + Executes the query, and returns the first column of the first row + in the result set returned by the query. Extra columns or rows are ignored. + + The first column of the first row in the result set, + or a null reference if the result set is empty. + + + + Creates a prepared version of the command on a PostgreSQL server. + + + + + This method checks the connection state to see if the connection + is set or it is open. If one of this conditions is not met, throws + an InvalidOperationException + + + + + This method substitutes the Parameters, if exist, in the command + to their actual values. + The parameter name format is :ParameterName. + + A version of CommandText with the Parameters inserted. + + + + Gets or sets the SQL statement or function (stored procedure) to execute at the data source. + + The Transact-SQL statement or stored procedure to execute. The default is an empty string. + + + + Gets or sets the wait time before terminating the attempt + to execute a command and generating an error. + + The time (in seconds) to wait for the command to execute. + The default is 20 seconds. + + + + Gets or sets a value indicating how the + CommandText property is to be interpreted. + + One of the CommandType values. The default is CommandType.Text. + + + + Gets or sets the NpgsqlConnection + used by this instance of the NpgsqlCommand. + + The connection to a data source. The default value is a null reference. + + + + Gets the NpgsqlParameterCollection. + + The parameters of the SQL statement or function (stored procedure). The default is an empty collection. + + + + Gets or sets the NpgsqlTransaction + within which the NpgsqlCommand executes. + + The NpgsqlTransaction. + The default value is a null reference. + + + + Gets or sets how command results are applied to the DataRow + when used by the Update + method of the DbDataAdapter. + + One of the UpdateRowSource values. + + + + Returns oid of inserted row. This is only updated when using executenonQuery and when command inserts just a single row. If table is created without oids, this will always be 0. + + + + + Represents a collection of parameters relevant to a NpgsqlCommand + as well as their respective mappings to columns in a DataSet. + This class cannot be inherited. + + + + + Initializes a new instance of the NpgsqlParameterCollection class. + + + + + Adds the specified NpgsqlParameter object to the NpgsqlParameterCollection. + + The NpgsqlParameter to add to the collection. + The index of the new NpgsqlParameter object. + + + + Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified parameter name and value. + + The name of the NpgsqlParameter. + The Value of the NpgsqlParameter to add to the collection. + The index of the new NpgsqlParameter object. + + Use caution when using this overload of the + Add method to specify integer parameter values. + Because this overload takes a value of type Object, + you must convert the integral value to an Object + type when the value is zero, as the following C# example demonstrates. + parameters.Add(":pname", Convert.ToInt32(0)); + If you do not perform this conversion, the compiler will assume you + are attempting to call the NpgsqlParameterCollection.Add(string, DbType) overload. + + + + + Adds a NpgsqlParameter to the NpgsqlParameterCollection given the parameter name and the data type. + + The name of the parameter. + One of the DbType values. + The index of the new NpgsqlParameter object. + + + + Adds a NpgsqlParameter to the NpgsqlParameterCollection with the parameter name, the data type, and the column length. + + The name of the parameter. + One of the DbType values. + The length of the column. + The index of the new NpgsqlParameter object. + + + + Adds a NpgsqlParameter to the NpgsqlParameterCollection with the parameter name, the data type, the column length, and the source column name. + + The name of the parameter. + One of the DbType values. + The length of the column. + The name of the source column. + The index of the new NpgsqlParameter object. + + + + Removes the specified NpgsqlParameter from the collection using the parameter name. + + The name of the NpgsqlParameter object to retrieve. + + + + Gets a value indicating whether a NpgsqlParameter with the specified parameter name exists in the collection. + + The name of the NpgsqlParameter object to find. + true if the collection contains the parameter; otherwise, false. + + + + Gets the location of the NpgsqlParameter in the collection with a specific parameter name. + + The name of the NpgsqlParameter object to find. + The zero-based location of the NpgsqlParameter in the collection. + + + + Removes the specified NpgsqlParameter from the collection using a specific index. + + The zero-based index of the parameter. + + + + Inserts a NpgsqlParameter into the collection at the specified index. + + The zero-based index where the parameter is to be inserted within the collection. + The NpgsqlParameter to add to the collection. + + + + Removes the specified NpgsqlParameter from the collection. + + The NpgsqlParameter to remove from the collection. + + + + Gets a value indicating whether a NpgsqlParameter exists in the collection. + + The value of the NpgsqlParameter object to find. + true if the collection contains the NpgsqlParameter object; otherwise, false. + + + + Gets a value indicating whether a NpgsqlParameter with the specified parameter name exists in the collection. + + The name of the NpgsqlParameter object to find. + A reference to the requested parameter is returned in this out param if it is found in the list. This value is null if the parameter is not found. + true if the collection contains the parameter and param will contain the parameter; otherwise, false. + + + + Removes all items from the collection. + + + + + Gets the location of a NpgsqlParameter in the collection. + + The value of the NpgsqlParameter object to find. + The zero-based index of the NpgsqlParameter object in the collection. + + + + Adds the specified NpgsqlParameter object to the NpgsqlParameterCollection. + + The NpgsqlParameter to add to the collection. + The zero-based index of the new NpgsqlParameter object. + + + + Copies NpgsqlParameter objects from the NpgsqlParameterCollection to the specified array. + + An Array to which to copy the NpgsqlParameter objects in the collection. + The starting index of the array. + + + + Returns an enumerator that can iterate through the collection. + + An IEnumerator that can be used to iterate through the collection. + + + + In methods taking an object as argument this method is used to verify + that the argument has the type NpgsqlParameter + + The object to verify + + + + Gets the NpgsqlParameter with the specified name. + + The name of the NpgsqlParameter to retrieve. + The NpgsqlParameter with the specified name, or a null reference if the parameter is not found. + + + + Gets the NpgsqlParameter at the specified index. + + The zero-based index of the NpgsqlParameter to retrieve. + The NpgsqlParameter at the specified index. + + + + Gets the number of NpgsqlParameter objects in the collection. + + The number of NpgsqlParameter objects in the collection. + + + + Represents an ongoing COPY FROM STDIN operation. + Provides methods to push data to server and end or cancel the operation. + + + + + Called from NpgsqlState.ProcessBackendResponses upon CopyInResponse. + If CopyStream is already set, it is used to read data to push to server, after which the copy is completed. + Otherwise CopyStream is set to a writable NpgsqlCopyInStream that calls SendCopyData each time it is written to. + + + + + Sends given packet to server as a CopyData message. + Does not check for notifications! Use another thread for that. + + + + + Sends CopyDone message to server. Handles responses, ie. may throw an exception. + + + + + Sends CopyFail message to server. Handles responses, ie. should always throw an exception: + in CopyIn state the server responds to CopyFail with an error response; + outside of a CopyIn state the server responds to CopyFail with an error response; + without network connection or whatever, there's going to eventually be a failure, timeout or user intervention. + + + + + Copy format information returned from server. + + + + + Represents a PostgreSQL Point type + + + + + Represents a PostgreSQL Line Segment type. + + + + + Represents a PostgreSQL Path type. + + + + + Represents a PostgreSQL Polygon type. + + + + + Represents a PostgreSQL Circle type. + + + + + Represents a PostgreSQL inet type. + + + + + This class represents a PasswordPacket message sent to backend + PostgreSQL. + + +
+
diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/40/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/40/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest new file mode 100644 index 0000000..47bd4a0 --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/40/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest @@ -0,0 +1,6 @@ + + + + + Vy8CgQgbu3qH5JHTK0op4kR8114= QTJu3Gttpt8hhCktGelNeXj4Yp8= 1ruqF7/L+m1tqnJVscaOtNRNHIE= + \ No newline at end of file diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/40/amd64/Microsoft.VC90.CRT/README_ENU.txt b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/40/amd64/Microsoft.VC90.CRT/README_ENU.txt new file mode 100644 index 0000000..fc38b36 Binary files /dev/null and b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/40/amd64/Microsoft.VC90.CRT/README_ENU.txt differ diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/40/policy.2.0.Npgsql.config b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/40/policy.2.0.Npgsql.config new file mode 100644 index 0000000..ac99fb8 --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/40/policy.2.0.Npgsql.config @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/40/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/40/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest new file mode 100644 index 0000000..bbd12cc --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/40/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest @@ -0,0 +1,6 @@ + + + + + +CXED+6HzJlSphyMNOn27ujadC0= MyKED+9DyS+1XcMeaC0Zlw2vFZ0= EeyDE7og6WoPd2oBhYbMEnpFHhY= + \ No newline at end of file diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/40/x86/Microsoft.VC90.CRT/README_ENU.txt b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/40/x86/Microsoft.VC90.CRT/README_ENU.txt new file mode 100644 index 0000000..fc38b36 Binary files /dev/null and b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/AnyCPU/40/x86/Microsoft.VC90.CRT/README_ENU.txt differ diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/install.ps1 b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/install.ps1 new file mode 100644 index 0000000..45be91f --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/install.ps1 @@ -0,0 +1,5 @@ +param($installPath, $toolsPath, $package, $project) + +$project.ProjectItems | ForEach { if ($_.Name -eq "InstallationDummyFile.txt") { $_.Remove() } } +$projectPath = Split-Path $project.FullName -Parent +Join-Path $projectPath "InstallationDummyFile.txt" | Remove-Item \ No newline at end of file diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/35/FluentMigrator.xml b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/35/FluentMigrator.xml new file mode 100644 index 0000000..d338db4 --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/35/FluentMigrator.xml @@ -0,0 +1,149 @@ + + + + FluentMigrator + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Allows for conditional inclusion of expresions based on the migration context + + + + + Defines fluent expressions that can be conditionally executed + + + + + The context to add expressions into + + If the database type doe snot apply then this will be a new context that is not used by the caller + + + + Constricts a new instance of a that will only add expressions to the provided if matches the migration processor + + If the database type does not apply then a will be used as a container to void any fluent expressions that would have been executed + The context to add expressions to if the database type applies + The database type that the expressions relate to + + + + Checks if the database type matches the name of the context migration processor + + The context to evaluate + The type to be checked + True if the database type applies, False if not + + + + Alter the schema of an existing object + + + + + Create a new database object + + + + + Delete a database object, table, or row + + + + + Rename tables / columns + + + + + Insert data into a table + + + + + Execute SQL statements + + + + + Update an existing row + + + + + Provides a null implmentation of a procesor that does not do any work + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + The arbitrary application context passed to the task runner. + + + The arbitrary application context passed to the task runner. + + + + Initializes a new instance of the class. + + + + + Used to filter which migrations are run. + + + + + Deletes an index + + the name of the index + + + + + Deletes an index, based on the naming convention in effect + + + + + + Deletes a named Primary Key from a table + + + + + + + Deletes a named Unique Constraint From a table + + + + + + The arbitrary application context passed to the task runner. + + + The arbitrary application context passed to the task runner. + + + diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/35/Migrate.exe.config b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/35/Migrate.exe.config new file mode 100644 index 0000000..e0aaca0 --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/35/Migrate.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/35/Npgsql.XML b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/35/Npgsql.XML new file mode 100644 index 0000000..1f94085 --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/35/Npgsql.XML @@ -0,0 +1,4079 @@ + + + + Npgsql + + + + + This class represents a parameter to a command that will be sent to server + + + + + Initializes a new instance of the NpgsqlParameter class. + + + + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name and a value of the new NpgsqlParameter. + + The m_Name of the parameter to map. + An Object that is the value of the NpgsqlParameter. + +

When you specify an Object + in the value parameter, the DbType is + inferred from the .NET Framework type of the Object.

+

When using this constructor, you must be aware of a possible misuse of the constructor which takes a DbType parameter. + This happens when calling this constructor passing an int 0 and the compiler thinks you are passing a value of DbType. + Use Convert.ToInt32(value) for example to have compiler calling the correct constructor.

+
+
+ + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name and the data type. + + The m_Name of the parameter to map. + One of the DbType values. + + + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name, the DbType, and the size. + + The m_Name of the parameter to map. + One of the DbType values. + The length of the parameter. + + + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name, the DbType, the size, + and the source column m_Name. + + The m_Name of the parameter to map. + One of the DbType values. + The length of the parameter. + The m_Name of the source column. + + + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name, the DbType, the size, + the source column m_Name, a ParameterDirection, + the precision of the parameter, the scale of the parameter, a + DataRowVersion to use, and the + value of the parameter. + + The m_Name of the parameter to map. + One of the DbType values. + The length of the parameter. + The m_Name of the source column. + One of the ParameterDirection values. + true if the value of the field can be null, otherwise false. + The total number of digits to the left and right of the decimal point to which + Value is resolved. + The total number of decimal places to which + Value is resolved. + One of the DataRowVersion values. + An Object that is the value + of the NpgsqlParameter. + + + + Creates a new NpgsqlParameter that + is a copy of the current instance. + + A new NpgsqlParameter that is a copy of this instance. + + + + Gets or sets the maximum number of digits used to represent the + Value property. + + The maximum number of digits used to represent the + Value property. + The default value is 0, which indicates that the data provider + sets the precision for Value. + + + + Gets or sets the number of decimal places to which + Value is resolved. + + The number of decimal places to which + Value is resolved. The default is 0. + + + + Gets or sets the maximum size, in bytes, of the data within the column. + + The maximum size, in bytes, of the data within the column. + The default value is inferred from the parameter value. + + + + Gets or sets the DbType of the parameter. + + One of the DbType values. The default is String. + + + + Gets or sets the DbType of the parameter. + + One of the DbType values. The default is String. + + + + Gets or sets a value indicating whether the parameter is input-only, + output-only, bidirectional, or a stored procedure return value parameter. + + One of the ParameterDirection + values. The default is Input. + + + + Gets or sets a value indicating whether the parameter accepts null values. + + true if null values are accepted; otherwise, false. The default is false. + + + + Gets or sets the m_Name of the NpgsqlParameter. + + The m_Name of the NpgsqlParameter. + The default is an empty string. + + + + The m_Name scrubbed of any optional marker + + + + + Gets or sets the m_Name of the source column that is mapped to the + DataSet and used for loading or + returning the Value. + + The m_Name of the source column that is mapped to the + DataSet. The default is an empty string. + + + + Gets or sets the DataRowVersion + to use when loading Value. + + One of the DataRowVersion values. + The default is Current. + + + + Gets or sets the value of the parameter. + + An Object that is the value of the parameter. + The default value is null. + + + + Gets or sets the value of the parameter. + + An Object that is the value of the parameter. + The default value is null. + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + For classes representing messages sent from the client to the server. + + + + + Writes given objects into a stream for PostgreSQL COPY in default copy format (not CSV or BINARY). + + + + + Return an exact copy of this NpgsqlConnectionString. + + + + + This function will set value for known key, both private member and base[key]. + + + + + + + The function will modify private member only, not base[key]. + + + + + + + Clear the member and assign them to the default value. + + + + + Compatibilty version. When possible, behaviour caused by breaking changes will be preserved + if this version is less than that where the breaking change was introduced. + + + + + Case insensative accessor for indivual connection string values. + + + + + Common base class for all derived MD5 implementations. + + + + + Called from constructor of derived class. + + + + + Finalizer for HashAlgorithm + + + + + Computes the entire hash of all the bytes in the byte array. + + + + + When overridden in a derived class, drives the hashing function. + + + + + + + + When overridden in a derived class, this pads and hashes whatever data might be left in the buffers and then returns the hash created. + + + + + When overridden in a derived class, initializes the object to prepare for hashing. + + + + + Used for stream chaining. Computes hash as data passes through it. + + The buffer from which to grab the data to be copied. + The offset into the input buffer to start reading at. + The number of bytes to be copied. + The buffer to write the copied data to. + At what point in the outputBuffer to write the data at. + + + + Used for stream chaining. Computes hash as data passes through it. Finishes off the hash. + + The buffer from which to grab the data to be copied. + The offset into the input buffer to start reading at. + The number of bytes to be copied. + + + + Get whether or not the hash can transform multiple blocks at a time. + Note: MUST be overriden if descendant can transform multiple block + on a single call! + + + + + Gets the previously computed hash. + + + + + Returns the size in bits of the hash. + + + + + Must be overriden if not 1 + + + + + Must be overriden if not 1 + + + + + Called from constructor of derived class. + + + + + Creates the default derived class. + + + + + Given a join expression and a projection, fetch all columns in the projection + that reference columns in the join. + + + + + Given an InputExpression append all from names (including nested joins) to the list. + + + + + Get new ColumnExpression that will be used in projection that had it's existing columns moved. + These should be simple references to the inner column + + + + + Every property accessed in the list of columns must be adjusted for a new scope + + + + + This class provides many util methods to handle + reading and writing of PostgreSQL protocol messages. + + + + + This method takes a ProtocolVersion and returns an integer + version number that the Postgres backend will recognize in a + startup packet. + + + + + This method takes a version string as returned by SELECT VERSION() and returns + a valid version string ("7.2.2" for example). + This is only needed when running protocol version 2. + This does not do any validity checks. + + + + + This method gets a C NULL terminated string from the network stream. + It keeps reading a byte in each time until a NULL byte is returned. + It returns the resultant string of bytes read. + This string is sent from backend. + + + + + Reads requested number of bytes from stream with retries until Stream.Read returns 0 or count is reached. + + Stream to read + byte buffer to fill + starting position to fill the buffer + number of bytes to read + The number of bytes read. May be less than count if no more bytes are available. + + + + This method writes a C NULL terminated string to the network stream. + It appends a NULL terminator to the end of the String. + + + This method writes a C NULL terminated string to the network stream. + It appends a NULL terminator to the end of the String. + + + + + This method writes a C NULL terminated string limited in length to the + backend server. + It pads the string with null bytes to the size specified. + + + + + Write a 32-bit integer to the given stream in the correct byte order. + + + + + Read a 32-bit integer from the given stream in the correct byte order. + + + + + Write a 16-bit integer to the given stream in the correct byte order. + + + + + Read a 16-bit integer from the given stream in the correct byte order. + + + + + Represent the frontend/backend protocol version. + + + + + Represent the backend server version. + As this class offers no functionality beyond that offered by it has been + deprecated in favour of that class. + + + + + + Returns the string representation of this version in three place dot notation (Major.Minor.Patch). + + + + + Server version major number. + + + + + Server version minor number. + + + + + Server version patch level number. + + + + + Represents a PostgreSQL COPY TO STDOUT operation with a corresponding SQL statement + to execute against a PostgreSQL database + and an associated stream used to write results to (if provided by user) + or for reading the results (when generated by driver). + Eg. new NpgsqlCopyOut("COPY (SELECT * FROM mytable) TO STDOUT", connection, streamToWrite).Start(); + + + + + Creates NpgsqlCommand to run given query upon Start(), after which CopyStream provides data from database as requested in the query. + + + + + Given command is run upon Start(), after which CopyStream provides data from database as requested in the query. + + + + + Given command is executed upon Start() and all requested copy data is written to toStream immediately. + + + + + Returns true if this operation is currently active and field at given location is in binary format. + + + + + Command specified upon creation is executed as a non-query. + If CopyStream is set upon creation, all copy data from server will be written to it, and operation will be finished immediately. + Otherwise the CopyStream member can be used for reading copy data from server until no more data is available. + + + + + Flush generated CopyStream at once. Effectively reads and discard all the rest of copy data from server. + + + + + Returns true if the connection is currently reserved for this operation. + + + + + The stream provided by user or generated upon Start() + + + + + The Command used to execute this copy operation. + + + + + Returns true if this operation is currently active and in binary format. + + + + + Returns number of fields if this operation is currently active, otherwise -1 + + + + + Faster alternative to using the generated CopyStream. + + + + + This class manages all connector objects, pooled AND non-pooled. + + + + Unique static instance of the connector pool + mamager. + + + Map of index to unused pooled connectors, avaliable to the + next RequestConnector() call. + This hashmap will be indexed by connection string. + This key will hold a list of queues of pooled connectors available to be used. + + + Timer for tracking unused connections in pools. + + + + Searches the shared and pooled connector lists for a + matching connector object or creates a new one. + + The NpgsqlConnection that is requesting + the connector. Its ConnectionString will be used to search the + pool for available connectors. + A connector object. + + + + Find a pooled connector. Handle locking and timeout here. + + + + + Find a pooled connector. Handle shared/non-shared here. + + + + + Releases a connector, possibly back to the pool for future use. + + + Pooled connectors will be put back into the pool if there is room. + Shared connectors should just have their use count decremented + since they always stay in the shared pool. + + The connector to release. + + + + Release a pooled connector. Handle locking here. + + + + + Release a pooled connector. Handle shared/non-shared here. + + + + + Create a connector without any pooling functionality. + + + + + Find an available pooled connector in the non-shared pool, or create + a new one if none found. + + + + + This method is only called when NpgsqlConnection.Dispose(false) is called which means a + finalization. This also means, an NpgsqlConnection was leak. We clear pool count so that + client doesn't end running out of connections from pool. When the connection is finalized, its underlying + socket is closed. + + + + + Close the connector. + + + Connector to release + + + + Put a pooled connector into the pool queue. + + Connector to pool + + + + A queue with an extra Int32 for keeping track of busy connections. + + + + + The number of pooled Connectors that belong to this queue but + are currently in use. + + + + + This class represents a BackEndKeyData message received + from PostgreSQL + + + + + Used when a connection is closed + + + + + Summary description for NpgsqlQuery + + + + + Represents the method that handles the Notice events. + + A NpgsqlNoticeEventArgs that contains the event data. + + + + Represents the method that handles the Notification events. + + The source of the event. + A NpgsqlNotificationEventArgs that contains the event data. + + + + This class represents a connection to a + PostgreSQL server. + + + + + Initializes a new instance of the + NpgsqlConnection class. + + + + + Initializes a new instance of the + NpgsqlConnection class + and sets the ConnectionString. + + The connection used to open the PostgreSQL database. + + + + Begins a database transaction with the specified isolation level. + + The isolation level under which the transaction should run. + An DbTransaction + object representing the new transaction. + + Currently the IsolationLevel ReadCommitted and Serializable are supported by the PostgreSQL backend. + There's no support for nested transactions. + + + + + Begins a database transaction. + + A NpgsqlTransaction + object representing the new transaction. + + Currently there's no support for nested transactions. + + + + + Begins a database transaction with the specified isolation level. + + The isolation level under which the transaction should run. + A NpgsqlTransaction + object representing the new transaction. + + Currently the IsolationLevel ReadCommitted and Serializable are supported by the PostgreSQL backend. + There's no support for nested transactions. + + + + + Opens a database connection with the property settings specified by the + ConnectionString. + + + + + This method changes the current database by disconnecting from the actual + database and connecting to the specified. + + The name of the database to use in place of the current database. + + + + Releases the connection to the database. If the connection is pooled, it will be + made available for re-use. If it is non-pooled, the actual connection will be shutdown. + + + + + Creates and returns a DbCommand + object associated with the IDbConnection. + + A DbCommand object. + + + + Creates and returns a NpgsqlCommand + object associated with the NpgsqlConnection. + + A NpgsqlCommand object. + + + + Releases all resources used by the + NpgsqlConnection. + + true when called from Dispose(); + false when being called from the finalizer. + + + + Create a new connection based on this one. + + A new NpgsqlConnection object. + + + + Create a new connection based on this one. + + A new NpgsqlConnection object. + + + + Default SSL CertificateSelectionCallback implementation. + + + + + Default SSL CertificateValidationCallback implementation. + + + + + Default SSL PrivateKeySelectionCallback implementation. + + + + + Default SSL ProvideClientCertificatesCallback implementation. + + + + + Write each key/value pair in the connection string to the log. + + + + + Returns the supported collections + + + + + Returns the schema collection specified by the collection name. + + The collection name. + The collection specified. + + + + Returns the schema collection specified by the collection name filtered by the restrictions. + + The collection name. + + The restriction values to filter the results. A description of the restrictions is contained + in the Restrictions collection. + + The collection specified. + + + + Occurs on NoticeResponses from the PostgreSQL backend. + + + + + Occurs on NotificationResponses from the PostgreSQL backend. + + + + + Called to provide client certificates for SSL handshake. + + + + + Mono.Security.Protocol.Tls.CertificateSelectionCallback delegate. + + + + + Mono.Security.Protocol.Tls.CertificateValidationCallback delegate. + + + + + Mono.Security.Protocol.Tls.PrivateKeySelectionCallback delegate. + + + + + Gets or sets the string used to connect to a PostgreSQL database. + Valid values are: +
    +
  • + Server: Address/Name of Postgresql Server; +
  • +
  • + Port: Port to connect to; +
  • +
  • + Protocol: Protocol version to use, instead of automatic; Integer 2 or 3; +
  • +
  • + Database: Database name. Defaults to user name if not specified; +
  • +
  • + User Id: User name; +
  • +
  • + Password: Password for clear text authentication; +
  • +
  • + SSL: True or False. Controls whether to attempt a secure connection. Default = False; +
  • +
  • + Pooling: True or False. Controls whether connection pooling is used. Default = True; +
  • +
  • + MinPoolSize: Min size of connection pool; +
  • +
  • + MaxPoolSize: Max size of connection pool; +
  • +
  • + Timeout: Time to wait for connection open in seconds. Default is 15. +
  • +
  • + CommandTimeout: Time to wait for command to finish execution before throw an exception. In seconds. Default is 20. +
  • +
  • + Sslmode: Mode for ssl connection control. Can be Prefer, Require, Allow or Disable. Default is Disable. Check user manual for explanation of values. +
  • +
  • + ConnectionLifeTime: Time to wait before closing unused connections in the pool in seconds. Default is 15. +
  • +
  • + SyncNotification: Specifies if Npgsql should use synchronous notifications. +
  • +
  • + SearchPath: Changes search path to specified and public schemas. +
  • +
+
+ The connection string that includes the server name, + the database name, and other parameters needed to establish + the initial connection. The default value is an empty string. + +
+ + + Backend server host name. + + + + + Backend server port. + + + + + If true, the connection will attempt to use SSL. + + + + + Gets the time to wait while trying to establish a connection + before terminating the attempt and generating an error. + + The time (in seconds) to wait for a connection to open. The default value is 15 seconds. + + + + Gets the time to wait while trying to execute a command + before terminating the attempt and generating an error. + + The time (in seconds) to wait for a command to complete. The default value is 20 seconds. + + + + Gets the time to wait before closing unused connections in the pool if the count + of all connections exeeds MinPoolSize. + + + If connection pool contains unused connections for ConnectionLifeTime seconds, + the half of them will be closed. If there will be unused connections in a second + later then again the half of them will be closed and so on. + This strategy provide smooth change of connection count in the pool. + + The time (in seconds) to wait. The default value is 15 seconds. + + + + Gets the name of the current database or the database to be used after a connection is opened. + + The name of the current database or the name of the database to be + used after a connection is opened. The default value is the empty string. + + + + Whether datareaders are loaded in their entirety (for compatibility with earlier code). + + + + + Gets the database server name. + + + + + Gets flag indicating if we are using Synchronous notification or not. + The default value is false. + + + + + Gets the current state of the connection. + + A bitwise combination of the ConnectionState values. The default is Closed. + + + + Gets whether the current state of the connection is Open or Closed + + ConnectionState.Open or ConnectionState.Closed + + + + Version of the PostgreSQL backend. + This can only be called when there is an active connection. + + + + + Protocol version in use. + This can only be called when there is an active connection. + + + + + Process id of backend server. + This can only be called when there is an active connection. + + + + + The connector object connected to the backend. + + + + + Gets the NpgsqlConnectionStringBuilder containing the parsed connection string values. + + + + + User name. + + + + + Password. + + + + + Determine if connection pooling will be used for this connection. + + + + + This class represents the CancelRequest message sent to PostgreSQL + server. + + + + + + + + + + + + + + + + + + + A time period expressed in 100ns units. + + + A time period expressed in a + + + Number of 100ns units. + + + Number of seconds. + + + Number of milliseconds. + + + Number of milliseconds. + + + Number of milliseconds. + + + A d with the given number of ticks. + + + A d with the given number of microseconds. + + + A d with the given number of milliseconds. + + + A d with the given number of seconds. + + + A d with the given number of minutes. + + + A d with the given number of hours. + + + A d with the given number of days. + + + A d with the given number of months. + + + An whose values are the sums of the two instances. + + + An whose values are the differences of the two instances. + + + An whose value is the negated value of this instance. + + + An whose value is the absolute value of this instance. + + + + An based on this one, but with any days converted to multiples of ±24hours. + + + + An based on this one, but with any months converted to multiples of ±30days. + + + + An based on this one, but with any months converted to multiples of ±30days and then any days converted to multiples of ±24hours; + + + + An eqivalent, canonical, . + + + An equivalent . + + + + + + An signed integer. + + + + The argument is not an . + + + The string was not in a format that could be parsed to produce an . + + + true if the parsing succeeded, false otherwise. + + + The representation. + + + An whose values are the sum of the arguments. + + + An whose values are the difference of the arguments + + + true if the two arguments are exactly the same, false otherwise. + + + false if the two arguments are exactly the same, true otherwise. + + + true if the first is less than second, false otherwise. + + + true if the first is less than or equivalent to second, false otherwise. + + + true if the first is greater than second, false otherwise. + + + true if the first is greater than or equivalent to the second, false otherwise. + + + The argument. + + + The negation of the argument. + + + + + + + + + + + + + + + + + + + + This time, normalised + + + + + + + + + This time, normalised + + + An integer which is 0 if they are equal, < 0 if this is the smaller and > 0 if this is the larger. + + + + + + + + + A class to handle everything associated with SSPI authentication + + + + + Simplified SecBufferDesc struct with only one SecBuffer + + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + EventArgs class to send Notice parameters, which are just NpgsqlError's in a lighter context. + + + + + Notice information. + + + + + This class represents the ErrorResponse and NoticeResponse + message sent from PostgreSQL server. + + + + + Return a string representation of this error object. + + + + + Severity code. All versions. + + + + + Error code. PostgreSQL 7.4 and up. + + + + + Terse error message. All versions. + + + + + Detailed error message. PostgreSQL 7.4 and up. + + + + + Suggestion to help resolve the error. PostgreSQL 7.4 and up. + + + + + Position (one based) within the query string where the error was encounterd. PostgreSQL 7.4 and up. + + + + + Position (one based) within the query string where the error was encounterd. This position refers to an internal command executed for example inside a PL/pgSQL function. PostgreSQL 7.4 and up. + + + + + Internal query string where the error was encounterd. This position refers to an internal command executed for example inside a PL/pgSQL function. PostgreSQL 7.4 and up. + + + + + Trace back information. PostgreSQL 7.4 and up. + + + + + Source file (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Source file line number (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Source routine (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + String containing the sql sent which produced this error. + + + + + Backend protocol version in use. + + + + + Represents an ongoing COPY TO STDOUT operation. + Provides methods to read data from server or end the operation. + + + + This class represents the base class for the state pattern design pattern + implementation. + + + + + + This method is used by the states to change the state of the context. + + + + + This method is responsible to handle all protocol messages sent from the backend. + It holds all the logic to do it. + To exchange data, it uses a Mediator object from which it reads/writes information + to handle backend requests. + + + + + + This method is responsible to handle all protocol messages sent from the backend. + It holds all the logic to do it. + To exchange data, it uses a Mediator object from which it reads/writes information + to handle backend requests. + + + + + + Called from NpgsqlState.ProcessBackendResponses upon CopyOutResponse. + If CopyStream is already set, it is used to write data received from server, after which the copy ends. + Otherwise CopyStream is set to a readable NpgsqlCopyOutStream that receives data from server. + + + + + Called from NpgsqlOutStream.Read to read copy data from server. + + + + + Copy format information returned from server. + + + + + Handles serialisation of .NET array or IEnumeration to pg format. + Arrays of arrays, enumerations of enumerations, arrays of enumerations etc. + are treated as multi-dimensional arrays (in much the same manner as an array of arrays + is used to emulate multi-dimensional arrays in languages that lack native support for them). + If such an enumeration of enumerations is "jagged" (as opposed to rectangular, cuboid, + hypercuboid, hyperhypercuboid, etc) then this class will "correctly" serialise it, but pg + will raise an error as it doesn't allow jagged arrays. + + + + + Create an ArrayNativeToBackendTypeConverter with the element converter passed + + The that would be used to serialise the element type. + + + + Serialise the enumeration or array. + + + + + Handles parsing of pg arrays into .NET arrays. + + + + + Takes a string representation of a pg 1-dimensional array + (or a 1-dimensional row within an n-dimensional array) + and allows enumeration of the string represenations of each items. + + + + + Takes a string representation of a pg n-dimensional array + and allows enumeration of the string represenations of the next + lower level of rows (which in turn can be taken as (n-1)-dimensional arrays. + + + + + Takes an ArrayList which may be an ArrayList of ArrayLists, an ArrayList of ArrayLists of ArrayLists + and so on and enumerates the items that aren't ArrayLists (the leaf nodes if we think of the ArrayList + passed as a tree). Simply uses the ArrayLists' own IEnumerators to get that of the next, + pushing them onto a stack until we hit something that isn't an ArrayList. + ArrayList to enumerate + IEnumerable + + + + + Create a new ArrayBackendToNativeTypeConverter + + for the element type. + + + + Creates an array from pg representation. + + + + + Creates an array list from pg represenation of an array. + Multidimensional arrays are treated as ArrayLists of ArrayLists + + + + + Creates an n-dimensional array from an ArrayList of ArrayLists or + a 1-dimensional array from something else. + + to convert + produced. + + + + Takes an array of ints and treats them like the limits of a set of counters. + Retains a matching set of ints that is set to all zeros on the first ++ + On a ++ it increments the "right-most" int. If that int reaches it's + limit it is set to zero and the one before it is incremented, and so on. + + Making this a more general purpose class is pretty straight-forward, but we'll just put what we need here. + + + + + This class represents the ParameterStatus message sent from PostgreSQL + server. + + + + + + This class is responsible for serving as bridge between the backend + protocol handling and the core classes. It is used as the mediator for + exchanging data generated/sent from/to backend. + + + + + + This class is responsible to create database commands for automatic insert, update and delete operations. + + + + + + This method is reponsible to derive the command parameter list with values obtained from function definition. + It clears the Parameters collection of command. Also, if there is any parameter type which is not supported by Npgsql, an InvalidOperationException will be thrown. + Parameters name will be parameter1, parameter2, ... + For while, only parameter name and NpgsqlDbType are obtained. + + NpgsqlCommand whose function parameters will be obtained. + + + + Represents a completed response message. + + + + + + Marker interface which identifies a class which may take possession of a stream for the duration of + it's lifetime (possibly temporarily giving that possession to another class for part of that time. + + It inherits from IDisposable, since any such class must make sure it leaves the stream in a valid state. + + The most important such class is that compiler-generated from ProcessBackendResponsesEnum. Of course + we can't make that inherit from this interface, alas. + + + + + The exception that is thrown when the PostgreSQL backend reports errors. + + + + + Construct a backend error exception based on a list of one or more + backend errors. The basic Exception.Message will be built from the + first (usually the only) error in the list. + + + + + Format a .NET style exception string. + Include all errors in the list, including any hints. + + + + + Append a line to the given Stream, first checking for zero-length. + + + + + Provide access to the entire list of errors provided by the PostgreSQL backend. + + + + + Severity code. All versions. + + + + + Error code. PostgreSQL 7.4 and up. + + + + + Basic error message. All versions. + + + + + Detailed error message. PostgreSQL 7.4 and up. + + + + + Suggestion to help resolve the error. PostgreSQL 7.4 and up. + + + + + Position (one based) within the query string where the error was encounterd. PostgreSQL 7.4 and up. + + + + + Trace back information. PostgreSQL 7.4 and up. + + + + + Source file (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Source file line number (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Source routine (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + String containing the sql sent which produced this error. + + + + + Returns the entire list of errors provided by the PostgreSQL backend. + + + + + The level of verbosity of the NpgsqlEventLog + + + + + Don't log at all + + + + + Only log the most common issues + + + + + Log everything + + + + + This class handles all the Npgsql event and debug logging + + + + + Writes a string to the Npgsql event log if msglevel is bigger then NpgsqlEventLog.Level + + + This method is obsolete and should no longer be used. + It is likely to be removed in future versions of Npgsql + + The message to write to the event log + The minimum LogLevel for which this message should be logged. + + + + Writes a string to the Npgsql event log if msglevel is bigger then NpgsqlEventLog.Level + + The ResourceManager to get the localized resources + The name of the resource that should be fetched by the ResourceManager + The minimum LogLevel for which this message should be logged. + The additional parameters that shall be included into the log-message (must be compatible with the string in the resource): + + + + Writes the default log-message for the action of calling the Get-part of an Indexer to the log file. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Indexer + The parameter given to the Indexer + + + + Writes the default log-message for the action of calling the Set-part of an Indexer to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Indexer + The parameter given to the Indexer + The value the Indexer is set to + + + + Writes the default log-message for the action of calling the Get-part of a Property to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Property + The name of the Property + + + + Writes the default log-message for the action of calling the Set-part of a Property to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Property + The name of the Property + The value the Property is set to + + + + Writes the default log-message for the action of calling a Method without Arguments to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + + + + Writes the default log-message for the action of calling a Method with one Argument to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + The value of the Argument of the Method + + + + Writes the default log-message for the action of calling a Method with two Arguments to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + The value of the first Argument of the Method + The value of the second Argument of the Method + + + + Writes the default log-message for the action of calling a Method with three Arguments to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + The value of the first Argument of the Method + The value of the second Argument of the Method + The value of the third Argument of the Method + + + + Writes the default log-message for the action of calling a Method with more than three Arguments to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + A Object-Array with zero or more Ojects that are Arguments of the Method. + + + + Sets/Returns the level of information to log to the logfile. + + The current LogLevel + + + + Sets/Returns the filename to use for logging. + + The filename of the current Log file. + + + + Sets/Returns whether Log messages should be echoed to the console + + true if Log messages are echoed to the console, otherwise false + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + Represents a PostgreSQL COPY FROM STDIN operation with a corresponding SQL statement + to execute against a PostgreSQL database + and an associated stream used to read data from (if provided by user) + or for writing it (when generated by driver). + Eg. new NpgsqlCopyIn("COPY mytable FROM STDIN", connection, streamToRead).Start(); + + + + + Creates NpgsqlCommand to run given query upon Start(). Data for the requested COPY IN operation can then be written to CopyData stream followed by a call to End() or Cancel(). + + + + + Given command is run upon Start(). Data for the requested COPY IN operation can then be written to CopyData stream followed by a call to End() or Cancel(). + + + + + Given command is executed upon Start() and all data from fromStream is passed to it as copy data. + + + + + Returns true if this operation is currently active and field at given location is in binary format. + + + + + Command specified upon creation is executed as a non-query. + If CopyStream is set upon creation, it will be flushed to server as copy data, and operation will be finished immediately. + Otherwise the CopyStream member can be used for writing copy data to server and operation finished with a call to End() or Cancel(). + + + + + Called after writing all data to CopyStream to successfully complete this copy operation. + + + + + Withdraws an already started copy operation. The operation will fail with given error message. + Will do nothing if current operation is not active. + + + + + Returns true if the connection is currently reserved for this operation. + + + + + The stream provided by user or generated upon Start(). + User may provide a stream to constructor; it is used to pass to server all data read from it. + Otherwise, call to Start() sets this to a writable NpgsqlCopyInStream that passes all data written to it to server. + In latter case this is only available while the copy operation is active and null otherwise. + + + + + Returns true if this operation is currently active and in binary format. + + + + + Returns number of fields expected on each input row if this operation is currently active, otherwise -1 + + + + + The Command used to execute this copy operation. + + + + + Set before a COPY IN query to define size of internal buffer for reading from given CopyStream. + + + + + Represents information about COPY operation data transfer format as returned by server. + + + + + Only created when a CopyInResponse or CopyOutResponse is received by NpgsqlState.ProcessBackendResponses() + + + + + Returns true if this operation is currently active and field at given location is in binary format. + + + + + Returns true if this operation is currently active and in binary format. + + + + + Returns number of fields if this operation is currently active, otherwise -1 + + + + + + + + + Provide event handlers to convert all native supported basic data types from their backend + text representation to a .NET object. + + + + + Binary data. + + + + + Convert a postgresql boolean to a System.Boolean. + + + + + Convert a postgresql bit to a System.Boolean. + + + + + Convert a postgresql datetime to a System.DateTime. + + + + + Convert a postgresql date to a System.DateTime. + + + + + Convert a postgresql time to a System.DateTime. + + + + + Convert a postgresql money to a System.Decimal. + + + + + Provide event handlers to convert the basic native supported data types from + native form to backend representation. + + + + + Binary data. + + + + + Convert to a postgresql boolean. + + + + + Convert to a postgresql bit. + + + + + Convert to a postgresql timestamp. + + + + + Convert to a postgresql date. + + + + + Convert to a postgresql time. + + + + + Convert to a postgres money. + + + + + Provide event handlers to convert extended native supported data types from their backend + text representation to a .NET object. + + + + + Convert a postgresql point to a System.NpgsqlPoint. + + + + + Convert a postgresql point to a System.RectangleF. + + + + + LDeg. + + + + + Path. + + + + + Polygon. + + + + + Circle. + + + + + Inet. + + + + + interval + + + + + Provide event handlers to convert extended native supported data types from + native form to backend representation. + + + + + Point. + + + + + Box. + + + + + LSeg. + + + + + Open path. + + + + + Polygon. + + + + + Circle. + + + + + Convert to a postgres inet. + + + + + Convert to a postgres interval + + + + + EventArgs class to send Notification parameters. + + + + + Process ID of the PostgreSQL backend that sent this notification. + + + + + Condition that triggered that notification. + + + + + Additional Information From Notifiying Process (for future use, currently postgres always sets this to an empty string) + + + + + Resolve a host name or IP address. + This is needed because if you call Dns.Resolve() with an IP address, it will attempt + to resolve it as a host name, when it should just convert it to an IP address. + + + + + + This class represents a RowDescription message sent from + the PostgreSQL. + + + + + + This struct represents the internal data of the RowDescription message. + + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + A factory to create instances of various Npgsql objects. + + + + + Creates an NpgsqlCommand object. + + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + Represents the method that handles the RowUpdated events. + + The source of the event. + A NpgsqlRowUpdatedEventArgs that contains the event data. + + + + Represents the method that handles the RowUpdating events. + + The source of the event. + A NpgsqlRowUpdatingEventArgs that contains the event data. + + + + This class represents an adapter from many commands: select, update, insert and delete to fill Datasets. + + + + + Stream for reading data from a table or select on a PostgreSQL version 7.4 or newer database during an active COPY TO STDOUT operation. + Passes data exactly as provided by the server. + + + + + Created only by NpgsqlCopyOutState.StartCopy() + + + + + Discards copy data as long as server pushes it. Returns after operation is finished. + Does nothing if this stream is not the active copy operation reader. + + + + + Not writable. + + + + + Not flushable. + + + + + Copies data read from server to given byte buffer. + Since server returns data row by row, length will differ each time, but it is only zero once the operation ends. + Can be mixed with calls to the more efficient NpgsqlCopyOutStream.Read() : byte[] though that would not make much sense. + + + + + Not seekable + + + + + Not supported + + + + + Returns a whole row of data from server without extra work. + If standard Stream.Read(...) has been called before, it's internal buffers remains are returned. + + + + + True while this stream can be used to read copy data from server + + + + + True + + + + + False + + + + + False + + + + + Number of bytes read so far + + + + + Number of bytes read so far; can not be set. + + + + + This class represents the Bind message sent to PostgreSQL + server. + + + + + + Summary description for LargeObjectManager. + + + + + Represents a transaction to be made in a PostgreSQL database. This class cannot be inherited. + + + + + Commits the database transaction. + + + + + Rolls back a transaction from a pending state. + + + + + Rolls back a transaction from a pending savepoint state. + + + + + Creates a transaction save point. + + + + + Cancel the transaction without telling the backend about it. This is + used to make the transaction go away when closing a connection. + + + + + Gets the NpgsqlConnection + object associated with the transaction, or a null reference if the + transaction is no longer valid. + + The NpgsqlConnection + object associated with the transaction. + + + + Specifies the IsolationLevel for this transaction. + + The IsolationLevel for this transaction. + The default is ReadCommitted. + + + + This class represents a StartupPacket message of PostgreSQL + protocol. + + + + + + Provides a means of reading a forward-only stream of rows from a PostgreSQL backend. This class cannot be inherited. + + + + + Return the data type name of the column at index . + + + + + Return the data type of the column at index . + + + + + Return the Npgsql specific data type of the column at requested ordinal. + + column position + Appropriate Npgsql type for column. + + + + Return the column name of the column at index . + + + + + Return the data type OID of the column at index . + + FIXME: Why this method returns String? + + + + Return the column name of the column named . + + + + + Return the data DbType of the column at index . + + + + + Return the data NpgsqlDbType of the column at index . + + + + + Get the value of a column as a . + If the differences between and + in handling of days and months is not important to your application, use + instead. + + Index of the field to find. + value of the field. + + + + Gets the value of a column converted to a Guid. + + + + + Gets the value of a column as Int16. + + + + + Gets the value of a column as Int32. + + + + + Gets the value of a column as Int64. + + + + + Gets the value of a column as Single. + + + + + Gets the value of a column as Double. + + + + + Gets the value of a column as String. + + + + + Gets the value of a column as Decimal. + + + + + Copy values from each column in the current row into . + + The number of column values copied. + + + + Copy values from each column in the current row into . + + An array appropriately sized to store values from all columns. + The number of column values copied. + + + + Gets the value of a column as Boolean. + + + + + Gets the value of a column as Byte. Not implemented. + + + + + Gets the value of a column as Char. + + + + + Gets the value of a column as DateTime. + + + + + Returns a System.Data.DataTable that describes the column metadata of the DataReader. + + + + + This methods parses the command text and tries to get the tablename + from it. + + + + + Is raised whenever Close() is called. + + + + + Gets the number of columns in the current row. + + + + + Gets the value of a column in its native format. + + + + + Gets the value of a column in its native format. + + + + + Gets a value indicating the depth of nesting for the current row. Always returns zero. + + + + + Gets a value indicating whether the data reader is closed. + + + + + Contains the column names as the keys + + + + + Contains all unique columns + + + + + This is the primary implementation of NpgsqlDataReader. It is the one used in normal cases (where the + preload-reader option is not set in the connection string to resolve some potential backwards-compatibility + issues), the only implementation used internally, and in cases where CachingDataReader is used, it is still + used to do the actual "leg-work" of turning a response stream from the server into a datareader-style + object - with CachingDataReader then filling it's cache from here. + + + + + Iterate through the objects returned through from the server. + If it's a CompletedResponse the rowsaffected count is updated appropriately, + and we iterate again, otherwise we return it (perhaps updating our cache of pending + rows if appropriate). + + The next we will deal with. + + + + Advances the data reader to the next result, when multiple result sets were returned by the PostgreSQL backend. + + True if the reader was advanced, otherwise false. + + + + Releases the resources used by the NpgsqlCommand. + + + + + Closes the data reader object. + + + + + Advances the data reader to the next result, when multiple result sets were returned by the PostgreSQL backend. + + True if the reader was advanced, otherwise false. + + + + Advances the data reader to the next row. + + True if the reader was advanced, otherwise false. + + + + Return the value of the column at index . + + + + + Gets raw data from a column. + + + + + Gets raw data from a column. + + + + + Report whether the value in a column is DBNull. + + + + + Gets the number of rows changed, inserted, or deleted by execution of the SQL statement. + + + + + Indicates if NpgsqlDatareader has rows to be read. + + + + + Provides an implementation of NpgsqlDataReader in which all data is pre-loaded into memory. + This operates by first creating a ForwardsOnlyDataReader as usual, and then loading all of it's + Rows into memory. There is a general principle that when there is a trade-off between a class design that + is more efficient and/or scalable on the one hand and one that is less efficient but has more functionality + (in this case the internal-only functionality of caching results) that one can build the less efficent class + from the most efficient without significant extra loss in efficiency, but not the other way around. The relationship + between ForwardsOnlyDataReader and CachingDataReader is an example of this). + Since the interface presented to the user is still forwards-only, queues are used to + store this information, so that dequeueing as we go we give the garbage collector the best opportunity + possible to reclaim any memory that is no longer in use. + ForwardsOnlyDataReader being used to actually + obtain the information from the server means that the "leg-work" is still only done (and need only be + maintained) in one place. + This class exists to allow for certain potential backwards-compatibility issues to be resolved + with little effort on the part of affected users. It is considerably less efficient than ForwardsOnlyDataReader + and hence never used internally. + + + + + Represents the method that allows the application to provide a certificate collection to be used for SSL clien authentication + + A X509CertificateCollection to be filled with one or more client certificates. + + + + !!! Helper class, for compilation only. + Connector implements the logic for the Connection Objects to + access the physical connection to the database, and isolate + the application developer from connection pooling internals. + + + + + Constructor. + + Controls whether the connector can be shared. + + + + This method checks if the connector is still ok. + We try to send a simple query text, select 1 as ConnectionTest; + + + + + This method is responsible for releasing all resources associated with this Connector. + + + + + This method is responsible to release all portals used by this Connector. + + + + + Default SSL CertificateSelectionCallback implementation. + + + + + Default SSL CertificateValidationCallback implementation. + + + + + Default SSL PrivateKeySelectionCallback implementation. + + + + + Default SSL ProvideClientCertificatesCallback implementation. + + + + + This method is required to set all the version dependent features flags. + SupportsPrepare means the server can use prepared query plans (7.3+) + + + + + Opens the physical connection to the server. + + Usually called by the RequestConnector + Method of the connection pool manager. + + + + Closes the physical connection to the server. + + + + + Returns next portal index. + + + + + Returns next plan index. + + + + + Occurs on NoticeResponses from the PostgreSQL backend. + + + + + Occurs on NotificationResponses from the PostgreSQL backend. + + + + + Called to provide client certificates for SSL handshake. + + + + + Mono.Security.Protocol.Tls.CertificateSelectionCallback delegate. + + + + + Mono.Security.Protocol.Tls.CertificateValidationCallback delegate. + + + + + Mono.Security.Protocol.Tls.PrivateKeySelectionCallback delegate. + + + + + Gets the current state of the connection. + + + + + Return Connection String. + + + + + Version of backend server this connector is connected to. + + + + + Backend protocol version in use by this connector. + + + + + The physical connection stream to the backend. + + + + + The physical connection socket to the backend. + + + + + Reports if this connector is fully connected. + + + + + The connection mediator. + + + + + Report if the connection is in a transaction. + + + + + Report whether the current connection can support prepare functionality. + + + + + This class contains helper methods for type conversion between + the .Net type system and postgresql. + + + + + A cache of basic datatype mappings keyed by server version. This way we don't + have to load the basic type mappings for every connection. + + + + + Find a NpgsqlNativeTypeInfo in the default types map that can handle objects + of the given NpgsqlDbType. + + + + + Find a NpgsqlNativeTypeInfo in the default types map that can handle objects + of the given NpgsqlDbType. + + + + + Find a NpgsqlNativeTypeInfo in the default types map that can handle objects + of the given DbType. + + + + + Find a NpgsqlNativeTypeInfo in the default types map that can handle objects + of the given System.Type. + + + + + This method is responsible to convert the string received from the backend + to the corresponding NpgsqlType. + The given TypeInfo is called upon to do the conversion. + If no TypeInfo object is provided, no conversion is performed. + + + + + Create the one and only native to backend type map. + This map is used when formatting native data + types to backend representations. + + + + + This method creates (or retrieves from cache) a mapping between type and OID + of all natively supported postgresql data types. + This is needed as from one version to another, this mapping can be changed and + so we avoid hardcoding them. + + NpgsqlTypeMapping containing all known data types. The mapping must be + cloned before it is modified because it is cached; changes made by one connection may + effect another connection. + + + + Attempt to map types by issuing a query against pg_type. + This function takes a list of NpgsqlTypeInfo and attempts to resolve the OID field + of each by querying pg_type. If the mapping is found, the type info object is + updated (OID) and added to the provided NpgsqlTypeMapping object. + + NpgsqlConnector to send query through. + Mapping object to add types too. + List of types that need to have OID's mapped. + + + + Delegate called to convert the given backend data to its native representation. + + + + + Delegate called to convert the given native data to its backand representation. + + + + + Represents a backend data type. + This class can be called upon to convert a backend field representation to a native object. + + + + + Construct a new NpgsqlTypeInfo with the given attributes and conversion handlers. + + Type OID provided by the backend server. + Type name provided by the backend server. + NpgsqlDbType + System type to convert fields of this type to. + Data conversion handler. + + + + Perform a data conversion from a backend representation to + a native object. + + Data sent from the backend. + Type modifier field sent from the backend. + + + + Type OID provided by the backend server. + + + + + Type name provided by the backend server. + + + + + NpgsqlDbType. + + + + + NpgsqlDbType. + + + + + Provider type to convert fields of this type to. + + + + + System type to convert fields of this type to. + + + + + Represents a backend data type. + This class can be called upon to convert a native object to its backend field representation, + + + + + Returns an NpgsqlNativeTypeInfo for an array where the elements are of the type + described by the NpgsqlNativeTypeInfo supplied. + + + + + Construct a new NpgsqlTypeInfo with the given attributes and conversion handlers. + + Type name provided by the backend server. + NpgsqlDbType + Data conversion handler. + + + + Perform a data conversion from a native object to + a backend representation. + DBNull and null values are handled differently depending if a plain query is used + When + + Native .NET object to be converted. + Flag indicating if the conversion has to be done for + plain queries or extended queries + + + + Type name provided by the backend server. + + + + + NpgsqlDbType. + + + + + DbType. + + + + + Apply quoting. + + + + + Use parameter size information. + + + + + Provide mapping between type OID, type name, and a NpgsqlBackendTypeInfo object that represents it. + + + + + Construct an empty mapping. + + + + + Copy constuctor. + + + + + Add the given NpgsqlBackendTypeInfo to this mapping. + + + + + Add a new NpgsqlBackendTypeInfo with the given attributes and conversion handlers to this mapping. + + Type OID provided by the backend server. + Type name provided by the backend server. + NpgsqlDbType + System type to convert fields of this type to. + Data conversion handler. + + + + Make a shallow copy of this type mapping. + + + + + Determine if a NpgsqlBackendTypeInfo with the given backend type OID exists in this mapping. + + + + + Determine if a NpgsqlBackendTypeInfo with the given backend type name exists in this mapping. + + + + + Get the number of type infos held. + + + + + Retrieve the NpgsqlBackendTypeInfo with the given backend type OID, or null if none found. + + + + + Retrieve the NpgsqlBackendTypeInfo with the given backend type name, or null if none found. + + + + + Provide mapping between type Type, NpgsqlDbType and a NpgsqlNativeTypeInfo object that represents it. + + + + + Add the given NpgsqlNativeTypeInfo to this mapping. + + + + + Add a new NpgsqlNativeTypeInfo with the given attributes and conversion handlers to this mapping. + + Type name provided by the backend server. + NpgsqlDbType + Data conversion handler. + + + + Retrieve the NpgsqlNativeTypeInfo with the given NpgsqlDbType. + + + + + Retrieve the NpgsqlNativeTypeInfo with the given DbType. + + + + + Retrieve the NpgsqlNativeTypeInfo with the given Type. + + + + + Determine if a NpgsqlNativeTypeInfo with the given backend type name exists in this mapping. + + + + + Determine if a NpgsqlNativeTypeInfo with the given NpgsqlDbType exists in this mapping. + + + + + Determine if a NpgsqlNativeTypeInfo with the given Type name exists in this mapping. + + + + + Get the number of type infos held. + + + + + Implements for version 3 of the protocol. + + + + + Reads a row, field by field, allowing a DataRow to be built appropriately. + + + + + Reads part of a field, as needed (for + and + + + + + Adds further functionality to stream that is dependant upon the type of data read. + + + + + Completes the implementation of Streamer for char data. + + + + + Completes the implementation of Streamer for byte data. + + + + + Implements for version 2 of the protocol. + + + + + Encapsulates the null mapping bytes sent at the start of a version 2 + datarow message, and the process of identifying the nullity of the data + at a particular index + + + + + Provides the underlying mechanism for reading schema information. + + + + + Creates an NpgsqlSchema that can read schema information from the database. + + An open database connection for reading metadata. + + + + Returns the MetaDataCollections that lists all possible collections. + + The MetaDataCollections + + + + Returns the Restrictions that contains the meaning and position of the values in the restrictions array. + + The Restrictions + + + + Returns the Databases that contains a list of all accessable databases. + + The restrictions to filter the collection. + The Databases + + + + Returns the Tables that contains table and view names and the database and schema they come from. + + The restrictions to filter the collection. + The Tables + + + + Returns the Columns that contains information about columns in tables. + + The restrictions to filter the collection. + The Columns. + + + + Returns the Views that contains view names and the database and schema they come from. + + The restrictions to filter the collection. + The Views + + + + Returns the Users containing user names and the sysid of those users. + + The restrictions to filter the collection. + The Users. + + + + This is the abstract base class for NpgsqlAsciiRow and NpgsqlBinaryRow. + + + + + Implements a bit string; a collection of zero or more bits which can each be 1 or 0. + BitString's behave as a list of bools, though like most strings and unlike most collections the position + tends to be of as much significance as the value. + BitStrings are often used as masks, and are commonly cast to and from other values. + + + + + Represents the empty string. + + + + + Create a BitString from an enumeration of boolean values. The BitString will contain + those booleans in the order they came in. + + The boolean values. + + + + Creates a BitString filled with a given number of true or false values. + + The value to fill the string with. + The number of bits to fill. + + + + Creats a bitstring from a string. + The string to copy from. + + + + + + Creates a single-bit element from a boolean value. + + The bool value which determines whether + the bit is 1 or 0. + + + + Creates a bitstring from an unsigned integer value. The string will be the shortest required to + contain the integer (e.g. 1 bit for 0 or 1, 2 for 2 or 3, 3 for 4-7, and so on). + + The integer. + This method is not CLS Compliant, and may not be available to some languages. + + + + Creates a bitstring from an integer value. The string will be the shortest required to + contain the integer (e.g. 1 bit for 0 or 1, 2 for 2 or 3, 3 for 4-7, and so on). + + The integer. + + + + Finds the first instance of a given value + + The value - whether true or false - to search for. + The index of the value found, or -1 if none are present. + + + + True if there is at least one bit with the value looked for. + + The value - true or false - to detect. + True if at least one bit was the same as item, false otherwise. + + + + Copies the bitstring to an array of bools. + + The boolean array to copy to. + The index in the array to start copying from. + + + + Returns an enumerator that enumerates through the string. + + The enumerator. + + + + Creats a bitstring by concatenating another onto this one. + + The string to append to this one. + The combined strings. + + + + Returns a substring of this string. + + The position to start from, must be between 0 and the length of the string. + The length of the string to return, must be greater than zero, and may not be + so large that the start + length exceeds the bounds of this instance. + The Bitstring identified + + + + Returns a substring of this string. + + The position to start from, must be between 0 and the length of the string, + the rest of the string is returned. + The Bitstring identified + + + + A logical and between this string and another. The two strings must be the same length. + + Another BitString to AND with this one. + A bitstring with 1 where both BitStrings had 1 and 0 otherwise. + + + + A logical or between this string and another. The two strings must be the same length. + + Another BitString to OR with this one. + A bitstring with 1 where either BitString had 1 and 0 otherwise. + + + + A logical xor between this string and another. The two strings must be the same length. + + Another BitString to XOR with this one. + A bitstring with 1 where one BitStrings and the other had 0, + and 0 where they both had 1 or both had 0. + + + + A bitstring that is the logical inverse of this one. + + A bitstring of the same length as this with 1 where this has 0 and vice-versa. + + + + Shifts the string operand bits to the left, filling with zeros to produce a + string of the same length. + + The number of bits to shift to the left. + A left-shifted bitstring. + The behaviour of LShift is closer to what one would expect from dealing + with PostgreSQL bit-strings than in using the same operations on integers in .NET + In particular, negative operands result in a right-shift, and operands greater than + the length of the string will shift it entirely, resulting in a zero-filled string. + + + + + Shifts the string operand bits to the right, filling with zeros to produce a + string of the same length. + + The number of bits to shift to the right. + A right-shifted bitstring. + The behaviour of RShift is closer to what one would expect from dealing + with PostgreSQL bit-strings than in using the same operations on integers in .NET + In particular, negative operands result in a left-shift, and operands greater than + the length of the string will shift it entirely, resulting in a zero-filled string. It also performs + a logical shift, rather than an arithmetic shift, so it always sets the vacated bit positions to zero + (like PostgreSQL and like .NET for unsigned integers but not for signed integers). + + + + + Returns true if the this string is identical to the argument passed. + + + + + Compares two strings. Strings are compared as strings, so while 0 being less than 1 will + mean a comparison between two strings of the same size is the same as treating them as numbers, + in the case of two strings of differing lengths the comparison starts at the right-most (most significant) + bit, and if all bits of the shorter string are exhausted without finding a comparison, then the larger + string is deemed to be greater than the shorter (0010 is greater than 0001 but less than 00100). + + Another string to compare with this one. + A value if the two strings are identical, an integer less + than zero if this is less than the argument, and an integer greater + than zero otherwise. + + + + Compares the string with another object. + + The object to compare with. + If the object is null then this string is considered greater. If the object is another BitString + then they are compared as in the explicit comparison for BitStrings + in any other case a is thrown. + + + + Compares this BitString with an object for equality. + + + + + Returns a code for use in hashing operations. + + + + + Returns a string representation of the BitString. + + + A string which can contain a letter and optionally a number which sets a minimum size for the string + returned. In each case using the lower-case form of the letter will result in a lower-case string + being returned. + + + B + A string of 1s and 0s. + + + X + An hexadecimal string (will result in an error unless the string's length is divisible by 4). + + + G + A string of 1s and 0s in single-quotes preceded by 'B' (Postgres bit string literal syntax). + + Y + An hexadecimal string in single-quotes preceded by 'X' (Postgres bit literal syntax, will result in an error unless the string's length is divisible by 4. + + C + The format produced by format-string "Y" if legal, otherwise that produced by format-string "G". + E + The most compact safe representation for Postgres. If single bit will be either a 0 or a 1. Otherwise if it + can be that produce by format string "Y" it will, otherwise if there are less than 9bits in length it will be that + produced by format-string "G". For longer strings that cannot be represented in hexadecimal it will be a string + representing the first part of the string in format "Y" followed by the PostgreSQL concatenation operator, followed + by the final bits in the format "G". E.g. "X'13DCE'||B'110'" + If format is empty or null, it is treated as if "B" had been passed (the default repreesentation, and that + generally used by PostgreSQL for display). + + The formatted string. + + + + Returns a string representation for the Bitstring + + A string containing '0' and '1' characters. + + + + Returns the same string as . formatProvider is ignored. + + + + + Parses a string to produce a BitString. Most formats that can be produced by + can be accepted, but hexadecimal + can be interpreted with the preceding X' to mark the following characters as + being hexadecimal rather than binary. + + + + + Performs a logical AND on the two operands. + + + + + Performs a logcial OR on the two operands. + + + + + Perofrms a logical EXCLUSIVE-OR on the two operands + + + + + Performs a logical NOT on the operand. + + + + + Concatenates the operands. + + + + + Left-shifts the string BitString. + + + + + Right-shifts the string BitString. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Interprets the bitstring as a series of bits in an encoded character string, + encoded according to the Encoding passed, and returns that string. + The bitstring must contain a whole number of octets(bytes) and also be + valid according to the Encoding passed. + + The to use in producing the string. + The string that was encoded in the BitString. + + + + Interprets the bitstring as a series of octets (bytes) and returns those octets. Fails + if the Bitstring does not contain a whole number of octets (its length is not evenly + divisible by 8). + + + + + Interprets the bitstring as a series of signed octets (bytes) and returns those octets. Fails + if the Bitstring does not contain a whole number of octets (its length is not evenly + divisible by 8). + This method is not CLS-Compliant and may not be available to languages that cannot + handle signed bytes. + + + + + Interprets the bitstring as a series of unsigned 16-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 16. + This method is not CLS-Compliant and may not be available to languages that cannot + handle unsigned integers. + + + + + Interprets the bitstring as a series of 16-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 16. + + + + + Interprets the bitstring as a series of unsigned 32-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 32. + This method is not CLS-Compliant and may not be available to languages that cannot + handle unsigned integers. + + + + + Interprets the bitstring as a series of signed 32-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 32. + + + + + Interprets the bitstring as a series of unsigned 64-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 64. + This method is not CLS-Compliant and may not be available to languages that cannot + handle unsigned integers. + + + + + Interprets the bitstring as a series of signed 64-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 64. + + + + + The length of the string. + + + + + Retrieves the value of the bit at the given index. + + + + + C# implementation of the MD5 cryptographic hash function. + + + + + Creates a new MD5CryptoServiceProvider. + + + + + Drives the hashing function. + + Byte array containing the data to hash. + Where in the input buffer to start. + Size in bytes of the data in the buffer to hash. + + + + This finalizes the hash. Takes the data from the chaining variables and returns it. + + + + + Resets the class after use. Called automatically after hashing is done. + + + + + This is the meat of the hash function. It is what processes each block one at a time. + + Byte array to process data from. + Where in the byte array to start processing. + + + + Pads and then processes the final block. + + Buffer to grab data from. + Position in buffer in bytes to get data from. + How much data in bytes in the buffer to use. + + + + Stream for writing data to a table on a PostgreSQL version 7.4 or newer database during an active COPY FROM STDIN operation. + Passes data exactly as is and when given, so see to it that you use server encoding, correct format and reasonably sized writes! + + + + + Created only by NpgsqlCopyInState.StartCopy() + + + + + Successfully completes copying data to server. Returns after operation is finished. + Does nothing if this stream is not the active copy operation writer. + + + + + Withdraws an already started copy operation. The operation will fail with given error message. + Does nothing if this stream is not the active copy operation writer. + + + + + Writes given bytes to server. + Fails if this stream is not the active copy operation writer. + + + + + Flushes stream contents to server. + Fails if this stream is not the active copy operation writer. + + + + + Not readable + + + + + Not seekable + + + + + Not supported + + + + + True while this stream can be used to write copy data to server + + + + + False + + + + + True + + + + + False + + + + + Number of bytes written so far + + + + + Number of bytes written so far; not settable + + + + + Represents a SQL statement or function (stored procedure) to execute + against a PostgreSQL database. This class cannot be inherited. + + + + + Initializes a new instance of the NpgsqlCommand class. + + + + + Initializes a new instance of the NpgsqlCommand class with the text of the query. + + The text of the query. + + + + Initializes a new instance of the NpgsqlCommand class with the text of the query and a NpgsqlConnection. + + The text of the query. + A NpgsqlConnection that represents the connection to a PostgreSQL server. + + + + Initializes a new instance of the NpgsqlCommand class with the text of the query, a NpgsqlConnection, and the NpgsqlTransaction. + + The text of the query. + A NpgsqlConnection that represents the connection to a PostgreSQL server. + The NpgsqlTransaction in which the NpgsqlCommand executes. + + + + Used to execute internal commands. + + + + + Attempts to cancel the execution of a NpgsqlCommand. + + This Method isn't implemented yet. + + + + Create a new command based on this one. + + A new NpgsqlCommand object. + + + + Create a new command based on this one. + + A new NpgsqlCommand object. + + + + Creates a new instance of an DbParameter object. + + An DbParameter object. + + + + Creates a new instance of a NpgsqlParameter object. + + A NpgsqlParameter object. + + + + Slightly optimised version of ExecuteNonQuery() for internal ues in cases where the number + of affected rows is of no interest. + + + + + Executes a SQL statement against the connection and returns the number of rows affected. + + The number of rows affected if known; -1 otherwise. + + + + Sends the CommandText to + the Connection and builds a + NpgsqlDataReader + using one of the CommandBehavior values. + + One of the CommandBehavior values. + A NpgsqlDataReader object. + + + + Sends the CommandText to + the Connection and builds a + NpgsqlDataReader. + + A NpgsqlDataReader object. + + + + Sends the CommandText to + the Connection and builds a + NpgsqlDataReader + using one of the CommandBehavior values. + + One of the CommandBehavior values. + A NpgsqlDataReader object. + Currently the CommandBehavior parameter is ignored. + + + + This method binds the parameters from parameters collection to the bind + message. + + + + + Executes the query, and returns the first column of the first row + in the result set returned by the query. Extra columns or rows are ignored. + + The first column of the first row in the result set, + or a null reference if the result set is empty. + + + + Creates a prepared version of the command on a PostgreSQL server. + + + + + This method checks the connection state to see if the connection + is set or it is open. If one of this conditions is not met, throws + an InvalidOperationException + + + + + This method substitutes the Parameters, if exist, in the command + to their actual values. + The parameter name format is :ParameterName. + + A version of CommandText with the Parameters inserted. + + + + Gets or sets the SQL statement or function (stored procedure) to execute at the data source. + + The Transact-SQL statement or stored procedure to execute. The default is an empty string. + + + + Gets or sets the wait time before terminating the attempt + to execute a command and generating an error. + + The time (in seconds) to wait for the command to execute. + The default is 20 seconds. + + + + Gets or sets a value indicating how the + CommandText property is to be interpreted. + + One of the CommandType values. The default is CommandType.Text. + + + + Gets or sets the NpgsqlConnection + used by this instance of the NpgsqlCommand. + + The connection to a data source. The default value is a null reference. + + + + Gets the NpgsqlParameterCollection. + + The parameters of the SQL statement or function (stored procedure). The default is an empty collection. + + + + Gets or sets the NpgsqlTransaction + within which the NpgsqlCommand executes. + + The NpgsqlTransaction. + The default value is a null reference. + + + + Gets or sets how command results are applied to the DataRow + when used by the Update + method of the DbDataAdapter. + + One of the UpdateRowSource values. + + + + Returns oid of inserted row. This is only updated when using executenonQuery and when command inserts just a single row. If table is created without oids, this will always be 0. + + + + + Represents a collection of parameters relevant to a NpgsqlCommand + as well as their respective mappings to columns in a DataSet. + This class cannot be inherited. + + + + + Initializes a new instance of the NpgsqlParameterCollection class. + + + + + Adds the specified NpgsqlParameter object to the NpgsqlParameterCollection. + + The NpgsqlParameter to add to the collection. + The index of the new NpgsqlParameter object. + + + + Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified parameter name and value. + + The name of the NpgsqlParameter. + The Value of the NpgsqlParameter to add to the collection. + The index of the new NpgsqlParameter object. + + Use caution when using this overload of the + Add method to specify integer parameter values. + Because this overload takes a value of type Object, + you must convert the integral value to an Object + type when the value is zero, as the following C# example demonstrates. + parameters.Add(":pname", Convert.ToInt32(0)); + If you do not perform this conversion, the compiler will assume you + are attempting to call the NpgsqlParameterCollection.Add(string, DbType) overload. + + + + + Adds a NpgsqlParameter to the NpgsqlParameterCollection given the parameter name and the data type. + + The name of the parameter. + One of the DbType values. + The index of the new NpgsqlParameter object. + + + + Adds a NpgsqlParameter to the NpgsqlParameterCollection with the parameter name, the data type, and the column length. + + The name of the parameter. + One of the DbType values. + The length of the column. + The index of the new NpgsqlParameter object. + + + + Adds a NpgsqlParameter to the NpgsqlParameterCollection with the parameter name, the data type, the column length, and the source column name. + + The name of the parameter. + One of the DbType values. + The length of the column. + The name of the source column. + The index of the new NpgsqlParameter object. + + + + Removes the specified NpgsqlParameter from the collection using the parameter name. + + The name of the NpgsqlParameter object to retrieve. + + + + Gets a value indicating whether a NpgsqlParameter with the specified parameter name exists in the collection. + + The name of the NpgsqlParameter object to find. + true if the collection contains the parameter; otherwise, false. + + + + Gets the location of the NpgsqlParameter in the collection with a specific parameter name. + + The name of the NpgsqlParameter object to find. + The zero-based location of the NpgsqlParameter in the collection. + + + + Removes the specified NpgsqlParameter from the collection using a specific index. + + The zero-based index of the parameter. + + + + Inserts a NpgsqlParameter into the collection at the specified index. + + The zero-based index where the parameter is to be inserted within the collection. + The NpgsqlParameter to add to the collection. + + + + Removes the specified NpgsqlParameter from the collection. + + The NpgsqlParameter to remove from the collection. + + + + Gets a value indicating whether a NpgsqlParameter exists in the collection. + + The value of the NpgsqlParameter object to find. + true if the collection contains the NpgsqlParameter object; otherwise, false. + + + + Gets a value indicating whether a NpgsqlParameter with the specified parameter name exists in the collection. + + The name of the NpgsqlParameter object to find. + A reference to the requested parameter is returned in this out param if it is found in the list. This value is null if the parameter is not found. + true if the collection contains the parameter and param will contain the parameter; otherwise, false. + + + + Removes all items from the collection. + + + + + Gets the location of a NpgsqlParameter in the collection. + + The value of the NpgsqlParameter object to find. + The zero-based index of the NpgsqlParameter object in the collection. + + + + Adds the specified NpgsqlParameter object to the NpgsqlParameterCollection. + + The NpgsqlParameter to add to the collection. + The zero-based index of the new NpgsqlParameter object. + + + + Copies NpgsqlParameter objects from the NpgsqlParameterCollection to the specified array. + + An Array to which to copy the NpgsqlParameter objects in the collection. + The starting index of the array. + + + + Returns an enumerator that can iterate through the collection. + + An IEnumerator that can be used to iterate through the collection. + + + + In methods taking an object as argument this method is used to verify + that the argument has the type NpgsqlParameter + + The object to verify + + + + Gets the NpgsqlParameter with the specified name. + + The name of the NpgsqlParameter to retrieve. + The NpgsqlParameter with the specified name, or a null reference if the parameter is not found. + + + + Gets the NpgsqlParameter at the specified index. + + The zero-based index of the NpgsqlParameter to retrieve. + The NpgsqlParameter at the specified index. + + + + Gets the number of NpgsqlParameter objects in the collection. + + The number of NpgsqlParameter objects in the collection. + + + + Represents an ongoing COPY FROM STDIN operation. + Provides methods to push data to server and end or cancel the operation. + + + + + Called from NpgsqlState.ProcessBackendResponses upon CopyInResponse. + If CopyStream is already set, it is used to read data to push to server, after which the copy is completed. + Otherwise CopyStream is set to a writable NpgsqlCopyInStream that calls SendCopyData each time it is written to. + + + + + Sends given packet to server as a CopyData message. + Does not check for notifications! Use another thread for that. + + + + + Sends CopyDone message to server. Handles responses, ie. may throw an exception. + + + + + Sends CopyFail message to server. Handles responses, ie. should always throw an exception: + in CopyIn state the server responds to CopyFail with an error response; + outside of a CopyIn state the server responds to CopyFail with an error response; + without network connection or whatever, there's going to eventually be a failure, timeout or user intervention. + + + + + Copy format information returned from server. + + + + + Represents a PostgreSQL Point type + + + + + Represents a PostgreSQL Line Segment type. + + + + + Represents a PostgreSQL Path type. + + + + + Represents a PostgreSQL Polygon type. + + + + + Represents a PostgreSQL Circle type. + + + + + Represents a PostgreSQL inet type. + + + + + This class represents a PasswordPacket message sent to backend + PostgreSQL. + + +
+
diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/35/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/35/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest new file mode 100644 index 0000000..47bd4a0 --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/35/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest @@ -0,0 +1,6 @@ + + + + + Vy8CgQgbu3qH5JHTK0op4kR8114= QTJu3Gttpt8hhCktGelNeXj4Yp8= 1ruqF7/L+m1tqnJVscaOtNRNHIE= + \ No newline at end of file diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/35/amd64/Microsoft.VC90.CRT/README_ENU.txt b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/35/amd64/Microsoft.VC90.CRT/README_ENU.txt new file mode 100644 index 0000000..fc38b36 Binary files /dev/null and b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/35/amd64/Microsoft.VC90.CRT/README_ENU.txt differ diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/35/policy.2.0.Npgsql.config b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/35/policy.2.0.Npgsql.config new file mode 100644 index 0000000..ac99fb8 --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/35/policy.2.0.Npgsql.config @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/35/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/35/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest new file mode 100644 index 0000000..bbd12cc --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/35/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest @@ -0,0 +1,6 @@ + + + + + +CXED+6HzJlSphyMNOn27ujadC0= MyKED+9DyS+1XcMeaC0Zlw2vFZ0= EeyDE7og6WoPd2oBhYbMEnpFHhY= + \ No newline at end of file diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/35/x86/Microsoft.VC90.CRT/README_ENU.txt b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/35/x86/Microsoft.VC90.CRT/README_ENU.txt new file mode 100644 index 0000000..fc38b36 Binary files /dev/null and b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/35/x86/Microsoft.VC90.CRT/README_ENU.txt differ diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/40/FluentMigrator.xml b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/40/FluentMigrator.xml new file mode 100644 index 0000000..d338db4 --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/40/FluentMigrator.xml @@ -0,0 +1,149 @@ + + + + FluentMigrator + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Allows for conditional inclusion of expresions based on the migration context + + + + + Defines fluent expressions that can be conditionally executed + + + + + The context to add expressions into + + If the database type doe snot apply then this will be a new context that is not used by the caller + + + + Constricts a new instance of a that will only add expressions to the provided if matches the migration processor + + If the database type does not apply then a will be used as a container to void any fluent expressions that would have been executed + The context to add expressions to if the database type applies + The database type that the expressions relate to + + + + Checks if the database type matches the name of the context migration processor + + The context to evaluate + The type to be checked + True if the database type applies, False if not + + + + Alter the schema of an existing object + + + + + Create a new database object + + + + + Delete a database object, table, or row + + + + + Rename tables / columns + + + + + Insert data into a table + + + + + Execute SQL statements + + + + + Update an existing row + + + + + Provides a null implmentation of a procesor that does not do any work + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + The arbitrary application context passed to the task runner. + + + The arbitrary application context passed to the task runner. + + + + Initializes a new instance of the class. + + + + + Used to filter which migrations are run. + + + + + Deletes an index + + the name of the index + + + + + Deletes an index, based on the naming convention in effect + + + + + + Deletes a named Primary Key from a table + + + + + + + Deletes a named Unique Constraint From a table + + + + + + The arbitrary application context passed to the task runner. + + + The arbitrary application context passed to the task runner. + + + diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/40/Migrate.exe.config b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/40/Migrate.exe.config new file mode 100644 index 0000000..899bb3e --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/40/Migrate.exe.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/40/Npgsql.XML b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/40/Npgsql.XML new file mode 100644 index 0000000..1f94085 --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/40/Npgsql.XML @@ -0,0 +1,4079 @@ + + + + Npgsql + + + + + This class represents a parameter to a command that will be sent to server + + + + + Initializes a new instance of the NpgsqlParameter class. + + + + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name and a value of the new NpgsqlParameter. + + The m_Name of the parameter to map. + An Object that is the value of the NpgsqlParameter. + +

When you specify an Object + in the value parameter, the DbType is + inferred from the .NET Framework type of the Object.

+

When using this constructor, you must be aware of a possible misuse of the constructor which takes a DbType parameter. + This happens when calling this constructor passing an int 0 and the compiler thinks you are passing a value of DbType. + Use Convert.ToInt32(value) for example to have compiler calling the correct constructor.

+
+
+ + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name and the data type. + + The m_Name of the parameter to map. + One of the DbType values. + + + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name, the DbType, and the size. + + The m_Name of the parameter to map. + One of the DbType values. + The length of the parameter. + + + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name, the DbType, the size, + and the source column m_Name. + + The m_Name of the parameter to map. + One of the DbType values. + The length of the parameter. + The m_Name of the source column. + + + + Initializes a new instance of the NpgsqlParameter + class with the parameter m_Name, the DbType, the size, + the source column m_Name, a ParameterDirection, + the precision of the parameter, the scale of the parameter, a + DataRowVersion to use, and the + value of the parameter. + + The m_Name of the parameter to map. + One of the DbType values. + The length of the parameter. + The m_Name of the source column. + One of the ParameterDirection values. + true if the value of the field can be null, otherwise false. + The total number of digits to the left and right of the decimal point to which + Value is resolved. + The total number of decimal places to which + Value is resolved. + One of the DataRowVersion values. + An Object that is the value + of the NpgsqlParameter. + + + + Creates a new NpgsqlParameter that + is a copy of the current instance. + + A new NpgsqlParameter that is a copy of this instance. + + + + Gets or sets the maximum number of digits used to represent the + Value property. + + The maximum number of digits used to represent the + Value property. + The default value is 0, which indicates that the data provider + sets the precision for Value. + + + + Gets or sets the number of decimal places to which + Value is resolved. + + The number of decimal places to which + Value is resolved. The default is 0. + + + + Gets or sets the maximum size, in bytes, of the data within the column. + + The maximum size, in bytes, of the data within the column. + The default value is inferred from the parameter value. + + + + Gets or sets the DbType of the parameter. + + One of the DbType values. The default is String. + + + + Gets or sets the DbType of the parameter. + + One of the DbType values. The default is String. + + + + Gets or sets a value indicating whether the parameter is input-only, + output-only, bidirectional, or a stored procedure return value parameter. + + One of the ParameterDirection + values. The default is Input. + + + + Gets or sets a value indicating whether the parameter accepts null values. + + true if null values are accepted; otherwise, false. The default is false. + + + + Gets or sets the m_Name of the NpgsqlParameter. + + The m_Name of the NpgsqlParameter. + The default is an empty string. + + + + The m_Name scrubbed of any optional marker + + + + + Gets or sets the m_Name of the source column that is mapped to the + DataSet and used for loading or + returning the Value. + + The m_Name of the source column that is mapped to the + DataSet. The default is an empty string. + + + + Gets or sets the DataRowVersion + to use when loading Value. + + One of the DataRowVersion values. + The default is Current. + + + + Gets or sets the value of the parameter. + + An Object that is the value of the parameter. + The default value is null. + + + + Gets or sets the value of the parameter. + + An Object that is the value of the parameter. + The default value is null. + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + For classes representing messages sent from the client to the server. + + + + + Writes given objects into a stream for PostgreSQL COPY in default copy format (not CSV or BINARY). + + + + + Return an exact copy of this NpgsqlConnectionString. + + + + + This function will set value for known key, both private member and base[key]. + + + + + + + The function will modify private member only, not base[key]. + + + + + + + Clear the member and assign them to the default value. + + + + + Compatibilty version. When possible, behaviour caused by breaking changes will be preserved + if this version is less than that where the breaking change was introduced. + + + + + Case insensative accessor for indivual connection string values. + + + + + Common base class for all derived MD5 implementations. + + + + + Called from constructor of derived class. + + + + + Finalizer for HashAlgorithm + + + + + Computes the entire hash of all the bytes in the byte array. + + + + + When overridden in a derived class, drives the hashing function. + + + + + + + + When overridden in a derived class, this pads and hashes whatever data might be left in the buffers and then returns the hash created. + + + + + When overridden in a derived class, initializes the object to prepare for hashing. + + + + + Used for stream chaining. Computes hash as data passes through it. + + The buffer from which to grab the data to be copied. + The offset into the input buffer to start reading at. + The number of bytes to be copied. + The buffer to write the copied data to. + At what point in the outputBuffer to write the data at. + + + + Used for stream chaining. Computes hash as data passes through it. Finishes off the hash. + + The buffer from which to grab the data to be copied. + The offset into the input buffer to start reading at. + The number of bytes to be copied. + + + + Get whether or not the hash can transform multiple blocks at a time. + Note: MUST be overriden if descendant can transform multiple block + on a single call! + + + + + Gets the previously computed hash. + + + + + Returns the size in bits of the hash. + + + + + Must be overriden if not 1 + + + + + Must be overriden if not 1 + + + + + Called from constructor of derived class. + + + + + Creates the default derived class. + + + + + Given a join expression and a projection, fetch all columns in the projection + that reference columns in the join. + + + + + Given an InputExpression append all from names (including nested joins) to the list. + + + + + Get new ColumnExpression that will be used in projection that had it's existing columns moved. + These should be simple references to the inner column + + + + + Every property accessed in the list of columns must be adjusted for a new scope + + + + + This class provides many util methods to handle + reading and writing of PostgreSQL protocol messages. + + + + + This method takes a ProtocolVersion and returns an integer + version number that the Postgres backend will recognize in a + startup packet. + + + + + This method takes a version string as returned by SELECT VERSION() and returns + a valid version string ("7.2.2" for example). + This is only needed when running protocol version 2. + This does not do any validity checks. + + + + + This method gets a C NULL terminated string from the network stream. + It keeps reading a byte in each time until a NULL byte is returned. + It returns the resultant string of bytes read. + This string is sent from backend. + + + + + Reads requested number of bytes from stream with retries until Stream.Read returns 0 or count is reached. + + Stream to read + byte buffer to fill + starting position to fill the buffer + number of bytes to read + The number of bytes read. May be less than count if no more bytes are available. + + + + This method writes a C NULL terminated string to the network stream. + It appends a NULL terminator to the end of the String. + + + This method writes a C NULL terminated string to the network stream. + It appends a NULL terminator to the end of the String. + + + + + This method writes a C NULL terminated string limited in length to the + backend server. + It pads the string with null bytes to the size specified. + + + + + Write a 32-bit integer to the given stream in the correct byte order. + + + + + Read a 32-bit integer from the given stream in the correct byte order. + + + + + Write a 16-bit integer to the given stream in the correct byte order. + + + + + Read a 16-bit integer from the given stream in the correct byte order. + + + + + Represent the frontend/backend protocol version. + + + + + Represent the backend server version. + As this class offers no functionality beyond that offered by it has been + deprecated in favour of that class. + + + + + + Returns the string representation of this version in three place dot notation (Major.Minor.Patch). + + + + + Server version major number. + + + + + Server version minor number. + + + + + Server version patch level number. + + + + + Represents a PostgreSQL COPY TO STDOUT operation with a corresponding SQL statement + to execute against a PostgreSQL database + and an associated stream used to write results to (if provided by user) + or for reading the results (when generated by driver). + Eg. new NpgsqlCopyOut("COPY (SELECT * FROM mytable) TO STDOUT", connection, streamToWrite).Start(); + + + + + Creates NpgsqlCommand to run given query upon Start(), after which CopyStream provides data from database as requested in the query. + + + + + Given command is run upon Start(), after which CopyStream provides data from database as requested in the query. + + + + + Given command is executed upon Start() and all requested copy data is written to toStream immediately. + + + + + Returns true if this operation is currently active and field at given location is in binary format. + + + + + Command specified upon creation is executed as a non-query. + If CopyStream is set upon creation, all copy data from server will be written to it, and operation will be finished immediately. + Otherwise the CopyStream member can be used for reading copy data from server until no more data is available. + + + + + Flush generated CopyStream at once. Effectively reads and discard all the rest of copy data from server. + + + + + Returns true if the connection is currently reserved for this operation. + + + + + The stream provided by user or generated upon Start() + + + + + The Command used to execute this copy operation. + + + + + Returns true if this operation is currently active and in binary format. + + + + + Returns number of fields if this operation is currently active, otherwise -1 + + + + + Faster alternative to using the generated CopyStream. + + + + + This class manages all connector objects, pooled AND non-pooled. + + + + Unique static instance of the connector pool + mamager. + + + Map of index to unused pooled connectors, avaliable to the + next RequestConnector() call. + This hashmap will be indexed by connection string. + This key will hold a list of queues of pooled connectors available to be used. + + + Timer for tracking unused connections in pools. + + + + Searches the shared and pooled connector lists for a + matching connector object or creates a new one. + + The NpgsqlConnection that is requesting + the connector. Its ConnectionString will be used to search the + pool for available connectors. + A connector object. + + + + Find a pooled connector. Handle locking and timeout here. + + + + + Find a pooled connector. Handle shared/non-shared here. + + + + + Releases a connector, possibly back to the pool for future use. + + + Pooled connectors will be put back into the pool if there is room. + Shared connectors should just have their use count decremented + since they always stay in the shared pool. + + The connector to release. + + + + Release a pooled connector. Handle locking here. + + + + + Release a pooled connector. Handle shared/non-shared here. + + + + + Create a connector without any pooling functionality. + + + + + Find an available pooled connector in the non-shared pool, or create + a new one if none found. + + + + + This method is only called when NpgsqlConnection.Dispose(false) is called which means a + finalization. This also means, an NpgsqlConnection was leak. We clear pool count so that + client doesn't end running out of connections from pool. When the connection is finalized, its underlying + socket is closed. + + + + + Close the connector. + + + Connector to release + + + + Put a pooled connector into the pool queue. + + Connector to pool + + + + A queue with an extra Int32 for keeping track of busy connections. + + + + + The number of pooled Connectors that belong to this queue but + are currently in use. + + + + + This class represents a BackEndKeyData message received + from PostgreSQL + + + + + Used when a connection is closed + + + + + Summary description for NpgsqlQuery + + + + + Represents the method that handles the Notice events. + + A NpgsqlNoticeEventArgs that contains the event data. + + + + Represents the method that handles the Notification events. + + The source of the event. + A NpgsqlNotificationEventArgs that contains the event data. + + + + This class represents a connection to a + PostgreSQL server. + + + + + Initializes a new instance of the + NpgsqlConnection class. + + + + + Initializes a new instance of the + NpgsqlConnection class + and sets the ConnectionString. + + The connection used to open the PostgreSQL database. + + + + Begins a database transaction with the specified isolation level. + + The isolation level under which the transaction should run. + An DbTransaction + object representing the new transaction. + + Currently the IsolationLevel ReadCommitted and Serializable are supported by the PostgreSQL backend. + There's no support for nested transactions. + + + + + Begins a database transaction. + + A NpgsqlTransaction + object representing the new transaction. + + Currently there's no support for nested transactions. + + + + + Begins a database transaction with the specified isolation level. + + The isolation level under which the transaction should run. + A NpgsqlTransaction + object representing the new transaction. + + Currently the IsolationLevel ReadCommitted and Serializable are supported by the PostgreSQL backend. + There's no support for nested transactions. + + + + + Opens a database connection with the property settings specified by the + ConnectionString. + + + + + This method changes the current database by disconnecting from the actual + database and connecting to the specified. + + The name of the database to use in place of the current database. + + + + Releases the connection to the database. If the connection is pooled, it will be + made available for re-use. If it is non-pooled, the actual connection will be shutdown. + + + + + Creates and returns a DbCommand + object associated with the IDbConnection. + + A DbCommand object. + + + + Creates and returns a NpgsqlCommand + object associated with the NpgsqlConnection. + + A NpgsqlCommand object. + + + + Releases all resources used by the + NpgsqlConnection. + + true when called from Dispose(); + false when being called from the finalizer. + + + + Create a new connection based on this one. + + A new NpgsqlConnection object. + + + + Create a new connection based on this one. + + A new NpgsqlConnection object. + + + + Default SSL CertificateSelectionCallback implementation. + + + + + Default SSL CertificateValidationCallback implementation. + + + + + Default SSL PrivateKeySelectionCallback implementation. + + + + + Default SSL ProvideClientCertificatesCallback implementation. + + + + + Write each key/value pair in the connection string to the log. + + + + + Returns the supported collections + + + + + Returns the schema collection specified by the collection name. + + The collection name. + The collection specified. + + + + Returns the schema collection specified by the collection name filtered by the restrictions. + + The collection name. + + The restriction values to filter the results. A description of the restrictions is contained + in the Restrictions collection. + + The collection specified. + + + + Occurs on NoticeResponses from the PostgreSQL backend. + + + + + Occurs on NotificationResponses from the PostgreSQL backend. + + + + + Called to provide client certificates for SSL handshake. + + + + + Mono.Security.Protocol.Tls.CertificateSelectionCallback delegate. + + + + + Mono.Security.Protocol.Tls.CertificateValidationCallback delegate. + + + + + Mono.Security.Protocol.Tls.PrivateKeySelectionCallback delegate. + + + + + Gets or sets the string used to connect to a PostgreSQL database. + Valid values are: +
    +
  • + Server: Address/Name of Postgresql Server; +
  • +
  • + Port: Port to connect to; +
  • +
  • + Protocol: Protocol version to use, instead of automatic; Integer 2 or 3; +
  • +
  • + Database: Database name. Defaults to user name if not specified; +
  • +
  • + User Id: User name; +
  • +
  • + Password: Password for clear text authentication; +
  • +
  • + SSL: True or False. Controls whether to attempt a secure connection. Default = False; +
  • +
  • + Pooling: True or False. Controls whether connection pooling is used. Default = True; +
  • +
  • + MinPoolSize: Min size of connection pool; +
  • +
  • + MaxPoolSize: Max size of connection pool; +
  • +
  • + Timeout: Time to wait for connection open in seconds. Default is 15. +
  • +
  • + CommandTimeout: Time to wait for command to finish execution before throw an exception. In seconds. Default is 20. +
  • +
  • + Sslmode: Mode for ssl connection control. Can be Prefer, Require, Allow or Disable. Default is Disable. Check user manual for explanation of values. +
  • +
  • + ConnectionLifeTime: Time to wait before closing unused connections in the pool in seconds. Default is 15. +
  • +
  • + SyncNotification: Specifies if Npgsql should use synchronous notifications. +
  • +
  • + SearchPath: Changes search path to specified and public schemas. +
  • +
+
+ The connection string that includes the server name, + the database name, and other parameters needed to establish + the initial connection. The default value is an empty string. + +
+ + + Backend server host name. + + + + + Backend server port. + + + + + If true, the connection will attempt to use SSL. + + + + + Gets the time to wait while trying to establish a connection + before terminating the attempt and generating an error. + + The time (in seconds) to wait for a connection to open. The default value is 15 seconds. + + + + Gets the time to wait while trying to execute a command + before terminating the attempt and generating an error. + + The time (in seconds) to wait for a command to complete. The default value is 20 seconds. + + + + Gets the time to wait before closing unused connections in the pool if the count + of all connections exeeds MinPoolSize. + + + If connection pool contains unused connections for ConnectionLifeTime seconds, + the half of them will be closed. If there will be unused connections in a second + later then again the half of them will be closed and so on. + This strategy provide smooth change of connection count in the pool. + + The time (in seconds) to wait. The default value is 15 seconds. + + + + Gets the name of the current database or the database to be used after a connection is opened. + + The name of the current database or the name of the database to be + used after a connection is opened. The default value is the empty string. + + + + Whether datareaders are loaded in their entirety (for compatibility with earlier code). + + + + + Gets the database server name. + + + + + Gets flag indicating if we are using Synchronous notification or not. + The default value is false. + + + + + Gets the current state of the connection. + + A bitwise combination of the ConnectionState values. The default is Closed. + + + + Gets whether the current state of the connection is Open or Closed + + ConnectionState.Open or ConnectionState.Closed + + + + Version of the PostgreSQL backend. + This can only be called when there is an active connection. + + + + + Protocol version in use. + This can only be called when there is an active connection. + + + + + Process id of backend server. + This can only be called when there is an active connection. + + + + + The connector object connected to the backend. + + + + + Gets the NpgsqlConnectionStringBuilder containing the parsed connection string values. + + + + + User name. + + + + + Password. + + + + + Determine if connection pooling will be used for this connection. + + + + + This class represents the CancelRequest message sent to PostgreSQL + server. + + + + + + + + + + + + + + + + + + + A time period expressed in 100ns units. + + + A time period expressed in a + + + Number of 100ns units. + + + Number of seconds. + + + Number of milliseconds. + + + Number of milliseconds. + + + Number of milliseconds. + + + A d with the given number of ticks. + + + A d with the given number of microseconds. + + + A d with the given number of milliseconds. + + + A d with the given number of seconds. + + + A d with the given number of minutes. + + + A d with the given number of hours. + + + A d with the given number of days. + + + A d with the given number of months. + + + An whose values are the sums of the two instances. + + + An whose values are the differences of the two instances. + + + An whose value is the negated value of this instance. + + + An whose value is the absolute value of this instance. + + + + An based on this one, but with any days converted to multiples of ±24hours. + + + + An based on this one, but with any months converted to multiples of ±30days. + + + + An based on this one, but with any months converted to multiples of ±30days and then any days converted to multiples of ±24hours; + + + + An eqivalent, canonical, . + + + An equivalent . + + + + + + An signed integer. + + + + The argument is not an . + + + The string was not in a format that could be parsed to produce an . + + + true if the parsing succeeded, false otherwise. + + + The representation. + + + An whose values are the sum of the arguments. + + + An whose values are the difference of the arguments + + + true if the two arguments are exactly the same, false otherwise. + + + false if the two arguments are exactly the same, true otherwise. + + + true if the first is less than second, false otherwise. + + + true if the first is less than or equivalent to second, false otherwise. + + + true if the first is greater than second, false otherwise. + + + true if the first is greater than or equivalent to the second, false otherwise. + + + The argument. + + + The negation of the argument. + + + + + + + + + + + + + + + + + + + + This time, normalised + + + + + + + + + This time, normalised + + + An integer which is 0 if they are equal, < 0 if this is the smaller and > 0 if this is the larger. + + + + + + + + + A class to handle everything associated with SSPI authentication + + + + + Simplified SecBufferDesc struct with only one SecBuffer + + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + EventArgs class to send Notice parameters, which are just NpgsqlError's in a lighter context. + + + + + Notice information. + + + + + This class represents the ErrorResponse and NoticeResponse + message sent from PostgreSQL server. + + + + + Return a string representation of this error object. + + + + + Severity code. All versions. + + + + + Error code. PostgreSQL 7.4 and up. + + + + + Terse error message. All versions. + + + + + Detailed error message. PostgreSQL 7.4 and up. + + + + + Suggestion to help resolve the error. PostgreSQL 7.4 and up. + + + + + Position (one based) within the query string where the error was encounterd. PostgreSQL 7.4 and up. + + + + + Position (one based) within the query string where the error was encounterd. This position refers to an internal command executed for example inside a PL/pgSQL function. PostgreSQL 7.4 and up. + + + + + Internal query string where the error was encounterd. This position refers to an internal command executed for example inside a PL/pgSQL function. PostgreSQL 7.4 and up. + + + + + Trace back information. PostgreSQL 7.4 and up. + + + + + Source file (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Source file line number (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Source routine (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + String containing the sql sent which produced this error. + + + + + Backend protocol version in use. + + + + + Represents an ongoing COPY TO STDOUT operation. + Provides methods to read data from server or end the operation. + + + + This class represents the base class for the state pattern design pattern + implementation. + + + + + + This method is used by the states to change the state of the context. + + + + + This method is responsible to handle all protocol messages sent from the backend. + It holds all the logic to do it. + To exchange data, it uses a Mediator object from which it reads/writes information + to handle backend requests. + + + + + + This method is responsible to handle all protocol messages sent from the backend. + It holds all the logic to do it. + To exchange data, it uses a Mediator object from which it reads/writes information + to handle backend requests. + + + + + + Called from NpgsqlState.ProcessBackendResponses upon CopyOutResponse. + If CopyStream is already set, it is used to write data received from server, after which the copy ends. + Otherwise CopyStream is set to a readable NpgsqlCopyOutStream that receives data from server. + + + + + Called from NpgsqlOutStream.Read to read copy data from server. + + + + + Copy format information returned from server. + + + + + Handles serialisation of .NET array or IEnumeration to pg format. + Arrays of arrays, enumerations of enumerations, arrays of enumerations etc. + are treated as multi-dimensional arrays (in much the same manner as an array of arrays + is used to emulate multi-dimensional arrays in languages that lack native support for them). + If such an enumeration of enumerations is "jagged" (as opposed to rectangular, cuboid, + hypercuboid, hyperhypercuboid, etc) then this class will "correctly" serialise it, but pg + will raise an error as it doesn't allow jagged arrays. + + + + + Create an ArrayNativeToBackendTypeConverter with the element converter passed + + The that would be used to serialise the element type. + + + + Serialise the enumeration or array. + + + + + Handles parsing of pg arrays into .NET arrays. + + + + + Takes a string representation of a pg 1-dimensional array + (or a 1-dimensional row within an n-dimensional array) + and allows enumeration of the string represenations of each items. + + + + + Takes a string representation of a pg n-dimensional array + and allows enumeration of the string represenations of the next + lower level of rows (which in turn can be taken as (n-1)-dimensional arrays. + + + + + Takes an ArrayList which may be an ArrayList of ArrayLists, an ArrayList of ArrayLists of ArrayLists + and so on and enumerates the items that aren't ArrayLists (the leaf nodes if we think of the ArrayList + passed as a tree). Simply uses the ArrayLists' own IEnumerators to get that of the next, + pushing them onto a stack until we hit something that isn't an ArrayList. + ArrayList to enumerate + IEnumerable + + + + + Create a new ArrayBackendToNativeTypeConverter + + for the element type. + + + + Creates an array from pg representation. + + + + + Creates an array list from pg represenation of an array. + Multidimensional arrays are treated as ArrayLists of ArrayLists + + + + + Creates an n-dimensional array from an ArrayList of ArrayLists or + a 1-dimensional array from something else. + + to convert + produced. + + + + Takes an array of ints and treats them like the limits of a set of counters. + Retains a matching set of ints that is set to all zeros on the first ++ + On a ++ it increments the "right-most" int. If that int reaches it's + limit it is set to zero and the one before it is incremented, and so on. + + Making this a more general purpose class is pretty straight-forward, but we'll just put what we need here. + + + + + This class represents the ParameterStatus message sent from PostgreSQL + server. + + + + + + This class is responsible for serving as bridge between the backend + protocol handling and the core classes. It is used as the mediator for + exchanging data generated/sent from/to backend. + + + + + + This class is responsible to create database commands for automatic insert, update and delete operations. + + + + + + This method is reponsible to derive the command parameter list with values obtained from function definition. + It clears the Parameters collection of command. Also, if there is any parameter type which is not supported by Npgsql, an InvalidOperationException will be thrown. + Parameters name will be parameter1, parameter2, ... + For while, only parameter name and NpgsqlDbType are obtained. + + NpgsqlCommand whose function parameters will be obtained. + + + + Represents a completed response message. + + + + + + Marker interface which identifies a class which may take possession of a stream for the duration of + it's lifetime (possibly temporarily giving that possession to another class for part of that time. + + It inherits from IDisposable, since any such class must make sure it leaves the stream in a valid state. + + The most important such class is that compiler-generated from ProcessBackendResponsesEnum. Of course + we can't make that inherit from this interface, alas. + + + + + The exception that is thrown when the PostgreSQL backend reports errors. + + + + + Construct a backend error exception based on a list of one or more + backend errors. The basic Exception.Message will be built from the + first (usually the only) error in the list. + + + + + Format a .NET style exception string. + Include all errors in the list, including any hints. + + + + + Append a line to the given Stream, first checking for zero-length. + + + + + Provide access to the entire list of errors provided by the PostgreSQL backend. + + + + + Severity code. All versions. + + + + + Error code. PostgreSQL 7.4 and up. + + + + + Basic error message. All versions. + + + + + Detailed error message. PostgreSQL 7.4 and up. + + + + + Suggestion to help resolve the error. PostgreSQL 7.4 and up. + + + + + Position (one based) within the query string where the error was encounterd. PostgreSQL 7.4 and up. + + + + + Trace back information. PostgreSQL 7.4 and up. + + + + + Source file (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Source file line number (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + Source routine (in backend) reporting the error. PostgreSQL 7.4 and up. + + + + + String containing the sql sent which produced this error. + + + + + Returns the entire list of errors provided by the PostgreSQL backend. + + + + + The level of verbosity of the NpgsqlEventLog + + + + + Don't log at all + + + + + Only log the most common issues + + + + + Log everything + + + + + This class handles all the Npgsql event and debug logging + + + + + Writes a string to the Npgsql event log if msglevel is bigger then NpgsqlEventLog.Level + + + This method is obsolete and should no longer be used. + It is likely to be removed in future versions of Npgsql + + The message to write to the event log + The minimum LogLevel for which this message should be logged. + + + + Writes a string to the Npgsql event log if msglevel is bigger then NpgsqlEventLog.Level + + The ResourceManager to get the localized resources + The name of the resource that should be fetched by the ResourceManager + The minimum LogLevel for which this message should be logged. + The additional parameters that shall be included into the log-message (must be compatible with the string in the resource): + + + + Writes the default log-message for the action of calling the Get-part of an Indexer to the log file. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Indexer + The parameter given to the Indexer + + + + Writes the default log-message for the action of calling the Set-part of an Indexer to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Indexer + The parameter given to the Indexer + The value the Indexer is set to + + + + Writes the default log-message for the action of calling the Get-part of a Property to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Property + The name of the Property + + + + Writes the default log-message for the action of calling the Set-part of a Property to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Property + The name of the Property + The value the Property is set to + + + + Writes the default log-message for the action of calling a Method without Arguments to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + + + + Writes the default log-message for the action of calling a Method with one Argument to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + The value of the Argument of the Method + + + + Writes the default log-message for the action of calling a Method with two Arguments to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + The value of the first Argument of the Method + The value of the second Argument of the Method + + + + Writes the default log-message for the action of calling a Method with three Arguments to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + The value of the first Argument of the Method + The value of the second Argument of the Method + The value of the third Argument of the Method + + + + Writes the default log-message for the action of calling a Method with more than three Arguments to the logfile. + + The minimum LogLevel for which this message should be logged. + The name of the class that contains the Method + The name of the Method + A Object-Array with zero or more Ojects that are Arguments of the Method. + + + + Sets/Returns the level of information to log to the logfile. + + The current LogLevel + + + + Sets/Returns the filename to use for logging. + + The filename of the current Log file. + + + + Sets/Returns whether Log messages should be echoed to the console + + true if Log messages are echoed to the console, otherwise false + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + Represents a PostgreSQL COPY FROM STDIN operation with a corresponding SQL statement + to execute against a PostgreSQL database + and an associated stream used to read data from (if provided by user) + or for writing it (when generated by driver). + Eg. new NpgsqlCopyIn("COPY mytable FROM STDIN", connection, streamToRead).Start(); + + + + + Creates NpgsqlCommand to run given query upon Start(). Data for the requested COPY IN operation can then be written to CopyData stream followed by a call to End() or Cancel(). + + + + + Given command is run upon Start(). Data for the requested COPY IN operation can then be written to CopyData stream followed by a call to End() or Cancel(). + + + + + Given command is executed upon Start() and all data from fromStream is passed to it as copy data. + + + + + Returns true if this operation is currently active and field at given location is in binary format. + + + + + Command specified upon creation is executed as a non-query. + If CopyStream is set upon creation, it will be flushed to server as copy data, and operation will be finished immediately. + Otherwise the CopyStream member can be used for writing copy data to server and operation finished with a call to End() or Cancel(). + + + + + Called after writing all data to CopyStream to successfully complete this copy operation. + + + + + Withdraws an already started copy operation. The operation will fail with given error message. + Will do nothing if current operation is not active. + + + + + Returns true if the connection is currently reserved for this operation. + + + + + The stream provided by user or generated upon Start(). + User may provide a stream to constructor; it is used to pass to server all data read from it. + Otherwise, call to Start() sets this to a writable NpgsqlCopyInStream that passes all data written to it to server. + In latter case this is only available while the copy operation is active and null otherwise. + + + + + Returns true if this operation is currently active and in binary format. + + + + + Returns number of fields expected on each input row if this operation is currently active, otherwise -1 + + + + + The Command used to execute this copy operation. + + + + + Set before a COPY IN query to define size of internal buffer for reading from given CopyStream. + + + + + Represents information about COPY operation data transfer format as returned by server. + + + + + Only created when a CopyInResponse or CopyOutResponse is received by NpgsqlState.ProcessBackendResponses() + + + + + Returns true if this operation is currently active and field at given location is in binary format. + + + + + Returns true if this operation is currently active and in binary format. + + + + + Returns number of fields if this operation is currently active, otherwise -1 + + + + + + + + + Provide event handlers to convert all native supported basic data types from their backend + text representation to a .NET object. + + + + + Binary data. + + + + + Convert a postgresql boolean to a System.Boolean. + + + + + Convert a postgresql bit to a System.Boolean. + + + + + Convert a postgresql datetime to a System.DateTime. + + + + + Convert a postgresql date to a System.DateTime. + + + + + Convert a postgresql time to a System.DateTime. + + + + + Convert a postgresql money to a System.Decimal. + + + + + Provide event handlers to convert the basic native supported data types from + native form to backend representation. + + + + + Binary data. + + + + + Convert to a postgresql boolean. + + + + + Convert to a postgresql bit. + + + + + Convert to a postgresql timestamp. + + + + + Convert to a postgresql date. + + + + + Convert to a postgresql time. + + + + + Convert to a postgres money. + + + + + Provide event handlers to convert extended native supported data types from their backend + text representation to a .NET object. + + + + + Convert a postgresql point to a System.NpgsqlPoint. + + + + + Convert a postgresql point to a System.RectangleF. + + + + + LDeg. + + + + + Path. + + + + + Polygon. + + + + + Circle. + + + + + Inet. + + + + + interval + + + + + Provide event handlers to convert extended native supported data types from + native form to backend representation. + + + + + Point. + + + + + Box. + + + + + LSeg. + + + + + Open path. + + + + + Polygon. + + + + + Circle. + + + + + Convert to a postgres inet. + + + + + Convert to a postgres interval + + + + + EventArgs class to send Notification parameters. + + + + + Process ID of the PostgreSQL backend that sent this notification. + + + + + Condition that triggered that notification. + + + + + Additional Information From Notifiying Process (for future use, currently postgres always sets this to an empty string) + + + + + Resolve a host name or IP address. + This is needed because if you call Dns.Resolve() with an IP address, it will attempt + to resolve it as a host name, when it should just convert it to an IP address. + + + + + + This class represents a RowDescription message sent from + the PostgreSQL. + + + + + + This struct represents the internal data of the RowDescription message. + + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + A factory to create instances of various Npgsql objects. + + + + + Creates an NpgsqlCommand object. + + + + + This class represents the Parse message sent to PostgreSQL + server. + + + + + + Represents the method that handles the RowUpdated events. + + The source of the event. + A NpgsqlRowUpdatedEventArgs that contains the event data. + + + + Represents the method that handles the RowUpdating events. + + The source of the event. + A NpgsqlRowUpdatingEventArgs that contains the event data. + + + + This class represents an adapter from many commands: select, update, insert and delete to fill Datasets. + + + + + Stream for reading data from a table or select on a PostgreSQL version 7.4 or newer database during an active COPY TO STDOUT operation. + Passes data exactly as provided by the server. + + + + + Created only by NpgsqlCopyOutState.StartCopy() + + + + + Discards copy data as long as server pushes it. Returns after operation is finished. + Does nothing if this stream is not the active copy operation reader. + + + + + Not writable. + + + + + Not flushable. + + + + + Copies data read from server to given byte buffer. + Since server returns data row by row, length will differ each time, but it is only zero once the operation ends. + Can be mixed with calls to the more efficient NpgsqlCopyOutStream.Read() : byte[] though that would not make much sense. + + + + + Not seekable + + + + + Not supported + + + + + Returns a whole row of data from server without extra work. + If standard Stream.Read(...) has been called before, it's internal buffers remains are returned. + + + + + True while this stream can be used to read copy data from server + + + + + True + + + + + False + + + + + False + + + + + Number of bytes read so far + + + + + Number of bytes read so far; can not be set. + + + + + This class represents the Bind message sent to PostgreSQL + server. + + + + + + Summary description for LargeObjectManager. + + + + + Represents a transaction to be made in a PostgreSQL database. This class cannot be inherited. + + + + + Commits the database transaction. + + + + + Rolls back a transaction from a pending state. + + + + + Rolls back a transaction from a pending savepoint state. + + + + + Creates a transaction save point. + + + + + Cancel the transaction without telling the backend about it. This is + used to make the transaction go away when closing a connection. + + + + + Gets the NpgsqlConnection + object associated with the transaction, or a null reference if the + transaction is no longer valid. + + The NpgsqlConnection + object associated with the transaction. + + + + Specifies the IsolationLevel for this transaction. + + The IsolationLevel for this transaction. + The default is ReadCommitted. + + + + This class represents a StartupPacket message of PostgreSQL + protocol. + + + + + + Provides a means of reading a forward-only stream of rows from a PostgreSQL backend. This class cannot be inherited. + + + + + Return the data type name of the column at index . + + + + + Return the data type of the column at index . + + + + + Return the Npgsql specific data type of the column at requested ordinal. + + column position + Appropriate Npgsql type for column. + + + + Return the column name of the column at index . + + + + + Return the data type OID of the column at index . + + FIXME: Why this method returns String? + + + + Return the column name of the column named . + + + + + Return the data DbType of the column at index . + + + + + Return the data NpgsqlDbType of the column at index . + + + + + Get the value of a column as a . + If the differences between and + in handling of days and months is not important to your application, use + instead. + + Index of the field to find. + value of the field. + + + + Gets the value of a column converted to a Guid. + + + + + Gets the value of a column as Int16. + + + + + Gets the value of a column as Int32. + + + + + Gets the value of a column as Int64. + + + + + Gets the value of a column as Single. + + + + + Gets the value of a column as Double. + + + + + Gets the value of a column as String. + + + + + Gets the value of a column as Decimal. + + + + + Copy values from each column in the current row into . + + The number of column values copied. + + + + Copy values from each column in the current row into . + + An array appropriately sized to store values from all columns. + The number of column values copied. + + + + Gets the value of a column as Boolean. + + + + + Gets the value of a column as Byte. Not implemented. + + + + + Gets the value of a column as Char. + + + + + Gets the value of a column as DateTime. + + + + + Returns a System.Data.DataTable that describes the column metadata of the DataReader. + + + + + This methods parses the command text and tries to get the tablename + from it. + + + + + Is raised whenever Close() is called. + + + + + Gets the number of columns in the current row. + + + + + Gets the value of a column in its native format. + + + + + Gets the value of a column in its native format. + + + + + Gets a value indicating the depth of nesting for the current row. Always returns zero. + + + + + Gets a value indicating whether the data reader is closed. + + + + + Contains the column names as the keys + + + + + Contains all unique columns + + + + + This is the primary implementation of NpgsqlDataReader. It is the one used in normal cases (where the + preload-reader option is not set in the connection string to resolve some potential backwards-compatibility + issues), the only implementation used internally, and in cases where CachingDataReader is used, it is still + used to do the actual "leg-work" of turning a response stream from the server into a datareader-style + object - with CachingDataReader then filling it's cache from here. + + + + + Iterate through the objects returned through from the server. + If it's a CompletedResponse the rowsaffected count is updated appropriately, + and we iterate again, otherwise we return it (perhaps updating our cache of pending + rows if appropriate). + + The next we will deal with. + + + + Advances the data reader to the next result, when multiple result sets were returned by the PostgreSQL backend. + + True if the reader was advanced, otherwise false. + + + + Releases the resources used by the NpgsqlCommand. + + + + + Closes the data reader object. + + + + + Advances the data reader to the next result, when multiple result sets were returned by the PostgreSQL backend. + + True if the reader was advanced, otherwise false. + + + + Advances the data reader to the next row. + + True if the reader was advanced, otherwise false. + + + + Return the value of the column at index . + + + + + Gets raw data from a column. + + + + + Gets raw data from a column. + + + + + Report whether the value in a column is DBNull. + + + + + Gets the number of rows changed, inserted, or deleted by execution of the SQL statement. + + + + + Indicates if NpgsqlDatareader has rows to be read. + + + + + Provides an implementation of NpgsqlDataReader in which all data is pre-loaded into memory. + This operates by first creating a ForwardsOnlyDataReader as usual, and then loading all of it's + Rows into memory. There is a general principle that when there is a trade-off between a class design that + is more efficient and/or scalable on the one hand and one that is less efficient but has more functionality + (in this case the internal-only functionality of caching results) that one can build the less efficent class + from the most efficient without significant extra loss in efficiency, but not the other way around. The relationship + between ForwardsOnlyDataReader and CachingDataReader is an example of this). + Since the interface presented to the user is still forwards-only, queues are used to + store this information, so that dequeueing as we go we give the garbage collector the best opportunity + possible to reclaim any memory that is no longer in use. + ForwardsOnlyDataReader being used to actually + obtain the information from the server means that the "leg-work" is still only done (and need only be + maintained) in one place. + This class exists to allow for certain potential backwards-compatibility issues to be resolved + with little effort on the part of affected users. It is considerably less efficient than ForwardsOnlyDataReader + and hence never used internally. + + + + + Represents the method that allows the application to provide a certificate collection to be used for SSL clien authentication + + A X509CertificateCollection to be filled with one or more client certificates. + + + + !!! Helper class, for compilation only. + Connector implements the logic for the Connection Objects to + access the physical connection to the database, and isolate + the application developer from connection pooling internals. + + + + + Constructor. + + Controls whether the connector can be shared. + + + + This method checks if the connector is still ok. + We try to send a simple query text, select 1 as ConnectionTest; + + + + + This method is responsible for releasing all resources associated with this Connector. + + + + + This method is responsible to release all portals used by this Connector. + + + + + Default SSL CertificateSelectionCallback implementation. + + + + + Default SSL CertificateValidationCallback implementation. + + + + + Default SSL PrivateKeySelectionCallback implementation. + + + + + Default SSL ProvideClientCertificatesCallback implementation. + + + + + This method is required to set all the version dependent features flags. + SupportsPrepare means the server can use prepared query plans (7.3+) + + + + + Opens the physical connection to the server. + + Usually called by the RequestConnector + Method of the connection pool manager. + + + + Closes the physical connection to the server. + + + + + Returns next portal index. + + + + + Returns next plan index. + + + + + Occurs on NoticeResponses from the PostgreSQL backend. + + + + + Occurs on NotificationResponses from the PostgreSQL backend. + + + + + Called to provide client certificates for SSL handshake. + + + + + Mono.Security.Protocol.Tls.CertificateSelectionCallback delegate. + + + + + Mono.Security.Protocol.Tls.CertificateValidationCallback delegate. + + + + + Mono.Security.Protocol.Tls.PrivateKeySelectionCallback delegate. + + + + + Gets the current state of the connection. + + + + + Return Connection String. + + + + + Version of backend server this connector is connected to. + + + + + Backend protocol version in use by this connector. + + + + + The physical connection stream to the backend. + + + + + The physical connection socket to the backend. + + + + + Reports if this connector is fully connected. + + + + + The connection mediator. + + + + + Report if the connection is in a transaction. + + + + + Report whether the current connection can support prepare functionality. + + + + + This class contains helper methods for type conversion between + the .Net type system and postgresql. + + + + + A cache of basic datatype mappings keyed by server version. This way we don't + have to load the basic type mappings for every connection. + + + + + Find a NpgsqlNativeTypeInfo in the default types map that can handle objects + of the given NpgsqlDbType. + + + + + Find a NpgsqlNativeTypeInfo in the default types map that can handle objects + of the given NpgsqlDbType. + + + + + Find a NpgsqlNativeTypeInfo in the default types map that can handle objects + of the given DbType. + + + + + Find a NpgsqlNativeTypeInfo in the default types map that can handle objects + of the given System.Type. + + + + + This method is responsible to convert the string received from the backend + to the corresponding NpgsqlType. + The given TypeInfo is called upon to do the conversion. + If no TypeInfo object is provided, no conversion is performed. + + + + + Create the one and only native to backend type map. + This map is used when formatting native data + types to backend representations. + + + + + This method creates (or retrieves from cache) a mapping between type and OID + of all natively supported postgresql data types. + This is needed as from one version to another, this mapping can be changed and + so we avoid hardcoding them. + + NpgsqlTypeMapping containing all known data types. The mapping must be + cloned before it is modified because it is cached; changes made by one connection may + effect another connection. + + + + Attempt to map types by issuing a query against pg_type. + This function takes a list of NpgsqlTypeInfo and attempts to resolve the OID field + of each by querying pg_type. If the mapping is found, the type info object is + updated (OID) and added to the provided NpgsqlTypeMapping object. + + NpgsqlConnector to send query through. + Mapping object to add types too. + List of types that need to have OID's mapped. + + + + Delegate called to convert the given backend data to its native representation. + + + + + Delegate called to convert the given native data to its backand representation. + + + + + Represents a backend data type. + This class can be called upon to convert a backend field representation to a native object. + + + + + Construct a new NpgsqlTypeInfo with the given attributes and conversion handlers. + + Type OID provided by the backend server. + Type name provided by the backend server. + NpgsqlDbType + System type to convert fields of this type to. + Data conversion handler. + + + + Perform a data conversion from a backend representation to + a native object. + + Data sent from the backend. + Type modifier field sent from the backend. + + + + Type OID provided by the backend server. + + + + + Type name provided by the backend server. + + + + + NpgsqlDbType. + + + + + NpgsqlDbType. + + + + + Provider type to convert fields of this type to. + + + + + System type to convert fields of this type to. + + + + + Represents a backend data type. + This class can be called upon to convert a native object to its backend field representation, + + + + + Returns an NpgsqlNativeTypeInfo for an array where the elements are of the type + described by the NpgsqlNativeTypeInfo supplied. + + + + + Construct a new NpgsqlTypeInfo with the given attributes and conversion handlers. + + Type name provided by the backend server. + NpgsqlDbType + Data conversion handler. + + + + Perform a data conversion from a native object to + a backend representation. + DBNull and null values are handled differently depending if a plain query is used + When + + Native .NET object to be converted. + Flag indicating if the conversion has to be done for + plain queries or extended queries + + + + Type name provided by the backend server. + + + + + NpgsqlDbType. + + + + + DbType. + + + + + Apply quoting. + + + + + Use parameter size information. + + + + + Provide mapping between type OID, type name, and a NpgsqlBackendTypeInfo object that represents it. + + + + + Construct an empty mapping. + + + + + Copy constuctor. + + + + + Add the given NpgsqlBackendTypeInfo to this mapping. + + + + + Add a new NpgsqlBackendTypeInfo with the given attributes and conversion handlers to this mapping. + + Type OID provided by the backend server. + Type name provided by the backend server. + NpgsqlDbType + System type to convert fields of this type to. + Data conversion handler. + + + + Make a shallow copy of this type mapping. + + + + + Determine if a NpgsqlBackendTypeInfo with the given backend type OID exists in this mapping. + + + + + Determine if a NpgsqlBackendTypeInfo with the given backend type name exists in this mapping. + + + + + Get the number of type infos held. + + + + + Retrieve the NpgsqlBackendTypeInfo with the given backend type OID, or null if none found. + + + + + Retrieve the NpgsqlBackendTypeInfo with the given backend type name, or null if none found. + + + + + Provide mapping between type Type, NpgsqlDbType and a NpgsqlNativeTypeInfo object that represents it. + + + + + Add the given NpgsqlNativeTypeInfo to this mapping. + + + + + Add a new NpgsqlNativeTypeInfo with the given attributes and conversion handlers to this mapping. + + Type name provided by the backend server. + NpgsqlDbType + Data conversion handler. + + + + Retrieve the NpgsqlNativeTypeInfo with the given NpgsqlDbType. + + + + + Retrieve the NpgsqlNativeTypeInfo with the given DbType. + + + + + Retrieve the NpgsqlNativeTypeInfo with the given Type. + + + + + Determine if a NpgsqlNativeTypeInfo with the given backend type name exists in this mapping. + + + + + Determine if a NpgsqlNativeTypeInfo with the given NpgsqlDbType exists in this mapping. + + + + + Determine if a NpgsqlNativeTypeInfo with the given Type name exists in this mapping. + + + + + Get the number of type infos held. + + + + + Implements for version 3 of the protocol. + + + + + Reads a row, field by field, allowing a DataRow to be built appropriately. + + + + + Reads part of a field, as needed (for + and + + + + + Adds further functionality to stream that is dependant upon the type of data read. + + + + + Completes the implementation of Streamer for char data. + + + + + Completes the implementation of Streamer for byte data. + + + + + Implements for version 2 of the protocol. + + + + + Encapsulates the null mapping bytes sent at the start of a version 2 + datarow message, and the process of identifying the nullity of the data + at a particular index + + + + + Provides the underlying mechanism for reading schema information. + + + + + Creates an NpgsqlSchema that can read schema information from the database. + + An open database connection for reading metadata. + + + + Returns the MetaDataCollections that lists all possible collections. + + The MetaDataCollections + + + + Returns the Restrictions that contains the meaning and position of the values in the restrictions array. + + The Restrictions + + + + Returns the Databases that contains a list of all accessable databases. + + The restrictions to filter the collection. + The Databases + + + + Returns the Tables that contains table and view names and the database and schema they come from. + + The restrictions to filter the collection. + The Tables + + + + Returns the Columns that contains information about columns in tables. + + The restrictions to filter the collection. + The Columns. + + + + Returns the Views that contains view names and the database and schema they come from. + + The restrictions to filter the collection. + The Views + + + + Returns the Users containing user names and the sysid of those users. + + The restrictions to filter the collection. + The Users. + + + + This is the abstract base class for NpgsqlAsciiRow and NpgsqlBinaryRow. + + + + + Implements a bit string; a collection of zero or more bits which can each be 1 or 0. + BitString's behave as a list of bools, though like most strings and unlike most collections the position + tends to be of as much significance as the value. + BitStrings are often used as masks, and are commonly cast to and from other values. + + + + + Represents the empty string. + + + + + Create a BitString from an enumeration of boolean values. The BitString will contain + those booleans in the order they came in. + + The boolean values. + + + + Creates a BitString filled with a given number of true or false values. + + The value to fill the string with. + The number of bits to fill. + + + + Creats a bitstring from a string. + The string to copy from. + + + + + + Creates a single-bit element from a boolean value. + + The bool value which determines whether + the bit is 1 or 0. + + + + Creates a bitstring from an unsigned integer value. The string will be the shortest required to + contain the integer (e.g. 1 bit for 0 or 1, 2 for 2 or 3, 3 for 4-7, and so on). + + The integer. + This method is not CLS Compliant, and may not be available to some languages. + + + + Creates a bitstring from an integer value. The string will be the shortest required to + contain the integer (e.g. 1 bit for 0 or 1, 2 for 2 or 3, 3 for 4-7, and so on). + + The integer. + + + + Finds the first instance of a given value + + The value - whether true or false - to search for. + The index of the value found, or -1 if none are present. + + + + True if there is at least one bit with the value looked for. + + The value - true or false - to detect. + True if at least one bit was the same as item, false otherwise. + + + + Copies the bitstring to an array of bools. + + The boolean array to copy to. + The index in the array to start copying from. + + + + Returns an enumerator that enumerates through the string. + + The enumerator. + + + + Creats a bitstring by concatenating another onto this one. + + The string to append to this one. + The combined strings. + + + + Returns a substring of this string. + + The position to start from, must be between 0 and the length of the string. + The length of the string to return, must be greater than zero, and may not be + so large that the start + length exceeds the bounds of this instance. + The Bitstring identified + + + + Returns a substring of this string. + + The position to start from, must be between 0 and the length of the string, + the rest of the string is returned. + The Bitstring identified + + + + A logical and between this string and another. The two strings must be the same length. + + Another BitString to AND with this one. + A bitstring with 1 where both BitStrings had 1 and 0 otherwise. + + + + A logical or between this string and another. The two strings must be the same length. + + Another BitString to OR with this one. + A bitstring with 1 where either BitString had 1 and 0 otherwise. + + + + A logical xor between this string and another. The two strings must be the same length. + + Another BitString to XOR with this one. + A bitstring with 1 where one BitStrings and the other had 0, + and 0 where they both had 1 or both had 0. + + + + A bitstring that is the logical inverse of this one. + + A bitstring of the same length as this with 1 where this has 0 and vice-versa. + + + + Shifts the string operand bits to the left, filling with zeros to produce a + string of the same length. + + The number of bits to shift to the left. + A left-shifted bitstring. + The behaviour of LShift is closer to what one would expect from dealing + with PostgreSQL bit-strings than in using the same operations on integers in .NET + In particular, negative operands result in a right-shift, and operands greater than + the length of the string will shift it entirely, resulting in a zero-filled string. + + + + + Shifts the string operand bits to the right, filling with zeros to produce a + string of the same length. + + The number of bits to shift to the right. + A right-shifted bitstring. + The behaviour of RShift is closer to what one would expect from dealing + with PostgreSQL bit-strings than in using the same operations on integers in .NET + In particular, negative operands result in a left-shift, and operands greater than + the length of the string will shift it entirely, resulting in a zero-filled string. It also performs + a logical shift, rather than an arithmetic shift, so it always sets the vacated bit positions to zero + (like PostgreSQL and like .NET for unsigned integers but not for signed integers). + + + + + Returns true if the this string is identical to the argument passed. + + + + + Compares two strings. Strings are compared as strings, so while 0 being less than 1 will + mean a comparison between two strings of the same size is the same as treating them as numbers, + in the case of two strings of differing lengths the comparison starts at the right-most (most significant) + bit, and if all bits of the shorter string are exhausted without finding a comparison, then the larger + string is deemed to be greater than the shorter (0010 is greater than 0001 but less than 00100). + + Another string to compare with this one. + A value if the two strings are identical, an integer less + than zero if this is less than the argument, and an integer greater + than zero otherwise. + + + + Compares the string with another object. + + The object to compare with. + If the object is null then this string is considered greater. If the object is another BitString + then they are compared as in the explicit comparison for BitStrings + in any other case a is thrown. + + + + Compares this BitString with an object for equality. + + + + + Returns a code for use in hashing operations. + + + + + Returns a string representation of the BitString. + + + A string which can contain a letter and optionally a number which sets a minimum size for the string + returned. In each case using the lower-case form of the letter will result in a lower-case string + being returned. + + + B + A string of 1s and 0s. + + + X + An hexadecimal string (will result in an error unless the string's length is divisible by 4). + + + G + A string of 1s and 0s in single-quotes preceded by 'B' (Postgres bit string literal syntax). + + Y + An hexadecimal string in single-quotes preceded by 'X' (Postgres bit literal syntax, will result in an error unless the string's length is divisible by 4. + + C + The format produced by format-string "Y" if legal, otherwise that produced by format-string "G". + E + The most compact safe representation for Postgres. If single bit will be either a 0 or a 1. Otherwise if it + can be that produce by format string "Y" it will, otherwise if there are less than 9bits in length it will be that + produced by format-string "G". For longer strings that cannot be represented in hexadecimal it will be a string + representing the first part of the string in format "Y" followed by the PostgreSQL concatenation operator, followed + by the final bits in the format "G". E.g. "X'13DCE'||B'110'" + If format is empty or null, it is treated as if "B" had been passed (the default repreesentation, and that + generally used by PostgreSQL for display). + + The formatted string. + + + + Returns a string representation for the Bitstring + + A string containing '0' and '1' characters. + + + + Returns the same string as . formatProvider is ignored. + + + + + Parses a string to produce a BitString. Most formats that can be produced by + can be accepted, but hexadecimal + can be interpreted with the preceding X' to mark the following characters as + being hexadecimal rather than binary. + + + + + Performs a logical AND on the two operands. + + + + + Performs a logcial OR on the two operands. + + + + + Perofrms a logical EXCLUSIVE-OR on the two operands + + + + + Performs a logical NOT on the operand. + + + + + Concatenates the operands. + + + + + Left-shifts the string BitString. + + + + + Right-shifts the string BitString. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Compares the two operands. + + + + + Interprets the bitstring as a series of bits in an encoded character string, + encoded according to the Encoding passed, and returns that string. + The bitstring must contain a whole number of octets(bytes) and also be + valid according to the Encoding passed. + + The to use in producing the string. + The string that was encoded in the BitString. + + + + Interprets the bitstring as a series of octets (bytes) and returns those octets. Fails + if the Bitstring does not contain a whole number of octets (its length is not evenly + divisible by 8). + + + + + Interprets the bitstring as a series of signed octets (bytes) and returns those octets. Fails + if the Bitstring does not contain a whole number of octets (its length is not evenly + divisible by 8). + This method is not CLS-Compliant and may not be available to languages that cannot + handle signed bytes. + + + + + Interprets the bitstring as a series of unsigned 16-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 16. + This method is not CLS-Compliant and may not be available to languages that cannot + handle unsigned integers. + + + + + Interprets the bitstring as a series of 16-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 16. + + + + + Interprets the bitstring as a series of unsigned 32-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 32. + This method is not CLS-Compliant and may not be available to languages that cannot + handle unsigned integers. + + + + + Interprets the bitstring as a series of signed 32-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 32. + + + + + Interprets the bitstring as a series of unsigned 64-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 64. + This method is not CLS-Compliant and may not be available to languages that cannot + handle unsigned integers. + + + + + Interprets the bitstring as a series of signed 64-bit integers and returns those integers. + Fails if the Bitstring's length is not evenly divisible by 64. + + + + + The length of the string. + + + + + Retrieves the value of the bit at the given index. + + + + + C# implementation of the MD5 cryptographic hash function. + + + + + Creates a new MD5CryptoServiceProvider. + + + + + Drives the hashing function. + + Byte array containing the data to hash. + Where in the input buffer to start. + Size in bytes of the data in the buffer to hash. + + + + This finalizes the hash. Takes the data from the chaining variables and returns it. + + + + + Resets the class after use. Called automatically after hashing is done. + + + + + This is the meat of the hash function. It is what processes each block one at a time. + + Byte array to process data from. + Where in the byte array to start processing. + + + + Pads and then processes the final block. + + Buffer to grab data from. + Position in buffer in bytes to get data from. + How much data in bytes in the buffer to use. + + + + Stream for writing data to a table on a PostgreSQL version 7.4 or newer database during an active COPY FROM STDIN operation. + Passes data exactly as is and when given, so see to it that you use server encoding, correct format and reasonably sized writes! + + + + + Created only by NpgsqlCopyInState.StartCopy() + + + + + Successfully completes copying data to server. Returns after operation is finished. + Does nothing if this stream is not the active copy operation writer. + + + + + Withdraws an already started copy operation. The operation will fail with given error message. + Does nothing if this stream is not the active copy operation writer. + + + + + Writes given bytes to server. + Fails if this stream is not the active copy operation writer. + + + + + Flushes stream contents to server. + Fails if this stream is not the active copy operation writer. + + + + + Not readable + + + + + Not seekable + + + + + Not supported + + + + + True while this stream can be used to write copy data to server + + + + + False + + + + + True + + + + + False + + + + + Number of bytes written so far + + + + + Number of bytes written so far; not settable + + + + + Represents a SQL statement or function (stored procedure) to execute + against a PostgreSQL database. This class cannot be inherited. + + + + + Initializes a new instance of the NpgsqlCommand class. + + + + + Initializes a new instance of the NpgsqlCommand class with the text of the query. + + The text of the query. + + + + Initializes a new instance of the NpgsqlCommand class with the text of the query and a NpgsqlConnection. + + The text of the query. + A NpgsqlConnection that represents the connection to a PostgreSQL server. + + + + Initializes a new instance of the NpgsqlCommand class with the text of the query, a NpgsqlConnection, and the NpgsqlTransaction. + + The text of the query. + A NpgsqlConnection that represents the connection to a PostgreSQL server. + The NpgsqlTransaction in which the NpgsqlCommand executes. + + + + Used to execute internal commands. + + + + + Attempts to cancel the execution of a NpgsqlCommand. + + This Method isn't implemented yet. + + + + Create a new command based on this one. + + A new NpgsqlCommand object. + + + + Create a new command based on this one. + + A new NpgsqlCommand object. + + + + Creates a new instance of an DbParameter object. + + An DbParameter object. + + + + Creates a new instance of a NpgsqlParameter object. + + A NpgsqlParameter object. + + + + Slightly optimised version of ExecuteNonQuery() for internal ues in cases where the number + of affected rows is of no interest. + + + + + Executes a SQL statement against the connection and returns the number of rows affected. + + The number of rows affected if known; -1 otherwise. + + + + Sends the CommandText to + the Connection and builds a + NpgsqlDataReader + using one of the CommandBehavior values. + + One of the CommandBehavior values. + A NpgsqlDataReader object. + + + + Sends the CommandText to + the Connection and builds a + NpgsqlDataReader. + + A NpgsqlDataReader object. + + + + Sends the CommandText to + the Connection and builds a + NpgsqlDataReader + using one of the CommandBehavior values. + + One of the CommandBehavior values. + A NpgsqlDataReader object. + Currently the CommandBehavior parameter is ignored. + + + + This method binds the parameters from parameters collection to the bind + message. + + + + + Executes the query, and returns the first column of the first row + in the result set returned by the query. Extra columns or rows are ignored. + + The first column of the first row in the result set, + or a null reference if the result set is empty. + + + + Creates a prepared version of the command on a PostgreSQL server. + + + + + This method checks the connection state to see if the connection + is set or it is open. If one of this conditions is not met, throws + an InvalidOperationException + + + + + This method substitutes the Parameters, if exist, in the command + to their actual values. + The parameter name format is :ParameterName. + + A version of CommandText with the Parameters inserted. + + + + Gets or sets the SQL statement or function (stored procedure) to execute at the data source. + + The Transact-SQL statement or stored procedure to execute. The default is an empty string. + + + + Gets or sets the wait time before terminating the attempt + to execute a command and generating an error. + + The time (in seconds) to wait for the command to execute. + The default is 20 seconds. + + + + Gets or sets a value indicating how the + CommandText property is to be interpreted. + + One of the CommandType values. The default is CommandType.Text. + + + + Gets or sets the NpgsqlConnection + used by this instance of the NpgsqlCommand. + + The connection to a data source. The default value is a null reference. + + + + Gets the NpgsqlParameterCollection. + + The parameters of the SQL statement or function (stored procedure). The default is an empty collection. + + + + Gets or sets the NpgsqlTransaction + within which the NpgsqlCommand executes. + + The NpgsqlTransaction. + The default value is a null reference. + + + + Gets or sets how command results are applied to the DataRow + when used by the Update + method of the DbDataAdapter. + + One of the UpdateRowSource values. + + + + Returns oid of inserted row. This is only updated when using executenonQuery and when command inserts just a single row. If table is created without oids, this will always be 0. + + + + + Represents a collection of parameters relevant to a NpgsqlCommand + as well as their respective mappings to columns in a DataSet. + This class cannot be inherited. + + + + + Initializes a new instance of the NpgsqlParameterCollection class. + + + + + Adds the specified NpgsqlParameter object to the NpgsqlParameterCollection. + + The NpgsqlParameter to add to the collection. + The index of the new NpgsqlParameter object. + + + + Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified parameter name and value. + + The name of the NpgsqlParameter. + The Value of the NpgsqlParameter to add to the collection. + The index of the new NpgsqlParameter object. + + Use caution when using this overload of the + Add method to specify integer parameter values. + Because this overload takes a value of type Object, + you must convert the integral value to an Object + type when the value is zero, as the following C# example demonstrates. + parameters.Add(":pname", Convert.ToInt32(0)); + If you do not perform this conversion, the compiler will assume you + are attempting to call the NpgsqlParameterCollection.Add(string, DbType) overload. + + + + + Adds a NpgsqlParameter to the NpgsqlParameterCollection given the parameter name and the data type. + + The name of the parameter. + One of the DbType values. + The index of the new NpgsqlParameter object. + + + + Adds a NpgsqlParameter to the NpgsqlParameterCollection with the parameter name, the data type, and the column length. + + The name of the parameter. + One of the DbType values. + The length of the column. + The index of the new NpgsqlParameter object. + + + + Adds a NpgsqlParameter to the NpgsqlParameterCollection with the parameter name, the data type, the column length, and the source column name. + + The name of the parameter. + One of the DbType values. + The length of the column. + The name of the source column. + The index of the new NpgsqlParameter object. + + + + Removes the specified NpgsqlParameter from the collection using the parameter name. + + The name of the NpgsqlParameter object to retrieve. + + + + Gets a value indicating whether a NpgsqlParameter with the specified parameter name exists in the collection. + + The name of the NpgsqlParameter object to find. + true if the collection contains the parameter; otherwise, false. + + + + Gets the location of the NpgsqlParameter in the collection with a specific parameter name. + + The name of the NpgsqlParameter object to find. + The zero-based location of the NpgsqlParameter in the collection. + + + + Removes the specified NpgsqlParameter from the collection using a specific index. + + The zero-based index of the parameter. + + + + Inserts a NpgsqlParameter into the collection at the specified index. + + The zero-based index where the parameter is to be inserted within the collection. + The NpgsqlParameter to add to the collection. + + + + Removes the specified NpgsqlParameter from the collection. + + The NpgsqlParameter to remove from the collection. + + + + Gets a value indicating whether a NpgsqlParameter exists in the collection. + + The value of the NpgsqlParameter object to find. + true if the collection contains the NpgsqlParameter object; otherwise, false. + + + + Gets a value indicating whether a NpgsqlParameter with the specified parameter name exists in the collection. + + The name of the NpgsqlParameter object to find. + A reference to the requested parameter is returned in this out param if it is found in the list. This value is null if the parameter is not found. + true if the collection contains the parameter and param will contain the parameter; otherwise, false. + + + + Removes all items from the collection. + + + + + Gets the location of a NpgsqlParameter in the collection. + + The value of the NpgsqlParameter object to find. + The zero-based index of the NpgsqlParameter object in the collection. + + + + Adds the specified NpgsqlParameter object to the NpgsqlParameterCollection. + + The NpgsqlParameter to add to the collection. + The zero-based index of the new NpgsqlParameter object. + + + + Copies NpgsqlParameter objects from the NpgsqlParameterCollection to the specified array. + + An Array to which to copy the NpgsqlParameter objects in the collection. + The starting index of the array. + + + + Returns an enumerator that can iterate through the collection. + + An IEnumerator that can be used to iterate through the collection. + + + + In methods taking an object as argument this method is used to verify + that the argument has the type NpgsqlParameter + + The object to verify + + + + Gets the NpgsqlParameter with the specified name. + + The name of the NpgsqlParameter to retrieve. + The NpgsqlParameter with the specified name, or a null reference if the parameter is not found. + + + + Gets the NpgsqlParameter at the specified index. + + The zero-based index of the NpgsqlParameter to retrieve. + The NpgsqlParameter at the specified index. + + + + Gets the number of NpgsqlParameter objects in the collection. + + The number of NpgsqlParameter objects in the collection. + + + + Represents an ongoing COPY FROM STDIN operation. + Provides methods to push data to server and end or cancel the operation. + + + + + Called from NpgsqlState.ProcessBackendResponses upon CopyInResponse. + If CopyStream is already set, it is used to read data to push to server, after which the copy is completed. + Otherwise CopyStream is set to a writable NpgsqlCopyInStream that calls SendCopyData each time it is written to. + + + + + Sends given packet to server as a CopyData message. + Does not check for notifications! Use another thread for that. + + + + + Sends CopyDone message to server. Handles responses, ie. may throw an exception. + + + + + Sends CopyFail message to server. Handles responses, ie. should always throw an exception: + in CopyIn state the server responds to CopyFail with an error response; + outside of a CopyIn state the server responds to CopyFail with an error response; + without network connection or whatever, there's going to eventually be a failure, timeout or user intervention. + + + + + Copy format information returned from server. + + + + + Represents a PostgreSQL Point type + + + + + Represents a PostgreSQL Line Segment type. + + + + + Represents a PostgreSQL Path type. + + + + + Represents a PostgreSQL Polygon type. + + + + + Represents a PostgreSQL Circle type. + + + + + Represents a PostgreSQL inet type. + + + + + This class represents a PasswordPacket message sent to backend + PostgreSQL. + + +
+
diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/40/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/40/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest new file mode 100644 index 0000000..47bd4a0 --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/40/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest @@ -0,0 +1,6 @@ + + + + + Vy8CgQgbu3qH5JHTK0op4kR8114= QTJu3Gttpt8hhCktGelNeXj4Yp8= 1ruqF7/L+m1tqnJVscaOtNRNHIE= + \ No newline at end of file diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/40/amd64/Microsoft.VC90.CRT/README_ENU.txt b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/40/amd64/Microsoft.VC90.CRT/README_ENU.txt new file mode 100644 index 0000000..fc38b36 Binary files /dev/null and b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/40/amd64/Microsoft.VC90.CRT/README_ENU.txt differ diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/40/policy.2.0.Npgsql.config b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/40/policy.2.0.Npgsql.config new file mode 100644 index 0000000..ac99fb8 --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/40/policy.2.0.Npgsql.config @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/40/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/40/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest new file mode 100644 index 0000000..bbd12cc --- /dev/null +++ b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/40/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest @@ -0,0 +1,6 @@ + + + + + +CXED+6HzJlSphyMNOn27ujadC0= MyKED+9DyS+1XcMeaC0Zlw2vFZ0= EeyDE7og6WoPd2oBhYbMEnpFHhY= + \ No newline at end of file diff --git a/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/40/x86/Microsoft.VC90.CRT/README_ENU.txt b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/40/x86/Microsoft.VC90.CRT/README_ENU.txt new file mode 100644 index 0000000..fc38b36 Binary files /dev/null and b/linger/src/packages/FluentMigrator.Tools.1.0.6.0/tools/x86/40/x86/Microsoft.VC90.CRT/README_ENU.txt differ diff --git a/linger/src/packages/ImpromptuInterface.6.0.6/ImpromptuInterface.6.0.6.nuspec b/linger/src/packages/ImpromptuInterface.6.0.6/ImpromptuInterface.6.0.6.nuspec new file mode 100644 index 0000000..141dded --- /dev/null +++ b/linger/src/packages/ImpromptuInterface.6.0.6/ImpromptuInterface.6.0.6.nuspec @@ -0,0 +1,18 @@ + + + + ImpromptuInterface + 6.0.6 + Jay Tuley + Jay Tuley + http://www.apache.org/licenses/LICENSE-2.0 + http://code.google.com/p/impromptu-interface/ + http://impromptu-interface.googlecode.com/files/ImpromptuInterface-Icon.png + false + A Lightweight Duck Casting Framework for dynamic C# 4.0 (.net4 & silverlight4 & silveright5 ). Includes helper methods for dynamic invocation via method and property names known only at runtime (runs faster than reflection). + ducktyping duckcasting dynamic .net40 Silverlight proxy impromptu interface reflection dlr currying + + + + + \ No newline at end of file diff --git a/linger/src/packages/ImpromptuInterface.6.0.6/License.txt b/linger/src/packages/ImpromptuInterface.6.0.6/License.txt new file mode 100644 index 0000000..40e8d92 --- /dev/null +++ b/linger/src/packages/ImpromptuInterface.6.0.6/License.txt @@ -0,0 +1,86 @@ +Apache License, Version 2.0 +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and +You must cause any modified files to carry prominent notices stating that You changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/linger/src/packages/ImpromptuInterface.6.0.6/Readme.txt b/linger/src/packages/ImpromptuInterface.6.0.6/Readme.txt new file mode 100644 index 0000000..125e1cc --- /dev/null +++ b/linger/src/packages/ImpromptuInterface.6.0.6/Readme.txt @@ -0,0 +1,63 @@ +impromptu-interface http://code.google.com/p/impromptu-interface/ + +C# 4.0 framework to allow you to wrap any object with a static Duck Typing Interface, emits cached dynamic binding code inside a proxy. + +Copyright 2010-2012 Ekon Benefits +Apache Licensed: http://www.apache.org/licenses/LICENSE-2.0 + +Author: +Jay Tuley jay+code@tuley.name + + +Usage: + public interface ISimpeleClassProps + { + string Prop1 { get; } + + long Prop2 { get; } + + Guid Prop3 { get; } + } + var tAnon = new {Prop1 = "Test", Prop2 = 42L, Prop3 = Guid.NewGuid()}; + + ISimpeleClassProps tActsLike = tAnon.ActLike(); +Or + dynamic tNew = new ExpandoObject(); + tNew.Prop1 = "Test"; + tNew.Prop2 = 42L; + tNew.Prop3 = Guid.NewGuid(); + + ISimpeleClassProps tActsLike = Impromptu.ActLike(tNew); + +Also Contains may primitive base classes such as: + +ImpromptuObject --Similar to DynamicObject but the expected static return type from the wrapped interface can be queried. +ImpromptuFactory -- Functional base class, used to create fluent factories with less boilerplate +ImpromptuDictionary -- Similar to ExpandoObject but returns default of the static return type if the property has never been set. +Mimic -- Accepts any call you make +ImpromptuLateLibraryType -- Allows you to use a type loaded at runtime using the dynamic keyword. + +Includes Fluent syntaxes for buiding object graphs & Regexes & Currying + +And has a full suite of helper invocation methods: + +dynamic InvokeConvert(object target, Type type, bool explict =false) +dynamic InvokeConstructor(Type type, params object[] args) +dynamic Impromptu.InvokeGet(object target, String_Or_InvokeMemberName name) +dynamic Impromptu.InvokeSet(object target, String_Or_InvokeMemberName name, object value) +dynamic InvokeGetIndex(object target, params object[] indexes) +dynamic InvokeSetIndex(object target, params object[] indexesThenValue) +dynamic Impromptu.InvokeMember(object target, String_Or_InvokeMemberName name, params object[] args) +dynamic Impromptu.InvokeMemberAction(object target, String_Or_InvokeMemberName name, params object[] args) +dynamic Impromptu.Invoke(object target, params object[] args) +dynamic Impromptu.InvokeAction(object target, params object[] args) +dynamic Impromptu.InvokeGetChain(object target, string propertyChain) +dynamic Impromptu.InvokeSetChain(object target, string propertyChain) +dynamic Impromputu.InvokeSetAll(object target, ...) +IEnumerable GetMemberNames(object target, bool dynamicOnly = false) +void Impromputu.InvokeAddAssign(object target, string name, object value) +void Impromputu.InvokeSubtractAssign(object target, string name, object value) +bool Impromputu.InvokeIsEvent(object target, string name) +dynamic Impromputu.InvokeBinaryOperator(dynamic leftArg, ExpressionType op, dynamic rightArg) +dynamic Impromputu.InvokeUnaryOpartor(ExpressionType op, dynamic arg) +dynamic Impromputu.CoerceConvert(object target, Type type) //uses every runtime conversion available to convert. \ No newline at end of file diff --git a/linger/src/packages/ImpromptuInterface.6.0.6/lib/SL40/ImpromptuInterface.XML b/linger/src/packages/ImpromptuInterface.6.0.6/lib/SL40/ImpromptuInterface.XML new file mode 100644 index 0000000..cf74ea5 --- /dev/null +++ b/linger/src/packages/ImpromptuInterface.6.0.6/lib/SL40/ImpromptuInterface.XML @@ -0,0 +1,4146 @@ + + + + ImpromptuInterface + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Extension method for Dealing with Special Delegate Type + + + + + Determines whether [is special this delegate] [the specified del]. + + The del. + + true if [is special this delegate] [the specified del]; otherwise, false. + + + + + Base Class for making a fluent factory using an Impromptu Interface return type. + + + + + Dynamic Object that knows about the Impromtu Interface return types; + Override Typical Dynamic Object methods, and use TypeForName to get the return type of an interface member. + + + + + This interface can be used on your custom dynamic objects if you want to know the interface you are impromptu-ly implementing. + + + + + Property used to pass interface information to proxied object + + + + + Sets the known property spec. + + The known property spec. + + + + This interface can be used on your custom dynamic objects if you want impromptu interfaces without casting to object or using the static method syntax of ActLike. + Also if you want to change the behavior for slightly for specific types as this will take precident when using the dynamic keyword or your specific type is known staticly. + + + + + This interface can be used on your custom dynamic objects if you want impromptu interfaces without casting to object or using the static method syntax of ActLike. + Also if you want to change the behavior for slightly for specific types as this will take precident when using the dynamic keyword or your specific type is known staticly. + + + + + + + + Added for silverlight compile time compatability + + + + + Initializes a new instance of the class. + + + + + Cache to avoid refelection for same Interfaces. + + + + + Hash for this instance to lookup cached values from + + + + + Keep Track of Known Property Spec + + + + + Returns the enumeration of all dynamic member names. + + + A sequence that contains dynamic member names. + + + + + Tries to get the type for the property name from the interface. + + The name. + The return Type. + + + + + Allows ActLike to be called via dyanmic invocation + + The type of the interface. + The other interfaces. + + + + + Gets or sets the known interfaces. + Set should only be called be the factory methood + + The known interfaces. + + + + Gets or sets the known fake interface (string method name to return type mapping). + + The known fake interface. + + + + Creates this instance with Interface; + + + + + + + Provides the default implementation for operations that get instance as defined by . Classes derived from the class can override this method to specify dynamic behavior for operations such as getting a value for a property. + + Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement, where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The result of the get operation. For example, if the method is called for a property, you can assign the property value to . + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.) + + + + + Provides the implementation for operations that invoke a member. Classes derived from the class can override this method to specify dynamic behavior for operations such as calling a method. + + Provides information about the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleMethod". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The arguments that are passed to the object member during the invoke operation. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is derived from the class, [0] is equal to 100. + The result of the member invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Constructs the type. Override for changing type intialization property changes. + + The type. + The args. + + + + + Gets the instance for a dynamic member. Override for type constrcution behavoir changes based on property name. + + Name of the member. + The args. + + + + + Base Class for making a singleton fluent factory using an Impromptu Interface return type. + + + + + Creates this instance with Interface; + + + + + + + Store Singletons + + + + + Lock for accessing singletons + + + + + Gets the instance for a dynamic member. Override for type constrcution behavoir changes based on property name. + + Name of the member. + + + + + + This interface can be used to access the original content of your emitted type; + + + + + Returns the proxied object + + + + + Dynamic Proxy that exposes any properties of objects, and can massage results based on interface + + + + + Proxies Calls allows subclasser to override do extra actions before or after base invocation + + + This may not be as efficient as other proxies that can work on just static objects or just dynamic objects... + Consider this when using. + + + + + Get access to target of original proxy + + + + + Gets the target. + + The target. + + + + Initializes a new instance of the class. + + The target. + + + + Returns the enumeration of all dynamic member names. + + + A sequence that contains dynamic member names. + + + + + Provides the implementation for operations that get member values. Classes derived from the class can override this method to specify dynamic behavior for operations such as getting a value for a property. + + Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement, where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The result of the get operation. For example, if the method is called for a property, you can assign the property value to . + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.) + + + + + Provides the implementation for operations that invoke an object. Classes derived from the class can override this method to specify dynamic behavior for operations such as invoking an object or a delegate. + + Provides information about the invoke operation. + The arguments that are passed to the object during the invoke operation. For example, for the sampleObject(100) operation, where sampleObject is derived from the class, is equal to 100. + The result of the object invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown. + + + + + Equals the specified other. + + The other. + + + + + Gets or sets the target. + + The target. + + + + Gets the call target. + + The call target. + + + + Initializes a new instance of the class. + + The target. + + + + Creates the proxy over the specified target. + + Interface + The target. + + + + + Creates the proxy over the specified target. + + The target. + + + + + Provides the implementation for operations that get member values. Classes derived from the class can override this method to specify dynamic behavior for operations such as getting a value for a property. + + Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement, where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The result of the get operation. For example, if the method is called for a property, you can assign the property value to . + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.) + + + + + Provides the implementation for operations that invoke a member. Classes derived from the class can override this method to specify dynamic behavior for operations such as calling a method. + + Provides information about the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleMethod". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The arguments that are passed to the object member during the invoke operation. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is derived from the class, is equal to 100. + The result of the member invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Tries the index of the get. + + The binder. + The indexes. + The result. + + + + + Internal Implementation of + + + + + Provides implementation for type conversion operations. Classes derived from the class can override this method to specify dynamic behavior for operations that convert an object from one type to another. + + Provides information about the conversion operation. The binder.Type property provides the type to which the object must be converted. For example, for the statement (String)sampleObject in C# (CType(sampleObject, Type) in Visual Basic), where sampleObject is an instance of the class derived from the class, binder.Type returns the type. The binder.Explicit property provides information about the kind of conversion that occurs. It returns true for explicit conversion and false for implicit conversion. + The result of the type conversion operation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Provides the implementation for operations that invoke a member. Classes derived from the class can override this method to specify dynamic behavior for operations such as calling a method. + + Provides information about the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleMethod". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The arguments that are passed to the object member during the invoke operation. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is derived from the class, [0] is equal to 100. + The result of the member invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Provides the implementation for operations that invoke an object. Classes derived from the class can override this method to specify dynamic behavior for operations such as invoking an object or a delegate. + + Provides information about the invoke operation. + The arguments that are passed to the object during the invoke operation. For example, for the sampleObject(100) operation, where sampleObject is derived from the class, [0] is equal to 100. + The result of the object invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown. + + + + + Internal method for subsequent invocations of + + + + + Provides implementation for type conversion operations. Classes derived from the class can override this method to specify dynamic behavior for operations that convert an object from one type to another. + + Provides information about the conversion operation. The binder.Type property provides the type to which the object must be converted. For example, for the statement (String)sampleObject in C# (CType(sampleObject, Type) in Visual Basic), where sampleObject is an instance of the class derived from the class, binder.Type returns the type. The binder.Explicit property provides information about the kind of conversion that occurs. It returns true for explicit conversion and false for implicit conversion. + The result of the type conversion operation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Provides the implementation for operations that invoke an object. Classes derived from the class can override this method to specify dynamic behavior for operations such as invoking an object or a delegate. + + Provides information about the invoke operation. + The arguments that are passed to the object during the invoke operation. For example, for the sampleObject(100) operation, where sampleObject is derived from the class, is equal to 100. + The result of the object invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown. + + + + + Gets the target. + + The target. + + + + Gets the name of the member. + + The name of the member. + + + + Gets the args. + + The args. + + + + Gets the total arg count. + + The total arg count. + + + + Gets the kind of the invocation. + + The kind of the invocation. + + + + Does most of the work buiding and caching proxies + + + + + Builds the type for the static proxy or returns from cache + + Type of the context. + The main interface. + The other interfaces. + + + + + Builds the type. + + Type of the context. + The informal interface. + + + + + Preloads a proxy for ActLike to use. + + Type of the proxy. + The ActLikeProxyAttribute, if not provide it will be looked up. + Returns false if there already is a proxy registered for the same type. + + + + Preloads proxies that ActLike uses from assembly. + + The assembly. + Returns false if there already is a proxy registered for the same type. + + + + Makes the property helper. + + The builder. + The type builder. + The info. + The get method. + The set method. + The emit info. + + + + Generates the delegate type of the call site function. + + The arg types. + Type of the return. + The method info. Required for reference types or delegates with more than 16 arguments. + The Type Builder. Required for reference types or delegates with more than 16 arguments. + + + + + Module Builder for buiding proxies + + + + + Base class of Expando-Type objects + + + + + Wrapped Dictionary + + + + + Initializes a new instance of the class. + + The dict. + + + + Returns the enumeration of all dynamic member names. + + + A sequence that contains dynamic member names. + + + + + Provides the implementation for operations that get member values. Classes derived from the class can override this method to specify dynamic behavior for operations such as getting a value for a property. + + Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement, where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The result of the get operation. For example, if the method is called for a property, you can assign the property value to . + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.) + + + + + Provides the implementation for operations that invoke a member. Classes derived from the class can override this method to specify dynamic behavior for operations such as calling a method. + + Provides information about the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleMethod". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The arguments that are passed to the object member during the invoke operation. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is derived from the class, is equal to 100. + The result of the member invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Provides the implementation for operations that set member values. Classes derived from the class can override this method to specify dynamic behavior for operations such as setting a value for a property. + + Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member to which the value is being assigned. For example, for the statement sampleObject.SampleProperty = "Test", where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The value to set to the member. For example, for sampleObject.SampleProperty = "Test", where sampleObject is an instance of the class derived from the class, the is "Test". + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Adds the specified item. + + The item. + + + + Determines whether [contains] [the specified item]. + + The item. + + true if [contains] [the specified item]; otherwise, false. + + + + + Copies to. + + The array. + Index of the array. + + + + Removes the specified item. + + The item. + + + + + Determines whether the specified key contains key. + + The key. + + true if the specified key contains key; otherwise, false. + + + + + Adds the specified key. + + The key. + The value. + + + + Removes the specified key. + + The key. + + + + + Tries the get value. + + The key. + The value. + + + + + Called when [property changed]. + + The key. + + + + Equalses the specified other. + + The other. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Gets a value indicating whether this instance is read only. + + + true if this instance is read only; otherwise, false. + + + + + Gets the keys. + + The keys. + + + + Gets the values. + + The values. + + + + Occurs when a property value changes. + + + + + This interface can be used to define your own custom proxy if you preload it. + + + Advanced usage only! This is required as well as + + + + + Method used to Initialize Proxy + + + + + + + + Base class of Emited ProxiesC:\Documents and Settings\jayt\My Documents\Visual Studio 2010\Projects\impromptuinterface\ImpromptuInterface\Optimization\ + + + + + Method used to Initialize Proxy + + + + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Actlike proxy should be equivalent to the objects they proxy + + The other. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns the proxied object + + + + + + Expando-Type List for dynamic objects + + + + + Added for silverlight compile time compatability + + + + + Wrapped list + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The contents. + The members. + + + + Gets the enumerator. + + + + + + Adds the specified item. + + The item. + + + + Clears this instance. + + + + + Determines whether [contains] [the specified item]. + + The item. + + true if [contains] [the specified item]; otherwise, false. + + + + + Copies to. + + The array. + Index of the array. + + + + Indexes the of. + + The item. + + + + + Equalses the specified other. + + The other. + + + + + Gets the represented item. USED fOR GetItemProperties + + + + + + Gets the count. + + The count. + + + + Occurs when the collection changes. + + + + + Gets or sets the override getting item method names. USED for GetItemProperties + + The override getting item method names. + + + + Late bind types from libraries not not at compile type + + + + + Initializes a new instance of the class. + + The type. + + + + Initializes a new instance of the class. + + Qualified Name of the type. + + + + Returns a late bound constructor + + The late bound constructor + + + + Gets a value indicating whether this Type is available at runtime. + + + true if this instance is available; otherwise, false. + + + + + Forward argument to constructor including named arguments + + + + + Extension Methods for fluent Regex + + + + + Implements the operator +. + + The left. + The right. + The result of the operator. + + + + Implements the operator -. + + The left. + The right. + The result of the operator. + + + + Gets or sets the delegate. + + The delegate. + + + + Gets or sets a value indicating whether this instance is adding. + + true if this instance is adding; otherwise, false. + + + + Similar to Expando Objects but handles null values when the property is defined with an impromptu interface + + + + + Convenience create method to make an Impromptu Dictionary instance acting like interface type parameter + + + The dict. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The dict. + + + + Gets the enumerator. + + + + + + Clears this instance. + + + + + Gets the count. + + The count. + + + + Gets or sets the with the specified key. + + + + + + Adds extra synatx to intialize properties to match up with clay + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The dict. + + + + Various extension methods for add + + + + + Combines target with context. + + The target. + The context. + + + + + Combines target with context. + + The type of the context. + The target. + + + + + Combines target with context. + + The target. + The context. + + + + + Withes the static context. + + The target. + The context. + + + + + attaches generic args to string + + The name. + The generic args. + + + + + attaches name of the argument. + + The argument. + The name. + + + + + Use for Named arguments passed to InvokeMethods + + + + + Performs an explicit conversion from to . + + The pair. + The result of the conversion. + + + + Create Function can set to variable to make cleaner syntax; + + + + + Initializes a new instance of the class. + + The name. + The value. + + + + Gets or sets the argument name. + + The name. + + + + Gets or sets the argument value. + + The value. + + + + InvokeArg that makes it easier to Cast from any IDictionaryValue + + + + + + Initializes a new instance of the class. + + The name. + The value. + + + + Performs an explicit conversion from to . + + The pair. + The result of the conversion. + + + + Utility Class + + + + + Determines whether [is anonymous type] [the specified target]. + + The target. + + true if [is anonymous type] [the specified target]; otherwise, false. + + + + + Names the args if necessary. + + The call info. + The args. + + + + + Gets the target context. + + The target. + The context. + if set to true [static context]. + + + + + Fixes the context. + + The context. + + + + + Is Current Runtime Mono? + + + + + String or InvokeMemberName + + + + + Performs an implicit conversion from to . + + The name. + The result of the conversion. + + + + Gets the name. + + The name. + + + + Gets the generic args. + + The generic args. + + + + Gets or sets a value indicating whether this member is special name. + + + true if this instance is special name; otherwise, false. + + + + + Name of Member with associated Generic parameterss + + + + + Create Function can set to variable to make cleaner syntax; + + + + + Create Function can set to variable to make cleaner syntax; + + + + + Performs an implicit conversion from to . + + The name. + The result of the conversion. + + + + Initializes a new instance of the class. + + The name. + The generic args. + + + + Initializes a new instance of the class. + + The name. + if set to true [is special name]. + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Extension Methods that make emiting code easier and easier to read + + + + + Gets the field info even if generic type parameter. + + The type. + Name of the field. + + + + + Gets the method info even if generic type parameter. + + The type. + Name of the method. + The arg types. + + + + + Gets the method info even if generic type parameter. + + The type. + Name of the method. + + + + + Emits branch true. expects using keyword. + + The generator. + The condition. + + + Using keyword allows you to set the emit code you are branching over and then automatically emits label when disposing + + g.Emit(OpCodes.Ldsfld, tConvertField))) + { + tIlGen.EmitDynamicConvertBinder(CSharpBinderFlags.None, returnType, contextType); + tIlGen.EmitCallsiteCreate(convertFuncType); + tIlGen.Emit(OpCodes.Stsfld, tConvertField); + } + ]]> + + + + + + Emits the call. + + The generator. + The target. + The call. + The parameters. + + + + Emits creating the callsite. + + The generator. + Type of the func. + + + + Emits the call invoke delegate. + + The generator. + Type of the func. + + + + Emits an array. + + The generator. + Type of the array. + The emit elements. + + + + Emits the store location. + + The generator. + The location. + + + + Emits the load argument. + + The generator. + The location. + + + + Emits the load location. + + The generator. + The location. + + + + Emits the dynamic method invoke binder. + + The generator. + The binding flags. + The name. + The context. + The arg info. + The arg names. + + + + Emits the dynamic set binder. + + The generator. + The binding flags. + The name. + The context. + The arg types. + + + + Emits the dynamic set binder dynamic params. + + The generator. + The flag. + The name. + The context. + The arg types. + + + + Emits the dynamic binary op binder. + + The generator. + The flag. + Type of the expr. + The context. + The arg types. + + + + Emits the dynamic get binder. + + The generator. + The binding flags. + The name. + The context. + The arg types. + + + + Emits creating the + + The generator. + The flag. + The name. + + + + Emits the dynamic convert binder. + + The generator. + The binding flag. + Type of the return. + The context. + + + + Emits the typeof(Type) + + The generator. + The type. + + + + Emits the typeof(Type) + + The generator. + The type. + + + + Used to automatically create label on dispose + + + + + Constructor + + + + + + Finishes block + + + + + Constructor + + + + + + Finishes block + + + + + Dummy that just returns null of default for everything. + + + + + Initializes a new instance of the class. + + + + + Provides the implementation for operations that get member values. Classes derived from the class can override this method to specify dynamic behavior for operations such as getting a value for a property. + + Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement, where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The result of the get operation. For example, if the method is called for a property, you can assign the property value to . + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.) + + + + + Provides the implementation for operations that set member values. Classes derived from the class can override this method to specify dynamic behavior for operations such as setting a value for a property. + + Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member to which the value is being assigned. For example, for the statement sampleObject.SampleProperty = "Test", where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The value to set to the member. For example, for sampleObject.SampleProperty = "Test", where sampleObject is an instance of the class derived from the class, the is "Test". + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Provides the implementation for operations that invoke a member. Classes derived from the class can override this method to specify dynamic behavior for operations such as calling a method. + + Provides information about the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleMethod". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The arguments that are passed to the object member during the invoke operation. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is derived from the class, is equal to 100. + The result of the member invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Tries the index of the get. + + The binder. + The indexes. + The result. + + + + + Main API + + + + + Creates a cached call site at runtime. + + Type of the delegate. + The CallSite binder. + Member Name + Permissions Context type + The arg names. + if set to true [static context]. + if set to true [is event]. + The CallSite + + Advanced usage only for serious custom dynamic invocation. + + + + + + Creates the call site. + + + The binder. + The name. + The context. + The arg names. + if set to true [static context]. + if set to true [is event]. + + /// + + Unit test that exhibits usage + (tBinder); + tSite.Target.Invoke(tSite, tPoco, out tResult); + Assert.AreEqual("success", tResult); + ]]> + + + + + + Dynamically Invokes a member method using the DLR + + The target. + The name. Can be a string it will be implicitly converted + The args. + The result + + Unit test that exhibits usage: + + (it => it.ToString()); + + var tValue = 1; + var tOut = Impromptu.InvokeMember(tExpando, "Func", tValue); + + Assert.AreEqual(tValue.ToString(), tOut); + ]]> + + + + + + Invokes the binary operator. + + The left arg. + The op. + The right Arg. + + + + + Invokes the unary opartor. + + The arg. + The op. + + + + + Invokes the specified target using the DLR; + + The target. + The args. + + + + + Dynamically Invokes indexer using the DLR. + + The target. + The indexes. + + + + + Convenience version of InvokeSetIndex that separates value and indexes. + + The target. + The value + The indexes + + + + + Invokes setindex. + + The target. + The indexes then value. + + + + Dynamically Invokes a member method which returns void using the DLR + + The target. + The name. + The args. + + Unit test that exhibits usage: + + (it => tTest = it); + + Impromptu.InvokeMemberAction(tExpando, "Action", tValue); + + Assert.AreEqual(tValue, tTest); + ]]> + + + + + + Invokes the action using the DLR + + The target. + The args. + + + + Dynamically Invokes a set member using the DLR. + + The target. + The name. + The value. + + Unit test that exhibits usage: + + + + + + if you call a static property off a type with a static context the csharp dlr binder won't do it, so this method reverts to reflection + + + + + Invokes the set on the end of a property chain. + + The target. + The property chain. + The value. + + + + Wraps a target to partial apply a method (or target if you can invoke target directly eg delegate). + + The target. + The total arg count. + + + + + Wraps a delegate to partially apply it. + + The target. + + + + + Dynamically Invokes a get member using the DLR. + + The target. + The name. + The result. + + Unit Test that describes usage + + + + + + + + Invokes the getter property chain. + + The target. + The property chain. + + + + + Determines whether the specified name on target is event. This allows you to know whether to InvokeMemberAction + add_{name} or a combo of {invokeget, +=, invokeset} and the corresponding remove_{name} + or a combon of {invokeget, -=, invokeset} + + The target. + The name. + + true if the specified target is event; otherwise, false. + + + + + Invokes add assign with correct behavior for events. + + The target. + The name. + The value. + + + + Invokes add assign with correct behavior for events. + + The target. + The name. + The value. + + + + Invokes subtract assign with correct behavior for events. + + The target. + The name. + The value. + + + + Invokes subtract assign with correct behavior for events. + + The target. + The name. + The value. + + + + Invokes convert using the DLR. + + The target. + The type. + if set to true [explicit]. + + + + + (Obsolete)Invokes the constructor. misspelling + + The type. + The args. + + + + + Invokes the constuctor. + + The type. + The args. + + + + + FastDynamicInvoke extension method. Runs up to runs up to 20x faster than . + + The del. + The args. + + + + + Given a generic parameter count and whether it returns void or not gives type of Action or Func + + The param count. + if set to true [return void]. + Type of Action or Func + + + + Gets the member names of properties. Not all IDynamicMetaObjectProvider have support for this. + + The target. + if set to true [dynamic only]. Won't add reflected properties + + + + + Dynamically invokes a method determined by the CallSite binder and be given an appropriate delegate type + + The Callsite + The target. + The args. + + + Advanced use only. Use this method for serious custom invocation, otherwise there are other convenience methods such as + , , and + + + + + Dynamically invokes a method determined by the CallSite binder and be given an appropriate delegate type + + The Callsite + The target. + The args. + + + Advanced use only. Use this method for serious custom invocation, otherwise there are other convenience methods such as + , , and + + + + + Extension Method that Wraps an existing object with an Explicit interface definition + + The type of the interface. + The original object can be annoymous type, System.DynamicObject as well as any others. + Optional other interfaces. + + + + + Extension Method that Wraps an existing object with an Interface of what it is implicitly assigned to. + + The original dynamic. + The other interfaces. + + + + + Makes static methods for the passed in property spec, designed to be used with old api's that reflect properties. + + The original dynamic. + The property spec. + + + + + Private helper method that initializes the proxy. + + The proxytype. + The original. + The interfaces. + The property spec. + + + + + This Extension method is called off the calling context to perserve permissions with the object wrapped with an explicit interface definition. + + The type of the interface. + The caller. + The original dynamic. + The other interfaces. + + + UnitTest That describes usage + + (tTest); + Assert.Throws(() => tNonExposed.Test()); + ]]> + + + + + + Chainable Linq to Objects Method, allows you to wrap a list of objects with an Explict interface defintion + + The type of the interface. + The original dynamic. + The other interfaces. + + + + + Static Method that wraps an existing dyanmic object with a explicit interface type + + The original dynamic. + The other interfaces. + + + + + This Extension method is called off the calling context to perserve permissions with the object wrapped with an explicit interface definition. + + The caller. + The original dynamic. + The other interfaces. + + + + + Chainable Linq to Objects Method, allows you to wrap a list of objects, and preserve method permissions with a caller, with an Explict interface defintion + + The type of the interface. + The original dynamic. + The caller. + The other interfaces. + + + + + Call Like method invokes set on target and a list of property/value. Invoke with dictionary, anonymous type or named arguments. + + The invoke set all. + + + + Builds Objects with a Fluent Syntax + + + + + New Builder + + + + + + New Builder + + The type of the object prototype. + + + + + Syntax for a quick new inline prototype object + + + + + Gets the new object builder. + + The new object. + + + + Gets the new list builder. + + The new list. + + + + Syntax for a quick inline object property setup + + The type of the object prototype. + + + + Gets the new object builder. + + The new. + + + + Gets the new list builder. + + The new list. + + + + Encapsulates an Activator + + + + + Initializes a new instance of the class. + + The type. + The args. + + + + Initializes a new instance of the class. With Factory Function + + The type. + The args. + + + + Creates this instance. + + + + + + Gets or sets the constructor type. + + The type. + + + + Gets or sets the constructor arguments. + + The arguments. + + + + Encapsulates an Activator + + The type of the object prototype. + + + + Initializes a new instance of the class. + + The args. + + + + Initializes a new instance of the class. With Factory Function + + The args. + + + + Creates this instance. + + + + + + Type that Encompasses Hashing a group of Types in various ways + + + + + Equalses the specified other. + + The other. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Implements the operator ==. + + The left. + The right. + The result of the operator. + + + + Implements the operator !=. + + The left. + The right. + The result of the operator. + + + + Types to be hashed + + + + + The Informal Interface to be hashed + + + + + Initializes a new instance of the class. + + The more types. + + + + Initializes a new instance of the class. + For use when you have must distinguish one type; and the rest aren't strict + + The type1. + The more types. + + + + Initializes a new instance of the class. + + The type1. + The informal interface. + + + + Initializes a new instance of the class. + + if set to true [strict order]. + types. + + + + Creates the TypeHash + + The more types. + + + + + Creates the TypeHash + + The type1. + The more types. + + + + + Creates the TypeHash + + The type1. + The informal interface. + + + + + Creates the TypeHash + + if set to true [strict order]. + The more types. + + + + + Cacheable representation of an invocation without the target or arguments also by default only does public methods to make it easier to cache. + /// + + + + Storable representation of an invocation without the target + + + + + Defacto Binder Name for Explicit Convert Op + + + + + Defacto Binder Name for Implicit Convert Op + + + + + Defacto Binder Name for Indexer + + + + + Defacto Binder Name for Construvter + + + + + Creates the invocation. + + The kind. + The name. + The args. + + + + + Initializes a new instance of the class. + + The kind. + The name. + The args. + + + + Equalses the specified other. + + The other. + + + + + Invokes the invocation on specified target with specific args. + + The target. + The args. + + + + + Deprecated use + + The target. + The args. + + + + + Invokes the invocation on specified target. + + The target. + + + + + Gets or sets the kind. + + The kind. + + + + Gets or sets the name. + + The name. + + + + Gets or sets the args. + + The args. + + + + Creates the cacheable convert call. + + Type of the convert. + if set to true [convert explict]. + + + + + Creates the cacheable method or indexer or property call. + + The kind. + The name. + The callInfo. + The context. + + + + + Initializes a new instance of the class. + + The kind. + The name. + The arg count. + The arg names. + The context. + Type of the convert. + if set to true [convert explict]. + The stored args. + + + + Equalses the specified other. + + The other. + + + + + LazyBinderType + + + + + Specific version of InvokeContext which declares a type to be used to invoke static methods. + + + + + Object that stores a context with a target for dynamic invocation + + + + + Create Function can set to variable to make cleaner syntax; + + + + + Create Function can set to variable to make cleaner syntax; + + + + + Create Function can set to variable to make cleaner syntax; + + + + + Initializes a new instance of the class. + + The target. + if set to true [static context]. + The context. + + + + Initializes a new instance of the class. + + The target. + The context. + + + + Gets or sets the target. + + The target. + + + + Gets or sets the context. + + The context. + + + + Gets or sets a value indicating whether [static context]. + + true if [static context]; otherwise, false. + + + + Performs an explicit conversion from to . + + The type. + The result of the conversion. + + + + Initializes a new instance of the class. + + The target. + + + + Type of Invocation + + + + + NotSet + + + + + Convert Implicit or Explicity + + + + + Get Property + + + + + Set Property + + + + + Get Indexer + + + + + Set Indexer + + + + + Invoke Method the has return value + + + + + Invoke Method that returns void + + + + + Invoke Method that could return a value or void + + + + + Invoke Constructor + + + + + Invoke += + + + + + Invoke -= + + + + + Invoke Event Property Test + + + + + Invoke Directly + + + + + Invoke Directly DiscardResult + + + + + Invoke Directly Return Value + + + + + Fluent Class for writing inline lambdass + + The type of the R. + + + + Arguments + + The lambda. + The lambda. + + + + This and arguments. + + The del. + + + + + Arguments + + The type of the Argument 1. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The type of the Argument 15. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The type of the Argument 15. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The type of the Argument 15. + The type of the Argument 16. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The type of the Argument 15. + The type of the Argument 16. + The del. + + + + + Fluent class for writing inline lambdas that return void + + + + + Arguments + + The lambda. + The lambda. + + + + This and arguments. + + The del. + + + + + Arguments + + The type of the Argument 1. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The type of the Argument 15. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The type of the Argument 15. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The type of the Argument 15. + The type of the Argument 16. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The type of the Argument 15. + The type of the Argument 16. + The del. + + + + + Initializes a new instance of the class. + + The max length that the list cannot grow beyound + + + + Gets the enumerator. with bare bones this is good only once + + + + + + Added for silverlight compile time compatability + + + + + Added for silverlight compile time compatability + + + + + Added for silverlight compile time compatability + + + + + Added for silverlight compile time compatability + + + + + Internal class implmenation for + + + + + Provides the implementation for operations that invoke an object. Classes derived from the class can override this method to specify dynamic behavior for operations such as invoking an object or a delegate. + + Provides information about the invoke operation. + The arguments that are passed to the object during the invoke operation. For example, for the sampleObject(100) operation, where sampleObject is derived from the class, [0] is equal to 100. + The result of the object invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown. + + + + + Class for TDD, used for mocking any dynamic object + + + + + Override on DynamicObject + + + + + + + + + Override on DynamicObject + + + + + + + + Override on DynamicObject + + + + + + + + + Override on DynamicObject + + + + + + + + Override on DynamicObject + + + + + + + Override on DynamicObject + + + + + + + + + Override on DynamicObject + + + + + + + + Override on DynamicObject + + + + + + + + + Override on DynamicObject + + + + + + + + + Override on DynamicObject + + + + + + + + + Override on DynamicObject + + + + + + + + Override on DynamicObject + + + + + + + + Attribute for Methods and Parameters on Custom Interfaces designed to be used with a dynamic implementation + + + + + Attribute on Inteface to stop proxy from recursively + proxying other interfaces + + + + + Proxy that Records Dynamic Invocations on an object + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The target. + + + + Replays the recording on target. + + The target. + + + + Tries the invoke member. + + The binder. + The args. + The result. + + + + + Tries the index of the get. + + The binder. + The indexes. + The result. + + + + + Tries the index of the set. + + The binder. + The indexes. + The value. + + + + + Gets or sets the recording. + + The recording. + + + + Abstract base for the Generic class with fatory methods + + + + + Creates ImpromptuLazy based on the specified valuefactory. + + + The valuefactory. + + + + + Creates ImpromptuLazy based on the specified target. + + + The target. + + + + + Initializes a new instance of the class. + + The target. + + + + Wraps a Lazy Type evalutaes on first method call + + + + + + Initializes a new instance of the class. + + The target. + + + + Initializes a new instance of the class. + + The value factory. + + + + Returns the enumeration of all dynamic member names. + + + A sequence that contains dynamic member names. + + + + + Interface for simplistic builder options + + + + + Creates a prototype list + + The contents. + + + + + Setup List or Array, takes either one or a list of constructor args that will use objects Type + + The constructor args. + + + + + Setup List or Array if list has a default constrcutor + + + + + + + Setup List or Array, takes either one or a list of constructor args that will use objects Type + + The constructor args factory. + + + + + Setup List or Array if list has a default constrcutor + + + + + + + Alternative name for + + The constructor args. + + + + + Alternative name for + + The constructor args factory. + + + + + Alternative name for + + The contents. + + + + + Sets up object builder + + The constructor args. + + + + + Sets up object builder + + + + + + + Generates Object, use by calling with named arguments builder.Object(Prop1:"test",Prop2:"test") + returns new object; + + + + + Setups up named builders + + The setup. + + + + Builds Expando-Like Objects with an inline Syntax + + The type of the object proto type. + + + + Build factory storage + + + + + Initializes a new instance of the class. + + + + + Creates a prototype list + + The contents. + + + + + Alternative name for + + The contents. + + + + + Sets up object builder + + The constructor args. + + + + + Sets up object builder + + + + + + + Creates a Prototype object. + + The object. + + + + Trapoline for setting up Builders + + + + + Trampoline for builder + + + + + Initializes a new instance of the class. + + The builder. + + + + Trampoline for setup builder + + + + + Initializes a new instance of the class. + + The builder. + + + + Dummy to access Properties + + + + + Gets the property. + + The type. + + + + + Dummy value + + + + + Initializes a new instance of the class. + + The value. + + + + Gets or sets the string value. + + The string value. + + + + Meta info describing proxy usage. Can be used to preload proxy. + + + + + Initializes a new instance of the class. + + The interfaces. + The context. + + + + Gets or sets the interfaces. + + The interfaces. + + + + Gets or sets the context. + + The context. + + + + Building block to use Method calls as dynamic lookups + + + + + Initializes a new instance of the class. + + The lookup. + + + diff --git a/linger/src/packages/ImpromptuInterface.6.0.6/lib/SL50/ImpromptuInterface.XML b/linger/src/packages/ImpromptuInterface.6.0.6/lib/SL50/ImpromptuInterface.XML new file mode 100644 index 0000000..11f84e8 --- /dev/null +++ b/linger/src/packages/ImpromptuInterface.6.0.6/lib/SL50/ImpromptuInterface.XML @@ -0,0 +1,4212 @@ + + + + ImpromptuInterface + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Extension method for Dealing with Special Delegate Type + + + + + Determines whether [is special this delegate] [the specified del]. + + The del. + + true if [is special this delegate] [the specified del]; otherwise, false. + + + + + Base Class for making a fluent factory using an Impromptu Interface return type. + + + + + Dynamic Object that knows about the Impromtu Interface return types; + Override Typical Dynamic Object methods, and use TypeForName to get the return type of an interface member. + + + + + This interface can be used on your custom dynamic objects if you want to know the interface you are impromptu-ly implementing. + + + + + Property used to pass interface information to proxied object + + + + + Sets the known property spec. + + The known property spec. + + + + This interface can be used on your custom dynamic objects if you want impromptu interfaces without casting to object or using the static method syntax of ActLike. + Also if you want to change the behavior for slightly for specific types as this will take precident when using the dynamic keyword or your specific type is known staticly. + + + + + This interface can be used on your custom dynamic objects if you want impromptu interfaces without casting to object or using the static method syntax of ActLike. + Also if you want to change the behavior for slightly for specific types as this will take precident when using the dynamic keyword or your specific type is known staticly. + + + + + + + + Added for silverlight compile time compatability + + + + + Initializes a new instance of the class. + + + + + Cache to avoid refelection for same Interfaces. + + + + + Hash for this instance to lookup cached values from + + + + + Keep Track of Known Property Spec + + + + + Returns the enumeration of all dynamic member names. + + + A sequence that contains dynamic member names. + + + + + Tries to get the type for the property name from the interface. + + The name. + The return Type. + + + + + Allows ActLike to be called via dyanmic invocation + + The type of the interface. + The other interfaces. + + + + + Gets the custom Type. + + + + + + Gets or sets the known interfaces. + Set should only be called be the factory methood + + The known interfaces. + + + + Gets or sets the known fake interface (string method name to return type mapping). + + The known fake interface. + + + + Creates this instance with Interface; + + + + + + + Provides the default implementation for operations that get instance as defined by . Classes derived from the class can override this method to specify dynamic behavior for operations such as getting a value for a property. + + Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement, where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The result of the get operation. For example, if the method is called for a property, you can assign the property value to . + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.) + + + + + Provides the implementation for operations that invoke a member. Classes derived from the class can override this method to specify dynamic behavior for operations such as calling a method. + + Provides information about the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleMethod". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The arguments that are passed to the object member during the invoke operation. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is derived from the class, [0] is equal to 100. + The result of the member invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Constructs the type. Override for changing type intialization property changes. + + The type. + The args. + + + + + Gets the instance for a dynamic member. Override for type constrcution behavoir changes based on property name. + + Name of the member. + The args. + + + + + Base Class for making a singleton fluent factory using an Impromptu Interface return type. + + + + + Creates this instance with Interface; + + + + + + + Store Singletons + + + + + Lock for accessing singletons + + + + + Gets the instance for a dynamic member. Override for type constrcution behavoir changes based on property name. + + Name of the member. + + + + + + This interface can be used to access the original content of your emitted type; + + + + + Returns the proxied object + + + + + Dynamic Proxy that exposes any properties of objects, and can massage results based on interface + + + + + Proxies Calls allows subclasser to override do extra actions before or after base invocation + + + This may not be as efficient as other proxies that can work on just static objects or just dynamic objects... + Consider this when using. + + + + + Get access to target of original proxy + + + + + Gets the target. + + The target. + + + + Initializes a new instance of the class. + + The target. + + + + Returns the enumeration of all dynamic member names. + + + A sequence that contains dynamic member names. + + + + + Provides the implementation for operations that get member values. Classes derived from the class can override this method to specify dynamic behavior for operations such as getting a value for a property. + + Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement, where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The result of the get operation. For example, if the method is called for a property, you can assign the property value to . + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.) + + + + + Provides the implementation for operations that invoke an object. Classes derived from the class can override this method to specify dynamic behavior for operations such as invoking an object or a delegate. + + Provides information about the invoke operation. + The arguments that are passed to the object during the invoke operation. For example, for the sampleObject(100) operation, where sampleObject is derived from the class, is equal to 100. + The result of the object invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown. + + + + + Equals the specified other. + + The other. + + + + + Gets or sets the target. + + The target. + + + + Gets the call target. + + The call target. + + + + Initializes a new instance of the class. + + The target. + + + + Creates the proxy over the specified target. + + Interface + The target. + + + + + Creates the proxy over the specified target. + + The target. + + + + + Provides the implementation for operations that get member values. Classes derived from the class can override this method to specify dynamic behavior for operations such as getting a value for a property. + + Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement, where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The result of the get operation. For example, if the method is called for a property, you can assign the property value to . + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.) + + + + + Provides the implementation for operations that invoke a member. Classes derived from the class can override this method to specify dynamic behavior for operations such as calling a method. + + Provides information about the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleMethod". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The arguments that are passed to the object member during the invoke operation. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is derived from the class, is equal to 100. + The result of the member invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Tries the index of the get. + + The binder. + The indexes. + The result. + + + + + Internal Implementation of + + + + + Provides implementation for type conversion operations. Classes derived from the class can override this method to specify dynamic behavior for operations that convert an object from one type to another. + + Provides information about the conversion operation. The binder.Type property provides the type to which the object must be converted. For example, for the statement (String)sampleObject in C# (CType(sampleObject, Type) in Visual Basic), where sampleObject is an instance of the class derived from the class, binder.Type returns the type. The binder.Explicit property provides information about the kind of conversion that occurs. It returns true for explicit conversion and false for implicit conversion. + The result of the type conversion operation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Gets the custom Type. + + + + + + Provides the implementation for operations that invoke a member. Classes derived from the class can override this method to specify dynamic behavior for operations such as calling a method. + + Provides information about the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleMethod". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The arguments that are passed to the object member during the invoke operation. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is derived from the class, [0] is equal to 100. + The result of the member invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Provides the implementation for operations that invoke an object. Classes derived from the class can override this method to specify dynamic behavior for operations such as invoking an object or a delegate. + + Provides information about the invoke operation. + The arguments that are passed to the object during the invoke operation. For example, for the sampleObject(100) operation, where sampleObject is derived from the class, [0] is equal to 100. + The result of the object invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown. + + + + + Internal method for subsequent invocations of + + + + + Provides implementation for type conversion operations. Classes derived from the class can override this method to specify dynamic behavior for operations that convert an object from one type to another. + + Provides information about the conversion operation. The binder.Type property provides the type to which the object must be converted. For example, for the statement (String)sampleObject in C# (CType(sampleObject, Type) in Visual Basic), where sampleObject is an instance of the class derived from the class, binder.Type returns the type. The binder.Explicit property provides information about the kind of conversion that occurs. It returns true for explicit conversion and false for implicit conversion. + The result of the type conversion operation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Gets the custom Type. + + + + + + Provides the implementation for operations that invoke an object. Classes derived from the class can override this method to specify dynamic behavior for operations such as invoking an object or a delegate. + + Provides information about the invoke operation. + The arguments that are passed to the object during the invoke operation. For example, for the sampleObject(100) operation, where sampleObject is derived from the class, is equal to 100. + The result of the object invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown. + + + + + Gets the target. + + The target. + + + + Gets the name of the member. + + The name of the member. + + + + Gets the args. + + The args. + + + + Gets the total arg count. + + The total arg count. + + + + Gets the kind of the invocation. + + The kind of the invocation. + + + + Does most of the work buiding and caching proxies + + + + + Builds the type for the static proxy or returns from cache + + Type of the context. + The main interface. + The other interfaces. + + + + + Builds the type. + + Type of the context. + The informal interface. + + + + + Preloads a proxy for ActLike to use. + + Type of the proxy. + The ActLikeProxyAttribute, if not provide it will be looked up. + Returns false if there already is a proxy registered for the same type. + + + + Preloads proxies that ActLike uses from assembly. + + The assembly. + Returns false if there already is a proxy registered for the same type. + + + + Makes the property helper. + + The builder. + The type builder. + The info. + The get method. + The set method. + The emit info. + + + + Generates the delegate type of the call site function. + + The arg types. + Type of the return. + The method info. Required for reference types or delegates with more than 16 arguments. + The Type Builder. Required for reference types or delegates with more than 16 arguments. + + + + + Module Builder for buiding proxies + + + + + Base class of Expando-Type objects + + + + + Wrapped Dictionary + + + + + Initializes a new instance of the class. + + The dict. + + + + Returns the enumeration of all dynamic member names. + + + A sequence that contains dynamic member names. + + + + + Provides the implementation for operations that get member values. Classes derived from the class can override this method to specify dynamic behavior for operations such as getting a value for a property. + + Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement, where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The result of the get operation. For example, if the method is called for a property, you can assign the property value to . + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.) + + + + + Provides the implementation for operations that invoke a member. Classes derived from the class can override this method to specify dynamic behavior for operations such as calling a method. + + Provides information about the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleMethod". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The arguments that are passed to the object member during the invoke operation. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is derived from the class, is equal to 100. + The result of the member invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Provides the implementation for operations that set member values. Classes derived from the class can override this method to specify dynamic behavior for operations such as setting a value for a property. + + Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member to which the value is being assigned. For example, for the statement sampleObject.SampleProperty = "Test", where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The value to set to the member. For example, for sampleObject.SampleProperty = "Test", where sampleObject is an instance of the class derived from the class, the is "Test". + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Adds the specified item. + + The item. + + + + Determines whether [contains] [the specified item]. + + The item. + + true if [contains] [the specified item]; otherwise, false. + + + + + Copies to. + + The array. + Index of the array. + + + + Removes the specified item. + + The item. + + + + + Determines whether the specified key contains key. + + The key. + + true if the specified key contains key; otherwise, false. + + + + + Adds the specified key. + + The key. + The value. + + + + Removes the specified key. + + The key. + + + + + Tries the get value. + + The key. + The value. + + + + + Called when [property changed]. + + The key. + + + + Equalses the specified other. + + The other. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Gets a value indicating whether this instance is read only. + + + true if this instance is read only; otherwise, false. + + + + + Gets the keys. + + The keys. + + + + Gets the values. + + The values. + + + + Occurs when a property value changes. + + + + + This interface can be used to define your own custom proxy if you preload it. + + + Advanced usage only! This is required as well as + + + + + Method used to Initialize Proxy + + + + + + + + Base class of Emited ProxiesC:\Documents and Settings\jayt\My Documents\Visual Studio 2010\Projects\impromptuinterface\ImpromptuInterface\Optimization\ + + + + + Method used to Initialize Proxy + + + + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Actlike proxy should be equivalent to the objects they proxy + + The other. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns the proxied object + + + + + + Expando-Type List for dynamic objects + + + + + Added for silverlight compile time compatability + + + + + Wrapped list + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The contents. + The members. + + + + Gets the enumerator. + + + + + + Adds the specified item. + + The item. + + + + Clears this instance. + + + + + Determines whether [contains] [the specified item]. + + The item. + + true if [contains] [the specified item]; otherwise, false. + + + + + Copies to. + + The array. + Index of the array. + + + + Indexes the of. + + The item. + + + + + Equalses the specified other. + + The other. + + + + + Gets the represented item. USED fOR GetItemProperties + + + + + + Gets the count. + + The count. + + + + Occurs when the collection changes. + + + + + Gets or sets the override getting item method names. USED for GetItemProperties + + The override getting item method names. + + + + Late bind types from libraries not not at compile type + + + + + Initializes a new instance of the class. + + The type. + + + + Initializes a new instance of the class. + + Qualified Name of the type. + + + + Returns a late bound constructor + + The late bound constructor + + + + Gets a value indicating whether this Type is available at runtime. + + + true if this instance is available; otherwise, false. + + + + + Forward argument to constructor including named arguments + + + + + Extension Methods for fluent Regex + + + + + Implements the operator +. + + The left. + The right. + The result of the operator. + + + + Implements the operator -. + + The left. + The right. + The result of the operator. + + + + Gets or sets the delegate. + + The delegate. + + + + Gets or sets a value indicating whether this instance is adding. + + true if this instance is adding; otherwise, false. + + + + Similar to Expando Objects but handles null values when the property is defined with an impromptu interface + + + + + Convenience create method to make an Impromptu Dictionary instance acting like interface type parameter + + + The dict. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The dict. + + + + Gets the enumerator. + + + + + + Clears this instance. + + + + + Gets the count. + + The count. + + + + Gets or sets the with the specified key. + + + + + + Adds extra synatx to intialize properties to match up with clay + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The dict. + + + + Various extension methods for add + + + + + Combines target with context. + + The target. + The context. + + + + + Combines target with context. + + The type of the context. + The target. + + + + + Combines target with context. + + The target. + The context. + + + + + Withes the static context. + + The target. + The context. + + + + + attaches generic args to string + + The name. + The generic args. + + + + + attaches name of the argument. + + The argument. + The name. + + + + + Use for Named arguments passed to InvokeMethods + + + + + Performs an explicit conversion from to . + + The pair. + The result of the conversion. + + + + Create Function can set to variable to make cleaner syntax; + + + + + Initializes a new instance of the class. + + The name. + The value. + + + + Gets or sets the argument name. + + The name. + + + + Gets or sets the argument value. + + The value. + + + + InvokeArg that makes it easier to Cast from any IDictionaryValue + + + + + + Initializes a new instance of the class. + + The name. + The value. + + + + Performs an explicit conversion from to . + + The pair. + The result of the conversion. + + + + Utility Class + + + + + Determines whether [is anonymous type] [the specified target]. + + The target. + + true if [is anonymous type] [the specified target]; otherwise, false. + + + + + Names the args if necessary. + + The call info. + The args. + + + + + Gets the target context. + + The target. + The context. + if set to true [static context]. + + + + + Fixes the context. + + The context. + + + + + Is Current Runtime Mono? + + + + + String or InvokeMemberName + + + + + Performs an implicit conversion from to . + + The name. + The result of the conversion. + + + + Gets the name. + + The name. + + + + Gets the generic args. + + The generic args. + + + + Gets or sets a value indicating whether this member is special name. + + + true if this instance is special name; otherwise, false. + + + + + Name of Member with associated Generic parameterss + + + + + Create Function can set to variable to make cleaner syntax; + + + + + Create Function can set to variable to make cleaner syntax; + + + + + Performs an implicit conversion from to . + + The name. + The result of the conversion. + + + + Initializes a new instance of the class. + + The name. + The generic args. + + + + Initializes a new instance of the class. + + The name. + if set to true [is special name]. + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Extension Methods that make emiting code easier and easier to read + + + + + Gets the field info even if generic type parameter. + + The type. + Name of the field. + + + + + Gets the method info even if generic type parameter. + + The type. + Name of the method. + The arg types. + + + + + Gets the method info even if generic type parameter. + + The type. + Name of the method. + + + + + Emits branch true. expects using keyword. + + The generator. + The condition. + + + Using keyword allows you to set the emit code you are branching over and then automatically emits label when disposing + + g.Emit(OpCodes.Ldsfld, tConvertField))) + { + tIlGen.EmitDynamicConvertBinder(CSharpBinderFlags.None, returnType, contextType); + tIlGen.EmitCallsiteCreate(convertFuncType); + tIlGen.Emit(OpCodes.Stsfld, tConvertField); + } + ]]> + + + + + + Emits the call. + + The generator. + The target. + The call. + The parameters. + + + + Emits creating the callsite. + + The generator. + Type of the func. + + + + Emits the call invoke delegate. + + The generator. + Type of the func. + + + + Emits an array. + + The generator. + Type of the array. + The emit elements. + + + + Emits the store location. + + The generator. + The location. + + + + Emits the load argument. + + The generator. + The location. + + + + Emits the load location. + + The generator. + The location. + + + + Emits the dynamic method invoke binder. + + The generator. + The binding flags. + The name. + The context. + The arg info. + The arg names. + + + + Emits the dynamic set binder. + + The generator. + The binding flags. + The name. + The context. + The arg types. + + + + Emits the dynamic set binder dynamic params. + + The generator. + The flag. + The name. + The context. + The arg types. + + + + Emits the dynamic binary op binder. + + The generator. + The flag. + Type of the expr. + The context. + The arg types. + + + + Emits the dynamic get binder. + + The generator. + The binding flags. + The name. + The context. + The arg types. + + + + Emits creating the + + The generator. + The flag. + The name. + + + + Emits the dynamic convert binder. + + The generator. + The binding flag. + Type of the return. + The context. + + + + Emits the typeof(Type) + + The generator. + The type. + + + + Emits the typeof(Type) + + The generator. + The type. + + + + Used to automatically create label on dispose + + + + + Constructor + + + + + + Finishes block + + + + + Constructor + + + + + + Finishes block + + + + + Dummy that just returns null of default for everything. + + + + + Initializes a new instance of the class. + + + + + Provides the implementation for operations that get member values. Classes derived from the class can override this method to specify dynamic behavior for operations such as getting a value for a property. + + Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement, where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The result of the get operation. For example, if the method is called for a property, you can assign the property value to . + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.) + + + + + Provides the implementation for operations that set member values. Classes derived from the class can override this method to specify dynamic behavior for operations such as setting a value for a property. + + Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member to which the value is being assigned. For example, for the statement sampleObject.SampleProperty = "Test", where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The value to set to the member. For example, for sampleObject.SampleProperty = "Test", where sampleObject is an instance of the class derived from the class, the is "Test". + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Provides the implementation for operations that invoke a member. Classes derived from the class can override this method to specify dynamic behavior for operations such as calling a method. + + Provides information about the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleMethod". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The arguments that are passed to the object member during the invoke operation. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is derived from the class, is equal to 100. + The result of the member invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Tries the index of the get. + + The binder. + The indexes. + The result. + + + + + Main API + + + + + Creates a cached call site at runtime. + + Type of the delegate. + The CallSite binder. + Member Name + Permissions Context type + The arg names. + if set to true [static context]. + if set to true [is event]. + The CallSite + + Advanced usage only for serious custom dynamic invocation. + + + + + + Creates the call site. + + + The binder. + The name. + The context. + The arg names. + if set to true [static context]. + if set to true [is event]. + + /// + + Unit test that exhibits usage + (tBinder); + tSite.Target.Invoke(tSite, tPoco, out tResult); + Assert.AreEqual("success", tResult); + ]]> + + + + + + Dynamically Invokes a member method using the DLR + + The target. + The name. Can be a string it will be implicitly converted + The args. + The result + + Unit test that exhibits usage: + + (it => it.ToString()); + + var tValue = 1; + var tOut = Impromptu.InvokeMember(tExpando, "Func", tValue); + + Assert.AreEqual(tValue.ToString(), tOut); + ]]> + + + + + + Invokes the binary operator. + + The left arg. + The op. + The right Arg. + + + + + Invokes the unary opartor. + + The arg. + The op. + + + + + Invokes the specified target using the DLR; + + The target. + The args. + + + + + Dynamically Invokes indexer using the DLR. + + The target. + The indexes. + + + + + Convenience version of InvokeSetIndex that separates value and indexes. + + The target. + The value + The indexes + + + + + Invokes setindex. + + The target. + The indexes then value. + + + + Dynamically Invokes a member method which returns void using the DLR + + The target. + The name. + The args. + + Unit test that exhibits usage: + + (it => tTest = it); + + Impromptu.InvokeMemberAction(tExpando, "Action", tValue); + + Assert.AreEqual(tValue, tTest); + ]]> + + + + + + Invokes the action using the DLR + + The target. + The args. + + + + Dynamically Invokes a set member using the DLR. + + The target. + The name. + The value. + + Unit test that exhibits usage: + + + + + + if you call a static property off a type with a static context the csharp dlr binder won't do it, so this method reverts to reflection + + + + + Invokes the set on the end of a property chain. + + The target. + The property chain. + The value. + + + + Wraps a target to partial apply a method (or target if you can invoke target directly eg delegate). + + The target. + The total arg count. + + + + + Wraps a delegate to partially apply it. + + The target. + + + + + Dynamically Invokes a get member using the DLR. + + The target. + The name. + The result. + + Unit Test that describes usage + + + + + + + + Invokes the getter property chain. + + The target. + The property chain. + + + + + Determines whether the specified name on target is event. This allows you to know whether to InvokeMemberAction + add_{name} or a combo of {invokeget, +=, invokeset} and the corresponding remove_{name} + or a combon of {invokeget, -=, invokeset} + + The target. + The name. + + true if the specified target is event; otherwise, false. + + + + + Invokes add assign with correct behavior for events. + + The target. + The name. + The value. + + + + Invokes add assign with correct behavior for events. + + The target. + The name. + The value. + + + + Invokes subtract assign with correct behavior for events. + + The target. + The name. + The value. + + + + Invokes subtract assign with correct behavior for events. + + The target. + The name. + The value. + + + + Invokes convert using the DLR. + + The target. + The type. + if set to true [explicit]. + + + + + (Obsolete)Invokes the constructor. misspelling + + The type. + The args. + + + + + Invokes the constuctor. + + The type. + The args. + + + + + FastDynamicInvoke extension method. Runs up to runs up to 20x faster than . + + The del. + The args. + + + + + Given a generic parameter count and whether it returns void or not gives type of Action or Func + + The param count. + if set to true [return void]. + Type of Action or Func + + + + Gets the member names of properties. Not all IDynamicMetaObjectProvider have support for this. + + The target. + if set to true [dynamic only]. Won't add reflected properties + + + + + Dynamically invokes a method determined by the CallSite binder and be given an appropriate delegate type + + The Callsite + The target. + The args. + + + Advanced use only. Use this method for serious custom invocation, otherwise there are other convenience methods such as + , , and + + + + + Dynamically invokes a method determined by the CallSite binder and be given an appropriate delegate type + + The Callsite + The target. + The args. + + + Advanced use only. Use this method for serious custom invocation, otherwise there are other convenience methods such as + , , and + + + + + Extension Method that Wraps an existing object with an Explicit interface definition + + The type of the interface. + The original object can be annoymous type, System.DynamicObject as well as any others. + Optional other interfaces. + + + + + Extension Method that Wraps an existing object with an Interface of what it is implicitly assigned to. + + The original dynamic. + The other interfaces. + + + + + Makes static methods for the passed in property spec, designed to be used with old api's that reflect properties. + + The original dynamic. + The property spec. + + + + + Private helper method that initializes the proxy. + + The proxytype. + The original. + The interfaces. + The property spec. + + + + + This Extension method is called off the calling context to perserve permissions with the object wrapped with an explicit interface definition. + + The type of the interface. + The caller. + The original dynamic. + The other interfaces. + + + UnitTest That describes usage + + (tTest); + Assert.Throws(() => tNonExposed.Test()); + ]]> + + + + + + Chainable Linq to Objects Method, allows you to wrap a list of objects with an Explict interface defintion + + The type of the interface. + The original dynamic. + The other interfaces. + + + + + Static Method that wraps an existing dyanmic object with a explicit interface type + + The original dynamic. + The other interfaces. + + + + + This Extension method is called off the calling context to perserve permissions with the object wrapped with an explicit interface definition. + + The caller. + The original dynamic. + The other interfaces. + + + + + Chainable Linq to Objects Method, allows you to wrap a list of objects, and preserve method permissions with a caller, with an Explict interface defintion + + The type of the interface. + The original dynamic. + The caller. + The other interfaces. + + + + + Gets the custom Type. + + + + + + Call Like method invokes set on target and a list of property/value. Invoke with dictionary, anonymous type or named arguments. + + The invoke set all. + + + + Builds Objects with a Fluent Syntax + + + + + New Builder + + + + + + New Builder + + The type of the object prototype. + + + + + Syntax for a quick new inline prototype object + + + + + Gets the new object builder. + + The new object. + + + + Gets the new list builder. + + The new list. + + + + Syntax for a quick inline object property setup + + The type of the object prototype. + + + + Gets the new object builder. + + The new. + + + + Gets the new list builder. + + The new list. + + + + Encapsulates an Activator + + + + + Initializes a new instance of the class. + + The type. + The args. + + + + Initializes a new instance of the class. With Factory Function + + The type. + The args. + + + + Creates this instance. + + + + + + Gets or sets the constructor type. + + The type. + + + + Gets or sets the constructor arguments. + + The arguments. + + + + Encapsulates an Activator + + The type of the object prototype. + + + + Initializes a new instance of the class. + + The args. + + + + Initializes a new instance of the class. With Factory Function + + The args. + + + + Creates this instance. + + + + + + Type that Encompasses Hashing a group of Types in various ways + + + + + Equalses the specified other. + + The other. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Implements the operator ==. + + The left. + The right. + The result of the operator. + + + + Implements the operator !=. + + The left. + The right. + The result of the operator. + + + + Types to be hashed + + + + + The Informal Interface to be hashed + + + + + Initializes a new instance of the class. + + The more types. + + + + Initializes a new instance of the class. + For use when you have must distinguish one type; and the rest aren't strict + + The type1. + The more types. + + + + Initializes a new instance of the class. + + The type1. + The informal interface. + + + + Initializes a new instance of the class. + + if set to true [strict order]. + types. + + + + Creates the TypeHash + + The more types. + + + + + Creates the TypeHash + + The type1. + The more types. + + + + + Creates the TypeHash + + The type1. + The informal interface. + + + + + Creates the TypeHash + + if set to true [strict order]. + The more types. + + + + + Cacheable representation of an invocation without the target or arguments also by default only does public methods to make it easier to cache. + /// + + + + Storable representation of an invocation without the target + + + + + Defacto Binder Name for Explicit Convert Op + + + + + Defacto Binder Name for Implicit Convert Op + + + + + Defacto Binder Name for Indexer + + + + + Defacto Binder Name for Construvter + + + + + Creates the invocation. + + The kind. + The name. + The args. + + + + + Initializes a new instance of the class. + + The kind. + The name. + The args. + + + + Equalses the specified other. + + The other. + + + + + Invokes the invocation on specified target with specific args. + + The target. + The args. + + + + + Deprecated use + + The target. + The args. + + + + + Invokes the invocation on specified target. + + The target. + + + + + Gets or sets the kind. + + The kind. + + + + Gets or sets the name. + + The name. + + + + Gets or sets the args. + + The args. + + + + Creates the cacheable convert call. + + Type of the convert. + if set to true [convert explict]. + + + + + Creates the cacheable method or indexer or property call. + + The kind. + The name. + The callInfo. + The context. + + + + + Initializes a new instance of the class. + + The kind. + The name. + The arg count. + The arg names. + The context. + Type of the convert. + if set to true [convert explict]. + The stored args. + + + + Equalses the specified other. + + The other. + + + + + LazyBinderType + + + + + Specific version of InvokeContext which declares a type to be used to invoke static methods. + + + + + Object that stores a context with a target for dynamic invocation + + + + + Create Function can set to variable to make cleaner syntax; + + + + + Create Function can set to variable to make cleaner syntax; + + + + + Create Function can set to variable to make cleaner syntax; + + + + + Initializes a new instance of the class. + + The target. + if set to true [static context]. + The context. + + + + Initializes a new instance of the class. + + The target. + The context. + + + + Gets or sets the target. + + The target. + + + + Gets or sets the context. + + The context. + + + + Gets or sets a value indicating whether [static context]. + + true if [static context]; otherwise, false. + + + + Performs an explicit conversion from to . + + The type. + The result of the conversion. + + + + Initializes a new instance of the class. + + The target. + + + + Type of Invocation + + + + + NotSet + + + + + Convert Implicit or Explicity + + + + + Get Property + + + + + Set Property + + + + + Get Indexer + + + + + Set Indexer + + + + + Invoke Method the has return value + + + + + Invoke Method that returns void + + + + + Invoke Method that could return a value or void + + + + + Invoke Constructor + + + + + Invoke += + + + + + Invoke -= + + + + + Invoke Event Property Test + + + + + Invoke Directly + + + + + Invoke Directly DiscardResult + + + + + Invoke Directly Return Value + + + + + Fluent Class for writing inline lambdass + + The type of the R. + + + + Arguments + + The lambda. + The lambda. + + + + This and arguments. + + The del. + + + + + Arguments + + The type of the Argument 1. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The type of the Argument 15. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The type of the Argument 15. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The type of the Argument 15. + The type of the Argument 16. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The type of the Argument 15. + The type of the Argument 16. + The del. + + + + + Fluent class for writing inline lambdas that return void + + + + + Arguments + + The lambda. + The lambda. + + + + This and arguments. + + The del. + + + + + Arguments + + The type of the Argument 1. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The type of the Argument 15. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The type of the Argument 15. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The type of the Argument 15. + The type of the Argument 16. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The type of the Argument 15. + The type of the Argument 16. + The del. + + + + + Runtime Property Info + + + + + Initializes a new instance of the class. + + Type of the declaring. + Name of the property. + + + + MetaData for dynamic types + + + + + Initializes a new instance of the class. + + Type of the base. + The dynamic object. + + + + Initializes a new instance of the class. + + The max length that the list cannot grow beyound + + + + Gets the enumerator. with bare bones this is good only once + + + + + + Added for silverlight compile time compatability + + + + + Added for silverlight compile time compatability + + + + + Added for silverlight compile time compatability + + + + + Added for silverlight compile time compatability + + + + + Internal class implmenation for + + + + + Gets the custom Type. + + + + + + Provides the implementation for operations that invoke an object. Classes derived from the class can override this method to specify dynamic behavior for operations such as invoking an object or a delegate. + + Provides information about the invoke operation. + The arguments that are passed to the object during the invoke operation. For example, for the sampleObject(100) operation, where sampleObject is derived from the class, [0] is equal to 100. + The result of the object invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown. + + + + + Class for TDD, used for mocking any dynamic object + + + + + Override on DynamicObject + + + + + + + + + Override on DynamicObject + + + + + + + + Override on DynamicObject + + + + + + + + + Override on DynamicObject + + + + + + + + Override on DynamicObject + + + + + + + Override on DynamicObject + + + + + + + + + Override on DynamicObject + + + + + + + + Override on DynamicObject + + + + + + + + + Override on DynamicObject + + + + + + + + + Override on DynamicObject + + + + + + + + + Override on DynamicObject + + + + + + + + Override on DynamicObject + + + + + + + + Gets the custom Type. + + + + + + Attribute for Methods and Parameters on Custom Interfaces designed to be used with a dynamic implementation + + + + + Attribute on Inteface to stop proxy from recursively + proxying other interfaces + + + + + Proxy that Records Dynamic Invocations on an object + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The target. + + + + Replays the recording on target. + + The target. + + + + Tries the invoke member. + + The binder. + The args. + The result. + + + + + Tries the index of the get. + + The binder. + The indexes. + The result. + + + + + Tries the index of the set. + + The binder. + The indexes. + The value. + + + + + Gets or sets the recording. + + The recording. + + + + Abstract base for the Generic class with fatory methods + + + + + Creates ImpromptuLazy based on the specified valuefactory. + + + The valuefactory. + + + + + Creates ImpromptuLazy based on the specified target. + + + The target. + + + + + Initializes a new instance of the class. + + The target. + + + + Wraps a Lazy Type evalutaes on first method call + + + + + + Initializes a new instance of the class. + + The target. + + + + Initializes a new instance of the class. + + The value factory. + + + + Returns the enumeration of all dynamic member names. + + + A sequence that contains dynamic member names. + + + + + Interface for simplistic builder options + + + + + Creates a prototype list + + The contents. + + + + + Setup List or Array, takes either one or a list of constructor args that will use objects Type + + The constructor args. + + + + + Setup List or Array if list has a default constrcutor + + + + + + + Setup List or Array, takes either one or a list of constructor args that will use objects Type + + The constructor args factory. + + + + + Setup List or Array if list has a default constrcutor + + + + + + + Alternative name for + + The constructor args. + + + + + Alternative name for + + The constructor args factory. + + + + + Alternative name for + + The contents. + + + + + Sets up object builder + + The constructor args. + + + + + Sets up object builder + + + + + + + Generates Object, use by calling with named arguments builder.Object(Prop1:"test",Prop2:"test") + returns new object; + + + + + Setups up named builders + + The setup. + + + + Builds Expando-Like Objects with an inline Syntax + + The type of the object proto type. + + + + Build factory storage + + + + + Initializes a new instance of the class. + + + + + Creates a prototype list + + The contents. + + + + + Alternative name for + + The contents. + + + + + Sets up object builder + + The constructor args. + + + + + Sets up object builder + + + + + + + Creates a Prototype object. + + The object. + + + + Trapoline for setting up Builders + + + + + Trampoline for builder + + + + + Initializes a new instance of the class. + + The builder. + + + + Trampoline for setup builder + + + + + Initializes a new instance of the class. + + The builder. + + + + Meta info describing proxy usage. Can be used to preload proxy. + + + + + Initializes a new instance of the class. + + The interfaces. + The context. + + + + Gets or sets the interfaces. + + The interfaces. + + + + Gets or sets the context. + + The context. + + + + Dummy to access Properties + + + + + Gets the property. + + The type. + + + + + Dummy value + + + + + Initializes a new instance of the class. + + The value. + + + + Gets or sets the string value. + + The string value. + + + + Building block to use Method calls as dynamic lookups + + + + + Initializes a new instance of the class. + + The lookup. + + + + Gets the custom Type. + + + + + diff --git a/linger/src/packages/ImpromptuInterface.6.0.6/lib/net40/ImpromptuInterface.xml b/linger/src/packages/ImpromptuInterface.6.0.6/lib/net40/ImpromptuInterface.xml new file mode 100644 index 0000000..1aa3d18 --- /dev/null +++ b/linger/src/packages/ImpromptuInterface.6.0.6/lib/net40/ImpromptuInterface.xml @@ -0,0 +1,4344 @@ + + + + ImpromptuInterface + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Special Delegate used to make impromptu object methods first parameter is this. + + + + + Extension method for Dealing with Special Delegate Type + + + + + Determines whether [is special this delegate] [the specified del]. + + The del. + + true if [is special this delegate] [the specified del]; otherwise, false. + + + + + Base Class for making a fluent factory using an Impromptu Interface return type. + + + + + Dynamic Object that knows about the Impromtu Interface return types; + Override Typical Dynamic Object methods, and use TypeForName to get the return type of an interface member. + + + + + This interface can be used on your custom dynamic objects if you want to know the interface you are impromptu-ly implementing. + + + + + Property used to pass interface information to proxied object + + + + + Sets the known property spec. + + The known property spec. + + + + This interface can be used on your custom dynamic objects if you want impromptu interfaces without casting to object or using the static method syntax of ActLike. + Also if you want to change the behavior for slightly for specific types as this will take precident when using the dynamic keyword or your specific type is known staticly. + + + + + This interface can be used on your custom dynamic objects if you want impromptu interfaces without casting to object or using the static method syntax of ActLike. + Also if you want to change the behavior for slightly for specific types as this will take precident when using the dynamic keyword or your specific type is known staticly. + + + + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. when deserializing + + The info. + The context. + + + + Populates a with the data needed to serialize the target object. + + The to populate with data. + The destination (see ) for this serialization. + The caller does not have the required permission. + + + + Cache to avoid refelection for same Interfaces. + + + + + Hash for this instance to lookup cached values from + + + + + Keep Track of Known Property Spec + + + + + Returns the enumeration of all dynamic member names. + + + A sequence that contains dynamic member names. + + + + + Tries to get the type for the property name from the interface. + + The name. + The return Type. + + + + + Allows ActLike to be called via dyanmic invocation + + The type of the interface. + The other interfaces. + + + + + Gets or sets the known interfaces. + Set should only be called be the factory methood + + The known interfaces. + + + + Gets or sets the known fake interface (string method name to return type mapping). + + The known fake interface. + + + + Creates this instance with Interface; + + + + + + + Provides the default implementation for operations that get instance as defined by . Classes derived from the class can override this method to specify dynamic behavior for operations such as getting a value for a property. + + Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement, where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The result of the get operation. For example, if the method is called for a property, you can assign the property value to . + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.) + + + + + Provides the implementation for operations that invoke a member. Classes derived from the class can override this method to specify dynamic behavior for operations such as calling a method. + + Provides information about the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleMethod". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The arguments that are passed to the object member during the invoke operation. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is derived from the class, [0] is equal to 100. + The result of the member invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Constructs the type. Override for changing type intialization property changes. + + The type. + The args. + + + + + Gets the instance for a dynamic member. Override for type constrcution behavoir changes based on property name. + + Name of the member. + The args. + + + + + Base Class for making a singleton fluent factory using an Impromptu Interface return type. + + + + + Creates this instance with Interface; + + + + + + + Store Singletons + + + + + Lock for accessing singletons + + + + + Gets the instance for a dynamic member. Override for type constrcution behavoir changes based on property name. + + Name of the member. + + + + + + This interface can be used to access the original content of your emitted type; + + + + + Returns the proxied object + + + + + Dynamic Proxy that exposes any properties of objects, and can massage results based on interface + + + + + Proxies Calls allows subclasser to override do extra actions before or after base invocation + + + This may not be as efficient as other proxies that can work on just static objects or just dynamic objects... + Consider this when using. + + + + + Get access to target of original proxy + + + + + Gets the target. + + The target. + + + + Initializes a new instance of the class. + + The target. + + + + Initializes a new instance of the class. + + The info. + The context. + + + + Populates a with the data needed to serialize the target object. + + The to populate with data. + The destination (see ) for this serialization. + The caller does not have the required permission. + + + + Returns the enumeration of all dynamic member names. + + + A sequence that contains dynamic member names. + + + + + Provides the implementation for operations that get member values. Classes derived from the class can override this method to specify dynamic behavior for operations such as getting a value for a property. + + Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement, where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The result of the get operation. For example, if the method is called for a property, you can assign the property value to . + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.) + + + + + Provides the implementation for operations that invoke an object. Classes derived from the class can override this method to specify dynamic behavior for operations such as invoking an object or a delegate. + + Provides information about the invoke operation. + The arguments that are passed to the object during the invoke operation. For example, for the sampleObject(100) operation, where sampleObject is derived from the class, is equal to 100. + The result of the object invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown. + + + + + Equals the specified other. + + The other. + + + + + Gets or sets the target. + + The target. + + + + Gets the call target. + + The call target. + + + + Initializes a new instance of the class. + + The target. + + + + Initializes a new instance of the class. + + The info. + The context. + + + + Creates the proxy over the specified target. + + Interface + The target. + + + + + Creates the proxy over the specified target. + + The target. + + + + + Provides the implementation for operations that get member values. Classes derived from the class can override this method to specify dynamic behavior for operations such as getting a value for a property. + + Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement, where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The result of the get operation. For example, if the method is called for a property, you can assign the property value to . + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.) + + + + + Provides the implementation for operations that invoke a member. Classes derived from the class can override this method to specify dynamic behavior for operations such as calling a method. + + Provides information about the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleMethod". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The arguments that are passed to the object member during the invoke operation. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is derived from the class, is equal to 100. + The result of the member invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Tries the index of the get. + + The binder. + The indexes. + The result. + + + + + Internal Implementation of + + + + + Provides implementation for type conversion operations. Classes derived from the class can override this method to specify dynamic behavior for operations that convert an object from one type to another. + + Provides information about the conversion operation. The binder.Type property provides the type to which the object must be converted. For example, for the statement (String)sampleObject in C# (CType(sampleObject, Type) in Visual Basic), where sampleObject is an instance of the class derived from the class, binder.Type returns the type. The binder.Explicit property provides information about the kind of conversion that occurs. It returns true for explicit conversion and false for implicit conversion. + The result of the type conversion operation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Provides the implementation for operations that invoke a member. Classes derived from the class can override this method to specify dynamic behavior for operations such as calling a method. + + Provides information about the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleMethod". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The arguments that are passed to the object member during the invoke operation. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is derived from the class, [0] is equal to 100. + The result of the member invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Provides the implementation for operations that invoke an object. Classes derived from the class can override this method to specify dynamic behavior for operations such as invoking an object or a delegate. + + Provides information about the invoke operation. + The arguments that are passed to the object during the invoke operation. For example, for the sampleObject(100) operation, where sampleObject is derived from the class, [0] is equal to 100. + The result of the object invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown. + + + + + Internal method for subsequent invocations of + + + + + Provides implementation for type conversion operations. Classes derived from the class can override this method to specify dynamic behavior for operations that convert an object from one type to another. + + Provides information about the conversion operation. The binder.Type property provides the type to which the object must be converted. For example, for the statement (String)sampleObject in C# (CType(sampleObject, Type) in Visual Basic), where sampleObject is an instance of the class derived from the class, binder.Type returns the type. The binder.Explicit property provides information about the kind of conversion that occurs. It returns true for explicit conversion and false for implicit conversion. + The result of the type conversion operation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Provides the implementation for operations that invoke an object. Classes derived from the class can override this method to specify dynamic behavior for operations such as invoking an object or a delegate. + + Provides information about the invoke operation. + The arguments that are passed to the object during the invoke operation. For example, for the sampleObject(100) operation, where sampleObject is derived from the class, is equal to 100. + The result of the object invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown. + + + + + Gets the target. + + The target. + + + + Gets the name of the member. + + The name of the member. + + + + Gets the args. + + The args. + + + + Gets the total arg count. + + The total arg count. + + + + Gets the kind of the invocation. + + The kind of the invocation. + + + + Does most of the work buiding and caching proxies + + + + + Writes the out DLL of types created between this call and being closed used for debugging of emitted IL code + + The name. + + + This may be used for generating an assembly for preloading proxies, however you must be very careful when doing so as + changes could make the emitted asssembly out of date very easily. + + + + + Builds the type for the static proxy or returns from cache + + Type of the context. + The main interface. + The other interfaces. + + + + + Builds the type. + + Type of the context. + The informal interface. + + + + + Preloads a proxy for ActLike to use. + + Type of the proxy. + The ActLikeProxyAttribute, if not provide it will be looked up. + Returns false if there already is a proxy registered for the same type. + + + + Preloads proxies that ActLike uses from assembly. + + The assembly. + Returns false if there already is a proxy registered for the same type. + + + + Makes the property helper. + + The builder. + The type builder. + The info. + The get method. + The set method. + The emit info. + + + + Generates the delegate type of the call site function. + + The arg types. + Type of the return. + The method info. Required for reference types or delegates with more than 16 arguments. + The Type Builder. Required for reference types or delegates with more than 16 arguments. + + + + + Module Builder for buiding proxies + + + + + Base class of Expando-Type objects + + + + + Wrapped Dictionary + + + + + Initializes a new instance of the class. + + The info. + The context. + + + + Populates a with the data needed to serialize the target object. + + The to populate with data. + The destination (see ) for this serialization. + The caller does not have the required permission. + + + + Initializes a new instance of the class. + + The dict. + + + + Returns the enumeration of all dynamic member names. + + + A sequence that contains dynamic member names. + + + + + Provides the implementation for operations that get member values. Classes derived from the class can override this method to specify dynamic behavior for operations such as getting a value for a property. + + Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement, where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The result of the get operation. For example, if the method is called for a property, you can assign the property value to . + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.) + + + + + Provides the implementation for operations that invoke a member. Classes derived from the class can override this method to specify dynamic behavior for operations such as calling a method. + + Provides information about the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleMethod". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The arguments that are passed to the object member during the invoke operation. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is derived from the class, is equal to 100. + The result of the member invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Provides the implementation for operations that set member values. Classes derived from the class can override this method to specify dynamic behavior for operations such as setting a value for a property. + + Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member to which the value is being assigned. For example, for the statement sampleObject.SampleProperty = "Test", where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The value to set to the member. For example, for sampleObject.SampleProperty = "Test", where sampleObject is an instance of the class derived from the class, the is "Test". + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Adds the specified item. + + The item. + + + + Determines whether [contains] [the specified item]. + + The item. + + true if [contains] [the specified item]; otherwise, false. + + + + + Copies to. + + The array. + Index of the array. + + + + Removes the specified item. + + The item. + + + + + Determines whether the specified key contains key. + + The key. + + true if the specified key contains key; otherwise, false. + + + + + Adds the specified key. + + The key. + The value. + + + + Removes the specified key. + + The key. + + + + + Tries the get value. + + The key. + The value. + + + + + Called when [property changed]. + + The key. + + + + Equalses the specified other. + + The other. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Gets a value indicating whether this instance is read only. + + + true if this instance is read only; otherwise, false. + + + + + Gets the keys. + + The keys. + + + + Gets the values. + + The values. + + + + Occurs when a property value changes. + + + + + This interface can be used to define your own custom proxy if you preload it. + + + Advanced usage only! This is required as well as + + + + + Method used to Initialize Proxy + + + + + + + + Base class of Emited ProxiesC:\Documents and Settings\jayt\My Documents\Visual Studio 2010\Projects\impromptuinterface\ImpromptuInterface\Optimization\ + + + + + Method used to Initialize Proxy + + + + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Actlike proxy should be equivalent to the objects they proxy + + The other. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Populates a with the data needed to serialize the target object. + + The to populate with data. + The destination (see ) for this serialization. + The caller does not have the required permission. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns the proxied object + + + + + + Expando-Type List for dynamic objects + + + + + Wrapped list + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The contents. + The members. + + + + Initializes a new instance of the class. + + The info. + The context. + + + + Gets the enumerator. + + + + + + Adds the specified item. + + The item. + + + + Clears this instance. + + + + + Determines whether [contains] [the specified item]. + + The item. + + true if [contains] [the specified item]; otherwise, false. + + + + + Copies to. + + The array. + Index of the array. + + + + Indexes the of. + + The item. + + + + + Equalses the specified other. + + The other. + + + + + Gets the represented item. USED fOR GetItemProperties + + + + + + Returns the name of the list. + + An array of objects, for which the list name is returned. This can be null. + The name of the list. + + + + Gets the count. + + The count. + + + + Occurs when the collection changes. + + + + + Gets or sets the override getting item method names. USED for GetItemProperties + + The override getting item method names. + + + + Late bind types from libraries not not at compile type + + + + + Initializes a new instance of the class. + + The type. + + + + Initializes a new instance of the class. + + Qualified Name of the type. + + + + Initializes a new instance of the class. + + The info. + The context. + + + + Returns a late bound constructor + + The late bound constructor + + + + Gets a value indicating whether this Type is available at runtime. + + + true if this instance is available; otherwise, false. + + + + + Forward argument to constructor including named arguments + + + + + Extension Methods for fluent Regex + + + + + Implements the operator +. + + The left. + The right. + The result of the operator. + + + + Implements the operator -. + + The left. + The right. + The result of the operator. + + + + Gets or sets the delegate. + + The delegate. + + + + Gets or sets a value indicating whether this instance is adding. + + true if this instance is adding; otherwise, false. + + + + Similar to Expando Objects but handles null values when the property is defined with an impromptu interface + + + + + Convenience create method to make an Impromptu Dictionary instance acting like interface type parameter + + + The dict. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The dict. + + + + Initializes a new instance of the class. + + The info. + The context. + + + + Gets the enumerator. + + + + + + Clears this instance. + + + + + Gets the count. + + The count. + + + + Gets or sets the with the specified key. + + + + + + Adds extra synatx to intialize properties to match up with clay + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The dict. + + + + Various extension methods for add + + + + + Combines target with context. + + The target. + The context. + + + + + Combines target with context. + + The type of the context. + The target. + + + + + Combines target with context. + + The target. + The context. + + + + + Withes the static context. + + The target. + The context. + + + + + attaches generic args to string + + The name. + The generic args. + + + + + attaches name of the argument. + + The argument. + The name. + + + + + Use for Named arguments passed to InvokeMethods + + + + + Performs an explicit conversion from to . + + The pair. + The result of the conversion. + + + + Create Function can set to variable to make cleaner syntax; + + + + + Initializes a new instance of the class. + + The name. + The value. + + + + Gets or sets the argument name. + + The name. + + + + Gets or sets the argument value. + + The value. + + + + InvokeArg that makes it easier to Cast from any IDictionaryValue + + + + + + Initializes a new instance of the class. + + The name. + The value. + + + + Performs an explicit conversion from to . + + The pair. + The result of the conversion. + + + + Utility Class + + + + + Determines whether [is anonymous type] [the specified target]. + + The target. + + true if [is anonymous type] [the specified target]; otherwise, false. + + + + + Names the args if necessary. + + The call info. + The args. + + + + + Gets the target context. + + The target. + The context. + if set to true [static context]. + + + + + Fixes the context. + + The context. + + + + + Gets the value. Conveinence Ext method + + + The info. + The name. + + + + + Is Current Runtime Mono? + + + + + String or InvokeMemberName + + + + + Performs an implicit conversion from to . + + The name. + The result of the conversion. + + + + Gets the name. + + The name. + + + + Gets the generic args. + + The generic args. + + + + Gets or sets a value indicating whether this member is special name. + + + true if this instance is special name; otherwise, false. + + + + + Name of Member with associated Generic parameterss + + + + + Create Function can set to variable to make cleaner syntax; + + + + + Create Function can set to variable to make cleaner syntax; + + + + + Performs an implicit conversion from to . + + The name. + The result of the conversion. + + + + Initializes a new instance of the class. + + The name. + The generic args. + + + + Initializes a new instance of the class. + + The name. + if set to true [is special name]. + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Extension Methods that make emiting code easier and easier to read + + + + + Gets the field info even if generic type parameter. + + The type. + Name of the field. + + + + + Gets the method info even if generic type parameter. + + The type. + Name of the method. + The arg types. + + + + + Gets the method info even if generic type parameter. + + The type. + Name of the method. + + + + + Emits branch true. expects using keyword. + + The generator. + The condition. + + + Using keyword allows you to set the emit code you are branching over and then automatically emits label when disposing + + g.Emit(OpCodes.Ldsfld, tConvertField))) + { + tIlGen.EmitDynamicConvertBinder(CSharpBinderFlags.None, returnType, contextType); + tIlGen.EmitCallsiteCreate(convertFuncType); + tIlGen.Emit(OpCodes.Stsfld, tConvertField); + } + ]]> + + + + + + Emits the call. + + The generator. + The target. + The call. + The parameters. + + + + Emits creating the callsite. + + The generator. + Type of the func. + + + + Emits the call invoke delegate. + + The generator. + Type of the func. + + + + Emits an array. + + The generator. + Type of the array. + The emit elements. + + + + Emits the store location. + + The generator. + The location. + + + + Emits the load argument. + + The generator. + The location. + + + + Emits the load location. + + The generator. + The location. + + + + Emits the dynamic method invoke binder. + + The generator. + The binding flags. + The name. + The context. + The arg info. + The arg names. + + + + Emits the dynamic set binder. + + The generator. + The binding flags. + The name. + The context. + The arg types. + + + + Emits the dynamic set binder dynamic params. + + The generator. + The flag. + The name. + The context. + The arg types. + + + + Emits the dynamic binary op binder. + + The generator. + The flag. + Type of the expr. + The context. + The arg types. + + + + Emits the dynamic get binder. + + The generator. + The binding flags. + The name. + The context. + The arg types. + + + + Emits creating the + + The generator. + The flag. + The name. + + + + Emits the dynamic convert binder. + + The generator. + The binding flag. + Type of the return. + The context. + + + + Emits the typeof(Type) + + The generator. + The type. + + + + Emits the typeof(Type) + + The generator. + The type. + + + + Used to automatically create label on dispose + + + + + Constructor + + + + + + Finishes block + + + + + Constructor + + + + + + Finishes block + + + + + Property Descriptor for Dynamic Objects + + + + + Initializes a new instance of the class. + + The name. + + + + When overridden in a derived class, returns whether resetting an object changes its value. + + The component to test for reset capability. + + true if resetting the component changes its value; otherwise, false. + + + + + When overridden in a derived class, gets the current value of the property on a component. + + The component with the property for which to retrieve the value. + + The value of a property for a given component. + + + + + When overridden in a derived class, resets the value for this property of the component to the default value. + + The component with the property value that is to be reset to the default value. + + + + When overridden in a derived class, sets the value of the component to a different value. + + The component with the property value that is to be set. + The new value. + + + + When overridden in a derived class, determines a value indicating whether the value of this property needs to be persisted. + + The component with the property to be examined for persistence. + + true if the property should be persisted; otherwise, false. + + + + + When overridden in a derived class, gets the type of the component this property is bound to. + + + A that represents the type of component this property is bound to. When the or methods are invoked, the object specified might be an instance of this type. + + + + When overridden in a derived class, gets a value indicating whether this property is read-only. + + + true if the property is read-only; otherwise, false. + + + + When overridden in a derived class, gets the type of the property. + + + A that represents the type of the property. + + + + Dummy that just returns null of default for everything. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The info. + The context. + + + + Provides the implementation for operations that get member values. Classes derived from the class can override this method to specify dynamic behavior for operations such as getting a value for a property. + + Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement, where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The result of the get operation. For example, if the method is called for a property, you can assign the property value to . + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.) + + + + + Provides the implementation for operations that set member values. Classes derived from the class can override this method to specify dynamic behavior for operations such as setting a value for a property. + + Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member to which the value is being assigned. For example, for the statement sampleObject.SampleProperty = "Test", where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The value to set to the member. For example, for sampleObject.SampleProperty = "Test", where sampleObject is an instance of the class derived from the class, the is "Test". + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Provides the implementation for operations that invoke a member. Classes derived from the class can override this method to specify dynamic behavior for operations such as calling a method. + + Provides information about the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleMethod". The binder.IgnoreCase property specifies whether the member name is case-sensitive. + The arguments that are passed to the object member during the invoke operation. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is derived from the class, is equal to 100. + The result of the member invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) + + + + + Tries the index of the get. + + The binder. + The indexes. + The result. + + + + + Main API + + + + + Creates a cached call site at runtime. + + Type of the delegate. + The CallSite binder. + Member Name + Permissions Context type + The arg names. + if set to true [static context]. + if set to true [is event]. + The CallSite + + Advanced usage only for serious custom dynamic invocation. + + + + + + Creates the call site. + + + The binder. + The name. + The context. + The arg names. + if set to true [static context]. + if set to true [is event]. + + /// + + Unit test that exhibits usage + (tBinder); + tSite.Target.Invoke(tSite, tPoco, out tResult); + Assert.AreEqual("success", tResult); + ]]> + + + + + + Dynamically Invokes a member method using the DLR + + The target. + The name. Can be a string it will be implicitly converted + The args. + The result + + Unit test that exhibits usage: + + (it => it.ToString()); + + var tValue = 1; + var tOut = Impromptu.InvokeMember(tExpando, "Func", tValue); + + Assert.AreEqual(tValue.ToString(), tOut); + ]]> + + + + + + Invokes the binary operator. + + The left arg. + The op. + The right Arg. + + + + + Invokes the unary opartor. + + The arg. + The op. + + + + + Invokes the specified target using the DLR; + + The target. + The args. + + + + + Dynamically Invokes indexer using the DLR. + + The target. + The indexes. + + + + + Convenience version of InvokeSetIndex that separates value and indexes. + + The target. + The value + The indexes + + + + + Invokes setindex. + + The target. + The indexes then value. + + + + Dynamically Invokes a member method which returns void using the DLR + + The target. + The name. + The args. + + Unit test that exhibits usage: + + (it => tTest = it); + + Impromptu.InvokeMemberAction(tExpando, "Action", tValue); + + Assert.AreEqual(tValue, tTest); + ]]> + + + + + + Invokes the action using the DLR + + The target. + The args. + + + + Dynamically Invokes a set member using the DLR. + + The target. + The name. + The value. + + Unit test that exhibits usage: + + + + + + if you call a static property off a type with a static context the csharp dlr binder won't do it, so this method reverts to reflection + + + + + Invokes the set on the end of a property chain. + + The target. + The property chain. + The value. + + + + Wraps a target to partial apply a method (or target if you can invoke target directly eg delegate). + + The target. + The total arg count. + + + + + Wraps a delegate to partially apply it. + + The target. + + + + + Dynamically Invokes a get member using the DLR. + + The target. + The name. + The result. + + Unit Test that describes usage + + + + + + + + Invokes the getter property chain. + + The target. + The property chain. + + + + + Determines whether the specified name on target is event. This allows you to know whether to InvokeMemberAction + add_{name} or a combo of {invokeget, +=, invokeset} and the corresponding remove_{name} + or a combon of {invokeget, -=, invokeset} + + The target. + The name. + + true if the specified target is event; otherwise, false. + + + + + Invokes add assign with correct behavior for events. + + The target. + The name. + The value. + + + + Invokes add assign with correct behavior for events. + + The target. + The name. + The value. + + + + Invokes subtract assign with correct behavior for events. + + The target. + The name. + The value. + + + + Invokes subtract assign with correct behavior for events. + + The target. + The name. + The value. + + + + Invokes convert using the DLR. + + The target. + The type. + if set to true [explicit]. + + + + + (Obsolete)Invokes the constructor. misspelling + + The type. + The args. + + + + + Invokes the constuctor. + + The type. + The args. + + + + + FastDynamicInvoke extension method. Runs up to runs up to 20x faster than . + + The del. + The args. + + + + + Given a generic parameter count and whether it returns void or not gives type of Action or Func + + The param count. + if set to true [return void]. + Type of Action or Func + + + + Gets the member names of properties. Not all IDynamicMetaObjectProvider have support for this. + + The target. + if set to true [dynamic only]. Won't add reflected properties + + + + + Dynamically invokes a method determined by the CallSite binder and be given an appropriate delegate type + + The Callsite + The target. + The args. + + + Advanced use only. Use this method for serious custom invocation, otherwise there are other convenience methods such as + , , and + + + + + Dynamically invokes a method determined by the CallSite binder and be given an appropriate delegate type + + The Callsite + The target. + The args. + + + Advanced use only. Use this method for serious custom invocation, otherwise there are other convenience methods such as + , , and + + + + + Extension Method that Wraps an existing object with an Explicit interface definition + + The type of the interface. + The original object can be annoymous type, System.DynamicObject as well as any others. + Optional other interfaces. + + + + + Extension Method that Wraps an existing object with an Interface of what it is implicitly assigned to. + + The original dynamic. + The other interfaces. + + + + + Makes static methods for the passed in property spec, designed to be used with old api's that reflect properties. + + The original dynamic. + The property spec. + + + + + Private helper method that initializes the proxy. + + The proxytype. + The original. + The interfaces. + The property spec. + + + + + This Extension method is called off the calling context to perserve permissions with the object wrapped with an explicit interface definition. + + The type of the interface. + The caller. + The original dynamic. + The other interfaces. + + + UnitTest That describes usage + + (tTest); + Assert.Throws(() => tNonExposed.Test()); + ]]> + + + + + + Chainable Linq to Objects Method, allows you to wrap a list of objects with an Explict interface defintion + + The type of the interface. + The original dynamic. + The other interfaces. + + + + + Static Method that wraps an existing dyanmic object with a explicit interface type + + The original dynamic. + The other interfaces. + + + + + This Extension method is called off the calling context to perserve permissions with the object wrapped with an explicit interface definition. + + The caller. + The original dynamic. + The other interfaces. + + + + + Chainable Linq to Objects Method, allows you to wrap a list of objects, and preserve method permissions with a caller, with an Explict interface defintion + + The type of the interface. + The original dynamic. + The caller. + The other interfaces. + + + + + Call Like method invokes set on target and a list of property/value. Invoke with dictionary, anonymous type or named arguments. + + The invoke set all. + + + + Builds Objects with a Fluent Syntax + + + + + New Builder + + + + + + New Builder + + The type of the object prototype. + + + + + Syntax for a quick new inline prototype object + + + + + Gets the new object builder. + + The new object. + + + + Gets the new list builder. + + The new list. + + + + Syntax for a quick inline object property setup + + The type of the object prototype. + + + + Gets the new object builder. + + The new. + + + + Gets the new list builder. + + The new list. + + + + Encapsulates an Activator + + + + + Initializes a new instance of the class. + + The type. + The args. + + + + Initializes a new instance of the class. With Factory Function + + The type. + The args. + + + + Creates this instance. + + + + + + Gets or sets the constructor type. + + The type. + + + + Gets or sets the constructor arguments. + + The arguments. + + + + Encapsulates an Activator + + The type of the object prototype. + + + + Initializes a new instance of the class. + + The args. + + + + Initializes a new instance of the class. With Factory Function + + The args. + + + + Creates this instance. + + + + + + Type that Encompasses Hashing a group of Types in various ways + + + + + Equalses the specified other. + + The other. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Implements the operator ==. + + The left. + The right. + The result of the operator. + + + + Implements the operator !=. + + The left. + The right. + The result of the operator. + + + + Types to be hashed + + + + + The Informal Interface to be hashed + + + + + Initializes a new instance of the class. + + The more types. + + + + Initializes a new instance of the class. + For use when you have must distinguish one type; and the rest aren't strict + + The type1. + The more types. + + + + Initializes a new instance of the class. + + The type1. + The informal interface. + + + + Initializes a new instance of the class. + + if set to true [strict order]. + types. + + + + Creates the TypeHash + + The more types. + + + + + Creates the TypeHash + + The type1. + The more types. + + + + + Creates the TypeHash + + The type1. + The informal interface. + + + + + Creates the TypeHash + + if set to true [strict order]. + The more types. + + + + + Cacheable representation of an invocation without the target or arguments also by default only does public methods to make it easier to cache. + /// + + + + Storable representation of an invocation without the target + + + + + Defacto Binder Name for Explicit Convert Op + + + + + Defacto Binder Name for Implicit Convert Op + + + + + Defacto Binder Name for Indexer + + + + + Defacto Binder Name for Construvter + + + + + Creates the invocation. + + The kind. + The name. + The args. + + + + + Initializes a new instance of the class. + + The kind. + The name. + The args. + + + + Equalses the specified other. + + The other. + + + + + Invokes the invocation on specified target with specific args. + + The target. + The args. + + + + + Deprecated use + + The target. + The args. + + + + + Invokes the invocation on specified target. + + The target. + + + + + Gets or sets the kind. + + The kind. + + + + Gets or sets the name. + + The name. + + + + Gets or sets the args. + + The args. + + + + Creates the cacheable convert call. + + Type of the convert. + if set to true [convert explict]. + + + + + Creates the cacheable method or indexer or property call. + + The kind. + The name. + The callInfo. + The context. + + + + + Initializes a new instance of the class. + + The kind. + The name. + The arg count. + The arg names. + The context. + Type of the convert. + if set to true [convert explict]. + The stored args. + + + + Equalses the specified other. + + The other. + + + + + LazyBinderType + + + + + Specific version of InvokeContext which declares a type to be used to invoke static methods. + + + + + Object that stores a context with a target for dynamic invocation + + + + + Create Function can set to variable to make cleaner syntax; + + + + + Create Function can set to variable to make cleaner syntax; + + + + + Create Function can set to variable to make cleaner syntax; + + + + + Initializes a new instance of the class. + + The target. + if set to true [static context]. + The context. + + + + Initializes a new instance of the class. + + The target. + The context. + + + + Gets or sets the target. + + The target. + + + + Gets or sets the context. + + The context. + + + + Gets or sets a value indicating whether [static context]. + + true if [static context]; otherwise, false. + + + + Performs an explicit conversion from to . + + The type. + The result of the conversion. + + + + Initializes a new instance of the class. + + The target. + + + + Type of Invocation + + + + + NotSet + + + + + Convert Implicit or Explicity + + + + + Get Property + + + + + Set Property + + + + + Get Indexer + + + + + Set Indexer + + + + + Invoke Method the has return value + + + + + Invoke Method that returns void + + + + + Invoke Method that could return a value or void + + + + + Invoke Constructor + + + + + Invoke += + + + + + Invoke -= + + + + + Invoke Event Property Test + + + + + Invoke Directly + + + + + Invoke Directly DiscardResult + + + + + Invoke Directly Return Value + + + + + Fluent Class for writing inline lambdass + + The type of the R. + + + + Arguments + + The lambda. + The lambda. + + + + This and arguments. + + The del. + + + + + Arguments + + The type of the Argument 1. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The type of the Argument 15. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The type of the Argument 15. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The type of the Argument 15. + The type of the Argument 16. + The lambdas. + + + + + this and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The type of the Argument 15. + The type of the Argument 16. + The del. + + + + + Fluent class for writing inline lambdas that return void + + + + + Arguments + + The lambda. + The lambda. + + + + This and arguments. + + The del. + + + + + Arguments + + The type of the Argument 1. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The type of the Argument 15. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The type of the Argument 15. + The del. + + + + + Arguments + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The type of the Argument 15. + The type of the Argument 16. + The lambda. + The lambda. + + + + This and Arguments. + + The type of the Argument 1. + The type of the Argument 2. + The type of the Argument 3. + The type of the Argument 4. + The type of the Argument 5. + The type of the Argument 6. + The type of the Argument 7. + The type of the Argument 8. + The type of the Argument 9. + The type of the Argument 10. + The type of the Argument 11. + The type of the Argument 12. + The type of the Argument 13. + The type of the Argument 14. + The type of the Argument 15. + The type of the Argument 16. + The del. + + + + + Support Deserializing the proxy since on separate runs of an executable + + + + + Original Object + + + + + Intefaces + + + + + Interfaces by name for Mono workaround + + + + + Type Context + + + + + Returns the real object that should be deserialized, rather than the object that the serialized stream specifies. + + The from which the current object is deserialized. + + Returns the actual object that is put into the graph. + + The caller does not have the required permission. The call will not work on a medium trusted server. + + + + Initializes a new instance of the class. + + The max length that the list cannot grow beyound + + + + Gets the enumerator. with bare bones this is good only once + + + + + + Internal class implmenation for + + + + + Provides the implementation for operations that invoke an object. Classes derived from the class can override this method to specify dynamic behavior for operations such as invoking an object or a delegate. + + Provides information about the invoke operation. + The arguments that are passed to the object during the invoke operation. For example, for the sampleObject(100) operation, where sampleObject is derived from the class, [0] is equal to 100. + The result of the object invocation. + + true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown. + + + + + Class for TDD, used for mocking any dynamic object + + + + + Override on DynamicObject + + + + + + + + + Override on DynamicObject + + + + + + + + Override on DynamicObject + + + + + + + + + Override on DynamicObject + + + + + + + + Override on DynamicObject + + + + + + + Override on DynamicObject + + + + + + + + + Override on DynamicObject + + + + + + + + Override on DynamicObject + + + + + + + + + Override on DynamicObject + + + + + + + + + Override on DynamicObject + + + + + + + + + Override on DynamicObject + + + + + + + + Override on DynamicObject + + + + + + + + Attribute for Methods and Parameters on Custom Interfaces designed to be used with a dynamic implementation + + + + + Initializes a new instance of the class. + + The info. + The context. + + + + Attribute on Inteface to stop proxy from recursively + proxying other interfaces + + + + + Proxy that Records Dynamic Invocations on an object + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The target. + + + + Initializes a new instance of the class. + + The info. + The context. + + + + Gets the object data. + + The info. + The context. + + + + Replays the recording on target. + + The target. + + + + Tries the invoke member. + + The binder. + The args. + The result. + + + + + Tries the index of the get. + + The binder. + The indexes. + The result. + + + + + Tries the index of the set. + + The binder. + The indexes. + The value. + + + + + Gets or sets the recording. + + The recording. + + + + Abstract base for the Generic class with fatory methods + + + + + Creates ImpromptuLazy based on the specified valuefactory. + + + The valuefactory. + + + + + Creates ImpromptuLazy based on the specified target. + + + The target. + + + + + Initializes a new instance of the class. + + The target. + + + + Initializes a new instance of the class. + + The info. + The context. + + + + Wraps a Lazy Type evalutaes on first method call + + + + + + Initializes a new instance of the class. + + The target. + + + + Initializes a new instance of the class. + + The info. + The context. + + + + Initializes a new instance of the class. + + The value factory. + + + + Returns the enumeration of all dynamic member names. + + + A sequence that contains dynamic member names. + + + + + Interface for simplistic builder options + + + + + Creates a prototype list + + The contents. + + + + + Setup List or Array, takes either one or a list of constructor args that will use objects Type + + The constructor args. + + + + + Setup List or Array if list has a default constrcutor + + + + + + + Setup List or Array, takes either one or a list of constructor args that will use objects Type + + The constructor args factory. + + + + + Setup List or Array if list has a default constrcutor + + + + + + + Alternative name for + + The constructor args. + + + + + Alternative name for + + The constructor args factory. + + + + + Alternative name for + + The contents. + + + + + Sets up object builder + + The constructor args. + + + + + Sets up object builder + + + + + + + Generates Object, use by calling with named arguments builder.Object(Prop1:"test",Prop2:"test") + returns new object; + + + + + Setups up named builders + + The setup. + + + + Builds Expando-Like Objects with an inline Syntax + + The type of the object proto type. + + + + Build factory storage + + + + + Initializes a new instance of the class. + + + + + Creates a prototype list + + The contents. + + + + + Alternative name for + + The contents. + + + + + Sets up object builder + + The constructor args. + + + + + Sets up object builder + + + + + + + Creates a Prototype object. + + The object. + + + + Trapoline for setting up Builders + + + + + Trampoline for builder + + + + + Initializes a new instance of the class. + + The builder. + + + + Trampoline for setup builder + + + + + Initializes a new instance of the class. + + The builder. + + + + Meta info describing proxy usage. Can be used to preload proxy. + + + + + Initializes a new instance of the class. + + The interfaces. + The context. + + + + Gets or sets the interfaces. + + The interfaces. + + + + Gets or sets the context. + + The context. + + + + Building block to use Method calls as dynamic lookups + + + + + Initializes a new instance of the class. + + The lookup. + + + diff --git a/linger/src/packages/Knockout.Mapping.2.4.0/Content/scripts/knockout.mapping-latest.debug.js b/linger/src/packages/Knockout.Mapping.2.4.0/Content/scripts/knockout.mapping-latest.debug.js new file mode 100644 index 0000000..48a6882 --- /dev/null +++ b/linger/src/packages/Knockout.Mapping.2.4.0/Content/scripts/knockout.mapping-latest.debug.js @@ -0,0 +1,796 @@ +/// Knockout Mapping plugin v2.4.0 +/// (c) 2013 Steven Sanderson, Roy Jacobs - http://knockoutjs.com/ +/// License: MIT (http://www.opensource.org/licenses/mit-license.php) +(function (factory) { + // Module systems magic dance. + + if (typeof require === "function" && typeof exports === "object" && typeof module === "object") { + // CommonJS or Node: hard-coded dependency on "knockout" + factory(require("knockout"), exports); + } else if (typeof define === "function" && define["amd"]) { + // AMD anonymous module with hard-coded dependency on "knockout" + define(["knockout", "exports"], factory); + } else { + // + +If you're writing an ASP.NET MVC 3 application, make sure that you are using Url.Content for your script references: + + + +If you're writing a regular ASP.NET application use ResolveClientUrl for your script references or register them via the ScriptManager +using a app root relative path (starting with a '~/'): + + + +If the above still doesn't work, you may have an issue with routing and extensionless URLs. To fix this, ensure you have the latest +patches installed for IIS and ASP.NET. \ No newline at end of file diff --git a/linger/src/packages/Microsoft.AspNet.SignalR.Core.1.0.0/lib/net40/Microsoft.AspNet.SignalR.Core.xml b/linger/src/packages/Microsoft.AspNet.SignalR.Core.1.0.0/lib/net40/Microsoft.AspNet.SignalR.Core.xml new file mode 100644 index 0000000..4cb6ec8 --- /dev/null +++ b/linger/src/packages/Microsoft.AspNet.SignalR.Core.1.0.0/lib/net40/Microsoft.AspNet.SignalR.Core.xml @@ -0,0 +1,2453 @@ + + + + Microsoft.AspNet.SignalR.Core + + + + Apply to Hubs and Hub methods to authorize client connections to Hubs and authorize client invocations of Hub methods. + + + + + Determines whether client is authorized to connect to . + true if the caller is authorized to connect to the hub; otherwise, false. + Description of the hub client is attempting to connect to. + The (re)connect request from the client. + + + Determines whether client is authorized to invoke the method. + true if the caller is authorized to invoke the method; otherwise, false. + An providing details regarding the method invocation. + Indicates whether the interface instance is an attribute applied directly to a method. + + + Set to false to apply authorization only to the invocations of any of the Hub's server-side methods. This property only affects attributes applied to the Hub class. This property cannot be read. + Returns . + + + Gets or sets the user roles. + Returns . + + + When overridden, provides an entry point for custom authorization checks. Called by and . + true if the user is authorized, otherwise, false. + The for the client being authorized. + + + Gets or sets the authorized users. + Returns . + + + + + Determines if browsers can make cross domain requests to SignalR endpoints. + Returns . + + + The dependency resolver to use for the hub connection. + Returns . + + + + Broadcasts a value to all connections, excluding the connection ids specified. + A task that represents when the broadcast is complete. + The connection + The value to broadcast. + The list of connection ids to exclude + + + Sends a message to all connections subscribed to the specified signal. An example of signal may be a specific connection id, or fully qualified group name (Use to manipulate groups). + A task that represents when the broadcast is complete. + The connection + The signal to send to. + value to publish. + The list of connection ids to exclude + + + A message sent to one or more connections. + + + Initializes a new instance of the class. + The signal. + The payload of the message. + + + Initializes a new instance of the class. + The signal. + The payload of the message. + The signals to exclude. + + + Represents a list of signals that should be used to filter what connections receive this message. + Returns . + + + The signal to this message should be sent to. Connections subscribed to this signal will receive the message payload. + Returns . + + + The payload of the message. + Returns . + + + + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + + + + + Returns . + + + Returns . + + + + + + + + + + + + + + Provides access to default host information. + + + Gets the default + Returns . + + + Gets the default + Returns . + + + Gets or sets the default . + Returns . + + + Returns . + + + Manages groups for a connection. + + + Initializes a new instance of the class. + The this group resides on. + The prefix for this group. Either a name or type name. + + + Adds a connection to the specified group. + A task that represents the connection id being added to the group. + The connection id to add to the group. + The name of the group + + + Removes a connection from the specified group. + A task that represents the connection id being removed from the group. + The connection id to remove from the group. + The name of the group + + + Sends a value to the specified group. + A task that represents when send is complete. + The name of the group. + The value to send. + The list of connection ids to exclude. + + + Provides methods that communicate with SignalR connections that connected to a . + + + + Returns . + + + Provides information about the calling client. + Returns . + + + + + The group manager for this hub instance. + Returns . + + + Called when the connection connects to this hub instance. + A . + + + Called when a connection disconnects from this hub instance. + A . + + + Called when the connection reconnects to this hub instance. + A . + + + + + Determines whether detailed exceptions thrown in Hub methods get reported back the invoking client. Defaults to false. + Returns . + + + Determines whether JavaScript proxies for the server-side hubs should be auto generated at {Path}/hubs. Defaults to true. + Returns . + + + + Requiring Authentication adds an to the with and authorizers that will be applied globally to all hubs and hub methods. These authorizers require that the 's IsAuthenticated for any clients that invoke server-side hub methods or receive client-side hub method invocations. + The to which the will be added. + + + A communication channel for a and its connections. + + + The main signal for this connection. This is the main signalr for a . + + + Sends a message to connections subscribed to the signal. + A task that returns when the message has be sent. + The message to send. + + + Manages groups for a connection and allows sending messages to the group. + + + Sends a value to the specified group. + A task that represents when send is complete. + The name of the group. + The value to send. + + + + Returns . + + + Returns . + + + + + Manages groups for a connection. + + + Adds a connection to the specified group. + A task that represents the connection id being added to the group. + The connection id to add to the group. + The name of the group + + + Removes a connection from the specified group. + A task that represents the connection id being removed from the group. + The connection id to remove from the group. + The name of the group + + + Provides access to information about a . + + + Encapsulates all information about a SignalR connection for an . + Returns . + + + Gets the the hub. + Returns . + + + Provides access to information about a . + + + Gets the for the . + + + Gets the for the . + + + Represents a SignalR request + + + Gets the cookies for this request. + + + Gets the form for this request. + + + Gets the headers for this request. + + + Gets state for the current HTTP request. + + + Gets the query string for this request. + + + Gets the url for this request. + + + Gets security information for the current HTTP request. + + + Represents a connection between client and server. + + + + Returns . + + + Returns . + The for the current connection. + + + Called before every request and gives a user authorization to access the request. + A Boolean value that represents if the request is authorized. + The for the current connection. + + + Gets the for the . + Returns . + + + Returns . + + + Returns the signals used in the . + The signals used for this . + The ID of the incoming connection. + + + Gets the for the . + Returns . + + + + Returns . + + + Returns . + + + Called when a new connection is made. + A that completes when the connect operation is complete. + The for the current connection. + The ID of the reconnecting client. + + + Called when a connection disconnects. + A that completes when the disconnect operation is complete. + The for the current connection. + The ID of the disconnected client. + + + Called when data is received from a connection. + A that completes when the receive operation is complete. + The for the current connection. + The ID of the connection sending the data. + The payload sent to the connection. + + + Called when a connection reconnects after a timeout. + A that completes when the re-connect operation is complete. + The for the current connection. + The ID of the reconnecting client. + + + Called when a connection reconnects after a timeout to determine which groups should be rejoined. + A collection of group names that should be joined on reconnect. + The for the current connection. + The groups the calling connection claims to be part of. + The ID of the reconnecting client. + + + Handles all requests for a . + A that completes when the pipeline is complete. + The for the current request. + Thrown if the connection wasn't initialized. Thrown if the transport wasn't specified. Thrown if the connection ID wasn't specified. + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + + + + + + + Provides access to server configuration. + + + Gets or sets a representing the amount of time to leave a connection open before timing out. + + + Gets of sets the number of messages to buffer for a specific signal. + + + Gets or sets a representing the amount of time to wait after a connection goes away before raising the disconnect event. + + + Gets or sets a representing the amount of time between send keep alive messages. If enabled, this value must be at least two seconds. Set to null to disable. + + + + + + + + + + + + + + + + + + + + + + + + + Represents a connection to the client. + + + Gets a cancellation token that represents the client's lifetime. + + + Gets or sets the content type of the response. + + + Closes the connection to the client. + A task that represents when the connection is closed. + + + Flushes the buffered response to the client. + A task that represents when the data has been flushed. + + + Writes buffered data. + The data to write to the buffer. + + + Represents a web socket. + + + Invoked when the websocket gracefully closes + + + Invoked when there is an error + + + Invoked when data is sent over the websocket + + + Sends data over the websocket. + A that represents the send is complete. + The value to send. + + + + + Responsible for creating instances. + + + Creates a new instance of the class. + The dependency resolver to use for when creating the . + + + Creates an instance of the specified type using the dependency resolver or the type's default constructor. + An instance of a . + The type of to create. + + + Extension methods for . + + + Wraps the underlying object as a stream + A stream the wraps the response + The + + + Closes the connection to a client with optional data. + A task that represents when the connection is closed. + The . + The data to write to the connection. + + + Applies authorization attributes from the class to determine whether to allow clients to receive messages sent from the hub. + + + + + Wraps a function to be called before a client subscribes to signals belonging to the hub described by the . By default, the will look for attributes on the hub to help determine if the client is authorized to subscribe to method invocations for the described hub. The function returns true if the client is authorized to subscribe to client-side hub method invocations; false, otherwise. + A wrapped function that dictates whether or not the client is authorized to connect to the described Hub. + A function that dictates whether or not the client is authorized to connect to the described Hub. + + + Wraps a function that invokes a server-side hub method. Even if a client has not been authorized to connect to a hub, it will still be authorized to invoke server-side methods on that hub unless it is prevented in by not executing the invoke parameter. + A wrapped function that invokes a server-side hub method. + A function that invokes a server-side hub method. + + + A description of a client-side hub method invocation. + + + + The argument list the client-side hub method will be called with. + Returns . + + + The name of the hub that the method being invoked belongs to. + Returns . + + + The name of the client-side hub method to be invoked. + Returns . + + + A key-value store representing the hub state on the server that has changed since the last time the hub state was sent to the client. + Returns . + + + The signal that clients receiving this invocation are subscribed to. + Returns . + + + Represents a server side proxy for the client side hub. + + + + Invokes a method on the connection(s) represented by the instance. + A task that represents when the data has been sent to the client. + The name of the method to invoke. + The arguments to pass to the client. + + + Executes the method. + true always. + The information that contains binding semantic and details of the client side hub operation. + The arguments that are passed to the object member during the invoke operation. + When method returns, contains the result of the member invocation. + + + + + + + Returns . + + + + + Returns . + + + + + Returns . + + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + + + + + Returns . + + + + + Resolves method parameter values based on provided objects. + The array of parameter values. + The method descriptor. + The list of values to resolve parameter values from. + + + Resolves a parameter value based on the provided object. + The parameter value. + The parameter descriptor. + The value to resolve the parameter value from. + + + + + Returns . + + + Returns . + + + + + + + + + + Gets the connection ID of the calling client. + The connection ID of the calling client. + + + Gets the headers for the request. + The headers for the request. + + + Gets the query string for the request. + The query string for the request. + + + Gets the for the current HTTP request. + The for the current HTTP request. + + + Gets the cookies for the request. + The cookies for the request. + + + Gets the for the request. + The for the request. + + + Encapsulates all information about an individual SignalR connection for an . + + + + + All connected clients. + Returns . + + + Returns a dynamic representation of all clients except the calling client ones specified. + A dynamic representation of all clients except the calling client ones specified. + A list of connection ids to exclude. + + + Represents the calling client. + Returns . + + + Returns a dynamic representation of the connection with the specified connection ID. + A dynamic representation of the specified client. + The connection id + + + Returns a dynamic representation of the specified group. + A dynamic representation of the specified group. + The name of the group + A list of connection ids to exclude. + + + All connected clients except the calling client. + Returns . + + + Returns a dynamic representation of all clients in a group except the calling client. + A dynamic representation of all clients in a group except the calling client. + The name of the group + + + Holds information about a single hub. + + + + Returns . + + + Hub type. + Returns . + + + Handles all communication over the hubs persistent connection. + + + Initializes an instance of the class. + Configuration settings determining whether to enable JS proxies and provide clients with detailed hub errors. + + + + Returns . + + + + + + Processes the hub's incoming method calls. + + + + + + Returns . + + + + Returns . + + + Returns . + + + Returns . + + + + + Returns . + + + + + Returns . + + + Common base class to simplify the implementation of IHubPipelineModules. A module can intercept and customize various stages of hub processing such as connecting, reconnecting, disconnecting, invoking server-side hub methods, invoking client-side hub methods, authorizing hub clients and rejoining hub groups. A module can be activated by calling . The combined modules added to the are invoked via the interface. + + + + Wraps a function to be called before a client subscribes to signals belonging to the hub described by the . By default, the will look for attributes on the to help determine if the client is authorized to subscribe to method invocations for the described hub. The function returns true if the client is authorized to subscribe to client-side hub method invocations; false, otherwise. + A wrapped function that dictates whether or not the client is authorized to connect to the described Hub. + A function that dictates whether or not the client is authorized to connect to the described Hub. + + + Wraps a function that is called when a client connects to the for each the client connects to. By default, this results in the 's OnConnected method being invoked. + A wrapped function to be called when a client connects to a hub. + A function to be called when a client connects to a hub. + + + Wraps a function that is called when a client disconnects from the for each the client was connected to. By default, this results in the 's OnDisconnected method being invoked. + A wrapped function to be called when a client disconnects from a hub. + A function to be called when a client disconnects from a hub. + + + Wraps a function that invokes a server-side hub method. Even if a client has not been authorized to connect to a hub, it will still be authorized to invoke server-side methods on that hub unless it is prevented in by not executing the invoke parameter. + A wrapped function that invokes a server-side hub method. + A function that invokes a server-side hub method. + + + Wraps a function that invokes a client-side hub method. + A wrapped function that invokes a client-side hub method. + A function that invokes a client-side hub method. + + + Wraps a function that is called when a client reconnects to the for each the client connects to. By default, this results in the 's OnReconnected method being invoked. + A wrapped function to be called when a client reconnects to a hub. + A function to be called when a client reconnects to a hub. + + + Wraps a function that determines which of the groups belonging to the hub described by the the client should be allowed to rejoin. By default, clients that are reconnecting to the server will be removed from all groups they may have previously been a member of, because untrusted clients may claim to be a member of groups they were never authorized to join. + A wrapped function that determines which groups the client should be allowed to rejoin. + A function that determines which groups the client should be allowed to rejoin. + + + This method is called after the connect components of any modules added later to the are executed and after is executed, if at all. + The hub the client has connected to. + + + This method is called after the disconnect components of any modules added later to the are executed and after is executed, if at all. + The hub the client has disconnected from. + + + This method is called after the incoming components of any modules added later to the and the server-side hub method have completed execution. + The possibly new or updated return value of the server-side hub method + The return value of the server-side hub method + A description of the server-side hub method invocation. + + + This method is called after the outgoing components of any modules added later to the are executed. This does not mean that all the clients have received the hub method invocation, but it does indicate a hub invocation message has successfully been published to a message bus. + A description of the client-side hub method invocation. + + + This method is called after the reconnect components of any modules added later to the are executed and after is executed, if at all. + The hub the client has reconnected to. + + + This method is called before the AuthorizeConnect components of any modules added later to the are executed. If this returns false, then those later-added modules will not run and the client will not be allowed to subscribe to client-side invocations of methods belonging to the hub defined by the . + true, if the client is authorized to connect to the hub, false otherwise. + A description of the hub the client is trying to subscribe to. + The connect request of the client trying to subscribe to the hub. + + + This method is called before the connect components of any modules added later to the are executed. If this returns false, then those later-added modules and the method will not be run. + true, if the connect components of later added modules and the method should be executed; false, otherwise. + The hub the client has connected to. + + + This method is called before the disconnect components of any modules added later to the are executed. If this returns false, then those later-added modules and the method will not be run. + true, if the disconnect components of later added modules and the method should be executed; false, otherwise. + The hub the client has disconnected from. + + + This method is called before the incoming components of any modules added later to the are executed. If this returns false, then those later-added modules and the server-side hub method invocation will not be executed. Even if a client has not been authorized to connect to a hub, it will still be authorized to invoke server-side methods on that hub unless it is prevented in by not executing the invoke parameter or prevented in by returning false. + true, if the incoming components of later added modules and the server-side hub method invocation should be executed; false, otherwise. + A description of the server-side hub method invocation. + + + This method is called before the outgoing components of any modules added later to the are executed. If this returns false, then those later-added modules and the client-side hub method invocation(s) will not be executed. + true, if the outgoing components of later added modules and the client-side hub method invocation(s) should be executed; false, otherwise. + A description of the client-side hub method invocation. + + + This method is called before the reconnect components of any modules added later to the are executed. If this returns false, then those later-added modules and the method will not be run. + true, if the reconnect components of later added modules and the method should be executed; false, otherwise. + The hub the client has reconnected to. + + + This is called when an uncaught exception is thrown by a server-side hub method or the incoming component of a module added later to the . Observing the exception using this method will not prevent it from bubbling up to other modules. + The exception that was thrown during the server-side invocation. + A description of the server-side hub method invocation. + + + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + The response returned from an incoming hub request. + + + + The exception that occurs as a result of invoking the hub method. + Returns . + + + The id of the operation. + Returns . + + + The result of the invocation. + Returns . + + + The stack trace of the exception that occurs as a result of invoking the hub method. + Returns . + + + The changes made the round tripped state. + Returns . + + + + Returns . + + + Interface to be implemented by s that can authorize client to connect to a . + + + Given a , determine whether client is authorized to connect to . + true if the caller is authorized to connect to the hub; otherwise, false. + Description of the hub client is attempting to connect to. + The connection request from the client. + + + Interface to be implemented by s that can authorize the invocation of methods. + + + Given a , determine whether client is authorized to invoke the method. + true if the caller is authorized to invoke the method; otherwise, false. + An providing details regarding the method invocation. + Indicates whether the interface instance is an attribute applied directly to a method. + + + A server side proxy for the client side hub. + + + Invokes a method on the connection(s) represented by the instance. + A task that represents when the data has been sent to the client. + The name of the method to invoke + The arguments to pass to the client + + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + + Returns . + + + Encapsulates all information about a SignalR connection for an . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Describes hub descriptor provider, which provides information about available hubs. + + + Retrieves all available hubs. + Collection of hub descriptors. + + + Tries to retrieve hub with a given name. + True, if hub has been found + Name of the hub. + Retrieved descriptor object. + + + A description of a server-side hub method invocation originating from a client. + + + The arguments to be passed to the invoked method. + + + A hub instance that contains the invoked method as a member. + + + A description of the method being invoked by the client. + + + A key-value store representing the hub state on the client at the time of the invocation. + + + Describes a hub manager - main point in the whole hub and method lookup process. + + + Retrieves a single hub descriptor. + Hub descriptor, if found. Null, otherwise. + Name of the hub. + + + Retrieves a method with a given name on a given hub. + Descriptor of the method, if found. Null otherwise. + Name of the hub. + Name of the method to find. + Method parameters to match. + + + Gets all methods available to call on a given hub. + List of available methods. + Name of the hub, + Optional predicate for filtering results. + + + Retrieves all available hubs matching the given predicate. + List of hub descriptors. + + + Resolves a given hub name to a concrete object. + Hub implementation instance, if found. Null otherwise. + Name of the hub. + + + Resolves all available hubs to their concrete objects. + List of hub instances. + + + A description of a client-side hub method invocation originating from the server. + + + The , if any, corresponding to the client that invoked the server-side hub method that is invoking the client-side hub method. + + + The signals (ConnectionId, hub type name or hub type name + "." + group name) belonging to clients that should not receive the method invocation regardless of the . + + + A description of the method call to be made on the client. + + + The signal (ConnectionId, hub type name or hub type name + "." + group name) belonging to clients that receive the method invocation. + + + A collection of modules that can intercept and customize various stages of hub processing such as connecting, reconnecting, disconnecting, invoking server-side hub methods, invoking client-side hub methods, authorizing hub clients and rejoining hub groups. + + + Adds an to the hub pipeline. Modules added to the pipeline first will wrap modules that are added to the pipeline later. All modules must be added to the pipeline before any methods on the are invoked. + The itself with the newly added module allowing calls to be chained. This method mutates the pipeline it is invoked on so it is not necessary to store its result. + A module that may intercept and customize various stages of hub processing such as connecting, reconnecting, disconnecting, invoking server-side hub methods, invoking client-side hub methods, authorizing hub clients and rejoining hub groups. + + + Implementations of this interface are responsible for executing operation required to complete various stages hub processing such as connecting, reconnecting, disconnecting, invoking server-side hub methods, invoking client-side hub methods, authorizing hub clients and rejoining hub groups. + + + To be called before a client subscribes to signals belonging to the hub described by the . By default, the will look for attributes on the to help determine if the client is authorized to subscribe to method invocations for the described hub. + true, if the client is authorized to subscribe to client-side hub method invocations; false, otherwise. + A description of the hub the client is attempting to connect to. + The connect request being made by the client which should include the client's User. + + + To be called when a client connects to the for each the client connects to. By default, this results in the 's OnConnected method being invoked. + Returns . + A the client is connected to. + + + To be called when a client disconnects from the for each the client was connected to. By default, this results in the 's OnDisconnected method being invoked. + Returns . + A the client was disconnected from. + + + Invokes a server-side hub method. + An asynchronous operation giving the return value of the server-side hub method invocation. + A description of the server-side hub method invocation. + + + To be called when a client reconnects to the for each the client connects to. By default, this results in the 's OnReconnected method being invoked. + Returns . + A the client is reconnected to. + + + This method determines which of the groups belonging to the hub described by the the client should be allowed to rejoin. By default, clients that are reconnecting to the server will be removed from all groups they may have previously been a member of, because untrusted clients may claim to be a member of groups they were never authorized to join. + A list of groups the client is allowed to rejoin. + A description of the hub for which the client is attempting to rejoin groups. + The reconnect request being made by the client that is attempting to rejoin groups. + The list of groups belonging to the relevant hub that the client claims to have been a member of before the reconnect. + + + Invokes a client-side hub method. + Returns . + A description of the client-side hub method invocation. + + + An can intercept and customize various stages of hub processing such as connecting, reconnecting, disconnecting, invoking server-side hub methods, invoking client-side hub methods, authorizing hub clients and rejoining hub groups. Modules can be be activated by calling . The combined modules added to the are invoked via the interface. + + + Wraps a function to be called before a client subscribes to signals belonging to the hub described by the . By default, the will look for attributes on the to help determine if the client is authorized to subscribe to method invocations for the described hub. The function returns true if the client is authorized to subscribe to client-side hub method invocations; false, otherwise. + A wrapped function that dictates whether or not the client is authorized to connect to the described Hub. + A function that dictates whether or not the client is authorized to connect to the described Hub. + + + Wraps a function that is called when a client connects to the for each the client connects to. By default, this results in the 's OnConnected method being invoked. + A wrapped function to be called when a client connects to a hub. + A function to be called when a client connects to a hub. + + + Wraps a function that is called when a client disconnects from the for each the client was connected to. By default, this results in the 's OnDisconnected method being invoked. + A wrapped function to be called when a client disconnects from a hub. + A function to be called when a client disconnects from a hub. + + + Wraps a function that invokes a server-side hub method. Even if a client has not been authorized to connect to a hub, it will still be authorized to invoke server-side methods on that hub unless it is prevented in by not executing the invoke parameter. + A wrapped function that invokes a server-side hub method. + A function that invokes a server-side hub method. + + + Wraps a function that invokes a client-side hub method. + A wrapped function that invokes a client-side hub method. + A function that invokes a client-side hub method. + + + Wraps a function that is called when a client reconnects to the for each the client connects to. By default, this results in the 's OnReconnected method being invoked. + A wrapped function to be called when a client reconnects to a hub. + A function to be called when a client reconnects to a hub. + + + Wraps a function that determines which of the groups belonging to the hub described by the the client should be allowed to rejoin. By default, clients that are reconnecting to the server will be removed from all groups they may have previously been a member of, because untrusted clients may claim to be a member of groups they were never authorized to join. + A wrapped function that determines which groups the client should be allowed to rejoin. + A function that determines which groups the client should be allowed to rejoin. + + + Handles parsing incoming requests through the . + + + Parses the incoming hub payload into a . + The resulting . + The raw hub payload. + + + + Returns . + + + + + Describes a hub method provider that builds a collection of available methods on a given hub. + + + Retrieve all methods on a given hub. + Available methods. + Hub descriptor object. + + + Tries to retrieve a method. + True, if a method has been found. + Hub descriptor object + Name of the method. + Descriptor of the method, if found. Null otherwise. + Method parameters to match. + + + Describes a parameter resolver for resolving parameter-matching values based on provided information. + + + Resolves method parameter values based on provided objects. + Array of parameter values. + Method descriptor. + List of values to resolve parameter values from. + + + Holds information about a single hub method. + + + + Attributes attached to this method. + Returns . + + + Hub descriptor object, target to this method. + Returns . + + + Method invocation delegate. Takes a target hub and an array of invocation arguments as it's arguments. + Returns . + + + Available method parameters. + Returns . + + + The return type of this method. + Returns . + + + + + + + + + + + + + Returns . + + + Holds information about a single hub method parameter. + + + + Parameter name. + Returns . + + + Parameter type. + Returns . + + + + + Returns . + + + Returns . + + + Returns . + + + + + Returns . + + + Searches the specified for the specified . + true if the method matching the name/parameter set is found on the hub, otherwise false. + Hub to search for the specified on. + The method name to search for. + If successful, the that was resolved. + The set of parameters that will be used to help locate a specific overload of the specified . + + + + Returns . + + + + + Returns . + + + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + A change tracking dictionary. + + + + + Returns . + + + Returns . + + + + + Returns . + + + Returns . + + + Returns . + + + + + Returns . + + + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Default implementation. + + + Initializes a new instance of the class. + The . + + + Returns a for the . + A for the . + Type of the . + + + Returns a for the . + A for the . + Type of the . + + + + + + + + + Returns . + + + Returns . + + + + Returns . + + + Returns . + + + Provides access to hubs and persistent connections references. + + + Returns a for the . + A for the . + Type of the . + + + + + + + + + Returns . + + + Returns . + + + Returns . + + + + Returns . + + + + Provides access to performance counters. + + + Gets the performance counter representing the number of messages received by connections (server to client) per second. + Returns . + + + Gets the performance counter representing the total number of messages received by connections (server to client) since the application was started. + Returns . + + + Gets the performance counter representing the number of messages sent by connections (client to server) per second. + Returns . + + + Gets the performance counter representing the total number of messages received by connections (server to client) since the application was started. + Returns . + + + Gets the performance counter representing the total number of connection Connect events since the application was started. + Returns . + + + Gets the performance counter representing the number of connections currently connected. + Returns . + + + Gets the performance counter representing the total number of connection Disconnect events since the application was started. + Returns . + + + Gets the performance counter representing the total number of connection Reconnect events since the application was started. + Returns . + + + Gets the performance counter representing the number of all errors processed per second. + Returns . + + + Gets the performance counter representing the total number of all errors processed since the application was started. + Returns . + + + Gets the performance counter representing the number of hub invocation errors per second. + Returns . + + + Gets the performance counter representing the total number of hub invocation errors processed since the application was started. + Returns . + + + Gets the performance counter representing the number of hub resolution errors per second. + Returns . + + + Gets the performance counter representing the total number of hub resolution errors processed since the application was started. + Returns . + + + Gets the performance counter representing the number of transport errors per second. + Returns . + + + Gets the performance counter representing the total number of transport errors processed since the application was started. + Returns . + + + Initializes the performance counters. + The host instance name. + The CancellationToken representing the host shutdown. + + + Gets the performance counter representing the number of workers allocated to deliver messages in the message bus. + Returns . + + + Gets the performance counter representing the number of workers currently busy delivering messages in the message bus. + Returns . + + + Gets the performance counter representing the number of messages published to the message bus per second. + Returns . + + + Gets the performance counter representing the total number of messages published to the message bus since the application was started. + Returns . + + + Gets the performance counter representing the current number of subscribers to the message bus. + Returns . + + + Gets the performance counter representing the number of new subscribers to the message bus per second. + Returns . + + + Gets the performance counter representing the total number of subscribers to the message bus since the application was started. + Returns . + + + Gets the performance counter representing the current number of topics in the message bus. + Returns . + + + + Returns . + + + Returns . + + + Generates a server id + + + The id of the server. + + + + Minifies a string in a way that can be reversed by this instance of . + A minified representation of the without the following characters:,|\ + The string to be minified. + + + A call to this function indicates that any future attempt to unminify strings that were previously minified from may be met with a null return value. This provides an opportunity normalize any internal data structures that reference . + The string that may have previously have been minified. + + + Reverses a call that was executed at least once previously on this instance of without any subsequent calls to sharing the same argument as the call that returned . + The argument of all previous calls to that returned . If every call to on this instance of has never returned or if the most recent call to that did return was followed by a call to sharing the same argument, may return null but must not throw. + A minified string that was returned by a previous call to . + + + Manages performance counters using Windows performance counters. + + + Creates a new instance. + + + The performance counter category name for SignalR counters. + + + Gets the performance counter representing the number of messages received by connections (server to client) per second. + Returns . + + + Gets the performance counter representing the total number of messages received by connections (server to client) since the application was started. + Returns . + + + Gets the performance counter representing the number of messages sent by connections (client to server) per second. + Returns . + + + Gets the performance counter representing the total number of messages sent by connections (client to server) since the application was started. + Returns . + + + Gets the performance counter representing the total number of connection Connect events since the application was started. + Returns . + + + Gets the performance counter representing the number of connections currently connected. + Returns . + + + Gets the performance counter representing the total number of connection Disconnect events since the application was started. + Returns . + + + Gets the performance counter representing the total number of connection Reconnect events since the application was started. + Returns . + + + Gets the performance counter representing the number of all errors processed per second. + Returns . + + + Gets the performance counter representing the total number of all errors processed since the application was started. + Returns . + + + Gets the performance counter representing the number of hub invocation errors per second. + Returns . + + + Gets the performance counter representing the total number of hub invocation errors processed since the application was started. + Returns . + + + Gets the performance counter representing the number of hub resolution errors per second. + Returns . + + + Gets the performance counter representing the total number of hub resolution errors processed since the application was started. + Returns . + + + Gets the performance counter representing the number of transport errors per second. + Returns . + + + Gets the performance counter representing the total number of transport errors processed since the application was started. + Returns . + + + Initializes the performance counters. + The host instance name. + The CancellationToken representing the host shutdown. + + + Gets the performance counter representing the number of workers allocated to deliver messages in the message bus. + Returns . + + + Gets the performance counter representing the number of workers currently busy delivering messages in the message bus. + Returns . + + + Gets the performance counter representing the number of messages published to the message bus per second. + Returns . + + + Gets the performance counter representing the total number of messages published to the message bus since the application was started. + Returns . + + + Gets the performance counter representing the current number of subscribers to the message bus. + Returns . + + + Gets the performance counter representing the number of new subscribers to the message bus per second. + Returns . + + + Gets the performance counter representing the total number of subscribers to the message bus since the application was started. + Returns . + + + Gets the performance counter representing the current number of topics in the message bus. + Returns . + + + + + + + + + + Default implementation. + + + + The id of the server. + Returns . + + + Used to serialize and deserialize outgoing/incoming data. + + + Deserializes the JSON to a .NET object. + The deserialized object from the JSON string. + The JSON to deserialize. + The of object being deserialized. + + + Serializes the specified object to a . + The object to serialize. + The to serialize the object to. + + + Represents a JSON value. + + + Converts the parameter value to the specified . + The converted parameter value. + The to convert the parameter to. + + + Converts the parameter value to the specified . + The converted parameter value. + The to convert the parameter to. + + + Implementations handle their own serialization to JSON. + + + Serializes itself to JSON via a . + The that receives the JSON serialized object. + + + Default implementation over Json.NET. + + + + + Deserializes the JSON to a .NET object. + The deserialized object from the JSON string. + The JSON to deserialize. + The of object being deserialized + + + Serializes the specified object to a . + The object to serialize. + The to serialize the object to. + + + Extensions for . + + + Deserializes the JSON to a .NET object. + The deserialized object from the JSON string. + The serializer. + The JSON to deserialize. + The of object being deserialized. + + + Serializes the specified object to a JSON string. + A JSON string representation of the object. + The serializer. + The object to serialize. + + + Helper class for common JSON operations. + + + Converts the specified name to camel case. + A camel cased version of the specified name. + The name to convert. + + + Returns . + + + + + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + + + + + + + + + + + + + + + Returns . + + + Returns . + + + + + + + + + Returns . + + + Returns . + + + Returns . + + + + + + Returns . + + + Returns . + + + Returns . + + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + + + Returns . + + + Returns . + + + Returns . + + + + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + This class is the main coordinator. It schedules work to be done for a particular subscription and has an algorithm for choosing a number of workers (thread pool threads), to handle the scheduled work. + + + + + Returns . + + + Returns . + + + + + + Returns . + + + + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Creates a topic for the specified key. + A for the specified key. + The key to create the topic for. + + + + + Publishes a new message to the specified event on the bus. + Returns . + The message to publish. + + + Returns . + + + + Returns . + + + Returns . + + + + + + + + + + Gets an associated with the result. + Returns . + + + Returns . + + + + Returns . + + + + + + + + Returns . + + + Returns . + + + Returns . + + + + + + + Returns . + + + Returns . + + + Returns . + + + + + Returns . + + + Sends messages to the backplane. + + + + Returns . + + + Invoked when a payload is received from the backplane. There should only be one active call at any time. + Returns . + The ID of the stream. + The ID of the payload within that stream. + List of messages associated. + + + Returns . + + + Returns . + + + + + + Returns . + + + + + + Returns . + + + + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + + + + Returns . + + + Returns . + + + Returns . + + + + + + Returns . + + + Returns . + + + + Returns . + + + Returns . + + + Returns . + + + + + + + + + + + + + + + Returns . + + + Returns . + + + + + Returns . + + + Returns . + + + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + + + + Returns . + + + Returns . + + + + Returns . + + + Returns . + + + Returns . + + + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + + Returns . + + + Returns . + + + Returns . + + + Represents a connection that can be tracked by an . + + + Gets a cancellation token that represents the connection’s lifetime. + Returns . + + + Gets the ID of the connection. + Returns . + + + Causes the connection to disconnect. + Returns . + + + Gets a value indicating the amount of time to wait after the connection dies before firing the disconnecting the connection. + Returns . + + + Kills the connection. + + + Gets a value that represents if the connection is alive. + + + Gets a value that represents if the connection is timed out. + Returns . + + + Sends a keep alive ping over the connection. + Returns . + + + Releases the http request associated with the connection (if any). + + + Gets a value that represents if the connection supports keep alive. + Returns . + + + Causes the connection to timeout. + + + Gets the uri of the connection. + Returns . + + + Represents a transport that communicates + + + Gets or sets a callback that is invoked when the initial connection connects to the transport. + Returns . + + + Gets or sets the connection ID for the transport. + Returns . + + + Gets or sets a callback that is invoked when the transport disconnects. + Returns . + + + Processes the specified for this transport. + A that completes when the transport has finished processing the connection. + The to process. + + + Gets or sets a callback that is invoked when the transport receives data. + Returns . + + + Gets or sets a callback that is invoked when the transport reconnects. + Returns . + + + Sends data over the transport. + A that completes when the send is complete. + The value to be sent. + + + Gets or sets a callback that is invoked when the transport connects. + Returns . + + + + Returns . + + + Returns . + + + Returns . + + + Manages tracking the state of connections. + + + Adds a new connection to the list of tracked connections. + The connection to be added. + + + Gets a list of connections being tracked. + A list of connections. + + + Marks an existing connection as active. + The connection to mark. + + + Removes a connection from the list of tracked connections. + The connection to remove. + + + Manages the transports for connections. + + + Gets the specified transport for the specified . + The for the specified . + The for the current request. + + + Determines whether the specified transport is supported. + True if the transport is supported, otherwise False. + The name of the transport to test. + + + + + + Returns . + + + Returns . + + + Returns . + + + Gets or sets the number of milliseconds to tell the browser to wait before reestablishing a long poll connection after data is sent from the server. Defaults to 0. + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Represents a response to a connection. + + + Creates a new instance of . + + + Creates a new instance of . + A filter that determines whether messages should be written to the client. + + + Gets or sets a value that indicates whether the connection was forcibly closed. + true if the connection was forcibly closed; otherwise, false. + + + Gets or sets a value that indicates whether the connection receives a disconnect command. + true if the connection receives a disconnect command; otherwise, false. + + + Gets or sets a filter that determines whether messages should be written to the client. + A filter that determines whether messages should be written to the client. + + + Signed token representing the list of groups. Updates on change. + Returns . + + + Gets or sets the time the long polling client should wait before reestablishing a connection if no data is received. + The time the long polling client should wait before reestablishing a connection if no data is received. + + + Gets or sets the id of the last message in the connection received. + The id of the last message in the connection received. + + + Gets or sets the list of messages to be sent to the receiving connection. + The list of messages to be sent to the receiving connection. + + + Serializes only the necessary components of the to JSON using Json.NET’s JsonTextWriter to improve performance. + The that receives the JSON serialization. + + + Gets or sets a value that indicates whether the connection timed out. + true if the connection timed out; otherwise, false. + + + Gets or sets the total count of the messages sent the receiving connection. + The total count of the messages sent the receiving connection. + + + + + Returns . + + + Returns . + + + Returns . + + + + + Returns . + + + Returns . + + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + + Returns . + + + Returns . + + + + + Returns . + + + + Returns . + + + Returns . + + + Returns . + + + + Returns . + + + Returns . + + + + Returns . + + + + Returns . + + + Returns . + + + Default implementation of . + + + Initializes and instance of the class. + The . + + + Adds a new connection to the list of tracked connections. + Returns . + The connection to be added. + + + + + Gets a list of connections being tracked. + A list of connections. + + + Marks an existing connection as active. + The connection to mark. + + + Removes a connection from the list of tracked connections. + The connection to remove. + + + The default implementation. + + + Initializes a new instance of class. + The default . + + + Gets the specified transport for the specified . + The for the specified . + The for the current request. + + + Adds a new transport to the list of supported transports. + The specified transport. + The factory method for the specified transport. + + + Removes a transport from the list of supported transports. + The specified transport. + + + Determines whether the specified transport is supported. + True if the transport is supported, otherwise False. + The name of the transport to test. + + + + + + Returns . + + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + \ No newline at end of file diff --git a/linger/src/packages/Microsoft.AspNet.SignalR.JS.1.0.0/content/Scripts/jquery.signalR-1.0.0.js b/linger/src/packages/Microsoft.AspNet.SignalR.JS.1.0.0/content/Scripts/jquery.signalR-1.0.0.js new file mode 100644 index 0000000..f9d7e60 --- /dev/null +++ b/linger/src/packages/Microsoft.AspNet.SignalR.JS.1.0.0/content/Scripts/jquery.signalR-1.0.0.js @@ -0,0 +1,1995 @@ +/* jquery.signalR.core.js */ +/*global window:false */ +/*! + * ASP.NET SignalR JavaScript Library v1.0.0 + * http://signalr.net/ + * + * Copyright Microsoft Open Technologies, Inc. All rights reserved. + * Licensed under the Apache 2.0 + * https://github.com/SignalR/SignalR/blob/master/LICENSE.md + * + */ + +/// +(function ($, window) { + "use strict"; + + if (typeof ($) !== "function") { + // no jQuery! + throw new Error("SignalR: jQuery not found. Please ensure jQuery is referenced before the SignalR.js file."); + } + + if (!window.JSON) { + // no JSON! + throw new Error("SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8."); + } + + var signalR, + _connection, + _pageLoaded = (window.document.readyState === "complete"), + _pageWindow = $(window), + + events = { + onStart: "onStart", + onStarting: "onStarting", + onReceived: "onReceived", + onError: "onError", + onConnectionSlow: "onConnectionSlow", + onReconnecting: "onReconnecting", + onReconnect: "onReconnect", + onStateChanged: "onStateChanged", + onDisconnect: "onDisconnect" + }, + + log = function (msg, logging) { + if (logging === false) { + return; + } + var m; + if (typeof (window.console) === "undefined") { + return; + } + m = "[" + new Date().toTimeString() + "] SignalR: " + msg; + if (window.console.debug) { + window.console.debug(m); + } else if (window.console.log) { + window.console.log(m); + } + }, + + changeState = function (connection, expectedState, newState) { + if (expectedState === connection.state) { + connection.state = newState; + + $(connection).triggerHandler(events.onStateChanged, [{ oldState: expectedState, newState: newState }]); + return true; + } + + return false; + }, + + isDisconnecting = function (connection) { + return connection.state === signalR.connectionState.disconnected; + }, + + configureStopReconnectingTimeout = function (connection) { + var stopReconnectingTimeout, + onReconnectTimeout; + + // Check if this connection has already been configured to stop reconnecting after a specified timeout. + // Without this check if a connection is stopped then started events will be bound multiple times. + if (!connection._.configuredStopReconnectingTimeout) { + onReconnectTimeout = function (connection) { + connection.log("Couldn't reconnect within the configured timeout (" + connection.disconnectTimeout + "ms), disconnecting."); + connection.stop(/* async */ false, /* notifyServer */ false); + }; + + connection.reconnecting(function () { + var connection = this; + stopReconnectingTimeout = window.setTimeout(function () { onReconnectTimeout(connection); }, connection.disconnectTimeout); + }); + + connection.stateChanged(function (data) { + if (data.oldState === signalR.connectionState.reconnecting) { + // Clear the pending reconnect timeout check + window.clearTimeout(stopReconnectingTimeout); + } + }); + + connection._.configuredStopReconnectingTimeout = true; + } + }; + + signalR = function (url, qs, logging) { + /// Creates a new SignalR connection for the given url + /// The URL of the long polling endpoint + /// + /// [Optional] Custom querystring parameters to add to the connection URL. + /// If an object, every non-function member will be added to the querystring. + /// If a string, it's added to the QS as specified. + /// + /// + /// [Optional] A flag indicating whether connection logging is enabled to the browser + /// console/log. Defaults to false. + /// + + return new signalR.fn.init(url, qs, logging); + }; + + signalR.events = events; + + signalR.changeState = changeState; + + signalR.isDisconnecting = isDisconnecting; + + signalR.connectionState = { + connecting: 0, + connected: 1, + reconnecting: 2, + disconnected: 4 + }; + + signalR.hub = { + start: function () { + // This will get replaced with the real hub connection start method when hubs is referenced correctly + throw new Error("SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g. ."); + } + }; + + _pageWindow.load(function () { _pageLoaded = true; }); + + function validateTransport(requestedTransport, connection) { + /// Validates the requested transport by cross checking it with the pre-defined signalR.transports + /// The designated transports that the user has specified. + /// The connection that will be using the requested transports. Used for logging purposes. + /// + if ($.isArray(requestedTransport)) { + // Go through transport array and remove an "invalid" tranports + for (var i = requestedTransport.length - 1; i >= 0; i--) { + var transport = requestedTransport[i]; + if ($.type(requestedTransport) !== "object" && ($.type(transport) !== "string" || !signalR.transports[transport])) { + connection.log("Invalid transport: " + transport + ", removing it from the transports list."); + requestedTransport.splice(i, 1); + } + } + + // Verify we still have transports left, if we dont then we have invalid transports + if (requestedTransport.length === 0) { + connection.log("No transports remain within the specified transport array."); + requestedTransport = null; + } + } else if ($.type(requestedTransport) !== "object" && !signalR.transports[requestedTransport] && requestedTransport !== "auto") { + connection.log("Invalid transport: " + requestedTransport.toString()); + requestedTransport = null; + } + + return requestedTransport; + } + + function getDefaultPort(protocol) { + if(protocol === "http:") { + return 80; + } + else if (protocol === "https:") { + return 443; + } + } + + function addDefaultPort(protocol, url) { + // Remove ports from url. We have to check if there's a / or end of line + // following the port in order to avoid removing ports such as 8080. + if(url.match(/:\d+$/)) { + return url; + } else { + return url + ":" + getDefaultPort(protocol); + } + } + + signalR.fn = signalR.prototype = { + init: function (url, qs, logging) { + this.url = url; + this.qs = qs; + this._ = {}; + if (typeof (logging) === "boolean") { + this.logging = logging; + } + }, + + isCrossDomain: function (url, against) { + /// Checks if url is cross domain + /// The base URL + /// + /// An optional argument to compare the URL against, if not specified it will be set to window.location. + /// If specified it must contain a protocol and a host property. + /// + var link; + + url = $.trim(url); + if (url.indexOf("http") !== 0) { + return false; + } + + against = against || window.location; + + // Create an anchor tag. + link = window.document.createElement("a"); + link.href = url; + + // When checking for cross domain we have to special case port 80 because the window.location will remove the + return link.protocol + addDefaultPort(link.protocol, link.host) !== against.protocol + addDefaultPort(against.protocol, against.host); + }, + + ajaxDataType: "json", + + logging: false, + + state: signalR.connectionState.disconnected, + + keepAliveData: {}, + + reconnectDelay: 2000, + + disconnectTimeout: 40000, // This should be set by the server in response to the negotiate request (40s default) + + keepAliveWarnAt: 2 / 3, // Warn user of slow connection if we breach the X% mark of the keep alive timeout + + start: function (options, callback) { + /// Starts the connection + /// Options map + /// A callback function to execute when the connection has started + var connection = this, + config = { + waitForPageLoad: true, + transport: "auto", + jsonp: false + }, + initialize, + deferred = connection._deferral || $.Deferred(), // Check to see if there is a pre-existing deferral that's being built on, if so we want to keep using it + parser = window.document.createElement("a"); + + if ($.type(options) === "function") { + // Support calling with single callback parameter + callback = options; + } else if ($.type(options) === "object") { + $.extend(config, options); + if ($.type(config.callback) === "function") { + callback = config.callback; + } + } + + config.transport = validateTransport(config.transport, connection); + + // If the transport is invalid throw an error and abort start + if (!config.transport) { + throw new Error("SignalR: Invalid transport(s) specified, aborting start."); + } + + // Check to see if start is being called prior to page load + // If waitForPageLoad is true we then want to re-direct function call to the window load event + if (!_pageLoaded && config.waitForPageLoad === true) { + _pageWindow.load(function () { + connection._deferral = deferred; + connection.start(options, callback); + }); + return deferred.promise(); + } + + configureStopReconnectingTimeout(connection); + + if (changeState(connection, + signalR.connectionState.disconnected, + signalR.connectionState.connecting) === false) { + // Already started, just return + deferred.resolve(connection); + return deferred.promise(); + } + + // Resolve the full url + parser.href = connection.url; + if (!parser.protocol || parser.protocol === ":") { + connection.protocol = window.document.location.protocol; + connection.host = window.document.location.host; + connection.baseUrl = connection.protocol + "//" + connection.host; + } + else { + connection.protocol = parser.protocol; + connection.host = parser.host; + connection.baseUrl = parser.protocol + "//" + parser.host; + } + + // Set the websocket protocol + connection.wsProtocol = connection.protocol === "https:" ? "wss://" : "ws://"; + + // If jsonp with no/auto transport is specified, then set the transport to long polling + // since that is the only transport for which jsonp really makes sense. + // Some developers might actually choose to specify jsonp for same origin requests + // as demonstrated by Issue #623. + if (config.transport === "auto" && config.jsonp === true) { + config.transport = "longPolling"; + } + + if (this.isCrossDomain(connection.url)) { + connection.log("Auto detected cross domain url."); + + if (config.transport === "auto") { + // Try webSockets and longPolling since SSE doesn't support CORS + // TODO: Support XDM with foreverFrame + config.transport = ["webSockets", "longPolling"]; + } + + // Determine if jsonp is the only choice for negotiation, ajaxSend and ajaxAbort. + // i.e. if the browser doesn't supports CORS + // If it is, ignore any preference to the contrary, and switch to jsonp. + if (!config.jsonp) { + config.jsonp = !$.support.cors; + + if (config.jsonp) { + connection.log("Using jsonp because this browser doesn't support CORS"); + } + } + } + + connection.ajaxDataType = config.jsonp ? "jsonp" : "json"; + + $(connection).bind(events.onStart, function (e, data) { + if ($.type(callback) === "function") { + callback.call(connection); + } + deferred.resolve(connection); + }); + + initialize = function (transports, index) { + index = index || 0; + if (index >= transports.length) { + if (!connection.transport) { + // No transport initialized successfully + $(connection).triggerHandler(events.onError, "SignalR: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization."); + deferred.reject("SignalR: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization."); + // Stop the connection if it has connected and move it into the disconnected state + connection.stop(); + } + return; + } + + var transportName = transports[index], + transport = $.type(transportName) === "object" ? transportName : signalR.transports[transportName]; + + if (transportName.indexOf("_") === 0) { + // Private member + initialize(transports, index + 1); + return; + } + + transport.start(connection, function () { // success + if (transport.supportsKeepAlive && connection.keepAliveData.activated) { + signalR.transports._logic.monitorKeepAlive(connection); + } + + connection.transport = transport; + + changeState(connection, + signalR.connectionState.connecting, + signalR.connectionState.connected); + + $(connection).triggerHandler(events.onStart); + + _pageWindow.unload(function () { // failure + connection.stop(false /* async */); + }); + + }, function () { + initialize(transports, index + 1); + }); + }; + + var url = connection.url + "/negotiate"; + connection.log("Negotiating with '" + url + "'."); + $.ajax({ + url: url, + global: false, + cache: false, + type: "GET", + data: {}, + dataType: connection.ajaxDataType, + error: function (error) { + $(connection).triggerHandler(events.onError, [error.responseText]); + deferred.reject("SignalR: Error during negotiation request: " + error.responseText); + // Stop the connection if negotiate failed + connection.stop(); + }, + success: function (res) { + var keepAliveData = connection.keepAliveData; + + connection.appRelativeUrl = res.Url; + connection.id = res.ConnectionId; + connection.token = res.ConnectionToken; + connection.webSocketServerUrl = res.WebSocketServerUrl; + + // Once the server has labeled the PersistentConnection as Disconnected, we should stop attempting to reconnect + // after res.DisconnectTimeout seconds. + connection.disconnectTimeout = res.DisconnectTimeout * 1000; // in ms + + + // If we have a keep alive + if (res.KeepAliveTimeout) { + // Register the keep alive data as activated + keepAliveData.activated = true; + + // Timeout to designate when to force the connection into reconnecting converted to milliseconds + keepAliveData.timeout = res.KeepAliveTimeout * 1000; + + // Timeout to designate when to warn the developer that the connection may be dead or is hanging. + keepAliveData.timeoutWarning = keepAliveData.timeout * connection.keepAliveWarnAt; + + // Instantiate the frequency in which we check the keep alive. It must be short in order to not miss/pick up any changes + keepAliveData.checkInterval = (keepAliveData.timeout - keepAliveData.timeoutWarning) / 3; + } + else { + keepAliveData.activated = false; + } + + if (!res.ProtocolVersion || res.ProtocolVersion !== "1.2") { + $(connection).triggerHandler(events.onError, "SignalR: Incompatible protocol version."); + deferred.reject("SignalR: Incompatible protocol version."); + return; + } + + $(connection).triggerHandler(events.onStarting); + + var transports = [], + supportedTransports = []; + + $.each(signalR.transports, function (key) { + if (key === "webSockets" && !res.TryWebSockets) { + // Server said don't even try WebSockets, but keep processing the loop + return true; + } + supportedTransports.push(key); + }); + + if ($.isArray(config.transport)) { + // ordered list provided + $.each(config.transport, function () { + var transport = this; + if ($.type(transport) === "object" || ($.type(transport) === "string" && $.inArray("" + transport, supportedTransports) >= 0)) { + transports.push($.type(transport) === "string" ? "" + transport : transport); + } + }); + } else if ($.type(config.transport) === "object" || + $.inArray(config.transport, supportedTransports) >= 0) { + // specific transport provided, as object or a named transport, e.g. "longPolling" + transports.push(config.transport); + } else { // default "auto" + transports = supportedTransports; + } + initialize(transports); + } + }); + + return deferred.promise(); + }, + + starting: function (callback) { + /// Adds a callback that will be invoked before anything is sent over the connection + /// A callback function to execute before each time data is sent on the connection + /// + var connection = this; + $(connection).bind(events.onStarting, function (e, data) { + callback.call(connection); + }); + return connection; + }, + + send: function (data) { + /// Sends data over the connection + /// The data to send over the connection + /// + var connection = this; + + if (connection.state === signalR.connectionState.disconnected) { + // Connection hasn't been started yet + throw new Error("SignalR: Connection must be started before data can be sent. Call .start() before .send()"); + } + + if (connection.state === signalR.connectionState.connecting) { + // Connection hasn't been started yet + throw new Error("SignalR: Connection has not been fully initialized. Use .start().done() or .start().fail() to run logic after the connection has started."); + } + + connection.transport.send(connection, data); + // REVIEW: Should we return deferred here? + return connection; + }, + + received: function (callback) { + /// Adds a callback that will be invoked after anything is received over the connection + /// A callback function to execute when any data is received on the connection + /// + var connection = this; + $(connection).bind(events.onReceived, function (e, data) { + callback.call(connection, data); + }); + return connection; + }, + + stateChanged: function (callback) { + /// Adds a callback that will be invoked when the connection state changes + /// A callback function to execute when the connection state changes + /// + var connection = this; + $(connection).bind(events.onStateChanged, function (e, data) { + callback.call(connection, data); + }); + return connection; + }, + + error: function (callback) { + /// Adds a callback that will be invoked after an error occurs with the connection + /// A callback function to execute when an error occurs on the connection + /// + var connection = this; + $(connection).bind(events.onError, function (e, data) { + callback.call(connection, data); + }); + return connection; + }, + + disconnected: function (callback) { + /// Adds a callback that will be invoked when the client disconnects + /// A callback function to execute when the connection is broken + /// + var connection = this; + $(connection).bind(events.onDisconnect, function (e, data) { + callback.call(connection); + }); + return connection; + }, + + connectionSlow: function (callback) { + /// Adds a callback that will be invoked when the client detects a slow connection + /// A callback function to execute when the connection is slow + /// + var connection = this; + $(connection).bind(events.onConnectionSlow, function(e, data) { + callback.call(connection); + }); + + return connection; + }, + + reconnecting: function (callback) { + /// Adds a callback that will be invoked when the underlying transport begins reconnecting + /// A callback function to execute when the connection enters a reconnecting state + /// + var connection = this; + $(connection).bind(events.onReconnecting, function (e, data) { + callback.call(connection); + }); + return connection; + }, + + reconnected: function (callback) { + /// Adds a callback that will be invoked when the underlying transport reconnects + /// A callback function to execute when the connection is restored + /// + var connection = this; + $(connection).bind(events.onReconnect, function (e, data) { + callback.call(connection); + }); + return connection; + }, + + stop: function (async, notifyServer) { + /// Stops listening + /// Whether or not to asynchronously abort the connection + /// Whether we want to notify the server that we are aborting the connection + /// + var connection = this; + + if (connection.state === signalR.connectionState.disconnected) { + return; + } + + try { + if (connection.transport) { + if (notifyServer !== false) { + connection.transport.abort(connection, async); + } + + if (connection.transport.supportsKeepAlive && connection.keepAliveData.activated) { + signalR.transports._logic.stopMonitoringKeepAlive(connection); + } + + connection.transport.stop(connection); + connection.transport = null; + } + + // Trigger the disconnect event + $(connection).triggerHandler(events.onDisconnect); + + delete connection.messageId; + delete connection.groupsToken; + + // Remove the ID and the deferral on stop, this is to ensure that if a connection is restarted it takes on a new id/deferral. + delete connection.id; + delete connection._deferral; + } + finally { + changeState(connection, connection.state, signalR.connectionState.disconnected); + } + + return connection; + }, + + log: function (msg) { + log(msg, this.logging); + } + }; + + signalR.fn.init.prototype = signalR.fn; + + signalR.noConflict = function () { + /// Reinstates the original value of $.connection and returns the signalR object for manual assignment + /// + if ($.connection === signalR) { + $.connection = _connection; + } + return signalR; + }; + + if ($.connection) { + _connection = $.connection; + } + + $.connection = $.signalR = signalR; + +}(window.jQuery, window)); +/* jquery.signalR.transports.common.js */ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. + +/*global window:false */ +/// + +(function ($, window) { + "use strict"; + + var signalR = $.signalR, + events = $.signalR.events, + changeState = $.signalR.changeState; + + signalR.transports = {}; + + function checkIfAlive(connection) { + var keepAliveData = connection.keepAliveData, + diff, + timeElapsed; + + // Only check if we're connected + if (connection.state === signalR.connectionState.connected) { + diff = new Date(); + + diff.setTime(diff - keepAliveData.lastKeepAlive); + timeElapsed = diff.getTime(); + + // Check if the keep alive has completely timed out + if (timeElapsed >= keepAliveData.timeout) { + connection.log("Keep alive timed out. Notifying transport that connection has been lost."); + + // Notify transport that the connection has been lost + connection.transport.lostConnection(connection); + } + else if (timeElapsed >= keepAliveData.timeoutWarning) { + // This is to assure that the user only gets a single warning + if (!keepAliveData.userNotified) { + connection.log("Keep alive has been missed, connection may be dead/slow."); + $(connection).triggerHandler(events.onConnectionSlow); + keepAliveData.userNotified = true; + } + } + else { + keepAliveData.userNotified = false; + } + } + + // Verify we're monitoring the keep alive + // We don't want this as a part of the inner if statement above because we want keep alives to continue to be checked + // in the event that the server comes back online (if it goes offline). + if (keepAliveData.monitoring) { + window.setTimeout(function () { + checkIfAlive(connection); + }, keepAliveData.checkInterval); + } + } + + signalR.transports._logic = { + pingServer: function (connection, transport) { + /// Pings the server + /// Connection associated with the server ping + /// + var baseUrl = transport === "webSockets" ? "" : connection.baseUrl, + url = baseUrl + connection.appRelativeUrl + "/ping", + deferral = $.Deferred(); + + $.ajax({ + url: url, + global: false, + cache: false, + type: "GET", + data: {}, + dataType: connection.ajaxDataType, + success: function (data) { + if (data.Response === "pong") { + deferral.resolve(); + } + else { + deferral.reject("SignalR: Invalid ping response when pinging server: " + (data.responseText || data.statusText)); + } + }, + error: function (data) { + deferral.reject("SignalR: Error pinging server: " + (data.responseText || data.statusText)); + } + }); + + return deferral.promise(); + }, + + addQs: function (url, connection) { + if (!connection.qs) { + return url; + } + + if (typeof (connection.qs) === "object") { + return url + "&" + $.param(connection.qs); + } + + if (typeof (connection.qs) === "string") { + return url + "&" + connection.qs; + } + + return url + "&" + window.encodeURIComponent(connection.qs.toString()); + }, + + getUrl: function (connection, transport, reconnecting, appendReconnectUrl) { + /// Gets the url for making a GET based connect request + var baseUrl = transport === "webSockets" ? "" : connection.baseUrl, + url = baseUrl + connection.appRelativeUrl, + qs = "transport=" + transport + "&connectionToken=" + window.encodeURIComponent(connection.token); + + if (connection.data) { + qs += "&connectionData=" + window.encodeURIComponent(connection.data); + } + + if (connection.groupsToken) { + qs += "&groupsToken=" + window.encodeURIComponent(connection.groupsToken); + } + + if (!reconnecting) { + url = url + "/connect"; + } else { + if (appendReconnectUrl) { + url = url + "/reconnect"; + } + if (connection.messageId) { + qs += "&messageId=" + window.encodeURIComponent(connection.messageId); + } + } + url += "?" + qs; + url = this.addQs(url, connection); + url += "&tid=" + Math.floor(Math.random() * 11); + return url; + }, + + maximizePersistentResponse: function (minPersistentResponse) { + return { + MessageId: minPersistentResponse.C, + Messages: minPersistentResponse.M, + Disconnect: typeof (minPersistentResponse.D) !== "undefined" ? true : false, + TimedOut: typeof (minPersistentResponse.T) !== "undefined" ? true : false, + LongPollDelay: minPersistentResponse.L, + GroupsToken: minPersistentResponse.G + }; + }, + + updateGroups: function (connection, groupsToken) { + if (groupsToken) { + connection.groupsToken = groupsToken; + } + }, + + ajaxSend: function (connection, data) { + var url = connection.url + "/send" + "?transport=" + connection.transport.name + "&connectionToken=" + window.encodeURIComponent(connection.token); + url = this.addQs(url, connection); + return $.ajax({ + url: url, + global: false, + type: connection.ajaxDataType === "jsonp" ? "GET" : "POST", + dataType: connection.ajaxDataType, + data: { + data: data + }, + success: function (result) { + if (result) { + $(connection).triggerHandler(events.onReceived, [result]); + } + }, + error: function (errData, textStatus) { + if (textStatus === "abort" || + (textStatus === "parsererror" && connection.ajaxDataType === "jsonp")) { + // The parsererror happens for sends that don't return any data, and hence + // don't write the jsonp callback to the response. This is harder to fix on the server + // so just hack around it on the client for now. + return; + } + $(connection).triggerHandler(events.onError, [errData]); + } + }); + }, + + ajaxAbort: function (connection, async) { + if (typeof (connection.transport) === "undefined") { + return; + } + + // Async by default unless explicitly overidden + async = typeof async === "undefined" ? true : async; + + var url = connection.url + "/abort" + "?transport=" + connection.transport.name + "&connectionToken=" + window.encodeURIComponent(connection.token); + url = this.addQs(url, connection); + $.ajax({ + url: url, + async: async, + timeout: 1000, + global: false, + type: "POST", + dataType: connection.ajaxDataType, + data: {} + }); + + connection.log("Fired ajax abort async = " + async); + }, + + processMessages: function (connection, minData) { + var data; + // Transport can be null if we've just closed the connection + if (connection.transport) { + var $connection = $(connection); + + // If our transport supports keep alive then we need to update the last keep alive time stamp. + // Very rarely the transport can be null. + if (connection.transport.supportsKeepAlive && connection.keepAliveData.activated) { + this.updateKeepAlive(connection); + } + + if (!minData) { + return; + } + + data = this.maximizePersistentResponse(minData); + + if (data.Disconnect) { + connection.log("Disconnect command received from server"); + + // Disconnected by the server + connection.stop(false, false); + return; + } + + this.updateGroups(connection, data.GroupsToken); + + if (data.Messages) { + $.each(data.Messages, function () { + try { + $connection.triggerHandler(events.onReceived, [this]); + } + catch (e) { + connection.log("Error raising received " + e); + $(connection).triggerHandler(events.onError, [e]); + } + }); + } + + if (data.MessageId) { + connection.messageId = data.MessageId; + } + } + }, + + monitorKeepAlive: function (connection) { + var keepAliveData = connection.keepAliveData, + that = this; + + // If we haven't initiated the keep alive timeouts then we need to + if (!keepAliveData.monitoring) { + keepAliveData.monitoring = true; + + // Initialize the keep alive time stamp ping + that.updateKeepAlive(connection); + + // Save the function so we can unbind it on stop + connection.keepAliveData.reconnectKeepAliveUpdate = function () { + that.updateKeepAlive(connection); + }; + + // Update Keep alive on reconnect + $(connection).bind(events.onReconnect, connection.keepAliveData.reconnectKeepAliveUpdate); + + connection.log("Now monitoring keep alive with a warning timeout of " + keepAliveData.timeoutWarning + " and a connection lost timeout of " + keepAliveData.timeout); + // Start the monitoring of the keep alive + checkIfAlive(connection); + } + else { + connection.log("Tried to monitor keep alive but it's already being monitored"); + } + }, + + stopMonitoringKeepAlive: function (connection) { + var keepAliveData = connection.keepAliveData; + + // Only attempt to stop the keep alive monitoring if its being monitored + if (keepAliveData.monitoring) { + // Stop monitoring + keepAliveData.monitoring = false; + + // Remove the updateKeepAlive function from the reconnect event + $(connection).unbind(events.onReconnect, connection.keepAliveData.reconnectKeepAliveUpdate); + + // Clear all the keep alive data + keepAliveData = {}; + connection.log("Stopping the monitoring of the keep alive"); + } + }, + + updateKeepAlive: function (connection) { + connection.keepAliveData.lastKeepAlive = new Date(); + }, + + ensureReconnectingState: function (connection) { + if (changeState(connection, + signalR.connectionState.connected, + signalR.connectionState.reconnecting) === true) { + $(connection).triggerHandler(events.onReconnecting); + } + return connection.state === signalR.connectionState.reconnecting; + }, + + foreverFrame: { + count: 0, + connections: {} + } + }; + +}(window.jQuery, window)); +/* jquery.signalR.transports.webSockets.js */ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. + +/*global window:false */ +/// + +(function ($, window) { + "use strict"; + + var signalR = $.signalR, + events = $.signalR.events, + changeState = $.signalR.changeState, + transportLogic = signalR.transports._logic; + + signalR.transports.webSockets = { + name: "webSockets", + + supportsKeepAlive: true, + + attemptingReconnect: false, + + currentSocketID: 0, + + send: function (connection, data) { + connection.socket.send(data); + }, + + start: function (connection, onSuccess, onFailed) { + var url, + opened = false, + that = this, + reconnecting = !onSuccess, + $connection = $(connection); + + if (!window.WebSocket) { + onFailed(); + return; + } + + if (!connection.socket) { + if (connection.webSocketServerUrl) { + url = connection.webSocketServerUrl; + } + else { + url = connection.wsProtocol + connection.host; + } + + url += transportLogic.getUrl(connection, this.name, reconnecting); + + connection.log("Connecting to websocket endpoint '" + url + "'"); + connection.socket = new window.WebSocket(url); + connection.socket.ID = ++that.currentSocketID; + connection.socket.onopen = function () { + opened = true; + connection.log("Websocket opened"); + + if (that.attemptingReconnect) { + that.attemptingReconnect = false; + } + + if (onSuccess) { + onSuccess(); + } else if (changeState(connection, + signalR.connectionState.reconnecting, + signalR.connectionState.connected) === true) { + $connection.triggerHandler(events.onReconnect); + } + }; + + connection.socket.onclose = function (event) { + // Only handle a socket close if the close is from the current socket. + // Sometimes on disconnect the server will push down an onclose event + // to an expired socket. + if (this.ID === that.currentSocketID) { + if (!opened) { + if (onFailed) { + onFailed(); + } + else if (reconnecting) { + that.reconnect(connection); + } + return; + } + else if (typeof event.wasClean !== "undefined" && event.wasClean === false) { + // Ideally this would use the websocket.onerror handler (rather than checking wasClean in onclose) but + // I found in some circumstances Chrome won't call onerror. This implementation seems to work on all browsers. + $(connection).triggerHandler(events.onError, [event.reason]); + connection.log("Unclean disconnect from websocket." + event.reason); + } + else { + connection.log("Websocket closed"); + } + + that.reconnect(connection); + } + }; + + connection.socket.onmessage = function (event) { + var data = window.JSON.parse(event.data), + $connection = $(connection); + + if (data) { + // data.M is PersistentResponse.Messages + if ($.isEmptyObject(data) || data.M) { + transportLogic.processMessages(connection, data); + } else { + // For websockets we need to trigger onReceived + // for callbacks to outgoing hub calls. + $connection.triggerHandler(events.onReceived, [data]); + } + } + }; + } + }, + + reconnect: function (connection) { + var that = this; + + if (connection.state !== signalR.connectionState.disconnected) { + if (!that.attemptingReconnect) { + that.attemptingReconnect = true; + } + + window.setTimeout(function () { + if (that.attemptingReconnect) { + that.stop(connection); + } + + if (transportLogic.ensureReconnectingState(connection)) { + connection.log("Websocket reconnecting"); + that.start(connection); + } + }, connection.reconnectDelay); + } + }, + + lostConnection: function (connection) { + this.reconnect(connection); + + }, + + stop: function (connection) { + if (connection.socket !== null) { + connection.log("Closing the Websocket"); + connection.socket.close(); + connection.socket = null; + } + }, + + abort: function (connection) { + } + }; + +}(window.jQuery, window)); +/* jquery.signalR.transports.serverSentEvents.js */ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. + +/*global window:false */ +/// + +(function ($, window) { + "use strict"; + + var signalR = $.signalR, + events = $.signalR.events, + changeState = $.signalR.changeState, + transportLogic = signalR.transports._logic; + + signalR.transports.serverSentEvents = { + name: "serverSentEvents", + + supportsKeepAlive: true, + + reconnectTimeout: false, + + currentEventSourceID: 0, + + timeOut: 3000, + + start: function (connection, onSuccess, onFailed) { + var that = this, + opened = false, + $connection = $(connection), + reconnecting = !onSuccess, + url, + connectTimeOut; + + if (connection.eventSource) { + connection.log("The connection already has an event source. Stopping it."); + connection.stop(); + } + + if (!window.EventSource) { + if (onFailed) { + connection.log("This browser doesn't support SSE."); + onFailed(); + } + return; + } + + url = transportLogic.getUrl(connection, this.name, reconnecting); + + try { + connection.log("Attempting to connect to SSE endpoint '" + url + "'"); + connection.eventSource = new window.EventSource(url); + connection.eventSource.ID = ++that.currentEventSourceID; + } + catch (e) { + connection.log("EventSource failed trying to connect with error " + e.Message); + if (onFailed) { + // The connection failed, call the failed callback + onFailed(); + } + else { + $connection.triggerHandler(events.onError, [e]); + if (reconnecting) { + // If we were reconnecting, rather than doing initial connect, then try reconnect again + that.reconnect(connection); + } + } + return; + } + + // After connecting, if after the specified timeout there's no response stop the connection + // and raise on failed + connectTimeOut = window.setTimeout(function () { + if (opened === false) { + connection.log("EventSource timed out trying to connect"); + connection.log("EventSource readyState: " + connection.eventSource.readyState); + + if (!reconnecting) { + that.stop(connection); + } + + if (reconnecting) { + // If we're reconnecting and the event source is attempting to connect, + // don't keep retrying. This causes duplicate connections to spawn. + if (connection.eventSource.readyState !== window.EventSource.CONNECTING && + connection.eventSource.readyState !== window.EventSource.OPEN) { + // If we were reconnecting, rather than doing initial connect, then try reconnect again + that.reconnect(connection); + } + } else if (onFailed) { + onFailed(); + } + } + }, + that.timeOut); + + connection.eventSource.addEventListener("open", function (e) { + connection.log("EventSource connected"); + + if (connectTimeOut) { + window.clearTimeout(connectTimeOut); + } + + if (that.reconnectTimeout) { + window.clearTimeout(that.reconnectTimeout); + } + + if (opened === false) { + opened = true; + + if (onSuccess) { + onSuccess(); + } else if (changeState(connection, + signalR.connectionState.reconnecting, + signalR.connectionState.connected) === true) { + // If there's no onSuccess handler we assume this is a reconnect + $connection.triggerHandler(events.onReconnect); + } + } + }, false); + + connection.eventSource.addEventListener("message", function (e) { + // process messages + if (e.data === "initialized") { + return; + } + + transportLogic.processMessages(connection, window.JSON.parse(e.data)); + }, false); + + connection.eventSource.addEventListener("error", function (e) { + // Only handle an error if the error is from the current Event Source. + // Sometimes on disconnect the server will push down an error event + // to an expired Event Source. + if (this.ID === that.currentEventSourceID) { + if (!opened) { + if (onFailed) { + onFailed(); + } + + return; + } + + connection.log("EventSource readyState: " + connection.eventSource.readyState); + + if (e.eventPhase === window.EventSource.CLOSED) { + // We don't use the EventSource's native reconnect function as it + // doesn't allow us to change the URL when reconnecting. We need + // to change the URL to not include the /connect suffix, and pass + // the last message id we received. + connection.log("EventSource reconnecting due to the server connection ending"); + that.reconnect(connection); + } else { + // connection error + connection.log("EventSource error"); + $connection.triggerHandler(events.onError); + } + } + }, false); + }, + + reconnect: function (connection) { + var that = this; + + that.reconnectTimeout = window.setTimeout(function () { + that.stop(connection); + + if (transportLogic.ensureReconnectingState(connection)) { + connection.log("EventSource reconnecting"); + that.start(connection); + } + }, connection.reconnectDelay); + }, + + lostConnection: function (connection) { + this.reconnect(connection); + }, + + send: function (connection, data) { + transportLogic.ajaxSend(connection, data); + }, + + stop: function (connection) { + if (connection && connection.eventSource) { + connection.log("EventSource calling close()"); + connection.eventSource.close(); + connection.eventSource = null; + delete connection.eventSource; + } + }, + abort: function (connection, async) { + transportLogic.ajaxAbort(connection, async); + } + }; + +}(window.jQuery, window)); +/* jquery.signalR.transports.foreverFrame.js */ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. + +/*global window:false */ +/// + +(function ($, window) { + "use strict"; + + var signalR = $.signalR, + events = $.signalR.events, + changeState = $.signalR.changeState, + transportLogic = signalR.transports._logic; + + signalR.transports.foreverFrame = { + name: "foreverFrame", + + supportsKeepAlive: true, + + timeOut: 3000, + + start: function (connection, onSuccess, onFailed) { + var that = this, + frameId = (transportLogic.foreverFrame.count += 1), + url, + frame = $(""); + + if (window.EventSource) { + // If the browser supports SSE, don't use Forever Frame + if (onFailed) { + connection.log("This browser supports SSE, skipping Forever Frame."); + onFailed(); + } + return; + } + + + // Build the url + url = transportLogic.getUrl(connection, this.name); + url += "&frameId=" + frameId; + + // Set body prior to setting URL to avoid caching issues. + $("body").append(frame); + + frame.prop("src", url); + transportLogic.foreverFrame.connections[frameId] = connection; + + connection.log("Binding to iframe's readystatechange event."); + frame.bind("readystatechange", function () { + if ($.inArray(this.readyState, ["loaded", "complete"]) >= 0) { + connection.log("Forever frame iframe readyState changed to " + this.readyState + ", reconnecting"); + + that.reconnect(connection); + } + }); + + connection.frame = frame[0]; + connection.frameId = frameId; + + if (onSuccess) { + connection.onSuccess = onSuccess; + } + + // After connecting, if after the specified timeout there's no response stop the connection + // and raise on failed + window.setTimeout(function () { + if (connection.onSuccess) { + connection.log("Failed to connect using forever frame source, it timed out after " + that.timeOut + "ms."); + that.stop(connection); + + if (onFailed) { + onFailed(); + } + } + }, that.timeOut); + }, + + reconnect: function (connection) { + var that = this; + window.setTimeout(function () { + if (connection.frame && transportLogic.ensureReconnectingState(connection)) { + var frame = connection.frame, + src = transportLogic.getUrl(connection, that.name, true) + "&frameId=" + connection.frameId; + connection.log("Updating iframe src to '" + src + "'."); + frame.src = src; + } + }, connection.reconnectDelay); + }, + + lostConnection: function (connection) { + this.reconnect(connection); + }, + + send: function (connection, data) { + transportLogic.ajaxSend(connection, data); + }, + + receive: function (connection, data) { + var cw; + + transportLogic.processMessages(connection, data); + // Delete the script & div elements + connection.frameMessageCount = (connection.frameMessageCount || 0) + 1; + if (connection.frameMessageCount > 50) { + connection.frameMessageCount = 0; + cw = connection.frame.contentWindow || connection.frame.contentDocument; + if (cw && cw.document) { + $("body", cw.document).empty(); + } + } + }, + + stop: function (connection) { + var cw = null; + if (connection.frame) { + if (connection.frame.stop) { + connection.frame.stop(); + } else { + try { + cw = connection.frame.contentWindow || connection.frame.contentDocument; + if (cw.document && cw.document.execCommand) { + cw.document.execCommand("Stop"); + } + } + catch (e) { + connection.log("SignalR: Error occured when stopping foreverFrame transport. Message = " + e.message); + } + } + $(connection.frame).remove(); + delete transportLogic.foreverFrame.connections[connection.frameId]; + connection.frame = null; + connection.frameId = null; + delete connection.frame; + delete connection.frameId; + connection.log("Stopping forever frame"); + } + }, + + abort: function (connection, async) { + transportLogic.ajaxAbort(connection, async); + }, + + getConnection: function (id) { + return transportLogic.foreverFrame.connections[id]; + }, + + started: function (connection) { + if (connection.onSuccess) { + connection.onSuccess(); + connection.onSuccess = null; + delete connection.onSuccess; + } else if (changeState(connection, + signalR.connectionState.reconnecting, + signalR.connectionState.connected) === true) { + // If there's no onSuccess handler we assume this is a reconnect + $(connection).triggerHandler(events.onReconnect); + } + } + }; + +}(window.jQuery, window)); +/* jquery.signalR.transports.longPolling.js */ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. + +/*global window:false */ +/// + +(function ($, window) { + "use strict"; + + var signalR = $.signalR, + events = $.signalR.events, + changeState = $.signalR.changeState, + isDisconnecting = $.signalR.isDisconnecting, + transportLogic = signalR.transports._logic; + + signalR.transports.longPolling = { + name: "longPolling", + + supportsKeepAlive: false, + + reconnectDelay: 3000, + + init: function (connection, onComplete) { + /// Pings the server to ensure availability + /// Connection associated with the server ping + /// Callback to call once initialization has completed + + var that = this, + pingLoop, + // pingFail is used to loop the re-ping behavior. When we fail we want to re-try. + pingFail = function (reason) { + if (isDisconnecting(connection) === false) { + connection.log("SignalR: Server ping failed because '" + reason + "', re-trying ping."); + window.setTimeout(pingLoop, that.reconnectDelay); + } + }; + + connection.log("SignalR: Initializing long polling connection with server."); + pingLoop = function () { + // Ping the server, on successful ping call the onComplete method, otherwise if we fail call the pingFail + transportLogic.pingServer(connection, that.name).done(onComplete).fail(pingFail); + }; + + pingLoop(); + }, + + start: function (connection, onSuccess, onFailed) { + /// Starts the long polling connection + /// The SignalR connection to start + var that = this, + initialConnectedFired = false, + fireConnect = function () { + if (initialConnectedFired) { + return; + } + initialConnectedFired = true; + onSuccess(); + connection.log("Longpolling connected"); + }; + + if (connection.pollXhr) { + connection.log("Polling xhr requests already exists, aborting."); + connection.stop(); + } + + // We start with an initialization procedure which pings the server to verify that it is there. + // On scucessful initialization we'll then proceed with starting the transport. + that.init(connection, function () { + connection.messageId = null; + + window.setTimeout(function () { + (function poll(instance, raiseReconnect) { + var messageId = instance.messageId, + connect = (messageId === null), + reconnecting = !connect, + url = transportLogic.getUrl(instance, that.name, reconnecting, raiseReconnect); + + // If we've disconnected during the time we've tried to re-instantiate the poll then stop. + if (isDisconnecting(instance) === true) { + return; + } + + connection.log("Attempting to connect to '" + url + "' using longPolling."); + instance.pollXhr = $.ajax({ + url: url, + global: false, + cache: false, + type: "GET", + dataType: connection.ajaxDataType, + success: function (minData) { + var delay = 0, + data; + + fireConnect(); + + if (minData) { + data = transportLogic.maximizePersistentResponse(minData); + } + + transportLogic.processMessages(instance, minData); + + if (data && + $.type(data.LongPollDelay) === "number") { + delay = data.LongPollDelay; + } + + if (data && data.Disconnect) { + return; + } + + if (isDisconnecting(instance) === true) { + return; + } + + // We never want to pass a raiseReconnect flag after a successful poll. This is handled via the error function + if (delay > 0) { + window.setTimeout(function () { + poll(instance, false); + }, delay); + } else { + poll(instance, false); + } + }, + + error: function (data, textStatus) { + if (textStatus === "abort") { + connection.log("Aborted xhr requst."); + return; + } + + if (connection.state !== signalR.connectionState.reconnecting) { + connection.log("An error occurred using longPolling. Status = " + textStatus + ". " + data.responseText); + $(instance).triggerHandler(events.onError, [data.responseText]); + } + + // Transition into the reconnecting state + transportLogic.ensureReconnectingState(instance); + + // If we've errored out we need to verify that the server is still there, so re-start initialization process + // This will ping the server until it successfully gets a response. + that.init(instance, function () { + // Call poll with the raiseReconnect flag as true + poll(instance, true); + }); + } + }); + + // This will only ever pass after an error has occured via the poll ajax procedure. + if (reconnecting && raiseReconnect === true) { + if (changeState(connection, + signalR.connectionState.reconnecting, + signalR.connectionState.connected) === true) { + // Successfully reconnected! + connection.log("Raising the reconnect event"); + $(instance).triggerHandler(events.onReconnect); + } + } + }(connection)); + + // Set an arbitrary timeout to trigger onSuccess, this will alot for enough time on the server to wire up the connection. + // Will be fixed by #1189 and this code can be modified to not be a timeout + window.setTimeout(function () { + // Trigger the onSuccess() method because we've now instantiated a connection + fireConnect(); + }, 250); + }, 250); // Have to delay initial poll so Chrome doesn't show loader spinner in tab + }); + }, + + lostConnection: function (connection) { + throw new Error("Lost Connection not handled for LongPolling"); + }, + + send: function (connection, data) { + transportLogic.ajaxSend(connection, data); + }, + + stop: function (connection) { + /// Stops the long polling connection + /// The SignalR connection to stop + if (connection.pollXhr) { + connection.pollXhr.abort(); + connection.pollXhr = null; + delete connection.pollXhr; + } + }, + + abort: function (connection, async) { + transportLogic.ajaxAbort(connection, async); + } + }; + +}(window.jQuery, window)); +/* jquery.signalR.hubs.js */ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. + +/*global window:false */ +/// + +(function ($, window) { + "use strict"; + + // we use a global id for tracking callbacks so the server doesn't have to send extra info like hub name + var callbackId = 0, + callbacks = {}, + eventNamespace = ".hubProxy"; + + function makeEventName(event) { + return event + eventNamespace; + } + + // Array.prototype.map + if (!Array.prototype.hasOwnProperty("map")) { + Array.prototype.map = function (fun, thisp) { + var arr = this, + i, + length = arr.length, + result = []; + for (i = 0; i < length; i += 1) { + if (arr.hasOwnProperty(i)) { + result[i] = fun.call(thisp, arr[i], i, arr); + } + } + return result; + }; + } + + function getArgValue(a) { + return $.isFunction(a) ? null : ($.type(a) === "undefined" ? null : a); + } + + function hasMembers(obj) { + for (var key in obj) { + // If we have any properties in our callback map then we have callbacks and can exit the loop via return + if (obj.hasOwnProperty(key)) { + return true; + } + } + + return false; + } + + // hubProxy + function hubProxy(hubConnection, hubName) { + /// + /// Creates a new proxy object for the given hub connection that can be used to invoke + /// methods on server hubs and handle client method invocation requests from the server. + /// + return new hubProxy.fn.init(hubConnection, hubName); + } + + hubProxy.fn = hubProxy.prototype = { + init: function (connection, hubName) { + this.state = {}; + this.connection = connection; + this.hubName = hubName; + this._ = { + callbackMap: {} + }; + }, + + hasSubscriptions: function () { + return hasMembers(this._.callbackMap); + }, + + on: function (eventName, callback) { + /// Wires up a callback to be invoked when a invocation request is received from the server hub. + /// The name of the hub event to register the callback for. + /// The callback to be invoked. + var self = this, + callbackMap = self._.callbackMap; + + // Normalize the event name to lowercase + eventName = eventName.toLowerCase(); + + // If there is not an event registered for this callback yet we want to create its event space in the callback map. + if (!callbackMap[eventName]) { + callbackMap[eventName] = {}; + } + + // Map the callback to our encompassed function + callbackMap[eventName][callback] = function (e, data) { + callback.apply(self, data); + }; + + $(self).bind(makeEventName(eventName), callbackMap[eventName][callback]); + + return self; + }, + + off: function (eventName, callback) { + /// Removes the callback invocation request from the server hub for the given event name. + /// The name of the hub event to unregister the callback for. + /// The callback to be invoked. + var self = this, + callbackMap = self._.callbackMap, + callbackSpace; + + // Normalize the event name to lowercase + eventName = eventName.toLowerCase(); + + callbackSpace = callbackMap[eventName]; + + // Verify that there is an event space to unbind + if (callbackSpace) { + // Only unbind if there's an event bound with eventName and a callback with the specified callback + if (callbackSpace[callback]) { + $(self).unbind(makeEventName(eventName), callbackSpace[callback]); + + // Remove the callback from the callback map + delete callbackSpace[callback]; + + // Check if there are any members left on the event, if not we need to destroy it. + if (!hasMembers(callbackSpace)) { + delete callbackMap[eventName]; + } + } + else if (!callback) { // Check if we're removing the whole event and we didn't error because of an invalid callback + $(self).unbind(makeEventName(eventName)); + + delete callbackMap[eventName]; + } + } + + return self; + }, + + invoke: function (methodName) { + /// Invokes a server hub method with the given arguments. + /// The name of the server hub method. + + var self = this, + args = $.makeArray(arguments).slice(1), + argValues = args.map(getArgValue), + data = { H: self.hubName, M: methodName, A: argValues, I: callbackId }, + d = $.Deferred(), + callback = function (minResult) { + var result = self._maximizeHubResponse(minResult); + + // Update the hub state + $.extend(self.state, result.State); + + if (result.Error) { + // Server hub method threw an exception, log it & reject the deferred + if (result.StackTrace) { + self.connection.log(result.Error + "\n" + result.StackTrace); + } + d.rejectWith(self, [result.Error]); + } else { + // Server invocation succeeded, resolve the deferred + d.resolveWith(self, [result.Result]); + } + }; + + callbacks[callbackId.toString()] = { scope: self, method: callback }; + callbackId += 1; + + if (!$.isEmptyObject(self.state)) { + data.S = self.state; + } + + self.connection.send(window.JSON.stringify(data)); + + return d.promise(); + }, + + _maximizeHubResponse: function (minHubResponse) { + return { + State: minHubResponse.S, + Result: minHubResponse.R, + Id: minHubResponse.I, + Error: minHubResponse.E, + StackTrace: minHubResponse.T + }; + } + }; + + hubProxy.fn.init.prototype = hubProxy.fn; + + // hubConnection + function hubConnection(url, options) { + /// Creates a new hub connection. + /// [Optional] The hub route url, defaults to "/signalr". + /// [Optional] Settings to use when creating the hubConnection. + var settings = { + qs: null, + logging: false, + useDefaultPath: true + }; + + $.extend(settings, options); + + if (!url || settings.useDefaultPath) { + url = (url || "") + "/signalr"; + } + return new hubConnection.fn.init(url, settings); + } + + hubConnection.fn = hubConnection.prototype = $.connection(); + + hubConnection.fn.init = function (url, options) { + var settings = { + qs: null, + logging: false, + useDefaultPath: true + }, + connection = this; + + $.extend(settings, options); + + // Call the base constructor + $.signalR.fn.init.call(connection, url, settings.qs, settings.logging); + + // Object to store hub proxies for this connection + connection.proxies = {}; + + // Wire up the received handler + connection.received(function (minData) { + var data, proxy, dataCallbackId, callback, hubName, eventName; + if (!minData) { + return; + } + + if (typeof (minData.I) !== "undefined") { + // We received the return value from a server method invocation, look up callback by id and call it + dataCallbackId = minData.I.toString(); + callback = callbacks[dataCallbackId]; + if (callback) { + // Delete the callback from the proxy + callbacks[dataCallbackId] = null; + delete callbacks[dataCallbackId]; + + // Invoke the callback + callback.method.call(callback.scope, minData); + } + } else { + data = this._maximizeClientHubInvocation(minData); + + // We received a client invocation request, i.e. broadcast from server hub + connection.log("Triggering client hub event '" + data.Method + "' on hub '" + data.Hub + "'."); + + // Normalize the names to lowercase + hubName = data.Hub.toLowerCase(); + eventName = data.Method.toLowerCase(); + + // Trigger the local invocation event + proxy = this.proxies[hubName]; + + // Update the hub state + $.extend(proxy.state, data.State); + $(proxy).triggerHandler(makeEventName(eventName), [data.Args]); + } + }); + }; + + hubConnection.fn._maximizeClientHubInvocation = function (minClientHubInvocation) { + return { + Hub: minClientHubInvocation.H, + Method: minClientHubInvocation.M, + Args: minClientHubInvocation.A, + State: minClientHubInvocation.S + }; + }; + + hubConnection.fn._registerSubscribedHubs = function () { + /// + /// Sets the starting event to loop through the known hubs and register any new hubs + /// that have been added to the proxy. + /// + + if (!this._subscribedToHubs) { + this._subscribedToHubs = true; + this.starting(function () { + // Set the connection's data object with all the hub proxies with active subscriptions. + // These proxies will receive notifications from the server. + var subscribedHubs = []; + + $.each(this.proxies, function (key) { + if (this.hasSubscriptions()) { + subscribedHubs.push({ name: key }); + } + }); + + this.data = window.JSON.stringify(subscribedHubs); + }); + } + }; + + hubConnection.fn.createHubProxy = function (hubName) { + /// + /// Creates a new proxy object for the given hub connection that can be used to invoke + /// methods on server hubs and handle client method invocation requests from the server. + /// + /// + /// The name of the hub on the server to create the proxy for. + /// + + // Normalize the name to lowercase + hubName = hubName.toLowerCase(); + + var proxy = this.proxies[hubName]; + if (!proxy) { + proxy = hubProxy(this, hubName); + this.proxies[hubName] = proxy; + } + + this._registerSubscribedHubs(); + + return proxy; + }; + + hubConnection.fn.init.prototype = hubConnection.fn; + + $.hubConnection = hubConnection; + +}(window.jQuery, window)); +/* jquery.signalR.version.js */ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. + +/*global window:false */ +/// +(function ($) { + $.signalR.version = "1.0.0.rc1"; +}(window.jQuery)); diff --git a/linger/src/packages/Microsoft.AspNet.SignalR.JS.1.0.0/content/Scripts/jquery.signalR-1.0.0.min.js b/linger/src/packages/Microsoft.AspNet.SignalR.JS.1.0.0/content/Scripts/jquery.signalR-1.0.0.min.js new file mode 100644 index 0000000..6f14d9d --- /dev/null +++ b/linger/src/packages/Microsoft.AspNet.SignalR.JS.1.0.0/content/Scripts/jquery.signalR-1.0.0.min.js @@ -0,0 +1,10 @@ +/*! + * ASP.NET SignalR JavaScript Library v1.0.0 + * http://signalr.net/ + * + * Copyright Microsoft Open Technologies, Inc. All rights reserved. + * Licensed under the Apache 2.0 + * https://github.com/SignalR/SignalR/blob/master/LICENSE.md + * + */ +(function(n,t){"use strict";function l(t,r){var u,f;if(n.isArray(t)){for(u=t.length-1;u>=0;u--)f=t[u],n.type(t)==="object"||n.type(f)==="string"&&i.transports[f]||(r.log("Invalid transport: "+f+", removing it from the transports list."),t.splice(u,1));t.length===0&&(r.log("No transports remain within the specified transport array."),t=null)}else n.type(t)==="object"||i.transports[t]||t==="auto"||(r.log("Invalid transport: "+t.toString()),t=null);return t}function h(n){return n==="http:"?80:n==="https:"?443:void 0}function o(n,t){return t.match(/:\d+$/)?t:t+":"+h(n)}if(typeof n!="function")throw new Error("SignalR: jQuery not found. Please ensure jQuery is referenced before the SignalR.js file.");if(!t.JSON)throw new Error("SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.");var i,s,e=t.document.readyState==="complete",f=n(t),r={onStart:"onStart",onStarting:"onStarting",onReceived:"onReceived",onError:"onError",onConnectionSlow:"onConnectionSlow",onReconnecting:"onReconnecting",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},c=function(n,i){if(i!==!1){var r;typeof t.console!="undefined"&&(r="["+(new Date).toTimeString()+"] SignalR: "+n,t.console.debug?t.console.debug(r):t.console.log&&t.console.log(r))}},u=function(t,i,u){return i===t.state?(t.state=u,n(t).triggerHandler(r.onStateChanged,[{oldState:i,newState:u}]),!0):!1},a=function(n){return n.state===i.connectionState.disconnected},v=function(n){var u,r;n._.configuredStopReconnectingTimeout||(r=function(n){n.log("Couldn't reconnect within the configured timeout ("+n.disconnectTimeout+"ms), disconnecting."),n.stop(!1,!1)},n.reconnecting(function(){var n=this;u=t.setTimeout(function(){r(n)},n.disconnectTimeout)}),n.stateChanged(function(n){n.oldState===i.connectionState.reconnecting&&t.clearTimeout(u)}),n._.configuredStopReconnectingTimeout=!0)};i=function(n,t,r){return new i.fn.init(n,t,r)},i.events=r,i.changeState=u,i.isDisconnecting=a,i.connectionState={connecting:0,connected:1,reconnecting:2,disconnected:4},i.hub={start:function(){throw new Error("SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g. "); + }; + + if (jQueryTmplVersion > 0) { + jQuery['tmpl']['tag']['ko_code'] = { + open: "__.push($1 || '');" + }; + jQuery['tmpl']['tag']['ko_with'] = { + open: "with($1) {", + close: "} " + }; + } + }; + + ko.jqueryTmplTemplateEngine.prototype = new ko.templateEngine(); + + // Use this one by default *only if jquery.tmpl is referenced* + var jqueryTmplTemplateEngineInstance = new ko.jqueryTmplTemplateEngine(); + if (jqueryTmplTemplateEngineInstance.jQueryTmplVersion > 0) + ko.setTemplateEngine(jqueryTmplTemplateEngineInstance); + + ko.exportSymbol('jqueryTmplTemplateEngine', ko.jqueryTmplTemplateEngine); +})(); +}); +})(window,document,navigator,window["jQuery"]); +})(); diff --git a/linger/src/packages/knockoutjs.2.2.1/Content/Scripts/knockout-2.2.1.js b/linger/src/packages/knockoutjs.2.2.1/Content/Scripts/knockout-2.2.1.js new file mode 100644 index 0000000..d93e497 --- /dev/null +++ b/linger/src/packages/knockoutjs.2.2.1/Content/Scripts/knockout-2.2.1.js @@ -0,0 +1,85 @@ +// Knockout JavaScript library v2.2.1 +// (c) Steven Sanderson - http://knockoutjs.com/ +// License: MIT (http://www.opensource.org/licenses/mit-license.php) + +(function() {function j(w){throw w;}var m=!0,p=null,r=!1;function u(w){return function(){return w}};var x=window,y=document,ga=navigator,F=window.jQuery,I=void 0; +function L(w){function ha(a,d,c,e,f){var g=[];a=b.j(function(){var a=d(c,f)||[];0b.a.i(d,a[c])&&d.push(a[c]);return d},V:function(a,b){a=a||[];for(var d=[],c=0,e=a.length;cn?a.setAttribute("selected",b):a.selected=b},D:function(a){return(a||"").replace(d,"")},Rb:function(a,d){for(var c=[],e=(a||"").split(d),f=0,g=e.length;fa.length?r:a.substring(0,b.length)===b},tb:function(a,b){if(b.compareDocumentPosition)return 16== +(b.compareDocumentPosition(a)&16);for(;a!=p;){if(a==b)return m;a=a.parentNode}return r},X:function(a){return b.a.tb(a,a.ownerDocument)},u:function(a){return a&&a.tagName&&a.tagName.toLowerCase()},n:function(b,d,c){var e=n&&l[d];if(!e&&"undefined"!=typeof F){if(a(b,d)){var f=c;c=function(a,b){var d=this.checked;b&&(this.checked=b.nb!==m);f.call(this,a);this.checked=d}}F(b).bind(d,c)}else!e&&"function"==typeof b.addEventListener?b.addEventListener(d,c,r):"undefined"!=typeof b.attachEvent?b.attachEvent("on"+ +d,function(a){c.call(b,a)}):j(Error("Browser doesn't support addEventListener or attachEvent"))},Ba:function(b,d){(!b||!b.nodeType)&&j(Error("element must be a DOM node when calling triggerEvent"));if("undefined"!=typeof F){var c=[];a(b,d)&&c.push({nb:b.checked});F(b).trigger(d,c)}else"function"==typeof y.createEvent?"function"==typeof b.dispatchEvent?(c=y.createEvent(e[d]||"HTMLEvents"),c.initEvent(d,m,m,x,0,0,0,0,0,r,r,r,r,0,b),b.dispatchEvent(c)):j(Error("The supplied element doesn't support dispatchEvent")): +"undefined"!=typeof b.fireEvent?(a(b,d)&&(b.checked=b.checked!==m),b.fireEvent("on"+d)):j(Error("Browser doesn't support triggering events"))},d:function(a){return b.$(a)?a():a},ua:function(a){return b.$(a)?a.t():a},da:function(a,d,c){if(d){var e=/[\w-]+/g,f=a.className.match(e)||[];b.a.o(d.match(e),function(a){var d=b.a.i(f,a);0<=d?c||f.splice(d,1):c&&f.push(a)});a.className=f.join(" ")}},cb:function(a,d){var c=b.a.d(d);if(c===p||c===I)c="";if(3===a.nodeType)a.data=c;else{var e=b.e.firstChild(a); +!e||3!=e.nodeType||b.e.nextSibling(e)?b.e.N(a,[y.createTextNode(c)]):e.data=c;b.a.wb(a)}},ab:function(a,b){a.name=b;if(7>=n)try{a.mergeAttributes(y.createElement(""),r)}catch(d){}},wb:function(a){9<=n&&(a=1==a.nodeType?a:a.parentNode,a.style&&(a.style.zoom=a.style.zoom))},ub:function(a){if(9<=n){var b=a.style.width;a.style.width=0;a.style.width=b}},Lb:function(a,d){a=b.a.d(a);d=b.a.d(d);for(var c=[],e=a;e<=d;e++)c.push(e);return c},L:function(a){for(var b=[],d=0,c=a.length;d< +c;d++)b.push(a[d]);return b},Pb:6===n,Qb:7===n,Z:n,Oa:function(a,d){for(var c=b.a.L(a.getElementsByTagName("input")).concat(b.a.L(a.getElementsByTagName("textarea"))),e="string"==typeof d?function(a){return a.name===d}:function(a){return d.test(a.name)},f=[],g=c.length-1;0<=g;g--)e(c[g])&&f.push(c[g]);return f},Ib:function(a){return"string"==typeof a&&(a=b.a.D(a))?x.JSON&&x.JSON.parse?x.JSON.parse(a):(new Function("return "+a))():p},xa:function(a,d,c){("undefined"==typeof JSON||"undefined"==typeof JSON.stringify)&& +j(Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js"));return JSON.stringify(b.a.d(a),d,c)},Jb:function(a,d,c){c=c||{};var e=c.params||{},f=c.includeFields||this.Na,g=a;if("object"==typeof a&&"form"===b.a.u(a))for(var g=a.action,h=f.length-1;0<=h;h--)for(var k=b.a.Oa(a,f[h]),l=k.length-1;0<=l;l--)e[k[l].name]=k[l].value;d=b.a.d(d);var n=y.createElement("form"); +n.style.display="none";n.action=g;n.method="post";for(var w in d)a=y.createElement("input"),a.name=w,a.value=b.a.xa(b.a.d(d[w])),n.appendChild(a);for(w in e)a=y.createElement("input"),a.name=w,a.value=e[w],n.appendChild(a);y.body.appendChild(n);c.submitter?c.submitter(n):n.submit();setTimeout(function(){n.parentNode.removeChild(n)},0)}}};b.b("utils",b.a);b.b("utils.arrayForEach",b.a.o);b.b("utils.arrayFirst",b.a.lb);b.b("utils.arrayFilter",b.a.fa);b.b("utils.arrayGetDistinctValues",b.a.Ga);b.b("utils.arrayIndexOf", +b.a.i);b.b("utils.arrayMap",b.a.V);b.b("utils.arrayPushAll",b.a.P);b.b("utils.arrayRemoveItem",b.a.ga);b.b("utils.extend",b.a.extend);b.b("utils.fieldsIncludedWithJsonPost",b.a.Na);b.b("utils.getFormFields",b.a.Oa);b.b("utils.peekObservable",b.a.ua);b.b("utils.postJson",b.a.Jb);b.b("utils.parseJson",b.a.Ib);b.b("utils.registerEventHandler",b.a.n);b.b("utils.stringifyJson",b.a.xa);b.b("utils.range",b.a.Lb);b.b("utils.toggleDomNodeCssClass",b.a.da);b.b("utils.triggerEvent",b.a.Ba);b.b("utils.unwrapObservable", +b.a.d);Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Array.prototype.slice.call(arguments);a=c.shift();return function(){return b.apply(a,c.concat(Array.prototype.slice.call(arguments)))}});b.a.f=new function(){var a=0,d="__ko__"+(new Date).getTime(),c={};return{get:function(a,d){var c=b.a.f.la(a,r);return c===I?I:c[d]},set:function(a,d,c){c===I&&b.a.f.la(a,r)===I||(b.a.f.la(a,m)[d]=c)},la:function(b,f){var g=b[d];if(!g||!("null"!==g&&c[g])){if(!f)return I;g=b[d]="ko"+ +a++;c[g]={}}return c[g]},clear:function(a){var b=a[d];return b?(delete c[b],a[d]=p,m):r}}};b.b("utils.domData",b.a.f);b.b("utils.domData.clear",b.a.f.clear);b.a.F=new function(){function a(a,d){var e=b.a.f.get(a,c);e===I&&d&&(e=[],b.a.f.set(a,c,e));return e}function d(c){var e=a(c,r);if(e)for(var e=e.slice(0),k=0;k",""]||!c.indexOf("",""]||(!c.indexOf("",""]||[0,"",""];a="ignored
"+c[1]+a+c[2]+"
";for("function"==typeof x.innerShiv?d.appendChild(x.innerShiv(a)):d.innerHTML=a;c[0]--;)d=d.lastChild;d=b.a.L(d.lastChild.childNodes)}return d};b.a.ca=function(a,d){b.a.ka(a);d=b.a.d(d);if(d!==p&&d!==I)if("string"!=typeof d&&(d=d.toString()), +"undefined"!=typeof F)F(a).html(d);else for(var c=b.a.ta(d),e=0;ec;c++)a=a();return a})};b.toJSON=function(a,d,c){a=b.gb(a);return b.a.xa(a,d,c)};b.b("toJS",b.gb);b.b("toJSON",b.toJSON);b.k={q:function(a){switch(b.a.u(a)){case "option":return a.__ko__hasDomDataOptionValue__=== +m?b.a.f.get(a,b.c.options.sa):7>=b.a.Z?a.getAttributeNode("value").specified?a.value:a.text:a.value;case "select":return 0<=a.selectedIndex?b.k.q(a.options[a.selectedIndex]):I;default:return a.value}},T:function(a,d){switch(b.a.u(a)){case "option":switch(typeof d){case "string":b.a.f.set(a,b.c.options.sa,I);"__ko__hasDomDataOptionValue__"in a&&delete a.__ko__hasDomDataOptionValue__;a.value=d;break;default:b.a.f.set(a,b.c.options.sa,d),a.__ko__hasDomDataOptionValue__=m,a.value="number"===typeof d? +d:""}break;case "select":for(var c=a.options.length-1;0<=c;c--)if(b.k.q(a.options[c])==d){a.selectedIndex=c;break}break;default:if(d===p||d===I)d="";a.value=d}}};b.b("selectExtensions",b.k);b.b("selectExtensions.readValue",b.k.q);b.b("selectExtensions.writeValue",b.k.T);var ka=/\@ko_token_(\d+)\@/g,na=["true","false"],oa=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i;b.g={Q:[],aa:function(a){var d=b.a.D(a);if(3>d.length)return[];"{"===d.charAt(0)&&(d=d.substring(1,d.length-1));a=[];for(var c= +p,e,f=0;f=b.a.Z&&e in fa?(e=fa[e],g?a.removeAttribute(e): +a[e]=f):g||a.setAttribute(e,f.toString());"name"===e&&b.a.ab(a,g?"":f.toString())}}};b.c.checked={init:function(a,d,c){b.a.n(a,"click",function(){var e;if("checkbox"==a.type)e=a.checked;else if("radio"==a.type&&a.checked)e=a.value;else return;var f=d(),g=b.a.d(f);"checkbox"==a.type&&g instanceof Array?(e=b.a.i(g,a.value),a.checked&&0>e?f.push(a.value):!a.checked&&0<=e&&f.splice(e,1)):b.g.ea(f,c,"checked",e,m)});"radio"==a.type&&!a.name&&b.c.uniqueName.init(a,u(m))},update:function(a,d){var c=b.a.d(d()); +"checkbox"==a.type?a.checked=c instanceof Array?0<=b.a.i(c,a.value):c:"radio"==a.type&&(a.checked=a.value==c)}};b.c.css={update:function(a,d){var c=b.a.d(d());if("object"==typeof c)for(var e in c){var f=b.a.d(c[e]);b.a.da(a,e,f)}else c=String(c||""),b.a.da(a,a.__ko__cssValue,r),a.__ko__cssValue=c,b.a.da(a,c,m)}};b.c.enable={update:function(a,d){var c=b.a.d(d());c&&a.disabled?a.removeAttribute("disabled"):!c&&!a.disabled&&(a.disabled=m)}};b.c.disable={update:function(a,d){b.c.enable.update(a,function(){return!b.a.d(d())})}}; +b.c.event={init:function(a,d,c,e){var f=d()||{},g;for(g in f)(function(){var f=g;"string"==typeof f&&b.a.n(a,f,function(a){var g,n=d()[f];if(n){var q=c();try{var s=b.a.L(arguments);s.unshift(e);g=n.apply(e,s)}finally{g!==m&&(a.preventDefault?a.preventDefault():a.returnValue=r)}q[f+"Bubble"]===r&&(a.cancelBubble=m,a.stopPropagation&&a.stopPropagation())}})})()}};b.c.foreach={Sa:function(a){return function(){var d=a(),c=b.a.ua(d);if(!c||"number"==typeof c.length)return{foreach:d,templateEngine:b.C.oa}; +b.a.d(d);return{foreach:c.data,as:c.as,includeDestroyed:c.includeDestroyed,afterAdd:c.afterAdd,beforeRemove:c.beforeRemove,afterRender:c.afterRender,beforeMove:c.beforeMove,afterMove:c.afterMove,templateEngine:b.C.oa}}},init:function(a,d){return b.c.template.init(a,b.c.foreach.Sa(d))},update:function(a,d,c,e,f){return b.c.template.update(a,b.c.foreach.Sa(d),c,e,f)}};b.g.Q.foreach=r;b.e.I.foreach=m;b.c.hasfocus={init:function(a,d,c){function e(e){a.__ko_hasfocusUpdating=m;var f=a.ownerDocument;"activeElement"in +f&&(e=f.activeElement===a);f=d();b.g.ea(f,c,"hasfocus",e,m);a.__ko_hasfocusUpdating=r}var f=e.bind(p,m),g=e.bind(p,r);b.a.n(a,"focus",f);b.a.n(a,"focusin",f);b.a.n(a,"blur",g);b.a.n(a,"focusout",g)},update:function(a,d){var c=b.a.d(d());a.__ko_hasfocusUpdating||(c?a.focus():a.blur(),b.r.K(b.a.Ba,p,[a,c?"focusin":"focusout"]))}};b.c.html={init:function(){return{controlsDescendantBindings:m}},update:function(a,d){b.a.ca(a,d())}};var da="__ko_withIfBindingData";Q("if");Q("ifnot",r,m);Q("with",m,r,function(a, +b){return a.createChildContext(b)});b.c.options={update:function(a,d,c){"select"!==b.a.u(a)&&j(Error("options binding applies only to SELECT elements"));for(var e=0==a.length,f=b.a.V(b.a.fa(a.childNodes,function(a){return a.tagName&&"option"===b.a.u(a)&&a.selected}),function(a){return b.k.q(a)||a.innerText||a.textContent}),g=a.scrollTop,h=b.a.d(d());0b.a.Z)&&a.nodes?a.nodes():p;if(d)return b.a.L(d.cloneNode(m).childNodes);a=a.text();return b.a.ta(a)};b.C.oa=new b.C;b.wa(b.C.oa);b.b("nativeTemplateEngine",b.C);b.qa=function(){var a=this.Db=function(){if("undefined"==typeof F||!F.tmpl)return 0;try{if(0<=F.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(a){}return 1}();this.renderTemplateSource=function(b,c,e){e=e||{};2>a&&j(Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.")); +var f=b.data("precompiled");f||(f=b.text()||"",f=F.template(p,"{{ko_with $item.koBindingContext}}"+f+"{{/ko_with}}"),b.data("precompiled",f));b=[c.$data];c=F.extend({koBindingContext:c},e.templateOptions);c=F.tmpl(f,b,c);c.appendTo(y.createElement("div"));F.fragments={};return c};this.createJavaScriptEvaluatorBlock=function(a){return"{{ko_code ((function() { return "+a+" })()) }}"};this.addTemplate=function(a,b){y.write("