Revert "Fixing the issue where we were showing Shell even during Login and Ge…"

--- src/MobileApps/MyDriving/MyDriving.UWP/App.xaml.cs
+++ src/MobileApps/MyDriving/MyDriving.UWP/App.xaml.cs
@@ -45,42 +45,41 @@
         protected override void OnLaunched(LaunchActivatedEventArgs e)
         {
             SplitViewShell shell = Window.Current.Content as SplitViewShell;
-
+
             // Do not repeat app initialization when the Window is already present,
             // just ensure that the window is active
             if (shell == null)
             {
                 // Create a Frame to act as the navigation context and navigate to the first page
                 Frame rootFrame = new Frame();
-                rootFrame.NavigationFailed += OnNavigationFailed;
-
+                shell = new SplitViewShell(rootFrame);
+
                 //Register platform specific implementations of shared interfaces
                 ServiceLocator.Instance.Add<IAuthentication, Authentication>();
                 ServiceLocator.Instance.Add<Utils.Interfaces.ILogger, PlatformLogger>();
                 ServiceLocator.Instance.Add<IOBDDevice, OBDDevice>();

+                rootFrame.NavigationFailed += OnNavigationFailed;
+
                 if (Settings.Current.IsLoggedIn)
                 {
                     //When the first screen of the app is launched after user has logged in, initialize the processor that manages connection to OBD Device and to the IOT Hub
                     MyDriving.Services.OBDDataProcessor.GetProcessor().Initialize(ViewModel.ViewModelBase.StoreManager);
-
-                    // Create the shell and set it to current trip
-                    shell = new SplitViewShell(rootFrame);
                     shell.SetTitle("CURRENT TRIP");
                     shell.SetSelectedPage("CURRENT TRIP");
                     rootFrame.Navigate(typeof(CurrentTripView), e.Arguments);
-                    Window.Current.Content = shell;
                 }
                 else if (Settings.Current.FirstRun)
                 {
                     rootFrame.Navigate(typeof(GetStarted1), e.Arguments);
-                    Window.Current.Content = rootFrame;
                 }
                 else
                 {
                     rootFrame.Navigate(typeof(LoginView), e.Arguments);
-                    Window.Current.Content = rootFrame;
                 }
+
+                // Place the shell in the current Window
+                Window.Current.Content = shell;
             }

             // Ensure the current window is active


Only set bitNumber in address for Write when a bit is written

--- S7.Net/Protocol/S7WriteMultiple.cs
+++ S7.Net/Protocol/S7WriteMultiple.cs
@@ -30,13 +30,13 @@
                 Serialization.SetWordAt(message, paramOffset + Parameter.Offsets.Amount, (ushort) value.Length);
                 Serialization.SetWordAt(message, paramOffset + Parameter.Offsets.DbNumber, (ushort) item.DB);
                 message[paramOffset + Parameter.Offsets.Area] = (byte) item.DataType;
-                Serialization.SetAddressAt(message, paramOffset + Parameter.Offsets.Address, item.StartByteAdr, item.BitAdr);
-
-                paramOffset += Parameter.Template.Length;

                 data.Add(0x00);
                 if (item.Value is bool b)
                 {
+                    Serialization.SetAddressAt(message, paramOffset + Parameter.Offsets.Address, item.StartByteAdr,
+                        item.BitAdr);
+
                     data.Add(0x03);
                     data.AddWord(1);

@@ -45,6 +45,8 @@
                 }
                 else
                 {
+                    Serialization.SetAddressAt(message, paramOffset + Parameter.Offsets.Address, item.StartByteAdr, 0);
+
                     var len = value.Length;
                     data.Add(0x04);
                     data.AddWord((ushort) (len << 3));
@@ -55,8 +57,9 @@
                         data.Add(0);
                     }
                 }
+
+                paramOffset += Parameter.Template.Length;
             }
-

             message.Add(data.Array);


HTTP/3: Make H3StaticTable.Get return ref readonly (#39636)

--- src/Shared/runtime/Http3/QPack/H3StaticTable.Http3.cs
+++ src/Shared/runtime/Http3/QPack/H3StaticTable.Http3.cs
@@ -48,7 +48,7 @@
         // TODO: just use Dictionary directly to avoid interface dispatch.
         public static IReadOnlyDictionary<HttpMethod, int> MethodIndex => s_methodIndex;

-        public static ref HeaderField Get(int index) => ref s_staticTable[index];
+        public static ref readonly HeaderField Get(int index) => ref s_staticTable[index];

         private static readonly HeaderField[] s_staticTable = new HeaderField[]
         {


No need to call into the MainLoop as the delegate is already executing on the mainloop.

svn path=/trunk/bitsharp/; revision=113647

--- src/MonoTorrent/MonoTorrent.Client/ClientEngine.cs
+++ src/MonoTorrent/MonoTorrent.Client/ClientEngine.cs
@@ -173,7 +173,7 @@
             this.listenManager = new ListenManager(this);
             MainLoop.QueueTimeout(TimeSpan.FromMilliseconds(TickLength), delegate {
                 if (IsRunning)
-                    MainLoop.QueueWait((MainLoopTask)LogicTick);
+                    LogicTick();
                 return true;
             });
             this.torrents = new MonoTorrentCollection<TorrentManager>();


Improved exception message

Improved exception message

The exception message thrown when Lifestyle.Scoped is used without
setting DefaultScopedLifestyle now contains a link to the documentation.

--- src/SimpleInjector/Lifestyles/ScopedProxyLifestyle.cs
+++ src/SimpleInjector/Lifestyles/ScopedProxyLifestyle.cs
@@ -60,7 +60,7 @@
                 "To be able to use the Lifestyle.Scoped property, please ensure that the container is " +
                 "configured with a default scoped lifestyle by setting the Container.Options." +
                 "DefaultScopedLifestyle property with the required scoped lifestyle for your type of " +
-                "application.");
+                "application. See: https://simpleinjector.org/lifetimes#scoped");
         }
     }
 }


Register now checks to see if the engine 'Contains' the Torrent before allowing registration to succeed.

svn path=/trunk/bitsharp/; revision=96832

--- src/MonoTorrent/MonoTorrent.Client/ClientEngine.cs
+++ src/MonoTorrent/MonoTorrent.Client/ClientEngine.cs
@@ -340,8 +340,11 @@
                 throw new TorrentException("This manager has already been registered");

             using (new WriterLock(torrentsLock))
