Renamed some properties

Renamed some properties

--- UltimateTeam.Toolkit/Models/ItemData.cs
+++ UltimateTeam.Toolkit/Models/ItemData.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
 using UltimateTeam.Toolkit.Parameters;

 namespace UltimateTeam.Toolkit.Models
@@ -75,25 +75,25 @@

         public int Nation { get; set; }

-        public long cardassetid { get; set; }
+        public long CardAssetId { get; set; }

-        public long value { get; set; }
+        public long Value { get; set; }

-        public string name { get; set; }
+        public string Name { get; set; }

-        public string category { get; set; }
+        public string Category { get; set; }

-        public int marketDataMaxPrice { get; set; }
+        public int MarketDataMaxPrice { get; set; }

-        public int marketDataMinPrice { get; set; }
+        public int MarketDataMinPrice { get; set; }

-        public int weightrare { get; set; }
+        public int WeightRare { get; set; }

-        public int bronze { get; set; }
+        public int Bronze { get; set; }

-        public int silver { get; set; }
+        public int Silver { get; set; }

-        public int gold { get; set; }
+        public int Gold { get; set; }

         public int Amount { get; set; }

@@ -103,16 +103,14 @@

         public string Negotiation { get; set; }

-        public string biodescription { get; set; }
+        public string BioDescription { get; set; }

-        public long stadiumid { get; set; }
+        public long StadiumId { get; set; }

-        public int capacity { get; set; }
+        public int Capacity { get; set; }

-        public string header { get; set; }
+        public string Header { get; set; }

-        public int year { get; set; }
-
-
+        public int Year { get; set; }
     }
 }


(build) Added workaround for gitversion for detached tags

--- build/buildData.cake
+++ build/buildData.cake
@@ -48,15 +48,28 @@
 Setup<BuildVersion>((ctx) => {
         var gitVersion = ctx.GitVersion();

-        ctx.Information($"Building Codecove.exe version {gitVersion.SemVer}!");
-
-        return new BuildVersion
+        var version = new BuildVersion
         {
             MajorMinorPatch      = gitVersion.MajorMinorPatch,
-            SemVersion           = gitVersion.SemVer,
-            SemVersionPadded     = gitVersion.LegacySemVerPadded,
-            InformationalVersion = gitVersion.InformationalVersion,
         };
+        var buildSystem = ctx.BuildSystem();
+        if (buildSystem.IsRunningOnAppVeyor && buildSystem.AppVeyor.Environment.Repository.Tag.IsTag)
+        {
+            // Workaround since gitversion don't seem to find the correct
+            // version on a tag release when not attached to a branch.
+            version.SemVersion = version.SemVersionPadded = gitVersion.MajorMinorPatch;
+            version.InformationalVersion = $"{gitVersion.MajorMinorPatch}+{gitVersion.FullBuildMetaData}";
+        }
+        else
+        {
+            version.SemVersion = gitVersion.SemVer;
+            version.SemVersionPadded = gitVersion.LegacySemVerPadded;
+            version.InformationalVersion = gitVersion.InformationalVersion;
+        }
+
+        ctx.Information($"Building Codecove.exe version {version.InformationalVersion}!");
+
+        return version;
 });

 Setup<DotNetCoreMSBuildSettings>((ctx) => {


Fixed 64bit dll name.

Fixed 64bit dll name.

--- VDMHelperCLR.Common/VdmHelperFactory.cs
+++ VDMHelperCLR.Common/VdmHelperFactory.cs
@@ -7,7 +7,7 @@
     public static class VdmHelperFactory
     {
         private static string DllName32 = "VDMHelperCLR32.dll";
-        private static string DllName64 = "VDMHelperCLR32.dll";
+        private static string DllName64 = "VDMHelperCLR64.dll";

         private static string GetPlatformDllName()
         {


Demo with Derek.

Demo with Derek.


Made resetcompressionstream gracefully fail if people didn't rebuild the LZHAM dll

--- VersionrCore/ObjectStore/LZHAMWriter.cs
+++ VersionrCore/ObjectStore/LZHAMWriter.cs
@@ -45,9 +45,16 @@
             base.Dispose(disposing);
             if (m_Compressor != IntPtr.Zero)
             {
-                IntPtr oldCompressor = ResetCompressionStream(m_Compressor);
-                if (oldCompressor != null)
-                    Compressors.Add(oldCompressor);
+                try
+                {
+                    IntPtr oldCompressor = ResetCompressionStream(m_Compressor);
+                    if (oldCompressor != null)
+                        Compressors.Add(oldCompressor);
+                }
+                catch
+                {
+                    DestroyCompressionStream(m_Compressor);
+                }
             }
             m_Compressor = IntPtr.Zero;
         }


Remove nonsense test

Remove nonsense test

--- WalletWasabi.Tests/UnitTests/IoTests.cs
+++ WalletWasabi.Tests/UnitTests/IoTests.cs
@@ -127,28 +127,6 @@
 			var fileCount = Directory.EnumerateFiles(Path.GetDirectoryName(ioman1.FilePath)).Count();
 			Assert.Equal(0, fileCount);

-			// Check AsyncLock usage on simultaneous file writes.
-
-			DigestableIoManager ioman2 = new DigestableIoManager(file2);
-
-			AsyncLock asyncLock1 = new AsyncLock();
-			AsyncLock asyncLock2 = new AsyncLock();
-
-			await Task.Run(async () =>
-			{
-				using (await asyncLock1.LockAsync())
-				{
-					// Should not be a problem because they use different AsyncLock.
-					using (await asyncLock2.LockAsync())
-					{
-						await ioman1.WriteAllLinesAsync(lines);
-						await ioman2.WriteAllLinesAsync(lines);
-						ioman1.DeleteMe();
-						ioman2.DeleteMe();
-					}
-				}
-			});
-
 			// TryReplace test.
 			var dummyFilePath = $"{ioman1.FilePath}dummy";
 			var dummyContent = new string[]


Corrected documentation of new WindowInfo functions.

--- Whathecode.System/Windows/WindowInfo.cs
+++ Whathecode.System/Windows/WindowInfo.cs
@@ -20,8 +20,7 @@
 	{
 		const int MaxClassnameLength = 128; // TODO: Is there an actual maximum class name length?

-		readonly Dictionary<User32.WindowState, WindowState> _windowStateMapping = new Dictionary
-			<User32.WindowState, WindowState>
+		readonly Dictionary<User32.WindowState, WindowState> _windowStateMapping = new Dictionary<User32.WindowState, WindowState>
 		{
 			{ User32.WindowState.ShowNormal, WindowState.Open },
 			{ User32.WindowState.Maximized, WindowState.Maximized },
@@ -192,7 +191,6 @@
 		/// <summary>
 		///   Retrieves the current state of the window.
 		/// </summary>
-		/// <returns></returns>
 		public WindowState GetWindowState()
 		{
 			User32.WindowPlacement placement = GetWindowPlacement();
@@ -249,7 +247,7 @@
 			int extraOptions = (int)User32.GetWindowLongPtr( Handle, (int)User32.GetWindowLongOptions.ExtendedStyles );
 			const int topmost = (int)User32.ExtendedWindowStyles.Topmost;

-			return ( ( extraOptions & topmost ) == topmost );
+			return ( (extraOptions & topmost) == topmost );
 		}

 		int SendMessageTimeOut( uint timeout, User32.SendMessageTimeoutFlags callFlags )
@@ -261,9 +259,9 @@
 		}

 		/// <summary>
-		///   Check whether or not a window is no longer responding to window messages.
-		/// </summary>
-		/// <param name="timeout">How long to wait for the window in milliseconds, before presuming it timed out.</param>
+		///   Check whether a window is responding to window messages.
+		/// </summary>
+		/// <param name="timeout">How long to wait for the window in milliseconds, before deciding whether or not it timed out.</param>
 		/// <returns>True when the window has timed out; false otherwise.</returns>
 		public bool HasTimedOut( uint timeout )
 		{
@@ -277,10 +275,10 @@
 		}

 		/// <summary>
-		///   Check whether or not a window is responding to messages within given timespan.
-		/// </summary>
-		/// <param name="timeout">How long to wait for the window in milliseconds, before presuming it timed out.</param>
-		/// <returns>True when the window has timed out; false otherwise.</returns>
+		///   Check whether or not a window is responding to messages within a given timespan, regardless of whether or not it is busy processing other messages.
+		/// </summary>
+		/// <param name="timeout">How long to wait for a response from the window in milliseconds.</param>
+		/// <returns>True when the window responded within the given timespan; false otherwise.</returns>
 		public bool IsResponding( uint timeout )
 		{
 			const User32.SendMessageTimeoutFlags respondingFlags =


allow the app to run if the sound pack version is 0

--- WindowsFormsApplication1/AudioPlayer.cs
+++ WindowsFormsApplication1/AudioPlayer.cs
@@ -107,7 +107,7 @@
                 return false;
             }
             float soundPackVersion = getSoundPackVersion(soundDirectory);
-            if (soundPackVersion == -1)
+            if (soundPackVersion == -1 || soundPackVersion == 0)
             {
                 Console.WriteLine("Unable to get sound pack version - expected a file called version_info with a single line containing a version number, e.g. 2.0");
             }


Added new unit test for generating many index queries over a range of unique index values.

--- ZeroG.Tests/Object/ObjectServiceTest.cs
+++ ZeroG.Tests/Object/ObjectServiceTest.cs
@@ -894,6 +894,69 @@

         [TestMethod]
         [TestCategory("Core")]
+        public void StoreAndRetrieveManyByIndex()
+        {
+            using (var svc = new ObjectService(ObjectTestHelper.GetConfig()))
+            {
+                var ns = ObjectTestHelper.NameSpace1;
+                var obj = ObjectTestHelper.ObjectName1;
+
+                svc.CreateNameSpace(new ObjectNameSpaceConfig(ns,
+                    "ZeroG Test", "Unit Test", DateTime.Now));
+
+                svc.ProvisionObjectStore(
+                    new ObjectMetadata(ns, obj,
+                        new ObjectIndexMetadata[]
+                        {
+                            new ObjectIndexMetadata("IntIndex1", ObjectIndexType.Integer),
+                            new ObjectIndexMetadata("StrIndex1", ObjectIndexType.String, 32),
+                            new ObjectIndexMetadata("StrNullIndex1", ObjectIndexType.String, 32, true)
+                        }));
+
+                int objectCount = 5000;
+                var strIndexes = new List<string>();
+                var storeValues = new List<PersistentObject>();
+                for (int i = 0; i < objectCount; i++)
+                {
+                    Guid val = Guid.NewGuid();
+                    string strIndex = val.ToString("N");
+                    strIndexes.Add(strIndex);
+
+                    storeValues.Add(new PersistentObject()
+                    {
+                        Name = obj,
+                        Value = val.ToByteArray(),
+                        Indexes = new ObjectIndex[]
+                        {
+                            ObjectIndex.Create("IntIndex1", i + 1000),
+                            ObjectIndex.Create("StrIndex1", strIndex),
+                            ObjectIndex.Create("StrNullIndex1", (0 == i || 0 == (i % 4)) ? null : "strIndex")
+                        }
+                    });
+                }
+
+                svc.BulkStore(ns, storeValues);
+
+                // query each value again
+                for (int i = 0; i < objectCount; i++)
+                {
+                    string strIndex = strIndexes[i];
+                    int intIndex = i + 1000;
+                    string strIndex2 = (0 == i || 0 == (i % 4)) ? null : "strIndex";
+
+                    IEnumerable<byte[]> objects = svc.Find(ns, obj, @"{ ""IntIndex1"" : " + intIndex + @",
+""AND"" : { ""StrIndex1"" : """ + strIndex + @""",
+""AND"" : { ""StrNullIndex1"" : " + ((null == strIndex2) ? "null" : "\"" + strIndex2 + "\"") + " } } }");
+
+                    Assert.IsNotNull(objects);
+                    Assert.AreEqual(1, objects.Count());
+                    Assert.AreEqual(strIndex, new Guid(objects.First()).ToString("N"));
+                }
+            }
+        }
+
+        [TestMethod]
+        [TestCategory("Core")]
         public void StoreAndRetrieveManyObjects()
         {
             using (var svc = new ObjectService(ObjectTestHelper.GetConfig()))


Added more dependency unit tests for fxieSpec to safeguard against my own mistakes

--- tests/FixieSpec.Tests/DependencyTests.cs
+++ tests/FixieSpec.Tests/DependencyTests.cs
@@ -18,6 +18,7 @@
         [Input("Ploeh.AutoFixture")]
         [Input("Ploeh.AutoFixture.AutoFakeItEasy")]
         [Input("Shouldly")]
+        [Input("FixieSpec.Tests")]
         public void ShouldNotReference(string assemblyName)
         {
             var references = typeof(FixieSpecConvention).Assembly.GetReferencedAssemblies();


Update home

Update home

--- schreinerei-gfeller/Views/Home/Index.cshtml
+++ schreinerei-gfeller/Views/Home/Index.cshtml
@@ -1,34 +1,84 @@
 @{
     ViewBag.Title = "Willkommen";
 }
-@section js {
-
-}
+

     Schreinerei Gfeller – Küchen, Innenausbau & Renovationen

-

+

     Für Sie erfüllen wir Küchenträume. Entwerfen Sie mit uns Ihre ganz persönlich und individuell gestaltete Küche. Ihre Vorstellungen werden durch uns Realität. Sie kommen mit Ihren Ideen, wir lassen uns inspirieren, beraten Sie über Material und Möglichkeiten, planen und führen aus.

-

-

-
Engel

+

+

+
Engel

Aus Schwemmholz und Draht kreieren wir die beliebten Engelsfiguren.

-        Mehr Engel
+

+            Mehr Engel
+

-

-
Innenausbau

+

+
Innenausbau

Wünschen Sie sich eine Veränderung in Ihren Räumen? Dann sind Sie richtig bei uns.

-        Mehr Innenausbau
+

+            Mehr Innenausbau
+

-

-
Innenausbau

+

+
Innenausbau

Wünschen Sie sich eine Veränderung in Ihren Räumen? Dann sind Sie richtig bei uns.

-        Mehr Innenausbau
+

+            Mehr Innenausbau
+

-

-
Engel

+

+
Engel

Aus Schwemmholz und Draht kreieren wir die beliebten Engelsfiguren.

-        Mehr Engel
+

+            Mehr Engel
+

-
+

+

+
News

+

+

+        06.12.2016
+

+        16:00 – 20:00
+

+

+
Adventsmärit Lützelflüh

+
Besuchen Sie uns auf dem Adventsmärit in Lützelflüh, trinken Sie eine heisse Schoggi und geniessen Sie die Atmosphäre.

+

+            Mehr Adventsmärit
+

+

+

+

+

+        06.12.2016
+

+        16:00 – 20:00
+

+

+
Gewerbeausstellung Lützelflüh

+
Besuchen Sie uns auf dem Adventsmärit in Lützelflüh, trinken Sie eine heisse Schoggi und geniessen Sie die Atmosphäre.

+

+            Mehr Gewerbeausstellung
+

+

+

+

+

+        06.12.2016
+

+        16:00 – 20:00
+

+

+
Adventsmärit Lützelflüh

+
Besuchen Sie uns auf dem Adventsmärit in Lützelflüh, trinken Sie eine heisse Schoggi und geniessen Sie die Atmosphäre.

+

+            Mehr
+

+

+


Исправлена ошибка нормировки, добавлен режекторный фильтр и возможность создавать АЧХ фитров

--- Signals/Signal.cs
+++ Signals/Signal.cs
@@ -192,7 +192,7 @@

-	public static class Filters
+	public class Filters
 	{
 		public static Vector Filter(Vector st, Vector kw)
 		{
@@ -201,7 +201,7 @@
 			ComplexVector Sw = Furie.fft(newSt);
 			Sw = Sw*newKw;
 			newSt = Furie.ifft(Sw).RealToVector();
-			return newSt.CutAndZero(st.N)/newSt.N;
+			return newSt.CutAndZero(st.N);//newSt.N;
 		}

@@ -230,8 +230,78 @@
 			return Filter(st, kw);
 		}

+		public static Vector FilterRezector(Vector st, double sr1, double sr2, Vector f)
+		{
+			Vector kw = new Vector(st.N);
+
+			kw += 1;
+
+			for (int i = 0; i < st.N; i++)
+			{
+				if((f.Vecktor[i]>=sr1)&&(f.Vecktor[i]<=sr2)) kw.Vecktor[i] = 0;
+			}
+
+
+			return Filter(st, kw);
+		}
+
+
+
+
+		public Vector GetAFH(Vector f, double[] param, AFHType afh)
+		{
+				Vector kw = new Vector(f.N);
+
+				if (afh == AFHType.Band)
+				{
+
+					for (int i = 0; i < f.N; i++)
+					{
+						if ((f.Vecktor[i] >= param[0]) && (f.Vecktor[i] <= param[1]))
+							kw.Vecktor[i] = 1;
+					}
+
+				}
+
+				if (afh == AFHType.High)
+				{
+					 kw = NeuroFunc.Porog(f,param[0]);
+				}
+
+				if (afh == AFHType.Low)
+				{
+				double srNew = f.Vecktor[f.N-1]-param[0];
+				kw = NeuroFunc.Porog(f,srNew).Revers();
+				}
+
+
+				if (afh == AFHType.Low)
+				{
+				kw += 1;
+
+				for (int i = 0; i < f.N; i++) {
+					if ((f.Vecktor[i] >= param[0]) && (f.Vecktor[i] <= param[1]))
+						kw.Vecktor[i] = 0;
+				}
+				}
+
+				return kw;
+		}
+
+
+
+
 	}

+	public enum AFHType
+	{
+		Low,
+		High,
+		Rezector,
+		Band
+	}
+
+
 }


Excluded .vs folder

Excluded .vs folder

--- docs/templates/template.cshtml
+++ docs/templates/template.cshtml
@@ -69,6 +69,6 @@

-
+


load posts from azure dev storage

load posts from azure dev storage

--- src/Hawk/Startup.cs
+++ src/Hawk/Startup.cs
@@ -9,6 +9,7 @@
 using Microsoft.Framework.Runtime;
 using Hawk.Middleware;
 using Hawk.Services;
+using Azure = Microsoft.WindowsAzure.Storage;

 namespace Hawk
 {
@@ -55,18 +56,21 @@
             #region temp data load

             // temp: syncronously load blog data from file system
-            var path = Configuration.Get("storage:FileSystemPath");
-            logger.LogInformation("Loading posts from {path}", path);
+            //var path = Configuration.Get("storage:FileSystemPath");
+            //logger.LogInformation("Loading posts from {path}", path);
+            //Action load = () => MemoryCachePostRepository.UpdateCache(cache, FileSystemRepo.EnumeratePosts(path));

-            Action load = () => MemoryCachePostRepository.UpdateCache(cache, FileSystemRepo.EnumeratePosts(path));
+            // temp: syncronously load blog data from Azure dev storage
+            logger.LogInformation("Loading posts from Azure development storage");
+            Action load = () =>
+            {
+                var loadTask = AzureRepo.LoadFromAzureAsync(Azure.CloudStorageAccount.DevelopmentStorageAccount);
+                loadTask.Wait();
+                MemoryCachePostRepository.UpdateCache(cache, loadTask.Result);
+            };
+
             load();
             cache.Set("Hawk.ReloadContent", load);
-
-            // temp: syncronously load blog data from Azure dev storage
-            //logger.LogInformation("Loading posts from Azure development storage");
-            //var loadTask = AzureRepo.LoadFromAzureAsync(Azure.CloudStorageAccount.DevelopmentStorageAccount);
-            //loadTask.Wait();
-            //MemoryCachePostRepository.UpdateCache(cache, loadTask.Result);

             #endregion


move logging setup to ctor

move logging setup to ctor

--- src/Host/Startup.cs
+++ src/Host/Startup.cs
@@ -19,6 +19,29 @@
 {
     public class Startup
     {
+        public Startup(ILoggerFactory loggerFactory)
+        {
+            Func<LogEvent, bool> serilogFilter = (e) =>
+            {
+                var context = e.Properties["SourceContext"].ToString();
+
+                return (context.StartsWith("\"IdentityServer") ||
+                        context.StartsWith("\"IdentityModel") ||
+                        e.Level == LogEventLevel.Error ||
+                        e.Level == LogEventLevel.Fatal);
+            };
+
+            var serilog = new LoggerConfiguration()
+                .MinimumLevel.Verbose()
+                .Enrich.FromLogContext()
+                .Filter.ByIncludingOnly(serilogFilter)
+                .WriteTo.LiterateConsole(outputTemplate: "[{Timestamp:HH:mm:ss} {Level}] {SourceContext}{NewLine}{Message}{NewLine}{Exception}{NewLine}")
+                .WriteTo.File(@"identityserver4_log.txt")
+                .CreateLogger();
+
+            loggerFactory.AddSerilog(serilog);
+        }
+
         public void ConfigureServices(IServiceCollection services)
         {
             services.AddIdentityServer(options =>
@@ -42,27 +65,6 @@

         public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
         {
-            // serilog filter
-            Func<LogEvent, bool> serilogFilter = (e) =>
-            {
-                var context = e.Properties["SourceContext"].ToString();
-
-                return (context.StartsWith("\"IdentityServer") ||
-                        context.StartsWith("\"IdentityModel") ||
-                        e.Level == LogEventLevel.Error ||
-                        e.Level == LogEventLevel.Fatal);
-            };
-
-            var serilog = new LoggerConfiguration()
-                .MinimumLevel.Verbose()
-                .Enrich.FromLogContext()
-                .Filter.ByIncludingOnly(serilogFilter)
-                .WriteTo.LiterateConsole(outputTemplate: "[{Timestamp:HH:mm:ss} {Level}] {SourceContext}{NewLine}{Message}{NewLine}{Exception}{NewLine}")
-                .WriteTo.File(@"identityserver4_log.txt")
-                .CreateLogger();
-
-            loggerFactory.AddSerilog(serilog);
-
             app.UseDeveloperExceptionPage();

             app.UseIdentityServer();
@@ -140,4 +142,4 @@
             app.UseMvcWithDefaultRoute();
         }
     }
-}
+}


bump version

bump version

--- Source/Version.cs
+++ Source/Version.cs
@@ -2,7 +2,7 @@
 using System.Reflection;

 // EasyNetQ version number: <major>.<minor>.<non-breaking-feature>.<build>
-[assembly: AssemblyVersion("0.39.0.0")]
+[assembly: AssemblyVersion("0.39.1.0")]
 [assembly: CLSCompliant(true)]

 // Note: until version 1.0 expect breaking changes on 0.X versions.


Version to 0.12.3 - Upgrade to RabbitMQ.Client 3.1.1

--- Source/Version.cs
+++ Source/Version.cs
@@ -1,10 +1,11 @@
 using System.Reflection;

 // EasyNetQ version number: <major>.<minor>.<non-breaking-feature>.<build>
-[assembly: AssemblyVersion("0.12.2.0")]
+[assembly: AssemblyVersion("0.12.3.0")]

 // Note: until version 1.0 expect breaking changes on 0.X versions.

+// 0.12.3.0 Upgrade to RabbitMQ.Client 3.1.1
 // 0.12.2.0 Requested Heartbeat on by default
 // 0.12.1.0 Factored declares out of AdvancedBus publish and consume.
 // 0.11.1.0 New plugable validation strategy (IMessageValidationStrategy)


--- Source/Version.cs
+++ Source/Version.cs
@@ -1,10 +1,11 @@
 using System.Reflection;

 // EasyNetQ version number: <major>.<minor>.<non-breaking-feature>.<build>
-[assembly: AssemblyVersion("0.15.2.0")]
+[assembly: AssemblyVersion("0.15.3.0")]

 // Note: until version 1.0 expect breaking changes on 0.X versions.

+// 0.15.3.0 Handle multiple=true on publisher confirm ack.
 // 0.15.2.0 Internal event bus
 // 0.15.1.0 PublishExchangeDeclareStrategy. Only one declare now rather than once per publish.
 // 0.15.0.0 Removed IPublishChannel and IAdvancedPublishChannel API. Publish now back on IBus.


trying to build my own poller

trying to build my own poller

--- src/Pipe/Program.cs
+++ src/Pipe/Program.cs
@@ -6,6 +6,7 @@
 using System.Threading.Tasks;
 using ZeroMQ;
 using ZeroMQ.Devices;
+using ZeroMQ.Interop;

 namespace PipeRunner
 {
@@ -27,20 +28,94 @@
             using (var context = ZmqContext.Create())
             {

-                var ForwarderDevice = new ForwarderDevice(context, Pipe.PublishAddressServer, Pipe.SubscribeAddressServer, DeviceMode.Threaded);
-                ForwarderDevice.Start();
-                while (!ForwarderDevice.IsRunning)
-                { }
+                //var ForwarderDevice = new ForwarderDevice(context, Pipe.PublishAddressServer, Pipe.SubscribeAddressServer, DeviceMode.Threaded);
+                //ForwarderDevice.Start();
+                //while (!ForwarderDevice.IsRunning)
+                //{ }

+                using (ZmqSocket frontend = context.CreateSocket(SocketType.XPUB), backend = context.CreateSocket(SocketType.XSUB))
+                {
+                    frontend.Bind(Pipe.PublishAddressServer); //"tcp://*:5559");
+                    backend.Bind(Pipe.SubscribeAddressServer); //"tcp://*:5560");
+
+                    frontend.ReceiveReady += RelayMessage(frontend, backend);
+                    var poller = new Poller();
+                    poller.AddSocket(frontend);
+                    //poller.AddSocket(backend);
+                    while (true)
+                    {
+                        poller.Poll();
+                    }
+                    //var pollItems = new PollItem[2];
+                    //pollItems[0] = frontend.CreatePollItem(IOMultiPlex.POLLIN);
+                    //pollItems[0].PollInHandler += (socket, revents) => FrontendPollInHandler(socket, backend);
+                    //pollItems[1] = backend.CreatePollItem(IOMultiPlex.POLLIN);
+                    //pollItems[1].PollInHandler += (socket, revents) => BackendPollInHandler(socket, frontend);
+
+                    //while (true)
+                    //{
+                    //    context.Poll(pollItems, -1);
+                    //}
+                }

                 //var pipe = new Pipe();
                 //pipe.Start(context);
-
                 Console.WriteLine("enter to exit=>");
                 input = Console.ReadLine();
                 //pipe.Exit();

             }
         }
+
+        private static void FrontendPollInHandler(ZmqSocket frontend, ZmqSocket backend)
+        {
+            RelayMessage(frontend, backend);
+        }
+
+        //private static void BackendPollInHandler(ZmqSocket backend, ZmqSocket frontend)
+        //{
+        //    RelayMessage(backend, frontend);
+        //}
+
+        private static void RelayMessagex(ZmqSocket source, ZmqSocket destination)
+        {
+            bool hasMore = true;
+            while (hasMore)
+            {
+                // side effect warning!
+                // note! that this uses Recv mode that gets a byte[], the router c# implementation
+                // doesnt work if you get a string message instead of the byte[] i would prefer the solution thats commented.
+                // but the router doesnt seem to be able to handle the response back to the client
+                //string message = source.Recv(Encoding.Unicode);
+                //hasMore = source.RcvMore;
+                //destination.Send(message, Encoding.Unicode, hasMore ? SendRecvOpt.SNDMORE : SendRecvOpt.NONE);
+
+                byte[] message = source.ReceiveFrame();
+                hasMore = source.ReceiveMore;
+                destination.Send(message, message.Length, hasMore ? SocketFlags.SendMore : SocketFlags.None);
+            }
+        }
+
+        private static EventHandler<SocketEventArgs> RelayMessage(ZmqSocket source, ZmqSocket destination)
+        {
+            bool hasMore = true;
+            while (hasMore)
+            {
+                // side effect warning!
+                // note! that this uses Recv mode that gets a byte[], the router c# implementation
+                // doesnt work if you get a string message instead of the byte[] i would prefer the solution thats commented.
+                // but the router doesnt seem to be able to handle the response back to the client
+                //string message = source.Recv(Encoding.Unicode);
+                //hasMore = source.RcvMore;
+                //destination.Send(message, Encoding.Unicode, hasMore ? SendRecvOpt.SNDMORE : SendRecvOpt.NONE);
+
+                byte[] message = source.ReceiveFrame();
+                hasMore = source.ReceiveMore;
+                destination.Send(message, message.Length, hasMore ? SocketFlags.SendMore : SocketFlags.None);
+            }
+            return null;
+        }
+
+
     }
 }


Bump version to 0.13.5

Bump version to 0.13.5

--- src/SolutionInfo.cs
+++ src/SolutionInfo.cs
@@ -2,12 +2,12 @@
 using System.Reflection;

 [assembly: AssemblyProductAttribute("Journalist")]
-[assembly: AssemblyVersionAttribute("0.13.4")]
-[assembly: AssemblyInformationalVersionAttribute("0.13.4")]
-[assembly: AssemblyFileVersionAttribute("0.13.4")]
+[assembly: AssemblyVersionAttribute("0.13.5")]
+[assembly: AssemblyInformationalVersionAttribute("0.13.5")]
+[assembly: AssemblyFileVersionAttribute("0.13.5")]
 [assembly: AssemblyCompanyAttribute("Anton Mednonogov")]
 namespace System {
     internal static class AssemblyVersionInformation {
-        internal const string Version = "0.13.4";
+        internal const string Version = "0.13.5";
     }
 }


Add Status and StatusDate fields

Add Status and StatusDate fields

--- ToCsvProcessor.cs
+++ ToCsvProcessor.cs
@@ -88,7 +88,7 @@
             "AssessmentSubtestClaim4MinimumValue",
             "AssessmentSubtestClaim4MaximumValue",
             "AssessmentClaim4PerformanceLevelIdentifier",
-            "AccommodationAmericanSignLanguage",
+            "AccommodationAmericanSignLanguage", // 73
             "AccommodationBraille",
             "AccommodationClosedCaptioning",
             "AccommodationTextToSpeech",
@@ -102,7 +102,11 @@
             "AccommodationScribe",
             "AccommodationSpeechToText",
             "AccommodationStreamlineMode",
-            "AccommodationNoiseBuffer"
+            "AccommodationNoiseBuffer",
+            "OpportunityId", // 88
+            "OpportunityKey",
+            "Status",
+            "StatusDate"
         };

         static string[] sItemFieldNames = new string[]
@@ -125,8 +129,6 @@
             "pageVisits",
             "pageTime",
             "dropped",
-            "opportunityId",
-            "opportunityKey"
         };

         static XPathExpression sXp_StateAbbreviation = XPathExpression.Compile("/TDSReport/Examinee/ExamineeRelationship[@name='StateAbbreviation' and @context='FINAL']/@value");
@@ -182,6 +184,10 @@
         static XPathExpression sXp_ClaimScore4AchievementLevel = XPathExpression.Compile("/TDSReport/Opportunity/Score[@measureOf='4-CR' and @measureLabel='PerformanceLevel']/@value");
         // Matches all accessibility codes
         static XPathExpression sXP_AccessibilityCodes = XPathExpression.Compile("/TDSReport/Opportunity/Accommodation/@code");
+        static XPathExpression sXp_OpportunityId = XPathExpression.Compile("/TDSReport/Opportunity/@oppId");
+        static XPathExpression sXp_OpportunityKey = XPathExpression.Compile("/TDSReport/Opportunity/@key");
+        static XPathExpression sXp_Status = XPathExpression.Compile("/TDSReport/Opportunity/@status");
+        static XPathExpression sXp_StatusDate = XPathExpression.Compile("/TDSReport/Opportunity/@statusDate");

         // Item Level Data
         static XPathExpression sXP_Item = XPathExpression.Compile("/TDSReport/Opportunity/Item");
@@ -203,8 +209,6 @@
         static XPathExpression sXp_PageVisits = XPathExpression.Compile("@pageVisits");
         static XPathExpression sXp_PageTime = XPathExpression.Compile("@pageTime");
         static XPathExpression sXp_Dropped = XPathExpression.Compile("@dropped");
-        static XPathExpression sXp_OpportunityId = XPathExpression.Compile("/TDSReport/Opportunity/@oppId");
-        static XPathExpression sXp_OpportunityKey = XPathExpression.Compile("/TDSReport/Opportunity/@key");

         static Dictionary<string, int> sAccessibilityCodeMapping;

@@ -347,7 +351,14 @@
             ProcessScores(nav, sXp_ClaimScore4, sXp_ClaimScore4StandardError, sXp_ClaimScore4AchievementLevel, studentFields, 69);

             // Preload accommodation fields with "3" (accessibility feature not made available)
-            for (int i = 73; i < sStudentFieldNames.Length; ++i) studentFields[i] = "3";
+            for (int i = 73; i < 88; ++i) studentFields[i] = "3";
+
+            // Additional fields
+            // Note, these fields are not included in the Data Warehouse specifications. This is a temporary fix with a new format to follow.
+            studentFields[88] = nav.Eval(sXp_OpportunityId);
+            studentFields[89] = nav.Eval(sXp_OpportunityKey);
+            studentFields[90] = nav.Eval(sXp_Status);
+            studentFields[91] = nav.Eval(sXp_StatusDate).Replace('T', ' ');

             // Process accommodations
             {
@@ -446,8 +457,6 @@
                     itemFields[15] = node.Eval(sXp_PageVisits);
                     itemFields[16] = node.Eval(sXp_PageTime);
                     itemFields[17] = node.Eval(sXp_Dropped);
-                    itemFields[18] = node.Eval(sXp_OpportunityId);
-                    itemFields[19] = node.Eval(sXp_OpportunityKey);

                     // Write one line to the CSV
                     if (m_iWriter != null)


Package: refactoring, invert id and use early return in OnProgramsComboGetList, pt1

--- ToolbarPackage.cs
+++ ToolbarPackage.cs
@@ -103,14 +103,14 @@
         private void OnProgramsComboGetList(object sender, EventArgs e)
         {
             OleMenuCmdEventArgs eventArgs = e as OleMenuCmdEventArgs;
-            if (eventArgs != null)
+            if (eventArgs == null)
+                return;
+
+            IntPtr outValue = eventArgs.OutValue;
+            if (outValue != IntPtr.Zero)
             {
-                IntPtr outValue = eventArgs.OutValue;
-                if (outValue != IntPtr.Zero)
-                {
-                    string[] values = State.ProcessList.ToArray();
-                    Marshal.GetNativeVariantForObject(values, outValue);
-                }
+                string[] values = State.ProcessList.ToArray();
+                Marshal.GetNativeVariantForObject(values, outValue);
             }
         }


Provide autoload options

Provide autoload options

--- ToolbarPackage.cs
+++ ToolbarPackage.cs
@@ -1,4 +1,5 @@
 using EnvDTE80;
+using Microsoft.VisualStudio;
 using Microsoft.VisualStudio.Shell;
 using Microsoft.VisualStudio.Shell.Interop;
 using System;
@@ -18,6 +19,9 @@
     [ProvideMenuResource("Menus.ctmenu", 1)]
     [ProvideOptionPage(typeof(OptionsPage), "Attach Toolbar", "General Settings",
         PkgCmdIDList.cmdidOptionsCategory, PkgCmdIDList.cmdidOptionsPage, true)]
+
+    [ProvideAutoLoad(VSConstants.UICONTEXT.NoSolution_string, PackageAutoLoadFlags.BackgroundLoad)]
+    [ProvideAutoLoad(VSConstants.UICONTEXT.SolutionExists_string, PackageAutoLoadFlags.BackgroundLoad)]

     [Guid(GuidList.guidAttachToolbarPkgString)]
     public sealed class ToolbarPackage : AsyncPackage


Z-1676 Translate to forward slashes and remove drive from name in ZipEntry constructor, mainly for ZipOutputStream entry path names

--- src/Zip/ZipEntry.cs
+++ src/Zip/ZipEntry.cs
@@ -41,6 +41,7 @@
 //	2009-12-22	Z-1649	Added AES support
 //	2010-02-02	DavidP	Changed NTFS Extra Data min length to 4
 //	2012-06-03	Z-1744	Use only the low order byte of "Version Needed to Extract"
+//	2012-07-18	Z-1676	Translate to forward slashes and remove drive from name in constructor

 using System;
 using System.IO;
@@ -220,7 +221,7 @@
 			CompressionMethod method)
 		{
 			if (name == null) {
-				throw new System.ArgumentNullException("name");
+				throw new ArgumentNullException("name");
 			}

 			if ( name.Length > 0xffff )	{
@@ -231,8 +232,8 @@
 				throw new ArgumentOutOfRangeException("versionRequiredToExtract");
 			}

-			this.DateTime = System.DateTime.Now;
-			this.name = name;
+			this.DateTime = DateTime.Now;
+			this.name = CleanName(name);
 			this.versionMadeBy = (ushort)madeByInfo;
 			this.versionToExtract = (ushort)versionRequiredToExtract;
 			this.method = method;
@@ -1205,7 +1206,7 @@
 				return string.Empty;
 			}

-			if (Path.IsPathRooted(name) == true) {
+			if (Path.IsPathRooted(name)) {
 				// NOTE:
 				// for UNC names...  \\machine\share\zoom\beet.txt gives \zoom\beet.txt
 				name = name.Substring(Path.GetPathRoot(name).Length);


implemented anti aliasing with fixed factor (X: 3, Y: 2)

--- WaveVisualizer.cs
+++ WaveVisualizer.cs
@@ -11,6 +11,9 @@
 {
     public class WaveVisualizer
     {
+        private const float ANTI_ALIAS_FACTOR_X = 3f;
+        private const float ANTI_ALIAS_FACTOR_Y = 2f;
+
         private readonly WaveVisualizingProperties props;

         public WaveVisualizer(WaveVisualizingProperties props)
@@ -20,8 +23,9 @@

         private float[] GetSampleBlock(int x, ISampleSequence samples)
         {
-            var incStart = (double)x / props.Width;
-            var excEnd = (double)++x / props.Width;
+            var w = props.Width * ANTI_ALIAS_FACTOR_X;
+            var incStart = (double)x / w;
+            var excEnd = (double)++x / w;
             var i0 = (int)Math.Floor(incStart * samples.Count);
             var cnt = (int)Math.Floor(excEnd * samples.Count) - 1 - i0;
             return samples.GetBlock(i0, cnt);
@@ -29,11 +33,13 @@

         private void PaintBar(Graphics g, int x, BarInfo barInfo, float scale)
         {
-            var yc = props.Height / 2f;
-            var y11 = yc - barInfo.Max * scale * 0.5f * props.Height;
-            var y12 = yc - barInfo.Min * scale * 0.5f * props.Height;
-            var y21 = yc - barInfo.PosMean * scale * 0.5f * props.Height + 1;
-            var y22 = yc - barInfo.NegMean * scale * 0.5f * props.Height + 1;
+            var w = props.Width * ANTI_ALIAS_FACTOR_X;
+            var h = props.Height * ANTI_ALIAS_FACTOR_Y;
+            var yc = h / 2f;
+            var y11 = yc - barInfo.Max * scale * 0.5f * h;
+            var y12 = yc - barInfo.Min * scale * 0.5f * h;
+            var y21 = yc - barInfo.PosMean * scale * 0.5f * h + 1;
+            var y22 = yc - barInfo.NegMean * scale * 0.5f * h + 1;
             var brush = new SolidBrush(props.ForegroundColor1);
             var posBrush = (int)y11 == (int)y21
                 ? brush : (Brush)new LinearGradientBrush(new Point(0, (int)y21 + 1), new Point(0, (int)y11 - 1),
@@ -41,7 +47,7 @@
             var negBrush = (int)y12 == (int)y22
                 ? brush : (Brush)new LinearGradientBrush(new Point(0, (int)y22 - 1), new Point(0, (int)y12 + 1),
                                     props.ForegroundColor1, props.ForegroundColor2);
-            var linePen = new Pen(props.LineColor, 1f);
+            var linePen = new Pen(props.LineColor, ANTI_ALIAS_FACTOR_Y);

             g.SmoothingMode = SmoothingMode.HighSpeed;
             g.FillRectangle(posBrush, x, y11, 1, y21 - y11);
@@ -49,7 +55,7 @@
             g.FillRectangle(brush, x, y21, 1, y22 - y21);

             g.SmoothingMode = SmoothingMode.AntiAlias;
-            g.DrawLine(linePen, 0f, yc, props.Width, yc);
+            g.DrawLine(linePen, 0f, yc, w, yc);

             posBrush.Dispose();
             negBrush.Dispose();
@@ -59,21 +65,34 @@
         public Bitmap CreateImage(ISampleSequence samples)
         {
             var bmp = new Bitmap(props.Width, props.Height, PixelFormat.Format32bppArgb);
-            var barInfos = new BarInfo[props.Width];
-            for (var x = 0; x < props.Width; x++)
+            var fullWidth = (int)(props.Width * ANTI_ALIAS_FACTOR_X);
+            var fullHeigth = (int)(props.Height * ANTI_ALIAS_FACTOR_Y);
+            using (var fullBmp = new Bitmap(fullWidth, fullHeigth, PixelFormat.Format32bppArgb))
             {
-                barInfos[x] = new BarInfo(GetSampleBlock(x, samples));
-            }
-            Parallel.For(0, props.Width, x => barInfos[x].Compute());
-            var min = barInfos.Select(bi => bi.Min).Min();
-            var max = barInfos.Select(bi => bi.Max).Max();
-            var scale = 1f / Math.Max(max, -min);
-            using (var g = Graphics.FromImage(bmp))
-            {
-                g.Clear(props.BackgroundColor);
-                for (var x = 0; x < props.Width; x++)
+                var barInfos = new BarInfo[fullWidth];
+                for (var x = 0; x < fullWidth; x++)
                 {
-                    PaintBar(g, x, barInfos[x], scale);
+                    barInfos[x] = new BarInfo(GetSampleBlock(x, samples));
+                }
+                Parallel.For(0, fullWidth, x => barInfos[x].Compute());
+                var min = barInfos.Select(bi => bi.Min).Min();
+                var max = barInfos.Select(bi => bi.Max).Max();
+                var scale = 1f / Math.Max(max, -min);
+                using (var g = Graphics.FromImage(fullBmp))
+                {
+                    g.Clear(props.BackgroundColor);
+                    for (var x = 0; x < fullWidth; x++)
+                    {
+                        PaintBar(g, x, barInfos[x], scale);
+                    }
+                }
+                using (var g = Graphics.FromImage(bmp))
+                {
+                    g.InterpolationMode = InterpolationMode.HighQualityBicubic;
+                    g.DrawImage(fullBmp,
+                        new Rectangle(0, 0, bmp.Width, bmp.Height),
+                        new Rectangle(0, 0, fullBmp.Width, fullBmp.Height),
+                        GraphicsUnit.Pixel);
                 }
             }
             return bmp;


Keys generation refactorings / changes

Keys generation refactorings / changes

--- source/FFImageLoading.Common/Work/ImageLoaderTask.cs
+++ source/FFImageLoading.Common/Work/ImageLoaderTask.cs
@@ -69,6 +69,7 @@
         private void SetKeys()
         {
             KeyRaw = Parameters.Path;
+
             if (Parameters.Source == ImageSource.Stream)
             {
                 if (!string.IsNullOrWhiteSpace(Parameters.StreamChecksum))
@@ -101,27 +102,48 @@

             if (Parameters.CustomDataResolver is IVectorDataResolver vect)
             {
-                if (vect.ReplaceStringMap == null || vect.ReplaceStringMap.Count == 0)
-                    KeyRaw = string.Format("{0};(size={1}x{2},dip={3},type={4})", KeyRaw, vect.VectorWidth, vect.VectorHeight, vect.UseDipUnits, vect.GetType().Name);
-                else
-                    KeyRaw = string.Format("{0};(size={1}x{2},dip={3},replace=({4}),type={5})", KeyRaw, vect.VectorWidth, vect.VectorHeight, vect.UseDipUnits,
-                                           string.Join(",", vect.ReplaceStringMap.Select(x => string.Format("{0}/{1}", x.Key, x.Value)).OrderBy(v => v)), vect.GetType().Name);
-            }
-
-			KeyDownsamplingOnly = string.Empty;
+				if (vect.ReplaceStringMap == null || vect.ReplaceStringMap.Count == 0)
+				{
+					KeyRaw = string.Format(
+						"{0};(size={1}x{2},type={3})",
+						KeyRaw,
+						vect.UseDipUnits ? DpiToPixels(vect.VectorWidth) : vect.VectorWidth,
+						vect.UseDipUnits ? DpiToPixels(vect.VectorHeight) : vect.VectorHeight,
+						vect.GetType().Name);
+				}
+				else
+				{
+					KeyRaw = string.Format(
+						"{0};(size={1}x{2},replace=({3}),type={4})",
+						KeyRaw,
+						vect.UseDipUnits ? DpiToPixels(vect.VectorWidth) : vect.VectorWidth,
+						vect.UseDipUnits ? DpiToPixels(vect.VectorHeight) : vect.VectorHeight,
+						string.Join(",", vect.ReplaceStringMap.Select(x => string.Format("{0}/{1}", x.Key, x.Value)).OrderBy(v => v)),
+						vect.GetType().Name);
+				}
+            }
+
 			if (Parameters.DownSampleSize != null && (Parameters.DownSampleSize.Item1 > 0 || Parameters.DownSampleSize.Item2 > 0))
             {
-                if (Parameters.DownSampleUseDipUnits)
-                    KeyDownsamplingOnly = string.Concat(";", DpiToPixels(Parameters.DownSampleSize.Item1), "x", DpiToPixels(Parameters.DownSampleSize.Item2));
-                else
-                    KeyDownsamplingOnly = string.Concat(";", Parameters.DownSampleSize.Item1, "x", Parameters.DownSampleSize.Item2);
-            }
-
-            KeyTransformationsOnly = string.Empty;
+				KeyDownsamplingOnly = string.Concat(
+					";",
+					Parameters.DownSampleUseDipUnits ? DpiToPixels(Parameters.DownSampleSize.Item1) : Parameters.DownSampleSize.Item1,
+					"x",
+					Parameters.DownSampleUseDipUnits ? DpiToPixels(Parameters.DownSampleSize.Item2) : Parameters.DownSampleSize.Item2);
+            }
+			else
+			{
+				KeyDownsamplingOnly = string.Empty;
+			}
+
             if (Parameters.Transformations != null && Parameters.Transformations.Count > 0)
             {
                 KeyTransformationsOnly = string.Concat(";", string.Join(";", Parameters.Transformations.Select(t => t.Key)));
             }
+			else
+			{
+				KeyTransformationsOnly = string.Empty;
+			}

 			if (isCustomCacheKeySet)
 			{
@@ -144,10 +166,18 @@
                 if (Parameters.CustomLoadingPlaceholderDataResolver is IVectorDataResolver vectLo)
                 {
                     if (vectLo.ReplaceStringMap == null || vectLo.ReplaceStringMap.Count == 0)
-                        KeyForLoadingPlaceholder = string.Format("{0};(size={1}x{2},dip={3})", KeyForLoadingPlaceholder, vectLo.VectorWidth, vectLo.VectorHeight, vectLo.UseDipUnits);
+                        KeyForLoadingPlaceholder = string.Format(
+							"{0};(size={1}x{2})",
+							KeyForLoadingPlaceholder,
+							vectLo.UseDipUnits ? DpiToPixels(vectLo.VectorWidth) : vectLo.VectorWidth,
+							vectLo.UseDipUnits ? DpiToPixels(vectLo.VectorHeight) : vectLo.VectorHeight);
                     else
-                        KeyForLoadingPlaceholder = string.Format("{0};(size={1}x{2},dip={3},replace=({4}))", KeyForLoadingPlaceholder, vectLo.VectorWidth, vectLo.VectorHeight, vectLo.UseDipUnits,
-                                               string.Join(",", vectLo.ReplaceStringMap.Select(x => string.Format("{0}/{1}", x.Key, x.Value)).OrderBy(v => v)));
+                        KeyForLoadingPlaceholder = string.Format(
+							"{0};(size={1}x{2},replace=({3}))",
+							KeyForLoadingPlaceholder,
+							vectLo.UseDipUnits ? DpiToPixels(vectLo.VectorWidth) : vectLo.VectorWidth,
+							vectLo.UseDipUnits ? DpiToPixels(vectLo.VectorHeight) : vectLo.VectorHeight,
+							string.Join(",", vectLo.ReplaceStringMap.Select(x => string.Format("{0}/{1}", x.Key, x.Value)).OrderBy(v => v)));
                 }
             }

@@ -161,10 +191,18 @@
                 if (Parameters.CustomLoadingPlaceholderDataResolver is IVectorDataResolver vectEr)
                 {
                     if (vectEr.ReplaceStringMap == null || vectEr.ReplaceStringMap.Count == 0)
-                        KeyForErrorPlaceholder = string.Format("{0};(size={1}x{2},dip={3})", KeyForErrorPlaceholder, vectEr.VectorWidth, vectEr.VectorHeight, vectEr.UseDipUnits);
+                        KeyForErrorPlaceholder = string.Format(
+							"{0};(size={1}x{2})",
+							KeyForErrorPlaceholder,
+							vectEr.UseDipUnits ? DpiToPixels(vectEr.VectorWidth) : vectEr.VectorWidth,
+							vectEr.UseDipUnits ? DpiToPixels(vectEr.VectorHeight) : vectEr.VectorHeight);
                     else
-                        KeyForErrorPlaceholder = string.Format("{0};(size={1}x{2},dip={3},replace=({4}))", KeyForErrorPlaceholder, vectEr.VectorWidth, vectEr.VectorHeight, vectEr.UseDipUnits,
-                                               string.Join(",", vectEr.ReplaceStringMap.Select(x => string.Format("{0}/{1}", x.Key, x.Value)).OrderBy(v => v)));
+                        KeyForErrorPlaceholder = string.Format(
+							"{0};(size={1}x{2},replace=({3}))",
+							KeyForErrorPlaceholder,
+							vectEr.UseDipUnits ? DpiToPixels(vectEr.VectorWidth) : vectEr.VectorWidth,
+							vectEr.UseDipUnits ? DpiToPixels(vectEr.VectorHeight) : vectEr.VectorHeight,
+							string.Join(",", vectEr.ReplaceStringMap.Select(x => string.Format("{0}/{1}", x.Key, x.Value)).OrderBy(v => v)));
                 }
             }


{EmulatorDir} variable not expanded in emulator scripts

--- source/Playnite/Controllers/GenericGameController.cs
+++ source/Playnite/Controllers/GenericGameController.cs
@@ -138,7 +138,7 @@

                     startupDir = expandedProfile.WorkingDirectory;
                     startupPath = expandedProfile.Executable;
-                    StartEmulatorProcess(startupPath, startupArgs, startupDir);
+                    StartEmulatorProcess(startupPath, startupArgs, startupDir, emulator.InstallDir, romPath);
                 }
             }
             else if (currentEmuProfile is BuiltInEmulatorProfile builtIn)
@@ -200,7 +200,7 @@
                         }
                     }

-                    StartEmulatorProcess(startupPath, startupArgs, startupDir, asyncExec);
+                    StartEmulatorProcess(startupPath, startupArgs, startupDir, emulator.InstallDir, romPath, asyncExec);
                 }
             }
             else
@@ -209,31 +209,31 @@
             }
         }

-        private void StartEmulatorProcess(string path, string args, string workDir, bool asyncExec = true)
+        private void StartEmulatorProcess(string path, string args, string workDir, string emulatorDir, string romPath, bool asyncExec = true)
         {
             if (asyncExec)
             {
-                ExecuteEmulatorScript(currentEmuProfile.PreScript);
+                ExecuteEmulatorScript(currentEmuProfile.PreScript, emulatorDir, romPath);

                 procMon = new ProcessMonitor();
-                procMon.TreeDestroyed += Monitor_TreeDestroyed;
+                procMon.TreeDestroyed += Monitor_EmulatedTreeDestroyed;
                 var process = ProcessStarter.StartProcess(path, args, workDir);

                 stopWatch = Stopwatch.StartNew();
-                ExecuteEmulatorScript(currentEmuProfile.PostScript);
+                ExecuteEmulatorScript(currentEmuProfile.PostScript, emulatorDir, romPath);
                 InvokeOnStarted(new GameStartedEventArgs() { StartedProcessId = process.Id });
                 procMon.WatchProcessTree(process);
             }
             else
             {
-                ExecuteEmulatorScript(currentEmuProfile.PostScript);
+                ExecuteEmulatorScript(currentEmuProfile.PreScript, emulatorDir, romPath);
                 ProcessStarter.StartProcess(path, args, workDir);
-                ExecuteEmulatorScript(currentEmuProfile.PostScript);
-                ExecuteEmulatorScript(currentEmuProfile.ExitScript);
-            }
-        }
-
-        private void ExecuteEmulatorScript(string script)
+                ExecuteEmulatorScript(currentEmuProfile.PostScript, emulatorDir, romPath);
+                ExecuteEmulatorScript(currentEmuProfile.ExitScript, emulatorDir, romPath);
+            }
+        }
+
+        private void ExecuteEmulatorScript(string script, string emulatorDir, string romPath)
         {
             if (script.IsNullOrEmpty())
             {
@@ -248,7 +248,7 @@
                     {  "Game", Game.GetClone() }
                 };

-                var expandedScript = Game.ExpandVariables(script);
+                var expandedScript = Game.ExpandVariables(script, false, emulatorDir, romPath);
                 var dir = Game.ExpandVariables(Game.InstallDirectory, true);
                 if (!dir.IsNullOrEmpty() && FileSystem.DirectoryExists(dir))
                 {
@@ -563,7 +563,13 @@
         private void Monitor_TreeDestroyed(object sender, EventArgs args)
         {
             stopWatch.Stop();
-            ExecuteEmulatorScript(currentEmuProfile?.ExitScript);
+            InvokeOnStopped(new GameStoppedEventArgs() { SessionLength = Convert.ToUInt64(stopWatch.Elapsed.TotalSeconds) });
+        }
+
+        private void Monitor_EmulatedTreeDestroyed(object sender, EventArgs args)
+        {
+            stopWatch.Stop();
+            ExecuteEmulatorScript(currentEmuProfile?.ExitScript, null, null);
             InvokeOnStopped(new GameStoppedEventArgs() { SessionLength = Convert.ToUInt64(stopWatch.Elapsed.TotalSeconds) });
         }


Change whitespace for cookie authentication doc region

--- aspnet/4-auth/App_Start/Startup.cs
+++ aspnet/4-auth/App_Start/Startup.cs
@@ -39,10 +39,11 @@
             {
                 AuthenticationType = DefaultAuthenticationTypes.ExternalCookie
             });
-
             app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
             app.UseTwoFactorSignInCookie(DefaultAuthenticationTypes.TwoFactorCookie, TimeSpan.FromMinutes(5));
             app.UseTwoFactorRememberBrowserCookie(DefaultAuthenticationTypes.TwoFactorRememberBrowserCookie);
+
+            // ...
             // [END cookie_authentication]

             // [START google_authentication]


Fixing the datetime format.

Fixing the datetime format.

--- eFormCore/Core.cs
+++ eFormCore/Core.cs
@@ -1530,8 +1530,8 @@
                         + Environment.NewLine + "<root>"
                         + Environment.NewLine + "<C" + reply.Id + " case_id=\"" + caseId + "\" case_name=\"" + reply.Label + "\" serial_number=\"" + caseId + "/" + cDto.MicrotingUId + "\" check_list_status=\"approved\">"
                         + Environment.NewLine + "<worker>" + Advanced_WorkerNameRead(reply.DoneById) + "</worker>"
-                        + Environment.NewLine + "<date>" + reply.DoneAt + "</date>"
-                        + Environment.NewLine + "<check_date>" + reply.DoneAt + "</check_date>"
+                        + Environment.NewLine + "<date>" + reply.DoneAt.ToString("yyyy-MM-dd hh:mm:ss") + "</date>"
+                        + Environment.NewLine + "<check_date>" + reply.DoneAt.ToString("yyyy-MM-dd hh:mm:ss") + "</check_date>"
                         + Environment.NewLine + "<check_lists>"

                         + clsLst
@@ -3424,7 +3424,7 @@

                                                             sqlController.CaseRetract(noteUId, check.Id);
                                                             log.LogEverything("Not Specified", "sqlController.CaseRetract(...)");
-
+                                                            // TODO add case.id
                                                             Case_Dto cDto = sqlController.CaseReadByMUId(noteUId);
                                                             //InteractionCaseUpdate(cDto);
                                                             try { HandleCaseCompleted?.Invoke(cDto, EventArgs.Empty); }


Update IndexModule.cs

Update IndexModule.cs

--- src/AppVeyorDemo/AppVeyorDemo/Modules/IndexModule.cs
+++ src/AppVeyorDemo/AppVeyorDemo/Modules/IndexModule.cs
@@ -12,7 +12,7 @@
             {
                 var model = new IndexViewModel
                 {
-                    HelloName = "AppVeyor",
+                    HelloName = "Leeds#",
                     ServerName = ConfigurationManager.AppSettings["Server_Name"]
                 };


Fix missing </div> in generated report

Fix missing </div> in generated report

--- src/Arkivverket.Arkade/Report/HtmlReportGenerator.cs
+++ src/Arkivverket.Arkade/Report/HtmlReportGenerator.cs
@@ -103,8 +103,8 @@

                 _stream.WriteLine(@"            </tbody>");
                 _stream.WriteLine(@"        </table>");
-                _stream.WriteLine(@"    </div>");
             }
+            _stream.WriteLine(@"    </div>");
         }

         private void Summary(TestSession testSession)