+            {
+                if (Contains(manager.Torrent))
+                    throw new TorrentException("A manager for this torrent has already been registered");
                 this.torrents.Add(manager);
-
+            }
             manager.Engine = this;
 /*
             manager.PieceHashed += delegate (object sender, PieceHashedEventArgs e) {


NLogConfigurationException (needs change exception handling)

--- src/NLog/LayoutRenderers/RegistryLayoutRenderer.cs
+++ src/NLog/LayoutRenderers/RegistryLayoutRenderer.cs
@@ -35,13 +35,13 @@
 namespace NLog.LayoutRenderers
 {
     using System;
+    using System.Collections.Generic;
     using System.Globalization;
     using System.Text;
     using Microsoft.Win32;
     using NLog;
     using NLog.Internal;
     using NLog.Config;
-    using System.Collections.Generic;
     using System.ComponentModel;
     using NLog.Layouts;

@@ -250,6 +250,7 @@
                 return hive;
             }

+            throw new NLogConfigurationException(string.Format("Key name is not supported. Root hive '{0}' not recognized.", hiveName));
         }

 #if NET3_5


Removed explicit test that isn't needed

Removed explicit test that isn't needed

--- src/NUnitFramework/tests/Attributes/TheoryTests.cs
+++ src/NUnitFramework/tests/Attributes/TheoryTests.cs
@@ -96,13 +96,6 @@
             SquareRootTest(d);
         }

-        [Theory, Explicit("Used to demonstrate display of failing Theory")]
-        public void SquareRootWithAllBadValues(
-            [Values(-12.0, -4.0, -9.0)] double d)
-        {
-            SquareRootTest(d);
-        }
-
         [Datapoints]
         string[] vals = new string[] { "xyz1", "xyz2", "xyz3" };


IPAddress: Use BinaryPrimitives.ReverseEndianness (#26329)

--- src/System.Net.Primitives/src/System/Net/IPAddress.cs
+++ src/System.Net.Primitives/src/System/Net/IPAddress.cs
@@ -2,6 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.

+using System.Buffers.Binary;
 using System.Diagnostics;
 using System.Net.Sockets;
 using System.Runtime.CompilerServices;
@@ -398,36 +399,17 @@

         public static long HostToNetworkOrder(long host)
         {
-#if BIGENDIAN
-            return host;
-#else
-            ulong value = (ulong)host;
-            value = (value << 32) | (value >> 32);
-            value = (value & 0x0000FFFF0000FFFF) << 16 | (value & 0xFFFF0000FFFF0000) >> 16;
-            value = (value & 0x00FF00FF00FF00FF) << 8 | (value & 0xFF00FF00FF00FF00) >> 8;
-            return (long)value;
-#endif
+            return BitConverter.IsLittleEndian ? BinaryPrimitives.ReverseEndianness(host) : host;
         }

         public static int HostToNetworkOrder(int host)
         {
-#if BIGENDIAN
-            return host;
-#else
-            uint value = (uint)host;
-            value = (value << 16) | (value >> 16);
-            value = (value & 0x00FF00FF) << 8 | (value & 0xFF00FF00) >> 8;
-            return (int)value;
-#endif
+            return BitConverter.IsLittleEndian ? BinaryPrimitives.ReverseEndianness(host) : host;
         }

         public static short HostToNetworkOrder(short host)
         {
-#if BIGENDIAN
-            return host;
-#else
-            return unchecked((short)((((int)host & 0xFF) << 8) | (int)((host >> 8) & 0xFF)));
-#endif
+            return BitConverter.IsLittleEndian ? BinaryPrimitives.ReverseEndianness(host) : host;
         }

         public static long NetworkToHostOrder(long network)


Correct call to drop database

Correct call to drop database

--- src/Tgstation.Server.Host/Database/DatabaseContext.cs
+++ src/Tgstation.Server.Host/Database/DatabaseContext.cs
@@ -284,7 +284,7 @@
 		public Task Save(CancellationToken cancellationToken) => SaveChangesAsync(cancellationToken);

 		/// <inheritdoc />
-		public Task Drop(CancellationToken cancellationToken) => Database.EnsureCreatedAsync(cancellationToken);
+		public Task Drop(CancellationToken cancellationToken) => Database.EnsureDeletedAsync(cancellationToken);

 		/// <inheritdoc />
 		public async Task<bool> Migrate(ILogger<DatabaseContext> logger, CancellationToken cancellationToken)


Code distance analysis was added

Code distance analysis was added

--- src/Utils/WaveletCodesListDecodingAnalyzer/Program.cs
+++ src/Utils/WaveletCodesListDecodingAnalyzer/Program.cs
@@ -7,6 +7,7 @@
     using System.Threading;
     using System.Threading.Tasks;
     using CodesAbstractions;
+    using CodesResearchTools.Analyzers.CodeDistance;
     using CodesResearchTools.Analyzers.ListsSizesDistribution;
     using CodesResearchTools.NoiseGenerator;
     using GfAlgorithms.CombinationsCountCalculator;
@@ -39,12 +40,28 @@
     public class Program
     {
         private static readonly INoiseGenerator NoiseGenerator;
+        private static readonly LinearCodeDistanceAnalyzer LinearCodeDistanceAnalyzer;
         private static readonly ListsSizesDistributionAnalyzer ListsSizesDistributionAnalyzer;
         private static readonly IEqualityComparer<FieldElement[]> WordsComparer;
         private static readonly IFixedDistanceCodesFactory FixedDistanceCodesFactory;
         private static readonly IGsBasedDecoderTelemetryCollector TelemetryCollector;

         private static readonly ILogger Logger;
+
+        private static void AnalyzeCodeDistance(int codewordLength, int informationWordLength, Polynomial generatingPolynomial)
+        {
+            var field = generatingPolynomial.Field;
+            var modularPolynomial = new Polynomial(field, 1).RightShift(codewordLength) + new Polynomial(field, field.InverseForAddition(1));
+
+            var codeDistance = LinearCodeDistanceAnalyzer.Analyze(
+                field,
+                informationWordLength,
+                x => (new Polynomial(field, x).RaiseVariableDegree(2) * generatingPolynomial % modularPolynomial).GetCoefficients(codewordLength - 1),
+                new CodeDistanceAnalyzerOptions { LoggingResolution = 1000000000L}
+            );
+            Logger.LogInformation("Code distance: {codeDistance}", codeDistance);
+
+        }

         private static void AnalyzeSpherePackings(ICode code)
         {
@@ -105,13 +122,8 @@
             );
         }

-        private static void AnalyzeSpherePackingsForN8K4D3() =>
-            AnalyzeSpherePackings(
-                new WaveletCode(
-                    8, 4, 4,
-                    new Polynomial(new PrimePowerOrderField(9), 2, 0, 1, 2, 1, 1)
-                )
-            );
+        private static void AnalyzeCodeDistanceForN26K13() =>
+            AnalyzeCodeDistance(26, 13, new Polynomial(new PrimePowerOrderField(27), 2, 0, 1, 2, 1, 1));

         private static void AnalyzeSpherePackingsForN7K3D4() =>
             AnalyzeSpherePackings(
@@ -124,6 +136,14 @@
                 )
             );

+        private static void AnalyzeSpherePackingsForN8K4D3() =>
+            AnalyzeSpherePackings(
+                new WaveletCode(
+                    8, 4, 4,
+                    new Polynomial(new PrimePowerOrderField(9), 2, 0, 1, 2, 1, 1)
+                )
+            );
+
         private static void AnalyzeCodeN7K3D4() => AnalyzeCode(FixedDistanceCodesFactory.CreateN7K3D4(), 2, 2);

         private static void AnalyzeCodeN26K13D12() => AnalyzeCode(FixedDistanceCodesFactory.CreateN26K13D12(), 6, 2);
@@ -230,7 +250,7 @@
         {
             try
             {
-                AnalyzeSpherePackingsForN7K3D4();
+                AnalyzeCodeDistanceForN26K13();
             }
             catch (Exception exception)
             {
@@ -254,6 +274,8 @@
                 );
             Logger = loggerFactory.CreateLogger<Program>();

+            LinearCodeDistanceAnalyzer = new LinearCodeDistanceAnalyzer(loggerFactory.CreateLogger<LinearCodeDistanceAnalyzer>());
+
             NoiseGenerator = new RecursiveGenerator();
             WordsComparer = new FieldElementsArraysComparer();
             ListsSizesDistributionAnalyzer = new ListsSizesDistributionAnalyzer(NoiseGenerator, loggerFactory.CreateLogger<ListsSizesDistributionAnalyzer>());


specific Console.Out

specific Console.Out

--- src/WeihanLi.Common/Logging/ConsoleLoggingProvider.cs
+++ src/WeihanLi.Common/Logging/ConsoleLoggingProvider.cs
@@ -129,7 +129,7 @@
                     }
                     else
                     {
-                        Console.WriteLine(log);
+                        Console.Out.WriteLine(log);
                     }
                 }
                 catch (Exception ex)


Make changes per review.

Make changes per review.

--- test/VisualStudio.Test/VsPackageManagerTest.cs
+++ test/VisualStudio.Test/VsPackageManagerTest.cs
@@ -11,24 +11,6 @@
 {
     public class VsPackageManagerTest
     {
-        //[Fact]
-        //public void GetProjectManagerDoNotThrowWhenActivePackageSourceIsNull()
-        //{
-        //    // Arrange
-        //    var localRepository = new Mock<MockPackageRepository>() { CallBase = true }.As<ISharedPackageRepository>().Object;
-        //    var sourceRepository = new MockPackageRepository();
-        //    var projectSystem = new MockProjectSystem();
-        //    var packageManager = new VsPackageManager(TestUtils.GetSolutionManager(), sourceRepository, projectSystem, localRepository, new Mock<IRecentPackageRepository>().Object, new Mock<VsPackageInstallerEvents>().Object);
-
-        //    var project = new Mock<Project>();
-
-        //    // Act
-        //    var projectManager = packageManager.GetProjectManager(project.Object);
-
-        //    // Assert
-        //    Assert.NotNull(projectManager);
-        //}
-
         [Fact]
         public void InstallPackageInstallsIntoProjectAndPackageManager()
         {


Refactored enum conversion

Refactored enum conversion

--- SafeMapper/Utils/EmitExtensions.cs
+++ SafeMapper/Utils/EmitExtensions.cs
@@ -68,7 +68,12 @@
             il.Emit(OpCodes.Ldloc, toLocal);
         }

-        public static void EmitMemberMap(this ILGenerator il, LocalBuilder fromLocal, LocalBuilder toLocal, MemberWrapper fromMember, MemberWrapper toMember)
+        public static void EmitMemberMap(
+            this ILGenerator il,
+            LocalBuilder fromLocal,
+            LocalBuilder toLocal,
+            MemberWrapper fromMember,
+            MemberWrapper toMember)
         {
             // Load toLocal as parameter for the setter
             il.Emit(toLocal.LocalType.IsValueType ? OpCodes.Ldloca : OpCodes.Ldloc, toLocal);
@@ -175,67 +180,17 @@
                 il.Emit(OpCodes.Ldloc, fromLocal);
             }

+            if (toType.IsEnum)
+            {
+                il.EmitConvertToEnum(fromType, toType);
+                il.MarkLabel(skipConversion);
+                return;
+            }
+
             if (fromType.IsEnum)
             {
-                if (toType == typeof(int))
-                {
-                    return;
-                }
-            }
-
-            if (toType.IsEnum)
-            {
-                if (fromType == typeof(int) || fromType.IsEnum)
-                {
-                    Label defaultCase = il.DefineLabel();
-                    Label endOfMethod = il.DefineLabel();
-                    LocalBuilder switchValue = il.DeclareLocal(fromType);
-
-                    il.Emit(OpCodes.Stloc, switchValue);
-
-                    var enumValues = Enum.GetValues(toType);
-
-                    var jumpTable = new Label[enumValues.Length];
-                    for (int i = 0; i < jumpTable.Length; i++)
-                    {
-                        jumpTable[i] = il.DefineLabel();
-                        il.Emit(OpCodes.Ldloc, switchValue);
-                        il.Emit(OpCodes.Ldc_I4, (int)enumValues.GetValue(i));
-                        il.Emit(OpCodes.Beq, jumpTable[i]);
-                    }
-
-                    // Branch on default case
-                    il.Emit(OpCodes.Br_S, defaultCase);
-
-                    for (int i = 0; i < enumValues.Length; i++)
-                    {
-                        il.MarkLabel(jumpTable[i]);
-                        il.Emit(OpCodes.Ldc_I4, (int)enumValues.GetValue(i));
-                        il.Emit(OpCodes.Br_S, endOfMethod);
-                    }
-
-                    // Default case
-                    il.MarkLabel(defaultCase);
-                    il.Emit(OpCodes.Ldc_I4, (int)enumValues.GetValue(0));
-
-                    il.MarkLabel(endOfMethod);
-
-                    return;
-                }
-
-                if (fromType == typeof(string))
-                {
-                    var enumParse = typeof(SafeConvert).GetMethod("EnumTryParse", new[] { typeof(string) });
-                    if (enumParse != null)
-                    {
-                        var enumParseGeneric = enumParse.MakeGenericMethod(toType);
-                        il.EmitCall(OpCodes.Call, enumParseGeneric, null);
-                    }
-
-                    il.MarkLabel(skipConversion);
-
-                    return;
-                }
+                il.EmitConvertFromEnum(fromType, toType);
+                return;
             }

             if (toType == typeof(string) && fromType != typeof(string))
@@ -244,7 +199,10 @@
             }
             else
             {
-                var converter = ReflectionUtils.GetConvertMethod(fromType, toType, new[] { typeof(SafeConvert), typeof(Convert) });
+                var converter = ReflectionUtils.GetConvertMethod(
+                    fromType,
+                    toType,
+                    new[] { typeof(SafeConvert), typeof(Convert) });
                 if (converter != null)
                 {
                     // Load IFormatProvider as second argument
@@ -272,7 +230,8 @@

                             if (toArrayMethod == null)
                             {
-                                toArrayMethod = typeof(Enumerable).GetMethod("ToArray").MakeGenericMethod(new[] { fromElementType });
+                                toArrayMethod =
+                                    typeof(Enumerable).GetMethod("ToArray").MakeGenericMethod(new[] { fromElementType });
                             }

                             if (toArrayMethod != null)
@@ -310,6 +269,75 @@
             il.MarkLabel(skipConversion);
         }

+        public static void EmitConvertFromEnum(this ILGenerator il, Type fromType, Type toType)
+        {
+            if (!fromType.IsEnum)
+            {
+                throw new ArgumentException("fromType needs to be an enum", "fromType");
+            }
+
+            // TODO: Add handling for all numeric values
+            if (toType == typeof(string))
+            {
+                il.EmitCallToString(fromType);
+            }
+        }
+
+        public static void EmitConvertToEnum(this ILGenerator il, Type fromType, Type toType)
+        {
+            if (!toType.IsEnum)
+            {
+                throw new ArgumentException("toType needs to be an enum", "toType");
+            }
+
+            if (fromType == typeof(int) || fromType.IsEnum)
+            {
+                Label defaultCase = il.DefineLabel();
+                Label endOfMethod = il.DefineLabel();
+                LocalBuilder switchValue = il.DeclareLocal(fromType);
+
+                il.Emit(OpCodes.Stloc, switchValue);
+
+                var enumValues = Enum.GetValues(toType);
+
+                var jumpTable = new Label[enumValues.Length];
+                for (int i = 0; i < jumpTable.Length; i++)
+                {
+                    jumpTable[i] = il.DefineLabel();
+                    il.Emit(OpCodes.Ldloc, switchValue);
+                    il.Emit(OpCodes.Ldc_I4, (int)enumValues.GetValue(i));
+                    il.Emit(OpCodes.Beq, jumpTable[i]);
+                }
+
+                // Branch on default case
+                il.Emit(OpCodes.Br_S, defaultCase);
+
+                for (int i = 0; i < enumValues.Length; i++)
+                {
+                    il.MarkLabel(jumpTable[i]);
+                    il.Emit(OpCodes.Ldc_I4, (int)enumValues.GetValue(i));
+                    il.Emit(OpCodes.Br_S, endOfMethod);
+                }
+
+                // Default case
+                il.MarkLabel(defaultCase);
+                il.Emit(OpCodes.Ldc_I4, (int)enumValues.GetValue(0));
+
+                il.MarkLabel(endOfMethod);
+                return;
+            }
+
+            if (fromType == typeof(string))
+            {
+                var enumParse = typeof(SafeConvert).GetMethod("EnumTryParse", new[] { typeof(string) });
+                if (enumParse != null)
+                {
+                    var enumParseGeneric = enumParse.MakeGenericMethod(toType);
+                    il.EmitCall(OpCodes.Call, enumParseGeneric, null);
+                }
+            }
+        }
+
         public static void EmitConvertClass(this ILGenerator il, Type fromType, Type toType)
         {
             var fromLocal = il.DeclareLocal(fromType);


Adjusted comment.

Adjusted comment.

--- Sandra.UI.WF.Chess/MovesTextBox.cs
+++ Sandra.UI.WF.Chess/MovesTextBox.cs
@@ -162,7 +162,7 @@
                     {
                         if (simulatedGame.InitialSideToMove == Chess.Color.Black)
                         {
-                            // Adjust plyCounter and add an ellipsis for the unknown previous white move.
+                            // Adjust plyCounter and add an ellipsis for the previous white move.
                             updated.Add(new TextElement.MoveCounter(plyCounter / 2 + 1));
                             updated.Add(new TextElement.InitialBlackSideToMoveEllipsis());
                             updated.Add(new TextElement.Space());


Update summaries which still refer to RichTextBox.

--- Sandra.UI.WF.Chess/SyntaxEditor.cs
+++ Sandra.UI.WF.Chess/SyntaxEditor.cs
@@ -97,7 +97,7 @@
         }

         /// <summary>
-        /// Occurs when the zoom factor of this <see cref="RichTextBox"/> is updated.
+        /// Occurs when the zoom factor of this <see cref="SyntaxEditor{TTerminal}"/> is updated.
         /// </summary>
         public event EventHandler<ZoomFactorChangedEventArgs> ZoomFactorChanged;

@@ -161,7 +161,7 @@
     }

     /// <summary>
-    /// Provides data for the <see cref="RichTextBoxEx.ZoomFactorChanged"/> event.
+    /// Provides data for the <see cref="SyntaxEditor{TTerminal}.ZoomFactorChanged"/> event.
     /// </summary>
     public class ZoomFactorChangedEventArgs : EventArgs
     {


SB-189 change to hangfire startup

SB-189 change to hangfire startup

--- Server/src/SchoolBusAPI/Startup.cs
+++ Server/src/SchoolBusAPI/Startup.cs
@@ -66,11 +66,7 @@

             // Add database context
             // - Pattern should be using Configuration.GetConnectionString("Schoolbus") directly; see GetConnectionString for more details.
-            services.AddDbContext<DbAppContext>(options => options.UseNpgsql(connectionString));
-
-            // enable Hangfire
-            PostgreSqlStorage storage = new PostgreSqlStorage(connectionString);
-            services.AddHangfire(x => x.UseStorage(storage));
+            services.AddDbContext<DbAppContext>(options => options.UseNpgsql(connectionString));

             // allow for large files to be uploaded
             services.Configure<FormOptions>(options =>
@@ -92,6 +88,10 @@
                         opts.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
                     });

+            // enable Hangfire
+            PostgreSqlStorage storage = new PostgreSqlStorage(connectionString);
+            services.AddHangfire(x => x.UseStorage(storage));
+
             // Configure Swagger
             services.AddSwaggerGen();
             services.ConfigureSwaggerGen(options =>
@@ -137,14 +137,17 @@
             app.UseSwagger();
             app.UseSwaggerUi();

+
+
+            if (env.IsDevelopment())
+            {
+                app.UseDeveloperExceptionPage();
+            }
+
             // enable Hangfire
             app.UseHangfireServer();
             app.UseHangfireDashboard(); // this enables the /hangfire action

-            if (env.IsDevelopment())
-            {
-                app.UseDeveloperExceptionPage();
-            }
             // this should be set as an environment variable.
             // Only enable when doing a new PROD deploy to populate CCW data and link it to the bus data.
             if (!string.IsNullOrEmpty(Configuration["ENABLE_HANGFIRE_CREATE"]))


fix CreateAllIndices removing PrimaryClusteredIndex

--- Signum.Engine/Engine/SqlBuilder.cs
+++ Signum.Engine/Engine/SqlBuilder.cs
@@ -176,7 +176,7 @@

         public static SqlPreCommand CreateAllIndices(ITable t)
         {
-            return t.GeneratAllIndexes().Select(CreateIndex).Combine(Spacing.Simple);
+            return t.GeneratAllIndexes().Where(a => !(a is PrimaryClusteredIndex)).Select(CreateIndex).Combine(Spacing.Simple);
         }

         public static SqlPreCommand DropIndex(UniqueIndex ix)


added the IDisposible interface for the AppDomainBootstrap

--- SocketEngine/AppDomainBootstrap.cs
+++ SocketEngine/AppDomainBootstrap.cs
@@ -93,7 +93,7 @@
     /// <summary>
     /// AppDomainBootstrap
     /// </summary>
-    class AppDomainBootstrap : MarshalByRefObject, IBootstrap
+    class AppDomainBootstrap : MarshalByRefObject, IBootstrap, IDisposable
     {
         private IBootstrap m_InnerBootstrap;

@@ -225,5 +225,12 @@
         {
             get { return m_InnerBootstrap.BaseDirectory; }
         }
+
+        void IDisposable.Dispose()
+        {
+            var disposableBootstrap = m_InnerBootstrap as IDisposable;
+            if (disposableBootstrap != null)
+                disposableBootstrap.Dispose();
+        }
     }
 }


Fixed issue where submenu item could be unfocused through setter but focus level was mismatched

--- Source/PauseMenu/TabSubmenuItem.cs
+++ Source/PauseMenu/TabSubmenuItem.cs
@@ -69,13 +69,17 @@
                 return;
             }

-            // reset focus if the child menu is focused but this menu is not
-            if (!Focused && Index >= 0 && Index < Items.Count && Items[Index].Focused)
-                Items[Index].Focused = false;
-
             // reset index if it's an invalid value
             if (Index < 0 || Index >= Items.Count)
                 RefreshIndex();
+
+            // reset focus if the child menu is focused but this menu is not
+            if (!Focused && Items[Index].Focused)
+                Items[Index].Focused = false;
+
+            // reset focus level if the child menu is not focused but the focus level is >1
+            if (Parent.FocusLevel > 1 && !Items[Index].Focused)
+                Parent.FocusLevel--;

             if (!Focused || Items.Count == 0 || Index < 0 || Index >= Items.Count)
                 return;


[Src] Add missing docs to AMD extension types

--- Src/Amd/CommandBufferExtensions.cs
+++ Src/Amd/CommandBufferExtensions.cs
@@ -83,16 +83,24 @@
         private static readonly vkCmdDrawIndexedIndirectCountAMDDelegate vkCmdDrawIndexedIndirectCountAMD = VulkanLibrary.GetProc<vkCmdDrawIndexedIndirectCountAMDDelegate>(nameof(vkCmdDrawIndexedIndirectCountAMD));
     }

+    /// <summary>
+    /// The rasterization order to use for a graphics pipeline is specified by adding a <see
+    /// cref="PipelineRasterizationStateRasterizationOrderAmd"/> structure to <see
+    /// cref="PipelineRasterizationStateCreateInfo.Next"/> chain.
+    /// </summary>
     [StructLayout(LayoutKind.Sequential)]
     public struct PipelineRasterizationStateRasterizationOrderAmd
     {
+        /// <summary>
+        /// The type of this structure.
+        /// </summary>
         public StructureType Type;
         /// <summary>
-        /// Pointer to next structure.
+        /// Is <see cref="IntPtr.Zero"/> or a pointer to an extension-specific structure.
         /// </summary>
         public IntPtr Next;
         /// <summary>
-        /// Rasterization order to use for the pipeline.
+        /// The primitive rasterization order to use.
         /// </summary>
         public RasterizationOrderAmd RasterizationOrder;


Addressed a Code Analysis warning.

Addressed a Code Analysis warning.

--- Src/Idioms/GuardClauseAssertion.cs
+++ Src/Idioms/GuardClauseAssertion.cs
@@ -88,6 +88,7 @@
         /// <see cref="BehaviorExpectation" />.
         /// </para>
         /// </remarks>
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "AutoFixture", Justification = "Workaround for a bug in CA: https://connect.microsoft.com/VisualStudio/feedback/details/521030/")]
         public override void Verify(ConstructorInfo constructorInfo)
         {
             if (constructorInfo == null)


Suppressed some code analysis warnings.

Suppressed some code analysis warnings.

--- Src/Idioms/GuardClauseAssertion.cs
+++ Src/Idioms/GuardClauseAssertion.cs
@@ -422,16 +422,18 @@
                 this.command.Execute(value);
             }

+            [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "codeblog", Justification = "False Positive. Code Analysis really shouldn't attempt to spell check URLs.")]
+            [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "uk", Justification = "False Positive. Code Analysis really shouldn't attempt to spell check URLs.")]
             [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "jonskeet", Justification = "False Positive. Code Analysis really shouldn't attempt to spell check URLs.")]
-            [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "msmvps", Justification = "False Positive. Code Analysis really shouldn't attempt to spell check URLs.")]
             public Exception CreateException(string value)
             {
                 var e = this.command.CreateException(value);
                 return new GuardClauseException(message, e);
             }

+            [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "codeblog", Justification = "False Positive. Code Analysis really shouldn't attempt to spell check URLs.")]
+            [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "uk", Justification = "False Positive. Code Analysis really shouldn't attempt to spell check URLs.")]
             [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "jonskeet", Justification = "False Positive. Code Analysis really shouldn't attempt to spell check URLs.")]
-            [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "msmvps", Justification = "False Positive. Code Analysis really shouldn't attempt to spell check URLs.")]
             public Exception CreateException(string value, Exception innerException)
             {
                 var e = this.command.CreateException(value, innerException);


DI in startup validation, refactoring and cleanup

--- StartupValidation/BaseValidator.cs
+++ StartupValidation/BaseValidator.cs
@@ -1,16 +1,14 @@
-using VersionOne.ServiceHost.Core;
+using Ninject;
 using VersionOne.ServiceHost.Core.Logging;
 using VersionOne.ServiceHost.Core.StartupValidation;

 namespace VersionOne.ServerConnector.StartupValidation {
     public abstract class BaseValidator : ISimpleValidator {
-        protected readonly ILogger Logger;
-        protected readonly IVersionOneProcessor V1Processor;
+        [Inject]
+        public ILogger Logger { get; set; }

-        protected  BaseValidator() {
-            Logger = ComponentRepository.Instance.Resolve<ILogger>();
-            V1Processor = ComponentRepository.Instance.Resolve<IVersionOneProcessor>();
-        }
+        [Inject]
+        public IVersionOneProcessor V1Processor { get; set; }

         public abstract bool Validate();
     }


Updated BigBankPlc example to match the Java version.

--- Structurizr.Examples/BigBankPlc.cs
+++ Structurizr.Examples/BigBankPlc.cs
@@ -1,13 +1,11 @@
-using System;
-using System.IO;
+using System.IO;
 using System.Linq;
-using Structurizr.Api;
 using Structurizr.Core.Util;
 using Structurizr.Documentation;

 namespace Structurizr.Examples
 {
-
+
     /// <summary>
     /// This is an example workspace to illustrate the key features of Structurizr,
     /// based around a fictional Internet Banking System for Big Bank plc.
@@ -30,255 +28,267 @@

         public static Workspace Create()
         {
-                Workspace workspace = new Workspace("Big Bank plc", "This is an example workspace to illustrate the key features of Structurizr, based around a fictional online banking system.");
-                Model model = workspace.Model;
-                model.ImpliedRelationshipsStrategy = new CreateImpliedRelationshipsUnlessAnyRelationshipExistsStrategy();
-                ViewSet views = workspace.Views;
-
-                model.Enterprise = new Enterprise("Big Bank plc");
-
-                // people and software systems
-                Person customer = model.AddPerson(Location.External, "Personal Banking Customer", "A customer of the bank, with personal bank accounts.");
-
-                SoftwareSystem internetBankingSystem = model.AddSoftwareSystem(Location.Internal, "Internet Banking System", "Allows customers to view information about their bank accounts, and make payments.");
-                customer.Uses(internetBankingSystem, "Uses");
-
-                SoftwareSystem mainframeBankingSystem = model.AddSoftwareSystem(Location.Internal, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.");
-                mainframeBankingSystem.AddTags(ExistingSystemTag);
-                internetBankingSystem.Uses(mainframeBankingSystem, "Uses");
-
-                SoftwareSystem emailSystem = model.AddSoftwareSystem(Location.Internal, "E-mail System", "The internal Microsoft Exchange e-mail system.");
-                internetBankingSystem.Uses(emailSystem, "Sends e-mail using");
-                emailSystem.AddTags(ExistingSystemTag);
-                emailSystem.Delivers(customer, "Sends e-mails to");
-
-                SoftwareSystem atm = model.AddSoftwareSystem(Location.Internal, "ATM", "Allows customers to withdraw cash.");
-                atm.AddTags(ExistingSystemTag);
-                atm.Uses(mainframeBankingSystem, "Uses");
-                customer.Uses(atm, "Withdraws cash using");
-
-                Person customerServiceStaff = model.AddPerson(Location.Internal, "Customer Service Staff", "Customer service staff within the bank.");
-                customerServiceStaff.AddTags(BankStaffTag);
-                customerServiceStaff.Uses(mainframeBankingSystem, "Uses");
-                customer.InteractsWith(customerServiceStaff, "Asks questions to", "Telephone");
-
-                Person backOfficeStaff = model.AddPerson(Location.Internal, "Back Office Staff", "Administration and support staff within the bank.");
-                backOfficeStaff.AddTags(BankStaffTag);
-                backOfficeStaff.Uses(mainframeBankingSystem, "Uses");
-
-                // containers
-                Container singlePageApplication = internetBankingSystem.AddContainer("Single-Page Application", "Provides all of the Internet banking functionality to customers via their web browser.", "JavaScript and Angular");
-                singlePageApplication.AddTags(WebBrowserTag);
-                Container mobileApp = internetBankingSystem.AddContainer("Mobile App", "Provides a limited subset of the Internet banking functionality to customers via their mobile device.", "Xamarin");
-                mobileApp.AddTags(MobileAppTag);
-                Container webApplication = internetBankingSystem.AddContainer("Web Application", "Delivers the static content and the Internet banking single page application.", "Java and Spring MVC");
-                Container apiApplication = internetBankingSystem.AddContainer("API Application", "Provides Internet banking functionality via a JSON/HTTPS API.", "Java and Spring MVC");
-                Container database = internetBankingSystem.AddContainer("Database", "Stores user registration information, hashed authentication credentials, access logs, etc.", "Relational Database Schema");
-                database.AddTags(DatabaseTag);
-
-                customer.Uses(webApplication, "Uses", "HTTPS");
-                customer.Uses(singlePageApplication, "Uses", "");
-                customer.Uses(mobileApp, "Uses", "");
-                webApplication.Uses(singlePageApplication, "Delivers to the customer's web browser", "");
-                apiApplication.Uses(database, "Reads from and writes to", "JDBC");
-                apiApplication.Uses(mainframeBankingSystem, "Uses", "XML/HTTPS");
-                apiApplication.Uses(emailSystem, "Sends e-mail using", "SMTP");
-
-                // components
-                // - for a real-world software system, you would probably want to extract the components using
-                // - static analysis/reflection rather than manually specifying them all
-                Component signinController = apiApplication.AddComponent("Sign In Controller", "Allows users to sign in to the Internet Banking System.", "Spring MVC Rest Controller");
-                Component accountsSummaryController = apiApplication.AddComponent("Accounts Summary Controller", "Provides customers with a summary of their bank accounts.", "Spring MVC Rest Controller");
-                Component resetPasswordController = apiApplication.AddComponent("Reset Password Controller", "Allows users to reset their passwords with a single use URL.", "Spring MVC Rest Controller");
-                Component securityComponent = apiApplication.AddComponent("Security Component", "Provides functionality related to signing in, changing passwords, etc.", "Spring Bean");
-                Component mainframeBankingSystemFacade = apiApplication.AddComponent("Mainframe Banking System Facade", "A facade onto the mainframe banking system.", "Spring Bean");
-                Component emailComponent = apiApplication.AddComponent("E-mail Component", "Sends e-mails to users.", "Spring Bean");
-
-                apiApplication.Components.Where(c => "Spring MVC Rest Controller".Equals(c.Technology)).ToList().ForEach(c => singlePageApplication.Uses(c, "Makes API calls to", "JSON/HTTPS"));
-                apiApplication.Components.Where(c => "Spring MVC Rest Controller".Equals(c.Technology)).ToList().ForEach(c => mobileApp.Uses(c, "Makes API calls to", "JSON/HTTPS"));
-                signinController.Uses(securityComponent, "Uses");
-                accountsSummaryController.Uses(mainframeBankingSystemFacade, "Uses");
-                resetPasswordController.Uses(securityComponent, "Uses");
-                resetPasswordController.Uses(emailComponent, "Uses");
-                securityComponent.Uses(database, "Reads from and writes to", "JDBC");
-                mainframeBankingSystemFacade.Uses(mainframeBankingSystem, "Uses", "XML/HTTPS");
-                emailComponent.Uses(emailSystem, "Sends e-mail using");
-
-                // deployment nodes and container instances
-                DeploymentNode developerLaptop = model.AddDeploymentNode("Development", "Developer Laptop", "A developer laptop.", "Microsoft Windows 10 or Apple macOS");
-                DeploymentNode apacheTomcat = developerLaptop.AddDeploymentNode("Docker Container - Web Server", "A Docker container.", "Docker")
-                        .AddDeploymentNode("Apache Tomcat", "An open source Java EE web server.", "Apache Tomcat 8.x", 1, DictionaryUtils.Create("Xmx=512M", "Xms=1024M", "Java Version=8"));
-                ContainerInstance developmentWebApplication = apacheTomcat.Add(webApplication);
-                ContainerInstance developmentApiApplication = apacheTomcat.Add(apiApplication);
-
-                DeploymentNode bigBankDataCenterForDevelopment = model.AddDeploymentNode("Development", "Big Bank plc", "", "Big Bank plc data center");
-                SoftwareSystemInstance developmentMainframeBankingSystem = bigBankDataCenterForDevelopment.AddDeploymentNode("bigbank-dev001").Add(mainframeBankingSystem);
-
-                ContainerInstance developmentDatabase = developerLaptop.AddDeploymentNode("Docker Container - Database Server", "A Docker container.", "Docker")
-                        .AddDeploymentNode("Database Server", "A development database.", "Oracle 12c")
-                        .Add(database);
-
-                ContainerInstance developmentSinglePageApplication = developerLaptop.AddDeploymentNode("Web Browser", "", "Chrome, Firefox, Safari, or Edge").Add(singlePageApplication);
-
-                DeploymentNode customerMobileDevice = model.AddDeploymentNode("Live", "Customer's mobile device", "", "Apple iOS or Android");
-                ContainerInstance liveMobileApp = customerMobileDevice.Add(mobileApp);
-
-                DeploymentNode customerComputer = model.AddDeploymentNode("Live", "Customer's computer", "", "Microsoft Windows or Apple macOS");
-                ContainerInstance liveSinglePageApplication = customerComputer.AddDeploymentNode("Web Browser", "", "Chrome, Firefox, Safari, or Edge").Add(singlePageApplication);
-
-                DeploymentNode bigBankDataCenterForLive = model.AddDeploymentNode("Live", "Big Bank plc", "", "Big Bank plc data center");
-                SoftwareSystemInstance liveMainframeBankingSystem = bigBankDataCenterForLive.AddDeploymentNode("bigbank-prod001").Add(mainframeBankingSystem);
-
-                DeploymentNode liveWebServer = bigBankDataCenterForLive.AddDeploymentNode("bigbank-web***", "A web server residing in the web server farm, accessed via F5 BIG-IP LTMs.", "Ubuntu 16.04 LTS", 4, DictionaryUtils.Create("Location=London and Reading"));
-                ContainerInstance liveWebApplication = liveWebServer.AddDeploymentNode("Apache Tomcat", "An open source Java EE web server.", "Apache Tomcat 8.x", 1, DictionaryUtils.Create("Xmx=512M", "Xms=1024M", "Java Version=8"))
-                        .Add(webApplication);
-
-                DeploymentNode liveApiServer = bigBankDataCenterForLive.AddDeploymentNode("bigbank-api***", "A web server residing in the web server farm, accessed via F5 BIG-IP LTMs.", "Ubuntu 16.04 LTS", 8, DictionaryUtils.Create("Location=London and Reading"));
-                ContainerInstance liveApiApplication = liveApiServer.AddDeploymentNode("Apache Tomcat", "An open source Java EE web server.", "Apache Tomcat 8.x", 1, DictionaryUtils.Create("Xmx=512M", "Xms=1024M", "Java Version=8"))
-                        .Add(apiApplication);
-
-                DeploymentNode primaryDatabaseServer = bigBankDataCenterForLive.AddDeploymentNode("bigbank-db01", "The primary database server.", "Ubuntu 16.04 LTS", 1, DictionaryUtils.Create("Location=London"))
-                        .AddDeploymentNode("Oracle - Primary", "The primary, live database server.", "Oracle 12c");
-                ContainerInstance livePrimaryDatabase = primaryDatabaseServer.Add(database);
-
-                DeploymentNode bigBankdb02 = bigBankDataCenterForLive.AddDeploymentNode("bigbank-db02", "The secondary database server.", "Ubuntu 16.04 LTS", 1, DictionaryUtils.Create("Location=Reading"));
-                bigBankdb02.AddTags(FailoverTag);
-                DeploymentNode secondaryDatabaseServer = bigBankdb02.AddDeploymentNode("Oracle - Secondary", "A secondary, standby database server, used for failover purposes only.", "Oracle 12c");
-                secondaryDatabaseServer.AddTags(FailoverTag);
-                ContainerInstance liveSecondaryDatabase = secondaryDatabaseServer.Add(database);
-
-                model.Relationships.Where(r=>r.Destination.Equals(liveSecondaryDatabase)).ToList().ForEach(r=>r.AddTags(FailoverTag));
-                Relationship dataReplicationRelationship = primaryDatabaseServer.Uses(secondaryDatabaseServer, "Replicates data to", "");
-                liveSecondaryDatabase.AddTags(FailoverTag);
-
-                // views/diagrams
-                SystemLandscapeView systemLandscapeView = views.CreateSystemLandscapeView("SystemLandscape", "The system landscape diagram for Big Bank plc.");
-                systemLandscapeView.AddAllElements();
-                systemLandscapeView.PaperSize = PaperSize.A5_Landscape;
-
-                SystemContextView systemContextView = views.CreateSystemContextView(internetBankingSystem, "SystemContext", "The system context diagram for the Internet Banking System.");
-                systemContextView.EnterpriseBoundaryVisible = false;
-                systemContextView.AddNearestNeighbours(internetBankingSystem);
-                systemContextView.PaperSize = PaperSize.A5_Landscape;
-
-                ContainerView containerView = views.CreateContainerView(internetBankingSystem, "Containers", "The container diagram for the Internet Banking System.");
-                containerView.Add(customer);
-                containerView.AddAllContainers();
-                containerView.Add(mainframeBankingSystem);
-                containerView.Add(emailSystem);
-                containerView.PaperSize = PaperSize.A5_Landscape;
-
-                ComponentView componentView = views.CreateComponentView(apiApplication, "Components", "The component diagram for the API Application.");
-                componentView.Add(mobileApp);
-                componentView.Add(singlePageApplication);
-                componentView.Add(database);
-                componentView.AddAllComponents();
-                componentView.Add(mainframeBankingSystem);
-                componentView.Add(emailSystem);
-                componentView.PaperSize = PaperSize.A5_Landscape;
-
-                systemLandscapeView.AddAnimation(internetBankingSystem, customer, mainframeBankingSystem, emailSystem);
-                systemLandscapeView.AddAnimation(atm);
-                systemLandscapeView.AddAnimation(customerServiceStaff, backOfficeStaff);
-
-                systemContextView.AddAnimation(internetBankingSystem);
-                systemContextView.AddAnimation(customer);
-                systemContextView.AddAnimation(mainframeBankingSystem);
-                systemContextView.AddAnimation(emailSystem);
-
-                containerView.AddAnimation(customer, mainframeBankingSystem, emailSystem);
-                containerView.AddAnimation(webApplication);
-                containerView.AddAnimation(singlePageApplication);
-                containerView.AddAnimation(mobileApp);
-                containerView.AddAnimation(apiApplication);
-                containerView.AddAnimation(database);
-
-                componentView.AddAnimation(singlePageApplication, mobileApp);
-                componentView.AddAnimation(signinController, securityComponent, database);
-                componentView.AddAnimation(accountsSummaryController, mainframeBankingSystemFacade, mainframeBankingSystem);
-                componentView.AddAnimation(resetPasswordController, emailComponent, database);
-
-                // dynamic diagrams and deployment diagrams are not available with the Free Plan
-                DynamicView dynamicView = views.CreateDynamicView(apiApplication, "SignIn", "Summarises how the sign in feature works in the single-page application.");
-                dynamicView.Add(singlePageApplication, "Submits credentials to", signinController);
-                dynamicView.Add(signinController, "Calls isAuthenticated() on", securityComponent);
-                dynamicView.Add(securityComponent, "select * from users where username = ?", database);
-                dynamicView.PaperSize = PaperSize.A5_Landscape;
-
-                DeploymentView developmentDeploymentView = views.CreateDeploymentView(internetBankingSystem, "DevelopmentDeployment", "An example development deployment scenario for the Internet Banking System.");
-                developmentDeploymentView.Environment = "Development";
-                developmentDeploymentView.Add(developerLaptop);
-                developmentDeploymentView.Add(bigBankDataCenterForDevelopment);
-                developmentDeploymentView.PaperSize = PaperSize.A5_Landscape;
-
-                developmentDeploymentView.AddAnimation(developmentSinglePageApplication);
-                developmentDeploymentView.AddAnimation(developmentWebApplication, developmentApiApplication);
-                developmentDeploymentView.AddAnimation(developmentDatabase);
-                //developmentDeploymentView.AddAnimation(developmentMainframeBankingSystem);
-
-                DeploymentView liveDeploymentView = views.CreateDeploymentView(internetBankingSystem, "LiveDeployment", "An example live deployment scenario for the Internet Banking System.");
-                liveDeploymentView.Environment = "Live";
-                liveDeploymentView.Add(bigBankDataCenterForLive);
-                liveDeploymentView.Add(customerMobileDevice);
-                liveDeploymentView.Add(customerComputer);
-                liveDeploymentView.Add(dataReplicationRelationship);
-                liveDeploymentView.PaperSize = PaperSize.A5_Landscape;
-
-                liveDeploymentView.AddAnimation(liveSinglePageApplication);
-                liveDeploymentView.AddAnimation(liveMobileApp);
-                liveDeploymentView.AddAnimation(liveWebApplication, liveApiApplication);
-                liveDeploymentView.AddAnimation(livePrimaryDatabase);
-                liveDeploymentView.AddAnimation(liveSecondaryDatabase);
-                //liveDeploymentView.AddAnimation(liveMainframeBankingSystem);
-
-                // colours, shapes and other diagram styling
-                Styles styles = views.Configuration.Styles;
-                styles.Add(new ElementStyle(Tags.SoftwareSystem) { Background = "#1168bd", Color = "#ffffff" });
-                styles.Add(new ElementStyle(Tags.Container) { Background = "#438dd5", Color = "#ffffff" });
-                styles.Add(new ElementStyle(Tags.Component) { Background = "#85bbf0", Color = "#000000" });
-                styles.Add(new ElementStyle(Tags.Person) { Background = "#08427b", Color = "#ffffff", Shape = Shape.Person, FontSize = 22});
-                styles.Add(new ElementStyle(ExistingSystemTag) { Background = "#999999", Color = "#ffffff"});
-                styles.Add(new ElementStyle(BankStaffTag) { Background = "#999999",Color = "#ffffff" });
-                styles.Add(new ElementStyle(WebBrowserTag) { Shape = Shape.WebBrowser });
-                styles.Add(new ElementStyle(MobileAppTag) { Shape = Shape.MobileDeviceLandscape });
-                styles.Add(new ElementStyle(DatabaseTag) { Shape = Shape.Cylinder });
-                styles.Add(new ElementStyle(FailoverTag) { Opacity = 25 });
-                styles.Add(new RelationshipStyle(FailoverTag) { Opacity = 25, Position = 70});
-
-                // documentation
-                // - usually the documentation would be included from separate Markdown/AsciiDoc files, but this is just an example
-                StructurizrDocumentationTemplate template = new StructurizrDocumentationTemplate(workspace);
-                template.AddContextSection(internetBankingSystem, Format.Markdown,
-                        "Here is some context about the Internet Banking System...\n" +
-                                "![](embed:SystemLandscape)\n" +
-                                "![](embed:SystemContext)\n" +
-                                "### Internet Banking System\n...\n" +
-                                "### Mainframe Banking System\n...\n");
-                template.AddContainersSection(internetBankingSystem, Format.Markdown,
-                        "Here is some information about the containers within the Internet Banking System...\n" +
-                                "![](embed:Containers)\n" +
-                                "### Web Application\n...\n" +
-                                "### Database\n...\n");
-                template.AddComponentsSection(webApplication, Format.Markdown,
-                        "Here is some information about the API Application...\n" +
-                                "![](embed:Components)\n" +
-                                "### Sign in process\n" +
-                                "Here is some information about the Sign In Controller, including how the sign in process works...\n" +
-                                "![](embed:SignIn)");
-                template.AddDevelopmentEnvironmentSection(internetBankingSystem, Format.AsciiDoc,
-                        "Here is some information about how to set up a development environment for the Internet Banking System...\n" +
-                                "image::embed:DevelopmentDeployment[]");
-                template.AddDeploymentSection(internetBankingSystem, Format.AsciiDoc,
-                        "Here is some information about the live deployment environment for the Internet Banking System...\n" +
-                                "image::embed:LiveDeployment[]");
-
-                return workspace;
+            Workspace workspace = new Workspace("Big Bank plc", "This is an example workspace to illustrate the key features of Structurizr, based around a fictional online banking system.");
+            Model model = workspace.Model;
+            model.ImpliedRelationshipsStrategy = new CreateImpliedRelationshipsUnlessAnyRelationshipExistsStrategy();
+            ViewSet views = workspace.Views;
+
+            model.Enterprise = new Enterprise("Big Bank plc");
+
+            // people and software systems
+            SoftwareSystem internetBankingSystem = model.AddSoftwareSystem(Location.Internal, "Internet Banking System", "Allows customers to view information about their bank accounts, and make payments.");
+            Person customer = model.AddPerson(Location.External, "Personal Banking Customer", "A customer of the bank, with personal bank accounts.");
+
+            customer.Uses(internetBankingSystem, "Views account balances, and makes payments using");
+
+            SoftwareSystem mainframeBankingSystem = model.AddSoftwareSystem(Location.Internal, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.");
+            mainframeBankingSystem.AddTags(ExistingSystemTag);
+            internetBankingSystem.Uses(mainframeBankingSystem, "Gets account information from, and makes payments using");
+
+            SoftwareSystem emailSystem = model.AddSoftwareSystem(Location.Internal, "E-mail System", "The internal Microsoft Exchange e-mail system.");
+            internetBankingSystem.Uses(emailSystem, "Sends e-mail using");
+            emailSystem.AddTags(ExistingSystemTag);
+            emailSystem.Delivers(customer, "Sends e-mails to");
+
+            SoftwareSystem atm = model.AddSoftwareSystem(Location.Internal, "ATM", "Allows customers to withdraw cash.");
+            atm.AddTags(ExistingSystemTag);
+            atm.Uses(mainframeBankingSystem, "Uses");
+            customer.Uses(atm, "Withdraws cash using");
+
+            Person customerServiceStaff = model.AddPerson(Location.Internal, "Customer Service Staff", "Customer service staff within the bank.");
+            customerServiceStaff.AddTags(BankStaffTag);
+            customerServiceStaff.Uses(mainframeBankingSystem, "Uses");
+            customer.InteractsWith(customerServiceStaff, "Asks questions to", "Telephone");
+
+            Person backOfficeStaff = model.AddPerson(Location.Internal, "Back Office Staff", "Administration and support staff within the bank.");
+            backOfficeStaff.AddTags(BankStaffTag);
+            backOfficeStaff.Uses(mainframeBankingSystem, "Uses");
+
+            // containers
+            Container singlePageApplication = internetBankingSystem.AddContainer("Single-Page Application", "Provides all of the Internet banking functionality to customers via their web browser.", "JavaScript and Angular");
+            singlePageApplication.AddTags(WebBrowserTag);
+            Container mobileApp = internetBankingSystem.AddContainer("Mobile App", "Provides a limited subset of the Internet banking functionality to customers via their mobile device.", "Xamarin");
+            mobileApp.AddTags(MobileAppTag);
+            Container webApplication = internetBankingSystem.AddContainer("Web Application", "Delivers the static content and the Internet banking single page application.", "Java and Spring MVC");
+            Container apiApplication = internetBankingSystem.AddContainer("API Application", "Provides Internet banking functionality via a JSON/HTTPS API.", "Java and Spring MVC");
+            Container database = internetBankingSystem.AddContainer("Database", "Stores user registration information, hashed authentication credentials, access logs, etc.", "Relational Database Schema");
+            database.AddTags(DatabaseTag);
+
+            customer.Uses(webApplication, "Visits bigbank.com/ib using", "HTTPS");
+            customer.Uses(singlePageApplication, "Views account balances, and makes payments using", "");
+            customer.Uses(mobileApp, "Views account balances, and makes payments using", "");
+            webApplication.Uses(singlePageApplication, "Delivers to the customer's web browser", "");
+            apiApplication.Uses(database, "Reads from and writes to", "JDBC");
+            apiApplication.Uses(mainframeBankingSystem, "Makes API calls to", "XML/HTTPS");
+            apiApplication.Uses(emailSystem, "Sends e-mail using", "SMTP");
+
+            // components
+            // - for a real-world software system, you would probably want to extract the components using
+            // - static analysis/reflection rather than manually specifying them all
+            Component signinController = apiApplication.AddComponent("Sign In Controller", "Allows users to sign in to the Internet Banking System.", "Spring MVC Rest Controller");
+            Component accountsSummaryController = apiApplication.AddComponent("Accounts Summary Controller", "Provides customers with a summary of their bank accounts.", "Spring MVC Rest Controller");
+            Component resetPasswordController = apiApplication.AddComponent("Reset Password Controller", "Allows users to reset their passwords with a single use URL.", "Spring MVC Rest Controller");
+            Component securityComponent = apiApplication.AddComponent("Security Component", "Provides functionality related to signing in, changing passwords, etc.", "Spring Bean");
+            Component mainframeBankingSystemFacade = apiApplication.AddComponent("Mainframe Banking System Facade", "A facade onto the mainframe banking system.", "Spring Bean");
+            Component emailComponent = apiApplication.AddComponent("E-mail Component", "Sends e-mails to users.", "Spring Bean");
+
+            apiApplication.Components.Where(c => "Spring MVC Rest Controller".Equals(c.Technology)).ToList().ForEach(c => singlePageApplication.Uses(c, "Makes API calls to", "JSON/HTTPS"));
+            apiApplication.Components.Where(c => "Spring MVC Rest Controller".Equals(c.Technology)).ToList().ForEach(c => mobileApp.Uses(c, "Makes API calls to", "JSON/HTTPS"));
+            signinController.Uses(securityComponent, "Uses");
+            accountsSummaryController.Uses(mainframeBankingSystemFacade, "Uses");
+            resetPasswordController.Uses(securityComponent, "Uses");
+            resetPasswordController.Uses(emailComponent, "Uses");
+            securityComponent.Uses(database, "Reads from and writes to", "JDBC");
+            mainframeBankingSystemFacade.Uses(mainframeBankingSystem, "Uses", "XML/HTTPS");
+            emailComponent.Uses(emailSystem, "Sends e-mail using");
+
+            // deployment nodes and container instances
+            DeploymentNode developerLaptop = model.AddDeploymentNode("Development", "Developer Laptop", "A developer laptop.", "Microsoft Windows 10 or Apple macOS");
+            DeploymentNode apacheTomcat = developerLaptop
+                .AddDeploymentNode("Docker Container - Web Server", "A Docker container.", "Docker")
+                .AddDeploymentNode("Apache Tomcat", "An open source Java EE web server.", "Apache Tomcat 8.x", 1, DictionaryUtils.Create("Xmx=512M", "Xms=1024M", "Java Version=8"));
+            ContainerInstance developmentWebApplication = apacheTomcat.Add(webApplication);
+            ContainerInstance developmentApiApplication = apacheTomcat.Add(apiApplication);
+
+            DeploymentNode bigBankDataCenterForDevelopment = model.AddDeploymentNode("Development", "Big Bank plc", "", "Big Bank plc data center");
+            SoftwareSystemInstance developmentMainframeBankingSystem = bigBankDataCenterForDevelopment
+                .AddDeploymentNode("bigbank-dev001").Add(mainframeBankingSystem);
+
+            ContainerInstance developmentDatabase = developerLaptop
+                .AddDeploymentNode("Docker Container - Database Server", "A Docker container.", "Docker")
+                .AddDeploymentNode("Database Server", "A development database.", "Oracle 12c")
+                .Add(database);
+
+            ContainerInstance developmentSinglePageApplication = developerLaptop
+                .AddDeploymentNode("Web Browser", "", "Chrome, Firefox, Safari, or Edge")
+                .Add(singlePageApplication);
+
+            DeploymentNode customerMobileDevice = model.AddDeploymentNode("Live", "Customer's mobile device", "", "Apple iOS or Android");
+            ContainerInstance liveMobileApp = customerMobileDevice.Add(mobileApp);
+
+            DeploymentNode customerComputer = model.AddDeploymentNode("Live", "Customer's computer", "", "Microsoft Windows or Apple macOS");
+            ContainerInstance liveSinglePageApplication = customerComputer
+                .AddDeploymentNode("Web Browser", "", "Chrome, Firefox, Safari, or Edge")
+                .Add(singlePageApplication);
+
+            DeploymentNode bigBankDataCenterForLive =
+                model.AddDeploymentNode("Live", "Big Bank plc", "", "Big Bank plc data center");
+            SoftwareSystemInstance liveMainframeBankingSystem = bigBankDataCenterForLive
+                .AddDeploymentNode("bigbank-prod001").Add(mainframeBankingSystem);
+
+            DeploymentNode liveWebServer = bigBankDataCenterForLive.AddDeploymentNode("bigbank-web***", "A web server residing in the web server farm, accessed via F5 BIG-IP LTMs.", "Ubuntu 16.04 LTS", 4, DictionaryUtils.Create("Location=London and Reading"));
+            ContainerInstance liveWebApplication = liveWebServer.AddDeploymentNode("Apache Tomcat", "An open source Java EE web server.", "Apache Tomcat 8.x", 1, DictionaryUtils.Create("Xmx=512M", "Xms=1024M", "Java Version=8"))
+                .Add(webApplication);
+
+            DeploymentNode liveApiServer = bigBankDataCenterForLive.AddDeploymentNode("bigbank-api***", "A web server residing in the web server farm, accessed via F5 BIG-IP LTMs.", "Ubuntu 16.04 LTS", 8, DictionaryUtils.Create("Location=London and Reading"));
+            ContainerInstance liveApiApplication = liveApiServer.AddDeploymentNode("Apache Tomcat", "An open source Java EE web server.", "Apache Tomcat 8.x", 1, DictionaryUtils.Create("Xmx=512M", "Xms=1024M", "Java Version=8"))
+                .Add(apiApplication);
+
+            DeploymentNode primaryDatabaseServer = bigBankDataCenterForLive
+                .AddDeploymentNode("bigbank-db01", "The primary database server.", "Ubuntu 16.04 LTS", 1, DictionaryUtils.Create("Location=London"))
+                .AddDeploymentNode("Oracle - Primary", "The primary, live database server.", "Oracle 12c");
+            ContainerInstance livePrimaryDatabase = primaryDatabaseServer.Add(database);
+
+            DeploymentNode bigBankdb02 = bigBankDataCenterForLive.AddDeploymentNode("bigbank-db02", "The secondary database server.", "Ubuntu 16.04 LTS", 1, DictionaryUtils.Create("Location=Reading"));
+            bigBankdb02.AddTags(FailoverTag);
+            DeploymentNode secondaryDatabaseServer = bigBankdb02.AddDeploymentNode("Oracle - Secondary", "A secondary, standby database server, used for failover purposes only.", "Oracle 12c");
+            secondaryDatabaseServer.AddTags(FailoverTag);
+            ContainerInstance liveSecondaryDatabase = secondaryDatabaseServer.Add(database);
+
+            model.Relationships.Where(r => r.Destination.Equals(liveSecondaryDatabase)).ToList().ForEach(r => r.AddTags(FailoverTag));
+            Relationship dataReplicationRelationship = primaryDatabaseServer.Uses(secondaryDatabaseServer, "Replicates data to", "");
+            liveSecondaryDatabase.AddTags(FailoverTag);
+
+            // views/diagrams
+            SystemLandscapeView systemLandscapeView = views.CreateSystemLandscapeView("SystemLandscape", "The system landscape diagram for Big Bank plc.");
+            systemLandscapeView.AddAllElements();
+            systemLandscapeView.PaperSize = PaperSize.A5_Landscape;
+
+            SystemContextView systemContextView = views.CreateSystemContextView(internetBankingSystem, "SystemContext", "The system context diagram for the Internet Banking System.");
+            systemContextView.EnterpriseBoundaryVisible = false;
+            systemContextView.AddNearestNeighbours(internetBankingSystem);
+            systemContextView.PaperSize = PaperSize.A5_Landscape;
+
+            ContainerView containerView = views.CreateContainerView(internetBankingSystem, "Containers", "The container diagram for the Internet Banking System.");
+            containerView.Add(customer);
+            containerView.AddAllContainers();
+            containerView.Add(mainframeBankingSystem);
+            containerView.Add(emailSystem);
+            containerView.PaperSize = PaperSize.A5_Landscape;
+
+            ComponentView componentView = views.CreateComponentView(apiApplication, "Components", "The component diagram for the API Application.");
+            componentView.Add(mobileApp);
+            componentView.Add(singlePageApplication);
+            componentView.Add(database);
+            componentView.AddAllComponents();
+            componentView.Add(mainframeBankingSystem);
+            componentView.Add(emailSystem);
+            componentView.PaperSize = PaperSize.A5_Landscape;
+
+            systemLandscapeView.AddAnimation(internetBankingSystem, customer, mainframeBankingSystem, emailSystem);
+            systemLandscapeView.AddAnimation(atm);
+            systemLandscapeView.AddAnimation(customerServiceStaff, backOfficeStaff);
+
+            systemContextView.AddAnimation(internetBankingSystem);
+            systemContextView.AddAnimation(customer);
+            systemContextView.AddAnimation(mainframeBankingSystem);
+            systemContextView.AddAnimation(emailSystem);
+
+            containerView.AddAnimation(customer, mainframeBankingSystem, emailSystem);
+            containerView.AddAnimation(webApplication);
+            containerView.AddAnimation(singlePageApplication);
+            containerView.AddAnimation(mobileApp);
+            containerView.AddAnimation(apiApplication);
+            containerView.AddAnimation(database);
+
+            componentView.AddAnimation(singlePageApplication, mobileApp);
+            componentView.AddAnimation(signinController, securityComponent, database);
+            componentView.AddAnimation(accountsSummaryController, mainframeBankingSystemFacade, mainframeBankingSystem);
+            componentView.AddAnimation(resetPasswordController, emailComponent, database);
+
+            // dynamic diagrams and deployment diagrams are not available with the Free Plan
+            DynamicView dynamicView = views.CreateDynamicView(apiApplication, "SignIn", "Summarises how the sign in feature works in the single-page application.");
+            dynamicView.Add(singlePageApplication, "Submits credentials to", signinController);
+            dynamicView.Add(signinController, "Calls isAuthenticated() on", securityComponent);
+            dynamicView.Add(securityComponent, "select * from users where username = ?", database);
+            dynamicView.PaperSize = PaperSize.A5_Landscape;
+
+            DeploymentView developmentDeploymentView = views.CreateDeploymentView(internetBankingSystem, "DevelopmentDeployment", "An example development deployment scenario for the Internet Banking System.");
+            developmentDeploymentView.Environment = "Development";
+            developmentDeploymentView.Add(developerLaptop);
+            developmentDeploymentView.Add(bigBankDataCenterForDevelopment);
+            developmentDeploymentView.PaperSize = PaperSize.A5_Landscape;
+
+            developmentDeploymentView.AddAnimation(developmentSinglePageApplication);
+            developmentDeploymentView.AddAnimation(developmentWebApplication, developmentApiApplication);
+            developmentDeploymentView.AddAnimation(developmentDatabase);
+            //developmentDeploymentView.AddAnimation(developmentMainframeBankingSystem);
+
+            DeploymentView liveDeploymentView = views.CreateDeploymentView(internetBankingSystem, "LiveDeployment", "An example live deployment scenario for the Internet Banking System.");
+            liveDeploymentView.Environment = "Live";
+            liveDeploymentView.Add(bigBankDataCenterForLive);
+            liveDeploymentView.Add(customerMobileDevice);
+            liveDeploymentView.Add(customerComputer);
+            liveDeploymentView.Add(dataReplicationRelationship);
+            liveDeploymentView.PaperSize = PaperSize.A5_Landscape;
+
+            liveDeploymentView.AddAnimation(liveSinglePageApplication);
+            liveDeploymentView.AddAnimation(liveMobileApp);
+            liveDeploymentView.AddAnimation(liveWebApplication, liveApiApplication);
+            liveDeploymentView.AddAnimation(livePrimaryDatabase);
+            liveDeploymentView.AddAnimation(liveSecondaryDatabase);
+            //liveDeploymentView.AddAnimation(liveMainframeBankingSystem);
+
+            // colours, shapes and other diagram styling
+            Styles styles = views.Configuration.Styles;
+            styles.Add(new ElementStyle(Tags.SoftwareSystem) { Background = "#1168bd", Color = "#ffffff" });
+            styles.Add(new ElementStyle(Tags.Container) { Background = "#438dd5", Color = "#ffffff" });
+            styles.Add(new ElementStyle(Tags.Component) { Background = "#85bbf0", Color = "#000000" });
+            styles.Add(new ElementStyle(Tags.Person) { Background = "#08427b", Color = "#ffffff", Shape = Shape.Person, FontSize = 22 });
+            styles.Add(new ElementStyle(ExistingSystemTag) { Background = "#999999", Color = "#ffffff" });
+            styles.Add(new ElementStyle(BankStaffTag) { Background = "#999999", Color = "#ffffff" });
+            styles.Add(new ElementStyle(WebBrowserTag) { Shape = Shape.WebBrowser });
+            styles.Add(new ElementStyle(MobileAppTag) { Shape = Shape.MobileDeviceLandscape });
+            styles.Add(new ElementStyle(DatabaseTag) { Shape = Shape.Cylinder });
+            styles.Add(new ElementStyle(FailoverTag) { Opacity = 25 });
+            styles.Add(new RelationshipStyle(FailoverTag) {Opacity = 25, Position = 70 });
+
+            // documentation
+            // - usually the documentation would be included from separate Markdown/AsciiDoc files, but this is just an example
+            StructurizrDocumentationTemplate template = new StructurizrDocumentationTemplate(workspace);
+            template.AddContextSection(internetBankingSystem, Format.Markdown,
+                "Here is some context about the Internet Banking System...\n" +
+                "![](embed:SystemLandscape)\n" +
+                "![](embed:SystemContext)\n" +
+                "### Internet Banking System\n...\n" +
+                "### Mainframe Banking System\n...\n");
+            template.AddContainersSection(internetBankingSystem, Format.Markdown,
+                "Here is some information about the containers within the Internet Banking System...\n" +
+                "![](embed:Containers)\n" +
+                "### Web Application\n...\n" +
+                "### Database\n...\n");
+            template.AddComponentsSection(webApplication, Format.Markdown,
+                "Here is some information about the API Application...\n" +
+                "![](embed:Components)\n" +
+                "### Sign in process\n" +
+                "Here is some information about the Sign In Controller, including how the sign in process works...\n" +
+                "![](embed:SignIn)");
+            template.AddDevelopmentEnvironmentSection(internetBankingSystem, Format.AsciiDoc,
+                "Here is some information about how to set up a development environment for the Internet Banking System...\n" +
+                "image::embed:DevelopmentDeployment[]");
+            template.AddDeploymentSection(internetBankingSystem, Format.AsciiDoc,
+                "Here is some information about the live deployment environment for the Internet Banking System...\n" +
+                "image::embed:LiveDeployment[]");
+
+            return workspace;
         }
-
+
         static void Main()
         {
             StructurizrClient structurizrClient = new StructurizrClient(ApiKey, ApiSecret);
             structurizrClient.PutWorkspace(WorkspaceId, Create());
         }
+
     }
+
 }


Add<TComponent> now auto names entity

Add<TComponent> now auto names entity

Since this is specifically for spawning instances of a component under an entity, added a default name for these entities to make them identifiable

--- System/Internal/EntityContainer.cs
+++ System/Internal/EntityContainer.cs
@@ -74,6 +74,8 @@
         public TComponent Add<TComponent>() where  TComponent : IComponent, new()
         {
             Entity entity = new Entity();
+            entity.Name = typeof(TComponent).Name;
+
             TComponent com = entity.AddComponent<TComponent>();
             entity.SetParent(this);
             return com;


Switch ArrayPalette.DistanceSquared to private

--- TAUtil.Gdi/Palette/ArrayPalette.cs
+++ TAUtil.Gdi/Palette/ArrayPalette.cs
@@ -78,7 +78,7 @@
             return this.GetEnumerator();
         }

-        public static int DistanceSquared(Color c1, Color c2)
+        private static int DistanceSquared(Color c1, Color c2)
         {
             int dr = c2.R - c1.R;
             int dg = c2.G - c1.G;


Modify test

Modify test

--- TMDbLibTests/ClientAccountTests.cs
+++ TMDbLibTests/ClientAccountTests.cs
@@ -77,7 +77,7 @@

             Assert.IsNotNull(list.Id);
             Assert.IsNotNull(list.Name);
-            Assert.IsNotNull(list.PosterPath);
+            Assert.IsNull(list.PosterPath);
             Assert.IsNotNull(list.Description);
             Assert.IsNotNull(list.ListType);
             Assert.IsNotNull(list.Iso_639_1);


onepackage - add version of requestid for system.web.httprequest

--- jsnlog/PublicFacing/Configuration/JavascriptLogging.cs
+++ jsnlog/PublicFacing/Configuration/JavascriptLogging.cs
@@ -73,6 +73,11 @@
         {
             return System.Web.HttpContext.Current.Wrapper().RequestId();
         }
+
+        public static string RequestId(this System.Web.HttpContext httpContext)
+        {
+            return httpContext.Wrapper().RequestId();
+        }
 #endif

         public static string RequestId(this Microsoft.AspNetCore.Http.HttpContext httpContext)


Fixed nPython.exe crash on Shutdown

Fixed nPython.exe crash on Shutdown

--- src/runtime/finalizer.cs
+++ src/runtime/finalizer.cs
@@ -80,6 +80,11 @@

         internal static void Shutdown()
         {
+            if (Runtime.Py_IsInitialized() == 0)
+            {
+                Instance._objQueue = new ConcurrentQueue<IDisposable>();
+                return;
+            }
             Instance.DisposeAll();
             Instance.CallPendingFinalizers();
             Runtime.PyErr_Clear();


Updating the NuGetHelper class to be able to find packages without version numbers in the path

references #261

--- src/nbuildkit/tasks/nBuildKit.MsBuild.Tasks/NugetHelpers.cs
+++ src/nbuildkit/tasks/nBuildKit.MsBuild.Tasks/NugetHelpers.cs
@@ -26,7 +26,7 @@
             var potentialPaths = packagesInfo.EnumerateDirectories(
                     string.Format(
                         CultureInfo.InvariantCulture,
-                        "{0}.*",
+                        "{0}*",
                         packageName),
                     SearchOption.TopDirectoryOnly);
             logger(
@@ -39,9 +39,17 @@

             string selectedPath = null;
             var selectedVersion = new Version();
+
+            var nonVersionPath = string.Empty;
             foreach (var path in potentialPaths)
             {
                 var versionText = path.Name.Substring(packageName.Length).Trim('.').Trim();
+                if (string.IsNullOrEmpty(versionText))
+                {
+                    // There can only be one path that matches the package name and doesn't have a version
+                    // number in the path
+                    nonVersionPath = path.FullName;
+                }

                 Version packageVersion;
                 if (!Version.TryParse(versionText, out packageVersion))
@@ -73,6 +81,11 @@
                 }
             }

+            if ((selectedPath == null) && !string.IsNullOrEmpty(nonVersionPath))
+            {
+                selectedPath = nonVersionPath;
+            }
+
             return selectedPath;
         }
     }


Check for AWS environment variables before getting into greetings

--- swag-sync/swag-sync/Program.cs
+++ swag-sync/swag-sync/Program.cs
@@ -1,6 +1,8 @@
 namespace swag
 {
     using System;
+    using System.Security;
+    using System.Diagnostics;

     class Program
     {
@@ -16,6 +18,37 @@
                     Console.WriteLine("Try: swag-sync --help");
                 }

+                return 1;
+            }
+
+            using (var console_listener = new ConsoleTraceListener())
+            {
+                console_listener.TraceOutputOptions |= TraceOptions.ProcessId;
+                console_listener.TraceOutputOptions |= TraceOptions.ThreadId;
+                console_listener.TraceOutputOptions |= TraceOptions.DateTime;
+                console_listener.TraceOutputOptions |= TraceOptions.Callstack;
+                Trace.Listeners.Add(console_listener);
+            }
+
+            string access_key = string.Empty;
+            string secret_key = string.Empty;
+
+            try
+            {
+                access_key = Environment.GetEnvironmentVariable("AWS_ACCESS_KEY_ID");
+                access_key = Environment.GetEnvironmentVariable("AWS_SECRET_ACCESS_KEY");
+            }
+            catch(SecurityException ex)
+            {
+                Trace.TraceError("Unable to access environment variables: {0}", ex.Message);
+                return 1;
+            }
+
+            if (string.IsNullOrWhiteSpace(access_key) ||
+                string.IsNullOrWhiteSpace(secret_key))
+            {
+                Trace.TraceError("You need to define {0} and {1} environment variables!",
+                    "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY");
                 return 1;
             }


More C# JsonExtensions tests

More C# JsonExtensions tests

--- tests/FSharp.Data.Tests.CSharp/JsonExtensionsTests.cs
+++ tests/FSharp.Data.Tests.CSharp/JsonExtensionsTests.cs
@@ -8,17 +8,42 @@
     [TestFixture]
     public class JsonExtensionTests
     {
+        private const string TestJson = "{\"PropertyOne\": \"string value\"}";
+
         [Test]
         public void Properties_with_valid_JSON()
         {
-            const string jsonWithProps = "{\"PropertyOne\": \"string value\"}";
-            JsonValue jsonValue = JsonValue.Parse(jsonWithProps, FSharpOption<CultureInfo>.Some(CultureInfo.CurrentCulture));
+            JsonValue jsonValue = JsonValue.Parse(TestJson, FSharpOption<CultureInfo>.Some(CultureInfo.CurrentCulture));

             var properties = jsonValue.Properties();

             Assert.AreEqual(1, properties.Length);
             Assert.AreEqual("PropertyOne", properties[0].Item1);
             Assert.AreEqual("string value", properties[0].Item2.AsString());
+        }
+
+        [Test]
+        public void GetProperty_with_valid_JSON()
+        {
+            JsonValue jsonValue = JsonValue.Parse(TestJson, FSharpOption<CultureInfo>.Some(CultureInfo.CurrentCulture));
+            var property = jsonValue.GetProperty("PropertyOne");
+            Assert.AreEqual("string value", property.AsString());
+        }
+
+        [Test]
+        public void TryGetProperty_with_valid_JSON()
+        {
+            JsonValue jsonValue = JsonValue.Parse(TestJson, FSharpOption<CultureInfo>.Some(CultureInfo.CurrentCulture));
+            var property = jsonValue.TryGetProperty("PropertyTwo");
+            Assert.AreEqual(FSharpOption<JsonValue>.None, property);
+        }
+
+        [Test]
+        public void PropertyIndexer_with_valid_JSON()
+        {
+            var jsonValue = JsonValue.NewArray(new[] {JsonValue.NewNumber(1), JsonValue.NewNumber(2)});
+            var property = jsonValue.Item(0);
+            Assert.AreEqual(1, property.AsInteger());
         }

         [Test]


tests

tests

--- tests/UnitTests/Inspectors/Types/MemberEventsFacts.cs
+++ tests/UnitTests/Inspectors/Types/MemberEventsFacts.cs
@@ -26,7 +26,7 @@
 				.InspectedBy(new EventsAdded())
 				.Build();

-			Assert.Equal(1, delta.Changes.Count);
+			Assert.Single(delta.Changes);
 		}

 		[Fact]


Remove unused member in TextureAtlas

Remove unused member in TextureAtlas

--- osu.Framework/Graphics/Textures/TextureAtlas.cs
+++ osu.Framework/Graphics/Textures/TextureAtlas.cs
@@ -28,8 +28,6 @@
         private readonly int atlasHeight;

         private Vector2I currentPosition;
-
-        private int mipmapLevels => (int)Math.Log(atlasWidth, 2);

         internal TextureWhitePixel WhitePixel
         {


Remove double set of same property

Remove double set of same property

--- osu.Framework/Graphics/Textures/TextureStore.cs
+++ osu.Framework/Graphics/Textures/TextureStore.cs
@@ -52,8 +52,6 @@
             var glTexture = atlas != null ? atlas.Add(raw.Width, raw.Height) : new TextureGLSingle(raw.Width, raw.Height, manualMipmaps, filteringMode);

             Texture tex = new Texture(glTexture) { ScaleAdjust = ScaleAdjust };
-
-            tex.ScaleAdjust = ScaleAdjust;
             tex.SetData(new TextureUpload(raw));

             return tex;


Refactor TextBox for better extensibility

--- osu.Framework/Graphics/UserInterface/TextBox.cs
+++ osu.Framework/Graphics/UserInterface/TextBox.cs
@@ -23,10 +23,10 @@
 {
     public class TextBox : Container
     {
-        private FlowContainer textFlow;
-        private Box background;
-        private Box cursor;
-        private Container textContainer;
+        protected FlowContainer TextFlow;
+        protected Box Background;
+        protected Box Caret;
+        protected Container TextContainer;

         public int? LengthLimit;

@@ -65,27 +65,28 @@

             Add(new Drawable[]
             {
-                background = new Box
+                Background = new Box
                 {
                     Colour = BackgroundUnfocused,
                     RelativeSizeAxes = Axes.Both,
                 },
-                textContainer = new Container
+                TextContainer = new Container
                 {
                     RelativeSizeAxes = Axes.Both,
                     Children = new Drawable[]
                     {
-                        cursor = new Box
+                        Caret = new Box
                         {
                             Size = Vector2.One,
                             Colour = Color4.Transparent,
                             RelativeSizeAxes = Axes.Y,
                             Alpha = 0,
                         },
-                        textFlow = new FlowContainer
+                        TextFlow = new FlowContainer
                         {
                             Direction = FlowDirection.HorizontalOnly,
-                            AutoSizeAxes = Axes.Both,
+                            AutoSizeAxes = Axes.X,
+                            RelativeSizeAxes = Axes.Y,
                         },
                     },
                 },
@@ -163,26 +164,26 @@
                     textContainerPosX = cursorPosEnd - DrawWidth / 2;
                 }

-                textContainerPosX = MathHelper.Clamp(textContainerPosX, 0, Math.Max(0, textFlow.DrawWidth - DrawWidth));
-
-                textContainer.MoveToX(-textContainerPosX, 300, EasingTypes.OutExpo);
+                textContainerPosX = MathHelper.Clamp(textContainerPosX, 0, Math.Max(0, TextFlow.DrawWidth - DrawWidth));
+
+                TextContainer.MoveToX(-textContainerPosX, 300, EasingTypes.OutExpo);

                 if (HasFocus)
                 {
-                    cursor.ClearTransformations();
-                    cursor.MoveTo(cursorPos, 60, EasingTypes.Out);
-                    cursor.ScaleTo(new Vector2(cursorWidth, 1), 60, EasingTypes.Out);
+                    Caret.ClearTransformations();
+                    Caret.MoveTo(cursorPos, 60, EasingTypes.Out);
+                    Caret.ScaleTo(new Vector2(cursorWidth, 1), 60, EasingTypes.Out);

                     if (selectionLength > 0)
                     {
-                        cursor.FadeTo(0.5f, 200, EasingTypes.Out);
-                        cursor.FadeColour(new Color4(249, 90, 255, 255), 200, EasingTypes.Out);
+                        Caret.FadeTo(0.5f, 200, EasingTypes.Out);
+                        Caret.FadeColour(new Color4(249, 90, 255, 255), 200, EasingTypes.Out);
                     }
                     else
                     {
-                        cursor.FadeTo(0.5f, 200, EasingTypes.Out);
-                        cursor.FadeColour(Color4.White, 200, EasingTypes.Out);
-                        cursor.Transforms.Add(new TransformAlpha
+                        Caret.FadeTo(0.5f, 200, EasingTypes.Out);
+                        Caret.FadeColour(Color4.White, 200, EasingTypes.Out);
+                        Caret.Transforms.Add(new TransformAlpha
                         {
                             StartValue = 0.5f,
                             EndValue = 0.2f,
@@ -206,19 +207,19 @@
             if (index > 0)
             {
                 if (index < InternalText.Length)
-                    return textFlow.Children.ElementAt(index).DrawPosition.X + textFlow.DrawPosition.X;
-                var d = textFlow.Children.ElementAt(index - 1);
-                return d.DrawPosition.X + d.DrawSize.X + textFlow.Spacing.X + textFlow.DrawPosition.X;
+                    return TextFlow.Children.ElementAt(index).DrawPosition.X + TextFlow.DrawPosition.X;
+                var d = TextFlow.Children.ElementAt(index - 1);
+                return d.DrawPosition.X + d.DrawSize.X + TextFlow.Spacing.X + TextFlow.DrawPosition.X;
             }
             return 0;
         }

         private int getCharacterClosestTo(Vector2 pos)
         {
-            pos = textFlow.ToLocalSpace(pos * DrawInfo.Matrix);
+            pos = TextFlow.ToLocalSpace(pos * DrawInfo.Matrix);

             int i = 0;
-            foreach (Drawable d in textFlow.Children)
+            foreach (Drawable d in TextFlow.Children)
             {
                 if (d.DrawPosition.X + d.DrawSize.X / 2 > pos.X)
                     break;
@@ -281,11 +282,11 @@
             if (sound)
                 audio.Sample.Get(@"Keyboard/key-delete")?.Play();

-            foreach (var d in textFlow.Children.Skip(start).Take(count).ToArray()) //ToArray since we are removing items from the children in this block.
-            {
-                textFlow.Remove(d);
-
-                textContainer.Add(d);
+            foreach (var d in TextFlow.Children.Skip(start).Take(count).ToArray()) //ToArray since we are removing items from the children in this block.
+            {
+                TextFlow.Remove(d);
+
+                TextContainer.Add(d);
                 d.FadeOut(200);
                 d.MoveToY(d.DrawSize.Y, 200, EasingTypes.InExpo);
                 d.Expire();
@@ -307,9 +308,9 @@
             // Remove all characters to the right and store them in a local list,
             // such that their depth can be updated.
             List<Drawable> charsRight = new List<Drawable>();
-            foreach (Drawable d in textFlow.Children.Skip(selectionLeft))
+            foreach (Drawable d in TextFlow.Children.Skip(selectionLeft))
                 charsRight.Add(d);
-            textFlow.Remove(charsRight);
+            TextFlow.Remove(charsRight);

             // Update their depth to make room for the to-be inserted character.
             int i = -selectionLeft;
@@ -318,15 +319,15 @@

             // Add the character
             Drawable ch;
-            textFlow.Add(ch = new SpriteText
+            TextFlow.Add(ch = new SpriteText
             {
                 Text = c.ToString(),
-                TextSize = DrawSize.Y,
+                TextSize = TextFlow.DrawSize.Y - (TextFlow.Padding.Top + TextFlow.Padding.Bottom),
                 Depth = -selectionLeft,
             });

             // Add back all the previously removed characters
-            textFlow.Add(charsRight);
+            TextFlow.Add(charsRight);

             return ch;
         }
@@ -352,10 +353,10 @@

             if (InternalText.Length + 1 > LengthLimit)
             {
-                if (background.Alpha > 0)
-                    background.FlashColour(Color4.Red, 200);
+                if (Background.Alpha > 0)
+                    Background.FlashColour(Color4.Red, 200);
                 else
-                    textFlow.FlashColour(Color4.Red, 200);
+                    TextFlow.FlashColour(Color4.Red, 200);
                 return null;
             }

@@ -394,7 +395,7 @@
                 {
                     int startBefore = selectionStart;
                     selectionStart = selectionEnd = 0;
-                    textFlow?.Clear();
+                    TextFlow?.Clear();
                     InternalText = string.Empty;

                     foreach (char c in value)
@@ -684,22 +685,22 @@
         {
             unbindInput();

-            cursor.ClearTransformations();
-            cursor.FadeOut(200);
+            Caret.ClearTransformations();
+            Caret.FadeOut(200);

             if (state.Keyboard.Keys.Contains(Key.Enter))
             {
-                background.Colour = BackgroundUnfocused;
-                background.ClearTransformations();
-                background.FlashColour(BackgroundCommit, 400);
+                Background.Colour = BackgroundUnfocused;
+                Background.ClearTransformations();
+                Background.FlashColour(BackgroundCommit, 400);

                 audio.Sample.Get(@"Keyboard/key-confirm")?.Play();
                 OnCommit?.Invoke(this, true);
             }
             else
             {
-                background.ClearTransformations();
-                background.FadeColour(BackgroundUnfocused, 200, EasingTypes.OutExpo);
+                Background.ClearTransformations();
+                Background.FadeColour(BackgroundUnfocused, 200, EasingTypes.OutExpo);
             }

             cursorAndLayout.Invalidate();
@@ -711,8 +712,8 @@

             bindInput();

-            background.ClearTransformations();
-            background.FadeColour(BackgroundFocused, 200, EasingTypes.Out);
+            Background.ClearTransformations();
+            Background.FadeColour(BackgroundFocused, 200, EasingTypes.Out);

             cursorAndLayout.Invalidate();
             return true;


Fix osu! mode adding combos twice.

Fix osu! mode adding combos twice.

--- osu.Game.Modes.Osu/Scoring/OsuScoreProcessor.cs
+++ osu.Game.Modes.Osu/Scoring/OsuScoreProcessor.cs
@@ -30,21 +30,6 @@

         protected override void OnNewJudgement(OsuJudgement judgement)
         {
-            if (judgement != null)
-            {
-                switch (judgement.Result)
-                {
-                    case HitResult.Hit:
-                        Combo.Value++;
-                        Health.Value += 0.1f;
-                        break;
-                    case HitResult.Miss:
-                        Combo.Value = 0;
-                        Health.Value -= 0.2f;
-                        break;
-                }
-            }
-
             int score = 0;
             int maxScore = 0;


Always use live queries to ensure waiting asserts actually get dynamic data

--- osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs
+++ osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs
@@ -117,22 +117,27 @@
             //ensure we were stored to beatmap database backing...
             Assert.IsTrue(resultSets.Count() == 1, $@"Incorrect result count found ({resultSets.Count()} but should be 1).");

-            IEnumerable<BeatmapInfo> resultBeatmaps = null;
-            IEnumerable<BeatmapSetInfo> resultBeatmapSet = null;
+            Func<IEnumerable<BeatmapInfo>> queryBeatmaps = () => store.QueryBeatmaps(s => s.OnlineBeatmapSetID == 241526 && s.BaseDifficultyID > 0);
+            Func<IEnumerable<BeatmapSetInfo>> queryBeatmapSets = () => store.QueryBeatmapSets(s => s.OnlineBeatmapSetID == 241526);

             //if we don't re-check here, the set will be inserted but the beatmaps won't be present yet.
-            waitForOrAssert(() => (resultBeatmaps = store.QueryBeatmaps(s => s.OnlineBeatmapSetID == 241526 && s.BaseDifficultyID > 0)).Count() == 12,
+            waitForOrAssert(() => queryBeatmaps().Count() == 12,
                 @"Beatmaps did not import to the database in allocated time", timeout);

-            waitForOrAssert(() => (resultBeatmapSet = store.QueryBeatmapSets(s => s.OnlineBeatmapSetID == 241526)).Count() == 1,
+            waitForOrAssert(() => queryBeatmapSets().Count() == 1,
                 @"BeatmapSet did not import to the database in allocated time", timeout);

-            var set = resultBeatmapSet.First();
+            int countBeatmapSetBeatmaps = 0;
+            int countBeatmaps = 0;

-            waitForOrAssert(() => set.Beatmaps.Count == resultBeatmaps.Count(),
-                $@"Incorrect database beatmap count post-import ({resultBeatmaps.Count()} but should be {set.Beatmaps.Count}).", timeout);
+            waitForOrAssert(() =>
+                (countBeatmapSetBeatmaps = queryBeatmapSets().First().Beatmaps.Count) ==
+                (countBeatmaps = queryBeatmaps().Count()),
+                $@"Incorrect database beatmap count post-import ({countBeatmaps} but should be {countBeatmapSetBeatmaps}).", timeout);

-            foreach (BeatmapInfo b in resultBeatmaps)
+            var set = queryBeatmapSets().First();
+
+            foreach (BeatmapInfo b in set.Beatmaps)
                 Assert.IsTrue(set.Beatmaps.Any(c => c.OnlineBeatmapID == b.OnlineBeatmapID));

             Assert.IsTrue(set.Beatmaps.Count > 0);


Remove unnecessary `virtual` spec from `GameplayClockContainer.Seek`

--- osu.Game/Screens/Play/GameplayClockContainer.cs
+++ osu.Game/Screens/Play/GameplayClockContainer.cs
@@ -111,7 +111,7 @@
         /// Seek to a specific time in gameplay.
         /// </summary>
         /// <param name="time">The destination time to seek to.</param>
-        public virtual void Seek(double time)
+        public void Seek(double time)
         {
             Logger.Log($"{nameof(GameplayClockContainer)} seeking to {time}");