Hide the new, unwanted "Show regional dialects" control

--- src/BloomExe/CollectionCreating/LanguageIdControl.cs
+++ src/BloomExe/CollectionCreating/LanguageIdControl.cs
@@ -15,6 +15,7 @@
 		{
 			InitializeComponent();
 			_lookupISOControl.SelectedLanguage = null;
+			_lookupISOControl.IsShowRegionalDialectsCheckBoxVisible = false;
 		}

 		private void OnLookupISOControlReadinessChanged(object sender, EventArgs e)


Bumped version

Bumped version

--- src/ConDep.Dsl.Operations/Properties/AssemblyInfo.cs
+++ src/ConDep.Dsl.Operations/Properties/AssemblyInfo.cs
@@ -7,8 +7,8 @@
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("ConDep.Dsl.Operations.Core")]
 [assembly: AssemblyCopyright("Copyright © ConDep 2014")]
-[assembly: AssemblyVersion("3.0.1.*")]
-[assembly: AssemblyFileVersion("3.0.1.*")]
+[assembly: AssemblyVersion("3.0.2.*")]
+[assembly: AssemblyFileVersion("3.0.2.*")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]


Update PathGeometryConverter.cs

Update PathGeometryConverter.cs

--- src/Core2D/Modules/Renderer/PathGeometryConverter.cs
+++ src/Core2D/Modules/Renderer/PathGeometryConverter.cs
@@ -71,82 +71,56 @@
         public static AM.StreamGeometry ToStreamGeometry(PathGeometryViewModel xpg)
         {
             var sg = new AM.StreamGeometry();
+            using var sgc = sg.Open();
+            sgc.SetFillRule(xpg.FillRule == FillRule.Nonzero ? AM.FillRule.NonZero : AM.FillRule.EvenOdd);

-            using (var sgc = sg.Open())
+            foreach (var xpf in xpg.Figures)
             {
-                PointShapeViewModel previous = default;
+                sgc.BeginFigure(new A.Point(xpf.StartPoint.X, xpf.StartPoint.Y), false);

-                sgc.SetFillRule(xpg.FillRule == FillRule.Nonzero ? AM.FillRule.NonZero : AM.FillRule.EvenOdd);
+                foreach (var segment in xpf.Segments)
+                {
+                    if (segment is ArcSegmentViewModel arcSegment)
+                    {
+                        sgc.ArcTo(
+                            new A.Point(arcSegment.Point.X, arcSegment.Point.Y),
+                            new A.Size(arcSegment.Size.Width, arcSegment.Size.Height),
+                            arcSegment.RotationAngle,
+                            arcSegment.IsLargeArc,
+                            arcSegment.SweepDirection == SweepDirection.Clockwise ? AM.SweepDirection.Clockwise : AM.SweepDirection.CounterClockwise);
+                    }
+                    else if (segment is CubicBezierSegmentViewModel cubicBezierSegment)
+                    {
+                        sgc.CubicBezierTo(
+                            new A.Point(cubicBezierSegment.Point1.X, cubicBezierSegment.Point1.Y),
+                            new A.Point(cubicBezierSegment.Point2.X, cubicBezierSegment.Point2.Y),
+                            new A.Point(cubicBezierSegment.Point3.X, cubicBezierSegment.Point3.Y));
+                    }
+                    else if (segment is LineSegmentViewModel lineSegment)
+                    {
+                        sgc.LineTo(
+                            new A.Point(lineSegment.Point.X, lineSegment.Point.Y));
+                    }
+                    else if (segment is QuadraticBezierSegmentViewModel quadraticBezierSegment)
+                    {
+                        sgc.QuadraticBezierTo(
+                            new A.Point(
+                                quadraticBezierSegment.Point1.X,
+                                quadraticBezierSegment.Point1.Y),
+                            new A.Point(
+                                quadraticBezierSegment.Point2.X,
+                                quadraticBezierSegment.Point2.Y));
+                    }
+                    else
+                    {
+                        throw new NotSupportedException("Not supported segment type: " + segment.GetType());
+                    }
+                }

-                foreach (var xpf in xpg.Figures)
-                {
-                    sgc.BeginFigure(new A.Point(xpf.StartPoint.X, xpf.StartPoint.Y), false);
-
-                    previous = xpf.StartPoint;
-
-                    foreach (var segment in xpf.Segments)
-                    {
-                        if (segment is ArcSegmentViewModel arcSegment)
-                        {
-                            sgc.ArcTo(
-                                new A.Point(arcSegment.Point.X, arcSegment.Point.Y),
-                                new A.Size(arcSegment.Size.Width, arcSegment.Size.Height),
-                                arcSegment.RotationAngle,
-                                arcSegment.IsLargeArc,
-                                arcSegment.SweepDirection == SweepDirection.Clockwise ? AM.SweepDirection.Clockwise : AM.SweepDirection.CounterClockwise);
-
-                            previous = arcSegment.Point;
-                        }
-                        else if (segment is CubicBezierSegmentViewModel cubicBezierSegment)
-                        {
-                            sgc.CubicBezierTo(
-                                new A.Point(cubicBezierSegment.Point1.X, cubicBezierSegment.Point1.Y),
-                                new A.Point(cubicBezierSegment.Point2.X, cubicBezierSegment.Point2.Y),
-                                new A.Point(cubicBezierSegment.Point3.X, cubicBezierSegment.Point3.Y));
-
-                            previous = cubicBezierSegment.Point3;
-                        }
-                        else if (segment is LineSegmentViewModel lineSegment)
-                        {
-                            sgc.LineTo(
-                                new A.Point(lineSegment.Point.X, lineSegment.Point.Y));
-
-                            previous = lineSegment.Point;
-                        }
-                        else if (segment is QuadraticBezierSegmentViewModel quadraticBezierSegment)
-                        {
-                            sgc.QuadraticBezierTo(
-                                new A.Point(
-                                    quadraticBezierSegment.Point1.X,
-                                    quadraticBezierSegment.Point1.Y),
-                                new A.Point(
-                                    quadraticBezierSegment.Point2.X,
-                                    quadraticBezierSegment.Point2.Y));
-
-                            previous = quadraticBezierSegment.Point2;
-                        }
-                        else
-                        {
-                            throw new NotSupportedException("Not supported segment type: " + segment.GetType());
-                        }
-                    }
-
-                    sgc.EndFigure(xpf.IsClosed);
-                }
+                sgc.EndFigure(xpf.IsClosed);
             }

             return sg;
-        }
-
-        public static PathGeometryViewModel ToPathGeometry(string pathData, IFactory factory)
-        {
-            var pg = AM.PathGeometry.Parse(pathData);
-            return ToPathGeometry(pg, factory);
-        }
-
-        public static AM.Geometry ToGeometry(PathGeometryViewModel xpg)
-        {
-            return ToStreamGeometry(xpg);
         }

         public static AM.Geometry ToGeometry(EllipseShapeViewModel ellipse)
@@ -207,15 +181,5 @@
             sgc.EndFigure(false);
             return sg;
         }
-
-        public static string ToSource(PathGeometryViewModel xpg)
-        {
-            return ToStreamGeometry(xpg).ToString();
-        }
-
-        public static string ToSource(AM.StreamGeometry sg)
-        {
-            return sg.ToString();
-        }
     }
 }


Fixed a thready safety issue . Also ensured that OnCompleted is called for subscribers

--- src/Deputy/Communication/InMemoryTransientMailbox.cs
+++ src/Deputy/Communication/InMemoryTransientMailbox.cs
@@ -43,7 +43,13 @@
                 }
             }

-            return Disposable.Create(() => _mailboxSubscribers.Remove(observer));
+            return Disposable.Create(() => {
+
+                lock(_mailboxSubscribers)
+                    _mailboxSubscribers.Remove(observer);
+
+                observer.OnCompleted();
+            });
         }
     }
 }


#132 - unrolling some of recursion in TryCollectBoundConstants given that some nodes container single sub-node, and the order of collecting cann be done on any order

--- src/FastExpressionCompiler/FastExpressionCompiler.cs
+++ src/FastExpressionCompiler/FastExpressionCompiler.cs
@@ -888,121 +888,152 @@
             !type.IsPrimitive && !type.IsEnum && !(value is string) && !(value is Type);

         // @paramExprs is required for nested lambda compilation
-        private static bool TryCollectBoundConstants(ref ClosureInfo closure, Expression expr,
-            IReadOnlyList<ParameterExpression> paramExprs)
-        {
-            if (expr == null)
-                return false;
-
-            switch (expr.NodeType)
-            {
-                case ExpressionType.Constant:
-                    var constantExpr = (ConstantExpression)expr;
-                    var value = constantExpr.Value;
-                    if (value != null && IsClosureBoundConstant(value, value.GetType().GetTypeInfo()))
-                        closure.AddConstant(constantExpr);
-                    return true;
-
-                case ExpressionType.Parameter:
-                    // if parameter is used BUT is not in passed parameters and not in local variables,
-                    // it means parameter is provided by outer lambda and should be put in closure for current lambda
-                    if (paramExprs.GetFirstIndex(expr) == -1 && !closure.IsLocalVar(expr))
-                        closure.AddNonPassedParam((ParameterExpression)expr);
-                    return true;
-
-                case ExpressionType.Call:
-                    var methodCallExpr = (MethodCallExpression)expr;
-                    var objExpr = methodCallExpr.Object;
-                    return (objExpr == null
-                            || TryCollectBoundConstants(ref closure, objExpr, paramExprs))
-                           && TryCollectBoundConstants(ref closure, methodCallExpr.Arguments, paramExprs);
-
-                case ExpressionType.MemberAccess:
-                    var memberExpr = ((MemberExpression)expr).Expression;
-                    return memberExpr == null || TryCollectBoundConstants(ref closure, memberExpr, paramExprs);
-
-                case ExpressionType.New:
-                    return TryCollectBoundConstants(ref closure, ((NewExpression)expr).Arguments, paramExprs);
-
-                case ExpressionType.NewArrayBounds:
-                case ExpressionType.NewArrayInit:
-                    return TryCollectBoundConstants(ref closure, ((NewArrayExpression)expr).Expressions, paramExprs);
-
-                case ExpressionType.MemberInit:
-                    return TryCollectMemberInitExprConstants(ref closure, (MemberInitExpression)expr, paramExprs);
-
-                case ExpressionType.Lambda:
-                    closure.AddNestedLambda((LambdaExpression)expr);
-                    return true;
-
-                case ExpressionType.Invoke:
-                    var invokeExpr = (InvocationExpression)expr;
-                    // optimization #138: we are inlining invoked lambda body (only for lambdas without arguments)
-                    // therefore we skipping collecting the lambda and invocation arguments and got directly to lambda body.
-                    // This approach is repeated in `TryEmitInvoke`
-                    return invokeExpr.Expression is LambdaExpression lambdaExpr && lambdaExpr.Parameters.Count == 0
-                        ? TryCollectBoundConstants(ref closure, lambdaExpr.Body, paramExprs)
-                        : TryCollectBoundConstants(ref closure, invokeExpr.Expression, paramExprs) &&
-                          TryCollectBoundConstants(ref closure, invokeExpr.Arguments, paramExprs);
-
-                case ExpressionType.Conditional:
-                    var condExpr = (ConditionalExpression)expr;
-                    return TryCollectBoundConstants(ref closure, condExpr.Test, paramExprs)
-                           && TryCollectBoundConstants(ref closure, condExpr.IfTrue, paramExprs)
-                           && TryCollectBoundConstants(ref closure, condExpr.IfFalse, paramExprs);
-
-                case ExpressionType.Block:
-                    var blockExpr = (BlockExpression)expr;
-                    closure.PushBlock(blockExpr.Result, blockExpr.Variables, Tools.Empty<LocalBuilder>());
-                    if (!TryCollectBoundConstants(ref closure, blockExpr.Expressions, paramExprs))
+        private static bool TryCollectBoundConstants(ref ClosureInfo closure, Expression expr, IReadOnlyList<ParameterExpression> paramExprs)
+        {
+            while (true)
+            {
+                if (expr == null)
+                    return false;
+
+                switch (expr.NodeType)
+                {
+                    case ExpressionType.Constant:
+                        var constantExpr = (ConstantExpression)expr;
+                        var value = constantExpr.Value;
+                        if (value != null && IsClosureBoundConstant(value, value.GetType().GetTypeInfo()))
+                            closure.AddConstant(constantExpr);
+                        return true;
+
+                    case ExpressionType.Parameter:
+                        // if parameter is used BUT is not in passed parameters and not in local variables,
+                        // it means parameter is provided by outer lambda and should be put in closure for current lambda
+                        if (paramExprs.GetFirstIndex(expr) == -1 && !closure.IsLocalVar(expr))
+                            closure.AddNonPassedParam((ParameterExpression)expr);
+                        return true;
+
+                    case ExpressionType.Call:
+                        var methodCallExpr = (MethodCallExpression)expr;
+                        if (methodCallExpr.Arguments.Count != 0 &&
+                            !TryCollectBoundConstants(ref closure, methodCallExpr.Arguments, paramExprs))
+                            return false;
+                        if (methodCallExpr.Object == null)
+                            return true;
+                        expr = methodCallExpr.Object;
+                        continue;
+
+                    case ExpressionType.MemberAccess:
+                        var memberExpr = ((MemberExpression)expr).Expression;
+                        if (memberExpr == null)
+                            return true;
+                        expr = memberExpr;
+                        continue;
+
+                    case ExpressionType.New:
+                        return TryCollectBoundConstants(ref closure, ((NewExpression)expr).Arguments, paramExprs);
+
+                    case ExpressionType.NewArrayBounds:
+                    case ExpressionType.NewArrayInit:
+                        return TryCollectBoundConstants(ref closure, ((NewArrayExpression)expr).Expressions, paramExprs);
+
+                    case ExpressionType.MemberInit:
+                        return TryCollectMemberInitExprConstants(ref closure, (MemberInitExpression)expr, paramExprs);
+
+                    case ExpressionType.Lambda:
+                        closure.AddNestedLambda((LambdaExpression)expr);
+                        return true;
+
+                    case ExpressionType.Invoke:
+                        // optimization #138: we are inlining invoked lambda body (only for lambdas without arguments)
+                        // therefore we skipping collecting the lambda and invocation arguments and got directly to lambda body.
+                        // This approach is repeated in `TryEmitInvoke`
+                        var invokeExpr = (InvocationExpression)expr;
+                        if (invokeExpr.Expression is LambdaExpression lambdaExpr && lambdaExpr.Parameters.Count == 0)
+                        {
+                            expr = lambdaExpr.Body;
+                            continue;
+                        }
+
+                        if (invokeExpr.Arguments.Count != 0 &&
+                            !TryCollectBoundConstants(ref closure, invokeExpr.Arguments, paramExprs))
+                            return false;
+
+                        expr = invokeExpr.Expression;
+                        continue;
+
+                    case ExpressionType.Conditional:
+                        var condExpr = (ConditionalExpression)expr;
+                        if (!TryCollectBoundConstants(ref closure, condExpr.Test, paramExprs))
+                            return false;
+                        if (condExpr.IfFalse != null &&
+                            !TryCollectBoundConstants(ref closure, condExpr.IfFalse, paramExprs))
+                            return false;
+                        expr = condExpr.IfTrue;
+                        continue;
+
+                    case ExpressionType.Block:
+                        var blockExpr = (BlockExpression)expr;
+                        closure.PushBlock(blockExpr.Result, blockExpr.Variables, Tools.Empty<LocalBuilder>());
+                        if (!TryCollectBoundConstants(ref closure, blockExpr.Expressions, paramExprs)) return false;
+                        closure.PopBlock();
+                        return true;
+
+                    case ExpressionType.Index:
+                        var indexExpr = (IndexExpression)expr;
+                        if (!TryCollectBoundConstants(ref closure, indexExpr.Arguments, paramExprs))
+                            return false;
+                        if (indexExpr.Object == null)
+                            return true;
+                        expr = indexExpr.Object;
+                        continue;
+
+                    case ExpressionType.Try:
+                        return TryCollectTryExprConstants(ref closure, (TryExpression)expr, paramExprs);
+
+                    case ExpressionType.Label:
+                        closure.LabelCount += 1;
+                        var defaultValueExpr = ((LabelExpression)expr).DefaultValue;
+                        if (defaultValueExpr == null)
+                            return true;
+                        expr = defaultValueExpr;
+                        continue;
+
+                    case ExpressionType.Goto:
+                        var gotoValueExpr = ((GotoExpression)expr).Value;
+                        if (gotoValueExpr == null)
+                            return true;
+                        expr = gotoValueExpr;
+                        continue;
+
+                    case ExpressionType.Switch:
+                        var switchExpr = ((SwitchExpression)expr);
+                        if (!TryCollectBoundConstants(ref closure, switchExpr.SwitchValue, paramExprs) ||
+                            switchExpr.DefaultBody != null && !TryCollectBoundConstants(ref closure, switchExpr.DefaultBody, paramExprs))
+                            return false;
+                        for (var i = 0; i < switchExpr.Cases.Count; i++)
+                            if (!TryCollectBoundConstants(ref closure, switchExpr.Cases[i].Body, paramExprs))
+                                return false;
+                        return true;
+
+                    case ExpressionType.Default:
+                        return true;
+
+                    default:
+                        if (expr is UnaryExpression unaryExpr)
+                        {
+                            expr = unaryExpr.Operand;
+                            continue;
+                        }
+
+                        if (expr is BinaryExpression binaryExpr)
+                        {
+                            if (!TryCollectBoundConstants(ref closure, binaryExpr.Left, paramExprs))
+                                return false;
+                            expr = binaryExpr.Right;
+                            continue;
+                        }
+
                         return false;
-                    closure.PopBlock();
-                    return true;
-
-                case ExpressionType.Index:
-                    var indexExpr = (IndexExpression)expr;
-                    return indexExpr.Object == null
-                           || TryCollectBoundConstants(ref closure, indexExpr.Object, paramExprs)
-                           && TryCollectBoundConstants(ref closure, indexExpr.Arguments, paramExprs);
-
-                case ExpressionType.Try:
-                    return TryCollectTryExprConstants(ref closure, (TryExpression)expr, paramExprs);
-
-                case ExpressionType.Label:
-                    closure.LabelCount += 1;
-                    var defaultValueExpr = ((LabelExpression)expr).DefaultValue;
-                    return defaultValueExpr == null ||
-                           TryCollectBoundConstants(ref closure, defaultValueExpr, paramExprs);
-
-                case ExpressionType.Goto:
-                    var gotoValueExpr = ((GotoExpression)expr).Value;
-                    return gotoValueExpr == null || TryCollectBoundConstants(ref closure, gotoValueExpr, paramExprs);
-
-                case ExpressionType.Switch:
-                    var switchExpression = ((SwitchExpression)expr);
-                    if (!TryCollectBoundConstants(ref closure, switchExpression.SwitchValue, paramExprs))
-                        return false;
-                    if (switchExpression.DefaultBody != null &&
-                        !TryCollectBoundConstants(ref closure, switchExpression.DefaultBody, paramExprs))
-                        return false;
-                    foreach (var sc in switchExpression.Cases)
-                    {
-                        if (!TryCollectBoundConstants(ref closure, sc.Body, paramExprs))
-                            return false;
-                    }
-
-                    return true;
-
-                case ExpressionType.Default:
-                    return true;
-
-                default:
-                    if (expr is UnaryExpression unaryExpr)
-                        return TryCollectBoundConstants(ref closure, unaryExpr.Operand, paramExprs);
-                    if (expr is BinaryExpression binaryExpr)
-                        return TryCollectBoundConstants(ref closure, binaryExpr.Left, paramExprs) &&
-                               TryCollectBoundConstants(ref closure, binaryExpr.Right, paramExprs);
-                    return false;
+                }
             }
         }

@@ -1314,7 +1345,7 @@

                 var leftType = left.Type;
                 var leftTypeInfo = leftType.GetTypeInfo();
-                if (leftTypeInfo.IsValueType) // Nullable -> It's the only ValueType compareable to null
+                if (leftTypeInfo.IsValueType) // Nullable -> It's the only ValueType comparable to null
                 {
                     var loc = il.DeclareLocal(leftType);
                     il.Emit(OpCodes.Stloc_S, loc);
@@ -3285,4 +3316,4 @@
             return result;
         }
     }
-}+}


Spelling fixes.

Spelling fixes.

--- src/Features/Core/Shared/Utilities/PatternMatcher.cs
+++ src/Features/Core/Shared/Utilities/PatternMatcher.cs
@@ -296,7 +296,7 @@
         /// candidate. If the container is provided, and the pattern itself contains dots, then
         /// the pattern will be tested against the candidate and container.  Specifically,
         /// the part of the pattern after the last dot will be tested against the candidate. If
-        /// a match occurs there, then the remaining dot-separated portoins of the pattern will
+        /// a match occurs there, then the remaining dot-separated portions of the pattern will
         /// be tested against every successive portion of the container from right to left.
         ///
         /// i.e. if you have a pattern of "Con.WL" and the candidate is "WriteLine" with a
@@ -330,7 +330,7 @@

             var containerParts = dottedContainer.Split(DotCharacterArray, StringSplitOptions.RemoveEmptyEntries);

-            // -1 because the last part was checked against hte name, and only the rest
+            // -1 because the last part was checked against the name, and only the rest
             // of the parts are checked against the container.
             if (patternParts.Length - 1 > containerParts.Length)
             {


Remove unused private method

Remove unused private method

--- src/Hyde/Table/Azure/AzureTableEntityTableContext.cs
+++ src/Hyde/Table/Azure/AzureTableEntityTableContext.cs
@@ -333,12 +333,6 @@
          return (GenericTableEntity)result.Result;
       }

-      private IEnumerable<dynamic> ExecuteFilterOnTable( string tableName, string filter )
-      {
-         var query = new TableQuery<GenericTableEntity>().Where( filter );
-         return Table( tableName ).ExecuteQuery( query ).Select( e => e.ConvertToDynamic() );
-      }
-
       private CloudTable Table( string tableName )
       {
          return new CloudTableClient( new Uri( _storageAccount.TableEndpoint ), _storageAccount.Credentials ).GetTableReference( tableName );


Lucene.Net.Core.Search.DocTermOrdsRangeFilter refactor: renamed fields camelCase

--- src/Lucene.Net.Core/Search/DocTermOrdsRangeFilter.cs
+++ src/Lucene.Net.Core/Search/DocTermOrdsRangeFilter.cs
@@ -36,19 +36,19 @@

     public abstract class DocTermOrdsRangeFilter : Filter
     {
-        internal readonly string Field_Renamed; // LUCENENET TODO: rename (private)
-        internal readonly BytesRef LowerVal_Renamed; // LUCENENET TODO: rename (private)
-        internal readonly BytesRef UpperVal_Renamed; // LUCENENET TODO: rename (private)
-        internal readonly bool IncludeLower; // LUCENENET TODO: rename (private)
-        internal readonly bool IncludeUpper; // LUCENENET TODO: rename (private)
+        internal readonly string field;
+        internal readonly BytesRef lowerVal;
+        internal readonly BytesRef upperVal;
+        internal readonly bool includeLower;
+        internal readonly bool includeUpper;

         private DocTermOrdsRangeFilter(string field, BytesRef lowerVal, BytesRef upperVal, bool includeLower, bool includeUpper)
         {
-            this.Field_Renamed = field;
-            this.LowerVal_Renamed = lowerVal;
-            this.UpperVal_Renamed = upperVal;
-            this.IncludeLower = includeLower;
-            this.IncludeUpper = includeUpper;
+            this.field = field;
+            this.lowerVal = lowerVal;
+            this.upperVal = upperVal;
+            this.includeLower = includeLower;
+            this.includeUpper = includeUpper;
         }

         ///
@@ -67,28 +67,16 @@

         private class DocTermOrdsRangeFilterAnonymousInnerClassHelper : DocTermOrdsRangeFilter
         {
-            // LUCENENET TODO: should rely on base class for these variables
-            private new string Field;
-            private new BytesRef LowerVal;
-            private new BytesRef UpperVal;
-            private new bool IncludeLower;
-            private new bool IncludeUpper;
-
             public DocTermOrdsRangeFilterAnonymousInnerClassHelper(string field, BytesRef lowerVal, BytesRef upperVal, bool includeLower, bool includeUpper)
                 : base(field, lowerVal, upperVal, includeLower, includeUpper)
             {
-                this.Field = field;
-                this.LowerVal = lowerVal;
-                this.UpperVal = upperVal;
-                this.IncludeLower = includeLower;
-                this.IncludeUpper = includeUpper;
             }

             public override DocIdSet GetDocIdSet(AtomicReaderContext context, Bits acceptDocs)
             {
-                SortedSetDocValues docTermOrds = FieldCache.DEFAULT.GetDocTermOrds(context.AtomicReader, Field);
-                long lowerPoint = LowerVal == null ? -1 : docTermOrds.LookupTerm(LowerVal);
-                long upperPoint = UpperVal == null ? -1 : docTermOrds.LookupTerm(UpperVal);
+                SortedSetDocValues docTermOrds = FieldCache.DEFAULT.GetDocTermOrds(context.AtomicReader, field);
+                long lowerPoint = lowerVal == null ? -1 : docTermOrds.LookupTerm(lowerVal);
+                long upperPoint = upperVal == null ? -1 : docTermOrds.LookupTerm(upperVal);

                 long inclusiveLowerPoint, inclusiveUpperPoint;

@@ -96,11 +84,11 @@
                 // * binarySearchLookup returns -1, if value was null.
                 // * the value is <0 if no exact hit was found, the returned value
                 //   is (-(insertion point) - 1)
-                if (lowerPoint == -1 && LowerVal == null)
+                if (lowerPoint == -1 && lowerVal == null)
                 {
                     inclusiveLowerPoint = 0;
                 }
-                else if (IncludeLower && lowerPoint >= 0)
+                else if (includeLower && lowerPoint >= 0)
                 {
                     inclusiveLowerPoint = lowerPoint;
                 }
@@ -113,11 +101,11 @@
                     inclusiveLowerPoint = Math.Max(0, -lowerPoint - 1);
                 }

-                if (upperPoint == -1 && UpperVal == null)
+                if (upperPoint == -1 && upperVal == null)
                 {
                     inclusiveUpperPoint = long.MaxValue;
                 }
-                else if (IncludeUpper && upperPoint >= 0)
+                else if (includeUpper && upperPoint >= 0)
                 {
                     inclusiveUpperPoint = upperPoint;
                 }
@@ -142,32 +130,32 @@

             private class FieldCacheDocIdSetAnonymousInnerClassHelper : FieldCacheDocIdSet
             {
-                private readonly DocTermOrdsRangeFilterAnonymousInnerClassHelper OuterInstance; // LUCENENET TODO: rename (private)
-
-                private readonly SortedSetDocValues DocTermOrds; // LUCENENET TODO: rename (private)
-                private readonly long InclusiveLowerPoint; // LUCENENET TODO: rename (private)
-                private readonly long InclusiveUpperPoint; // LUCENENET TODO: rename (private)
+                private readonly DocTermOrdsRangeFilterAnonymousInnerClassHelper outerInstance;
+
+                private readonly SortedSetDocValues docTermOrds;
+                private readonly long inclusiveLowerPoint;
+                private readonly long inclusiveUpperPoint;

                 public FieldCacheDocIdSetAnonymousInnerClassHelper(DocTermOrdsRangeFilterAnonymousInnerClassHelper outerInstance, int maxDoc, Bits acceptDocs, SortedSetDocValues docTermOrds, long inclusiveLowerPoint, long inclusiveUpperPoint)
                     : base(maxDoc, acceptDocs)
                 {
-                    this.OuterInstance = outerInstance;
-                    this.DocTermOrds = docTermOrds;
-                    this.InclusiveLowerPoint = inclusiveLowerPoint;
-                    this.InclusiveUpperPoint = inclusiveUpperPoint;
+                    this.outerInstance = outerInstance;
+                    this.docTermOrds = docTermOrds;
+                    this.inclusiveLowerPoint = inclusiveLowerPoint;
+                    this.inclusiveUpperPoint = inclusiveUpperPoint;
                 }

                 protected internal override sealed bool MatchDoc(int doc)
                 {
-                    DocTermOrds.SetDocument(doc);
+                    docTermOrds.SetDocument(doc);
                     long ord;
-                    while ((ord = DocTermOrds.NextOrd()) != SortedSetDocValues.NO_MORE_ORDS)
+                    while ((ord = docTermOrds.NextOrd()) != SortedSetDocValues.NO_MORE_ORDS)
                     {
-                        if (ord > InclusiveUpperPoint)
+                        if (ord > inclusiveUpperPoint)
                         {
                             return false;
                         }
-                        else if (ord >= InclusiveLowerPoint)
+                        else if (ord >= inclusiveLowerPoint)
                         {
                             return true;
                         }
@@ -179,12 +167,12 @@

         public override sealed string ToString()
         {
-            StringBuilder sb = (new StringBuilder(Field_Renamed)).Append(":");
-            return sb.Append(IncludeLower ? '[' : '{')
-                .Append((LowerVal_Renamed == null) ? "*" : LowerVal_Renamed.ToString())
+            StringBuilder sb = (new StringBuilder(field)).Append(":");
+            return sb.Append(includeLower ? '[' : '{')
+                .Append((lowerVal == null) ? "*" : lowerVal.ToString())
                 .Append(" TO ")
-                .Append((UpperVal_Renamed == null) ? "*" : UpperVal_Renamed.ToString())
-                .Append(IncludeUpper ? ']' : '}')
+                .Append((upperVal == null) ? "*" : upperVal.ToString())
+                .Append(includeUpper ? ']' : '}')
                 .ToString();
         }

@@ -200,15 +188,15 @@
             }
             DocTermOrdsRangeFilter other = (DocTermOrdsRangeFilter)o;

-            if (!this.Field_Renamed.Equals(other.Field_Renamed) || this.IncludeLower != other.IncludeLower || this.IncludeUpper != other.IncludeUpper)
-            {
-                return false;
-            }
-            if (this.LowerVal_Renamed != null ? !this.LowerVal_Renamed.Equals(other.LowerVal_Renamed) : other.LowerVal_Renamed != null)
-            {
-                return false;
-            }
-            if (this.UpperVal_Renamed != null ? !this.UpperVal_Renamed.Equals(other.UpperVal_Renamed) : other.UpperVal_Renamed != null)
+            if (!this.field.Equals(other.field) || this.includeLower != other.includeLower || this.includeUpper != other.includeUpper)
+            {
+                return false;
+            }
+            if (this.lowerVal != null ? !this.lowerVal.Equals(other.lowerVal) : other.lowerVal != null)
+            {
+                return false;
+            }
+            if (this.upperVal != null ? !this.upperVal.Equals(other.upperVal) : other.upperVal != null)
             {
                 return false;
             }
@@ -217,11 +205,11 @@

         public override sealed int GetHashCode()
         {
-            int h = Field_Renamed.GetHashCode();
-            h ^= (LowerVal_Renamed != null) ? LowerVal_Renamed.GetHashCode() : 550356204;
+            int h = field.GetHashCode();
+            h ^= (lowerVal != null) ? lowerVal.GetHashCode() : 550356204;
             h = (h << 1) | ((int)((uint)h >> 31)); // rotate to distinguish lower from upper
-            h ^= (UpperVal_Renamed != null) ? UpperVal_Renamed.GetHashCode() : -1674416163;
-            h ^= (IncludeLower ? 1549299360 : -365038026) ^ (IncludeUpper ? 1721088258 : 1948649653);
+            h ^= (upperVal != null) ? upperVal.GetHashCode() : -1674416163;
+            h ^= (includeLower ? 1549299360 : -365038026) ^ (includeUpper ? 1721088258 : 1948649653);
             return h;
         }

@@ -231,7 +219,7 @@
         {
             get
             {
-                return Field_Renamed;
+                return field;
             }
         }

@@ -239,14 +227,14 @@
         /// Returns true if the lower endpoint is inclusive
         public virtual bool IncludesLower
         {
-            get { return IncludeLower; }
+            get { return includeLower; }
         }

         ///
         /// Returns true if the upper endpoint is inclusive
         public virtual bool IncludesUpper
         {
-            get { return IncludeUpper; }
+            get { return includeUpper; }
         }

         ///
@@ -255,7 +243,7 @@
         {
             get
             {
-                return LowerVal_Renamed;
+                return lowerVal;
             }
         }

@@ -265,7 +253,7 @@
         {
             get
             {
-                return UpperVal_Renamed;
+                return upperVal;
             }
         }
     }


build out the test

build out the test

--- src/MassTransit.HttpTransport.Tests/HttpHostTests.cs
+++ src/MassTransit.HttpTransport.Tests/HttpHostTests.cs
@@ -16,10 +16,14 @@
     using System.Net.Http;
     using System.Threading;
     using System.Threading.Tasks;
+    using Clients;
     using Configuration.Builders;
     using GreenPipes;
     using Hosting;
+    using MassTransit.Pipeline.Pipes;
     using NUnit.Framework;
+    using Serialization;
+    using Transports;
     using Util;

@@ -49,13 +53,21 @@
         public async Task HttpHost_Endpoints()
         {
             var host = new HttpHost(new ConfigurationHostSettings("http", "localhost", 8080, HttpMethod.Post));
-            var rep = new HttpReceiveTransport(host, null, null);
-            var randle = rep.Start(Pipe.Empty<ReceiveContext>());
+            var hosts = new BusHostCollection<HttpHost>();
+            hosts.Add(host);
+
+            var ser = new JsonMessageSerializer();
+            var stp = new HttpSendTransportProvider(hosts);
+            SendPipe sp = null;
+            var sep = new HttpSendEndpointProvider(ser, new Uri("http://localhost:8080"), stp, sp);
+            var pep = new HttpPublishEndpointProvider();
+            var httpReceiveTransport = new HttpReceiveTransport(host, sep, pep);
+            var receiveTransportHandle = httpReceiveTransport.Start(Pipe.Empty<ReceiveContext>());

             var handle = await host.Start();
             using (var tokenSource = new CancellationTokenSource(TimeSpan.FromMinutes(1)))
             {
-                await randle.Stop(tokenSource.Token);
+                await receiveTransportHandle.Stop(tokenSource.Token);
                 await handle.Stop(tokenSource.Token);
             }
         }


Invoke 'ScrollIntoView' after changing scroll positions; fixing keystroke-based scrolling.

--- src/Mirage.Urbanization.WinForms/AreaRenderHelper.cs
+++ src/Mirage.Urbanization.WinForms/AreaRenderHelper.cs
@@ -56,9 +56,11 @@
             return _zoneSelectionPanelBehaviour.HandleKeyCharAction(@char);
         }

-        private static void MoveScroll(ScrollProperties scrollProperties, int modifier)
-        {
-            var newValue = scrollProperties.Value + (modifier * 300);
+        private static void MoveScroll(Panel panel, Func<Panel, ScrollProperties> scrollPropertiesSelector, int modifier)
+        {
+            var scrollProperties = scrollPropertiesSelector(panel);
+
+            int newValue = scrollProperties.Value + (((int)modifier * 300));
             if (newValue > scrollProperties.Minimum && newValue < scrollProperties.Maximum)
             {
                 scrollProperties.Value = newValue;
@@ -75,27 +77,27 @@
             {
                 throw new InvalidOperationException();
             }
-
+            panel.ScrollControlIntoView(panel);
         }

         public void MoveRight()
         {
-            MoveScroll(_viewportPanel.HorizontalScroll, 1);
+            MoveScroll(_viewportPanel, x => x.HorizontalScroll, 1);
         }

         public void MoveLeft()
         {
-            MoveScroll(_viewportPanel.HorizontalScroll, -1);
+            MoveScroll(_viewportPanel, x => x.HorizontalScroll, -1);
         }

         public void MoveUp()
         {
-            MoveScroll(_viewportPanel.VerticalScroll, -1);
+            MoveScroll(_viewportPanel, x => x.VerticalScroll, -1);
         }

         public void MoveDown()
         {
-            MoveScroll(_viewportPanel.VerticalScroll, 1);
+            MoveScroll(_viewportPanel, x => x.VerticalScroll, 1);
         }

         public SimulationRenderHelper(Panel gamePanel, RenderZoneOptions renderZoneOptions, SimulationOptions options)


Fix a crash where we'd end up doing network requests on the UI thread

--- src/ModernHttpClient.Android/OkHttpNetworkHandler.cs
+++ src/ModernHttpClient.Android/OkHttpNetworkHandler.cs
@@ -26,12 +26,15 @@
             var rq = client.Open(new Java.Net.URL(request.RequestUri.ToString()));
             rq.RequestMethod = request.Method.Method.ToUpperInvariant();

+            // NB: This is a trick to get us off the UI thread
+            await Task.Run(() => {}).ConfigureAwait(false);
+
             foreach (var kvp in request.Headers) { rq.SetRequestProperty(kvp.Key, kvp.Value.FirstOrDefault()); }

             if (request.Content != null) {
                 foreach (var kvp in request.Content.Headers) { rq.SetRequestProperty (kvp.Key, kvp.Value.FirstOrDefault ()); }

-                var contentStream = await request.Content.ReadAsStreamAsync();
+                var contentStream = await request.Content.ReadAsStreamAsync().ConfigureAwait(false);
                 await copyToAsync(contentStream, rq.OutputStream, cancellationToken).ConfigureAwait(false);
                 rq.OutputStream.Close();
             }
@@ -40,14 +43,16 @@
             var reason = default(string);

             try {
-                await copyToAsync(rq.InputStream, body, cancellationToken);
+                // NB: Apparently my trick only works sometimes. Android will
+                // make us suffer if we try to run anything on the UI thread
+                await Task.Run(async () => await copyToAsync(rq.InputStream, body, cancellationToken));
             } catch (Exception ex) {
                 reason = ex.Message;
             } finally {
                 rq.InputStream.Close();
             }

-            if (reason != null) {
+            if (reason != null && rq.ErrorStream != null) {
                 try {
                     await rq.ErrorStream.CopyToAsync (body).ConfigureAwait (false);
                 } finally {


NH3202/Fixture.cs: Minor cleanup.

NH3202/Fixture.cs: Minor cleanup.

--- src/NHibernate.Test/NHSpecificTest/NH3202/Fixture.cs
+++ src/NHibernate.Test/NHSpecificTest/NH3202/Fixture.cs
@@ -13,7 +13,7 @@
 		protected override void Configure(Configuration configuration)
 		{
 			if (!(Dialect is MsSql2008Dialect))
-				Assert.Ignore("Test is for SQL dialect only");
+				Assert.Ignore("Test is for MS SQL Server dialect only (custom dialect).");

 			cfg.SetProperty(Environment.Dialect, typeof(OffsetStartsAtOneTestDialect).AssemblyQualifiedName);
 			cfg.SetProperty(Environment.ConnectionDriver, typeof(OffsetTestDriver).AssemblyQualifiedName);
@@ -34,7 +34,7 @@
 			CustomDriver.OffsetStartsAtOneTestDialect = OffsetStartsAtOneTestDialect;

 			base.OnSetUp();
-
+
 			using (var session = OpenSession())
 			using (var transaction = session.BeginTransaction())
 			{
@@ -49,7 +49,6 @@

 		protected override void OnTearDown()
 		{
-
 			using (ISession s = OpenSession())
 			using (ITransaction t = s.BeginTransaction())
 			{
@@ -61,9 +60,8 @@

 		[Test]
-		public void Offset_not_starting_at_one_sets_parameter_to_skip_value()
+		public void OffsetNotStartingAtOneSetsParameterToSkipValue()
 		{
-
 			OffsetStartsAtOneTestDialect.ForceOffsetStartsAtOne = false;

 			using (var session = OpenSession())
@@ -75,13 +73,12 @@
 					.SingleOrDefault<SequencedItem>();

 				Assert.That(CustomDriver.OffsetParameterValueFromCommand, Is.EqualTo(2));
-			}
+			}
 		}

 		[Test]
-		public void Offset_starting_at_one_sets_parameter_to_skip_value_plus_one()
+		public void OffsetStartingAtOneSetsParameterToSkipValuePlusOne()
 		{
-
 			OffsetStartsAtOneTestDialect.ForceOffsetStartsAtOne = true;

 			using (var session = OpenSession())
@@ -93,10 +90,8 @@
 					.SingleOrDefault<SequencedItem>();

 				Assert.That(CustomDriver.OffsetParameterValueFromCommand, Is.EqualTo(3));
-			}
+			}
 		}
-
-
 	}

 	public class OffsetStartsAtOneTestDialect : MsSql2008Dialect
@@ -122,7 +117,7 @@
 			if (!hasLimit)
 				return;

-			OffsetParameterValueFromCommand = (int) ((IDataParameter) command.Parameters[_offsetParameterIndex]).Value;
+			OffsetParameterValueFromCommand = (int)((IDataParameter)command.Parameters[_offsetParameterIndex]).Value;
 		}
 	}
 }


Changed the way a SocketGuildUser is retrieved in LevelService#AddLevelRole

--- src/NadekoBot/Modules/Level/Services/LevelService.cs
+++ src/NadekoBot/Modules/Level/Services/LevelService.cs
@@ -28,8 +28,10 @@
         private Task AddLevelRole(SocketMessage sm)
         {
             if (sm.Author.IsBot) return Task.CompletedTask;
+            var stc = sm.Channel as SocketTextChannel;
+            if (stc == null) return Task.CompletedTask;
             List<IRole> rolesToAdd;
-            var user = (SocketGuildUser) _client.GetUser(sm.Author.Id);
+            var user = stc.GetUser(sm.Id);
             sm.Channel.SendMessageAsync($"username: {user.Mention}, guild: {user.Guild.Name}").GetAwaiter().GetResult();
             using (var uow = _db.UnitOfWork) {
                 var userLevel = uow.LevelModel.GetLevel(sm.Author.Id);


Kleiner Test

Kleiner Test

--- src/NadekoBot/Modules/Level/Services/LevelService.cs
+++ src/NadekoBot/Modules/Level/Services/LevelService.cs
@@ -56,6 +56,7 @@
                 SendLevelChangedMessage(uow.LevelModel.CalculateLevel(sm.Author.Id), sm.Author, sm.Channel);
                 uow.Complete();
             }
+            AddLevelRole(sm);
             return Task.CompletedTask;
         }