Add more logs

Add more logs

--- Enyim.Caching/MemcachedClient.cs
+++ Enyim.Caching/MemcachedClient.cs
@@ -200,6 +200,7 @@
         {
             if (!CreateGetCommand<T>(key, out var result, out var node, out var command))
             {
+                _logger.LogInformation($"Failed to CreateGetCommand for '{key}' key");
                 return result;
             }


Fix Overlap detection

Fix Overlap detection

--- src/Cryptography/Utilities.cs
+++ src/Cryptography/Utilities.cs
@@ -22,8 +22,8 @@
             byteOffset = Unsafe.ByteOffset(ref first.DangerousGetPinnableReference(), ref second.DangerousGetPinnableReference());

             return (sizeof(IntPtr) == sizeof(int))
-                ? second.Length != 0 && unchecked((uint)byteOffset < (uint)first.Length || (uint)byteOffset > (uint)-second.Length)
-                : second.Length != 0 && unchecked((ulong)byteOffset < (ulong)first.Length || (ulong)byteOffset > (ulong)-second.Length);
+                ? !first.IsEmpty && !second.IsEmpty && unchecked((uint)byteOffset < (uint)first.Length || (uint)byteOffset > (uint)-second.Length)
+                : !first.IsEmpty && !second.IsEmpty && unchecked((ulong)byteOffset < (ulong)first.Length || (ulong)byteOffset > (ulong)-second.Length);
         }
     }
 }


Improve the PackMessage method

Improve the PackMessage method

--- Espera.Network/NetworkHelpers.cs
+++ Espera.Network/NetworkHelpers.cs
@@ -3,7 +3,6 @@
 using System;
 using System.IO;
 using System.IO.Compression;
-using System.Linq;
 using System.Net.Sockets;
 using System.Text;
 using System.Threading.Tasks;
@@ -42,14 +41,19 @@

         public static async Task<byte[]> PackMessageAsync(NetworkMessage message)
         {
-            string serialized = JsonConvert.SerializeObject(message, Formatting.None);
+            string serialized = await Task.Run(() => JsonConvert.SerializeObject(message, Formatting.None));
             byte[] contentBytes = Encoding.UTF8.GetBytes(serialized);

             contentBytes = await CompressDataAsync(contentBytes);

             byte[] length = BitConverter.GetBytes(contentBytes.Length); // We have a fixed size of 4 bytes

-            return length.Concat(contentBytes).ToArray();
+            var returnData = new byte[length.Length + serialized.Length];
+
+            Buffer.BlockCopy(length, 0, returnData, 0, length.Length);
+            Buffer.BlockCopy(contentBytes, 0, returnData, length.Length, contentBytes.Length);
+
+            return returnData;
         }

         public static async Task<FileTransferMessage> ReadNextFileTransferMessageAsync(this TcpClient client)


Add an explicit IEnumerable<TEntity>.GetEnumerator() implementation to
Table<TEntity>.  This is done for cor-compare compatibility with .NET.

If we don't explicitly implement IEnumerable<TEntity>.GetEnumerator(), then
Table<TEntity>.GetEnumerator() is 'public final virtual hidebysig newslot',
while .NET is just 'public hidebysig'.  The only way to match the full
signature is to ensure that Table<TEntity>.GetEnumerator() isn't the interface
implementation for IEnumerable<TEntity>.GetEnumerator(), thus we need to
introduce an explicit implementation.

git-svn-id: 1800f71f313d917366f95485fa960eed04b40598@1028 33146b6e-df29-0410-a1ca-39be37fb9416

--- src/DbLinq/Data/Linq/Table.cs
+++ src/DbLinq/Data/Linq/Table.cs
@@ -131,14 +131,18 @@
             return query.GetEnumerator();
         }

+        IEnumerator<TEntity> IEnumerable<TEntity>.GetEnumerator()
+        {
+            return GetEnumerator();
+        }
+
         /// <summary>
         /// Enumerates all table items
         /// </summary>
         /// <returns></returns>
         IEnumerator IEnumerable.GetEnumerator()
         {
-            var enumT = GetEnumerator();
-            return enumT;
+            return GetEnumerator();
         }

         Type IQueryable.ElementType


example: echo.bus.tls, pull nsqConfig into variable

--- Examples/Echo.Bus.Tls/Program.cs
+++ Examples/Echo.Bus.Tls/Program.cs
@@ -31,6 +31,18 @@
             // new dependency injection container
             var container = new ContainerBuilder().Build();

+            var nsqConfig = new Config
+                            {
+                                TlsConfig = new TlsConfig
+                                            {
+                                                MinVersion = SslProtocols.Tls12,
+                                                InsecureSkipVerify = true // NOTE: For testing only
+                                            },
+                                LookupdPollInterval = TimeSpan.FromSeconds(5),
+                                AuthSecret = "b2b:secret",
+                                DialTimeout = TimeSpan.FromSeconds(10)
+                            };
+
             // start the bus
             BusService.Start(new BusConfiguration(
                 new AutofacObjectBuilder(container), // dependency injection container
@@ -52,15 +64,7 @@
                 defaultNsqLookupdHttpEndpoints: new[] { "127.0.0.1:4161" },
                 nsqLogger: new ConsoleLogger(LogLevel.Info), // default = TraceLogger
                 defaultThreadsPerHandler: 1, // threads per handler. tweak based on use case.
-                nsqConfig: new Config
-                {
-                    TlsConfig = new TlsConfig
-                    {
-                        MinVersion = SslProtocols.Tls12,
-                        InsecureSkipVerify = true // NOTE: For testing only
-                    },
-                    LookupdPollInterval = TimeSpan.FromSeconds(5)
-                }
+                nsqConfig: nsqConfig
             ));
         }
     }


fixed experiment body restrictions evaluation

--- src/Kerbalism/Science/ExperimentInfo.cs
+++ src/Kerbalism/Science/ExperimentInfo.cs
@@ -251,10 +251,18 @@

 			public bool IsBodyAllowed(CelestialBody body)
 			{
-				bool isAllowed = true;
-
-				foreach (BodyCondition bodyCondition in bodiesAllowed)
-					isAllowed &= bodyCondition.TestCondition(body);
+				bool isAllowed;
+
+				if (bodiesAllowed.Count > 0)
+				{
+					isAllowed = false;
+					foreach (BodyCondition bodyCondition in bodiesAllowed)
+						isAllowed |= bodyCondition.TestCondition(body);
+				}
+				else
+				{
+					isAllowed = true;
+				}

 				foreach (BodyCondition bodyCondition in bodiesNotAllowed)
 					isAllowed &= !bodyCondition.TestCondition(body);


Fixed mistake

Fixed mistake

Fixed mistake with DiscordApiData types

--- src/Discore/DiscordApiData.cs
+++ src/Discore/DiscordApiData.cs
@@ -753,24 +753,29 @@
         }
         #endregion

-        static readonly DiscordApiData _valueType = new DiscordApiData(DiscordApiDataType.Value);
-        static readonly DiscordApiData _containerType = new DiscordApiData(DiscordApiDataType.Container);
-        static readonly DiscordApiData _arrayType = new DiscordApiData(DiscordApiDataType.Array);
-
         /// <summary>
         /// Creates a new value-type <see cref="DiscordApiData"/>.
         /// </summary>
-        public static DiscordApiData ValueType => _valueType;
+        public static DiscordApiData CreateValue()
+        {
+            return new DiscordApiData(DiscordApiDataType.Value);
+        }

         /// <summary>
         /// Creates a new container-type <see cref="DiscordApiData"/>.
         /// </summary>
-        public static DiscordApiData ContainerType => _containerType;
+        public static DiscordApiData CreateContainer()
+        {
+            return new DiscordApiData(DiscordApiDataType.Container);
+        }

         /// <summary>
         /// Creates a new array-type <see cref="DiscordApiData"/>.
         /// </summary>
-        public static DiscordApiData ArrayType => _arrayType;
+        public static DiscordApiData CreateArray()
+        {
+            return new DiscordApiData(DiscordApiDataType.Array);
+        }

         /// <summary>
         /// Serializes this api data object to a JSON string.


Changed URL to my website

Changed URL to my website

--- FRC_Scouting_V2/Home.Designer.cs
+++ FRC_Scouting_V2/Home.Designer.cs
@@ -74,18 +74,19 @@
             this.tableLayoutPanel1.Controls.Add(this.isInternetConnectedLabel, 4, 8);
             this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
+            this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.tableLayoutPanel1.Name = "tableLayoutPanel1";
             this.tableLayoutPanel1.RowCount = 9;
-            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
-            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
-            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
-            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
-            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
-            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
-            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
-            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
-            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
-            this.tableLayoutPanel1.Size = new System.Drawing.Size(496, 379);
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 48F));
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 38F));
+            this.tableLayoutPanel1.Size = new System.Drawing.Size(992, 729);
             this.tableLayoutPanel1.TabIndex = 0;
             //
             // frcLogoPictureBox
@@ -93,10 +94,11 @@
             this.tableLayoutPanel1.SetColumnSpan(this.frcLogoPictureBox, 8);
             this.frcLogoPictureBox.Dock = System.Windows.Forms.DockStyle.Fill;
             this.frcLogoPictureBox.Image = global::FRC_Scouting_V2.Properties.Resources.FRC_LOGO;
-            this.frcLogoPictureBox.Location = new System.Drawing.Point(3, 28);
+            this.frcLogoPictureBox.Location = new System.Drawing.Point(6, 54);
+            this.frcLogoPictureBox.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.frcLogoPictureBox.Name = "frcLogoPictureBox";
             this.tableLayoutPanel1.SetRowSpan(this.frcLogoPictureBox, 7);
-            this.frcLogoPictureBox.Size = new System.Drawing.Size(490, 323);
+            this.frcLogoPictureBox.Size = new System.Drawing.Size(980, 625);
             this.frcLogoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
             this.frcLogoPictureBox.TabIndex = 1;
             this.frcLogoPictureBox.TabStop = false;
@@ -114,7 +116,8 @@
             this.eventSelector});
             this.menuStrip1.Location = new System.Drawing.Point(0, 0);
             this.menuStrip1.Name = "menuStrip1";
-            this.menuStrip1.Size = new System.Drawing.Size(496, 25);
+            this.menuStrip1.Padding = new System.Windows.Forms.Padding(6, 4, 0, 4);
+            this.menuStrip1.Size = new System.Drawing.Size(992, 48);
             this.menuStrip1.TabIndex = 0;
             this.menuStrip1.Text = "menuStrip1";
             //
@@ -123,13 +126,13 @@
             this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.exitToolStripMenuItem});
             this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
-            this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 21);
+            this.fileToolStripMenuItem.Size = new System.Drawing.Size(64, 40);
             this.fileToolStripMenuItem.Text = "File";
             //
             // exitToolStripMenuItem
             //
             this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
-            this.exitToolStripMenuItem.Size = new System.Drawing.Size(92, 22);
+            this.exitToolStripMenuItem.Size = new System.Drawing.Size(127, 36);
             this.exitToolStripMenuItem.Text = "Exit";
             this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
             //
@@ -145,58 +148,58 @@
             this.teamInformationLookupToolStripMenuItem,
             this.eventInformationLookupToolStripMenuItem});
             this.informationToolStripMenuItem.Name = "informationToolStripMenuItem";
-            this.informationToolStripMenuItem.Size = new System.Drawing.Size(82, 21);
+            this.informationToolStripMenuItem.Size = new System.Drawing.Size(152, 40);
             this.informationToolStripMenuItem.Text = "Information";
             //
             // changelogToolStripMenuItem
             //
             this.changelogToolStripMenuItem.Name = "changelogToolStripMenuItem";
-            this.changelogToolStripMenuItem.Size = new System.Drawing.Size(221, 22);
+            this.changelogToolStripMenuItem.Size = new System.Drawing.Size(388, 36);
             this.changelogToolStripMenuItem.Text = "Changelog";
             this.changelogToolStripMenuItem.Click += new System.EventHandler(this.changelogToolStripMenuItem_Click);
             //
             // toolStripSeparator1
             //
             this.toolStripSeparator1.Name = "toolStripSeparator1";
-            this.toolStripSeparator1.Size = new System.Drawing.Size(218, 6);
+            this.toolStripSeparator1.Size = new System.Drawing.Size(385, 6);
             //
             // fRC3710TeamInformationToolStripMenuItem
             //
             this.fRC3710TeamInformationToolStripMenuItem.Name = "fRC3710TeamInformationToolStripMenuItem";
-            this.fRC3710TeamInformationToolStripMenuItem.Size = new System.Drawing.Size(221, 22);
+            this.fRC3710TeamInformationToolStripMenuItem.Size = new System.Drawing.Size(388, 36);
             this.fRC3710TeamInformationToolStripMenuItem.Text = "FRC 3710 Team Information";
             this.fRC3710TeamInformationToolStripMenuItem.Click += new System.EventHandler(this.fRC3710TeamInformationToolStripMenuItem_Click);
             //
             // programInformationToolStripMenuItem
             //
             this.programInformationToolStripMenuItem.Name = "programInformationToolStripMenuItem";
-            this.programInformationToolStripMenuItem.Size = new System.Drawing.Size(221, 22);
+            this.programInformationToolStripMenuItem.Size = new System.Drawing.Size(388, 36);
             this.programInformationToolStripMenuItem.Text = "Program Information";
             this.programInformationToolStripMenuItem.Click += new System.EventHandler(this.programInformationToolStripMenuItem_Click);
             //
             // licenseInformationToolStripMenuItem
             //
             this.licenseInformationToolStripMenuItem.Name = "licenseInformationToolStripMenuItem";
-            this.licenseInformationToolStripMenuItem.Size = new System.Drawing.Size(221, 22);
+            this.licenseInformationToolStripMenuItem.Size = new System.Drawing.Size(388, 36);
             this.licenseInformationToolStripMenuItem.Text = "License Information";
             this.licenseInformationToolStripMenuItem.Click += new System.EventHandler(this.licenseInformationToolStripMenuItem_Click);
             //
             // toolStripSeparator2
             //
             this.toolStripSeparator2.Name = "toolStripSeparator2";
-            this.toolStripSeparator2.Size = new System.Drawing.Size(218, 6);
+            this.toolStripSeparator2.Size = new System.Drawing.Size(385, 6);
             //
             // teamInformationLookupToolStripMenuItem
             //
             this.teamInformationLookupToolStripMenuItem.Name = "teamInformationLookupToolStripMenuItem";
-            this.teamInformationLookupToolStripMenuItem.Size = new System.Drawing.Size(221, 22);
+            this.teamInformationLookupToolStripMenuItem.Size = new System.Drawing.Size(388, 36);
             this.teamInformationLookupToolStripMenuItem.Text = "Team Information Lookup";
             this.teamInformationLookupToolStripMenuItem.Click += new System.EventHandler(this.teamInformationLookupToolStripMenuItem_Click);
             //
             // eventInformationLookupToolStripMenuItem
             //
             this.eventInformationLookupToolStripMenuItem.Name = "eventInformationLookupToolStripMenuItem";
-            this.eventInformationLookupToolStripMenuItem.Size = new System.Drawing.Size(221, 22);
+            this.eventInformationLookupToolStripMenuItem.Size = new System.Drawing.Size(388, 36);
             this.eventInformationLookupToolStripMenuItem.Text = "Event Information Lookup";
             this.eventInformationLookupToolStripMenuItem.Click += new System.EventHandler(this.eventInformationLookupToolStripMenuItem_Click);
             //
@@ -206,27 +209,27 @@
             this.showConsoleWindowToolStripMenuItem,
             this.resetAllSavedSettingsToDefaultToolStripMenuItem});
             this.debugToolStripMenuItem.Name = "debugToolStripMenuItem";
-            this.debugToolStripMenuItem.Size = new System.Drawing.Size(54, 21);
+            this.debugToolStripMenuItem.Size = new System.Drawing.Size(99, 40);
             this.debugToolStripMenuItem.Text = "Debug";
             //
             // showConsoleWindowToolStripMenuItem
             //
             this.showConsoleWindowToolStripMenuItem.Name = "showConsoleWindowToolStripMenuItem";
-            this.showConsoleWindowToolStripMenuItem.Size = new System.Drawing.Size(253, 22);
+            this.showConsoleWindowToolStripMenuItem.Size = new System.Drawing.Size(460, 36);
             this.showConsoleWindowToolStripMenuItem.Text = "Show Console Window";
             this.showConsoleWindowToolStripMenuItem.Click += new System.EventHandler(this.showConsoleWindowToolStripMenuItem_Click);
             //
             // resetAllSavedSettingsToDefaultToolStripMenuItem
             //
             this.resetAllSavedSettingsToDefaultToolStripMenuItem.Name = "resetAllSavedSettingsToDefaultToolStripMenuItem";
-            this.resetAllSavedSettingsToDefaultToolStripMenuItem.Size = new System.Drawing.Size(253, 22);
+            this.resetAllSavedSettingsToDefaultToolStripMenuItem.Size = new System.Drawing.Size(460, 36);
             this.resetAllSavedSettingsToDefaultToolStripMenuItem.Text = "Reset All Saved Settings to Default";
             this.resetAllSavedSettingsToDefaultToolStripMenuItem.Click += new System.EventHandler(this.resetAllSavedSettingsToDefaultToolStripMenuItem_Click);
             //
             // settingsToolStripMenuItem
             //
             this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
-            this.settingsToolStripMenuItem.Size = new System.Drawing.Size(61, 21);
+            this.settingsToolStripMenuItem.Size = new System.Drawing.Size(113, 40);
             this.settingsToolStripMenuItem.Text = "Settings";
             this.settingsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click);
             //
@@ -236,19 +239,20 @@
             this.eventSelector.DropDownWidth = 245;
             this.eventSelector.FlatStyle = System.Windows.Forms.FlatStyle.System;
             this.eventSelector.Name = "eventSelector";
-            this.eventSelector.Size = new System.Drawing.Size(248, 21);
+            this.eventSelector.Size = new System.Drawing.Size(492, 40);
             this.eventSelector.SelectedIndexChanged += new System.EventHandler(this.eventSelector_SelectedIndexChanged_1);
             //
             // myWebsiteRichTextBox
             //
             this.tableLayoutPanel1.SetColumnSpan(this.myWebsiteRichTextBox, 4);
             this.myWebsiteRichTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.myWebsiteRichTextBox.Location = new System.Drawing.Point(3, 357);
+            this.myWebsiteRichTextBox.Location = new System.Drawing.Point(6, 691);
+            this.myWebsiteRichTextBox.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.myWebsiteRichTextBox.Name = "myWebsiteRichTextBox";
             this.myWebsiteRichTextBox.ReadOnly = true;
-            this.myWebsiteRichTextBox.Size = new System.Drawing.Size(242, 19);
+            this.myWebsiteRichTextBox.Size = new System.Drawing.Size(484, 32);
             this.myWebsiteRichTextBox.TabIndex = 2;
-            this.myWebsiteRichTextBox.Text = "Visit my website at https:www.xNovax.net";
+            this.myWebsiteRichTextBox.Text = "Visit my website at www.xNovax.net";
             this.myWebsiteRichTextBox.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.myWebsiteRichTextBox_LinkClicked);
             //
             // isInternetConnectedLabel
@@ -256,9 +260,10 @@
             this.isInternetConnectedLabel.AutoSize = true;
             this.tableLayoutPanel1.SetColumnSpan(this.isInternetConnectedLabel, 4);
             this.isInternetConnectedLabel.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.isInternetConnectedLabel.Location = new System.Drawing.Point(251, 354);
+            this.isInternetConnectedLabel.Location = new System.Drawing.Point(502, 685);
+            this.isInternetConnectedLabel.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.isInternetConnectedLabel.Name = "isInternetConnectedLabel";
-            this.isInternetConnectedLabel.Size = new System.Drawing.Size(242, 25);
+            this.isInternetConnectedLabel.Size = new System.Drawing.Size(484, 44);
             this.isInternetConnectedLabel.TabIndex = 3;
             this.isInternetConnectedLabel.Text = "Testing your internet connection...";
             this.isInternetConnectedLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -270,13 +275,14 @@
             //
             // Home
             //
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(496, 379);
+            this.ClientSize = new System.Drawing.Size(992, 729);
             this.Controls.Add(this.tableLayoutPanel1);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
             this.MainMenuStrip = this.menuStrip1;
+            this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.MaximizeBox = false;
             this.Name = "Home";
             this.Text = "FRC_Scouting_V2";


Refactor

Refactor

--- FTF.Specs/ContainerExtensions.cs
+++ FTF.Specs/ContainerExtensions.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 using System.Linq;
 using System.Reflection;
 using FTF.Core;
@@ -42,49 +43,15 @@
                 .SelectMany(a => a.GetExportedTypes())
                 .ToArray();

-            var concreteTypes = allTypes
-                .Where(t => t.GetCustomAttributes<ConcreteAttribute>().Any())
-                .ToArray();
+            c.RegisterConcreteTypes(allTypes);

-            foreach (var type in concreteTypes)
-                c.Register(type);
-
-            var delegateMethods = allTypes
-                .SelectMany(type => type.GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly))
-                .Where(method => method.GetCustomAttributes<Delegate>(inherit: false).Any())
-                .ToArray();
-
-            foreach (var method in delegateMethods)
-            {
-                var delegateType = method
-                    .GetCustomAttribute<Delegate>()
-                    .DelegateType;
-
-                c.Register(delegateType, () => CreateInstance(method, delegateType, c.GetInstance(method.DeclaringType)));
-            }
+            c.RegisterDelegates(allTypes);

             var entities = allTypes
                 .Where(t => t.GetInterfaces().Any(i => i == typeof (IEntity)));

             foreach (var entityType in entities)
-            {
-                var type = typeof(Save<>).MakeGenericType(entityType);
-
-                c.Register(type, () =>
-                {
-                    var db = c.GetInstance<DbContext>();
-
-                    var setMethod = db.GetType()
-                        .GetMethod("Set", new Type[0])
-                        .MakeGenericMethod(entityType);
-
-                    var dbSet = setMethod.Invoke(db, null);
-
-                    var addMethod = dbSet.GetType().GetMethod("Add");
-
-                    return System.Delegate.CreateDelegate(type, dbSet, addMethod);
-                });
-            }
+                c.RegisterSaveDelagates(entityType);

             // Storage.EntityFramework
             c.Register(() => new DbContext("name=FTF.Tests", new System.Data.Entity.DropCreateDatabaseAlways<DbContext>()),
@@ -96,11 +63,67 @@
             c.Register(typeof(IQueryable<>), typeof(DbSetAdapter<>));
         }

-        private static object CreateInstance(MethodInfo method, Type delegateType, object instance)
+        private static void RegisterDelegates(this Container c, Type[] allTypes)
         {
-            return method.IsStatic
-                ? System.Delegate.CreateDelegate(delegateType, method)
-                : System.Delegate.CreateDelegate(delegateType, instance, method);
+            const BindingFlags bindingFlags = BindingFlags.Public
+                | BindingFlags.Instance
+                | BindingFlags.Static
+                | BindingFlags.DeclaredOnly;
+
+            var delegateMethods = allTypes
+                .SelectMany(t => t.GetMethods(bindingFlags))
+                .Where(method => method.GetCustomAttributes<Delegate>(inherit: false).Any())
+                .ToArray();
+
+            foreach (var method in delegateMethods)
+            {
+                var delegateType = method
+                    .GetCustomAttribute<Delegate>()
+                    .DelegateType;
+
+                c.Register(delegateType, () => CreateDelegate(c, method, delegateType));
+            }
+        }
+
+        private static void RegisterConcreteTypes(this Container c, IEnumerable<Type> allTypes)
+        {
+            var concreteTypes = allTypes
+                .Where(t => t.GetCustomAttributes<ConcreteAttribute>().Any())
+                .ToArray();
+
+            foreach (var type in concreteTypes)
+                c.Register(type);
+        }
+
+        private static void RegisterSaveDelagates(this Container c, Type entityType)
+        {
+            var saveType = typeof (Save<>).MakeGenericType(entityType);
+
+            c.Register(saveType, () =>
+            {
+                var db = c.GetInstance<DbContext>();
+
+                var setMethod = db.GetType()
+                    .GetMethod("Set", new Type[0])
+                    .MakeGenericMethod(entityType);
+
+                var dbSet = setMethod.Invoke(db, null);
+
+                var addMethod = dbSet.GetType().GetMethod("Add");
+
+                return System.Delegate.CreateDelegate(saveType, dbSet, addMethod);
+            });
+        }
+
+        private static object CreateDelegate(Container c, MethodInfo method, Type delegateType)
+        {
+            if (method.IsStatic)
+                return System.Delegate.CreateDelegate(delegateType, method);
+
+            return System.Delegate.CreateDelegate(
+                delegateType,
+                c.GetInstance(method.DeclaringType),
+                method);
         }
     }
 }


Finally fixing #415 by also forwarding DataContext to Menu

--- Fluent.Ribbon/Controls/Ribbon.cs
+++ Fluent.Ribbon/Controls/Ribbon.cs
@@ -445,9 +445,9 @@
         /// <summary>
         /// Gets or sets file menu control (can be application menu button, backstage button and so on)
         /// </summary>
-        public UIElement Menu
-        {
-            get { return (UIElement)this.GetValue(MenuProperty); }
+        public FrameworkElement Menu
+        {
+            get { return (FrameworkElement)this.GetValue(MenuProperty); }
             set { this.SetValue(MenuProperty, value); }
         }

@@ -455,7 +455,19 @@
         /// <see cref="DependencyProperty"/> for <see cref="Menu"/>.
         /// </summary>
         public static readonly DependencyProperty MenuProperty =
-            DependencyProperty.Register(nameof(Menu), typeof(UIElement), typeof(Ribbon), new PropertyMetadata(AddOrRemoveLogicalChildOnPropertyChanged));
+            DependencyProperty.Register(nameof(Menu), typeof(FrameworkElement), typeof(Ribbon), new PropertyMetadata(OnMenuChanged));
+
+        private static void OnMenuChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            var ribbon = (Ribbon)d;
+
+            var oldValue = e.OldValue as FrameworkElement;
+            var newValue = e.NewValue as FrameworkElement;
+
+            ForwardDataContext(ribbon, oldValue, newValue);
+
+            AddOrRemoveLogicalChildOnPropertyChanged(d, e);
+        }

         #endregion

@@ -546,6 +558,23 @@
             }
         }

+        private static void ForwardDataContext(FrameworkElement dataContextSource, FrameworkElement oldTargetElement, FrameworkElement newTargetElement)
+        {
+            if (oldTargetElement != null
+                && BindingOperations.IsDataBound(oldTargetElement, DataContextProperty) == false)
+            {
+                // Remove-Forward DataContext
+                oldTargetElement.DataContext = null;
+            }
+
+            if (newTargetElement != null
+                && BindingOperations.IsDataBound(newTargetElement, DataContextProperty) == false)
+            {
+                // Forward DataContext
+                newTargetElement.DataContext = dataContextSource.DataContext;
+            }
+        }
+
         private static void AddOrRemoveLogicalChildOnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
         {
             var ribbon = (Ribbon)d;
@@ -608,11 +637,10 @@
             var oldValue = e.OldValue as RibbonTitleBar;
             var newValue = e.NewValue as RibbonTitleBar;

+            ForwardDataContext(ribbon, oldValue, newValue);
+
             if (oldValue != null)
             {
-                // Remove-Forward DataContext
-                oldValue.DataContext = null;
-
                 foreach (var ribbonContextualTabGroup in ribbon.ContextualGroups)
                 {
                     ribbon.TitleBar.Items.Remove(ribbonContextualTabGroup);
@@ -626,9 +654,6 @@

             if (newValue != null)
             {
-                // Forward DataContext
-                newValue.DataContext = ribbon.DataContext;
-
                 foreach (var contextualTabGroup in ribbon.ContextualGroups)
                 {
                     ribbon.TitleBar.Items.Add(contextualTabGroup);
@@ -1431,10 +1456,8 @@

         private void Handle_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
         {
-            if (this.TitleBar != null)
-            {
-                this.TitleBar.DataContext = e.NewValue;
-            }
+            ForwardDataContext(this, null, this.TitleBar);
+            ForwardDataContext(this, null, this.Menu);
         }

         #endregion


client: updated memory client

client: updated memory client

--- src/MessageVault/Memory/MemoryClient.cs
+++ src/MessageVault/Memory/MemoryClient.cs
@@ -67,6 +67,26 @@
 				Assert.AreEqual(25, task.Result.Position);
 			}
 		}
+
+		[Test]
+		public void Publisher() {
+			using (var client = new MemoryClient())
+			{
+				Publish(client, new MessageToWrite("Key", new byte[0]));
+			}
+		}
+
+
+
+		public async Task PublishAsync(IClient client, params MessageToWrite[] messages)
+		{
+			await  client.PostMessagesAsync("demo", messages);
+		}
+
+		public void Publish(IClient client, params MessageToWrite[] events)
+		{
+			PublishAsync(client, events).Wait();
+		}
 	}

 }


Added GetBoundingBox method to Entity

Added GetBoundingBox method to Entity

--- GameEngine/GameObjects/Entity.cs
+++ GameEngine/GameObjects/Entity.cs
@@ -3,6 +3,8 @@
 using GameEngine.Tiled;
 using Microsoft.Xna.Framework;
 using Microsoft.Xna.Framework.Content;
+using System;
+using System.Collections.Generic;

 namespace GameEngine.GameObjects
 {
@@ -52,11 +54,31 @@
             this.Drawables = new DrawableSet();
         }

-        public void LoadAnimationXML(string FileName, ContentManager Content, string Group, int Layer=0)
+        public Rectangle GetBoundingBox(GameTime GameTime)
         {
-            Animation.LoadAnimationXML(Drawables, FileName, Content, Group, Layer);
+            List<GameDrawableInstance> drawables = Drawables[CurrentDrawable];
+
+            if (drawables.Count == 0) return new Rectangle(0, 0, 0, 0);                             //a null rectangle for no drawables
+            if (drawables.Count == 1) return drawables[0].Drawable.GetSourceRectangle(GameTime);    //if there is only one, just return it
+
+            int minX = Int32.MaxValue;
+            int minY = Int32.MaxValue;
+            int maxX = Int32.MinValue;
+            int maxY = Int32.MaxValue;
+
+            foreach (GameDrawableInstance draw in drawables)
+            {
+                Rectangle drawRectangle = draw.Drawable.GetSourceRectangle(GameTime);
+                if (drawRectangle.X < minX) minX = drawRectangle.X;
+                if (drawRectangle.Y < minY) minY = drawRectangle.Y;
+                if (drawRectangle.X > maxX) maxX = drawRectangle.X;
+                if (drawRectangle.Y > maxY) maxY = drawRectangle.Y;
+            }
+
+            return new Rectangle(minX, minY, maxX - minX, maxY - minY);
         }

+        //TODO: Probably needs to be updated to allow interaction with other entities in the TileEngine instance
         public virtual void Update(GameTime GameTime, TiledMap Map)
         {
         }


Filenames based on hashes are now safe

Filenames based on hashes are now safe

--- src/Nuterra.Build/AssemblyCSharpUtil.cs
+++ src/Nuterra.Build/AssemblyCSharpUtil.cs
@@ -21,7 +21,7 @@

 		public static string CreateAssemblyBackup(string sourceAssembly, string assemblyBackupDir, string hash)
 		{
-			string targetFile = Path.Combine(assemblyBackupDir, $"{hash}.dll");
+			string targetFile = FormatBackupPath(assemblyBackupDir, hash);
 			if (!Directory.Exists(assemblyBackupDir))
 			{
 				Directory.CreateDirectory(assemblyBackupDir);
@@ -35,6 +35,7 @@

 		public static string FormatBackupPath(string assemblyBackupDir, string hash)
 		{
+			hash = hash.Replace('/', '-');
 			return Path.Combine(assemblyBackupDir, $"{hash}.dll");
 		}


made colors easier to use

made colors easier to use

--- GameOverlay/Graphics/D2DColor.cs
+++ GameOverlay/Graphics/D2DColor.cs
@@ -10,81 +10,92 @@
     public struct D2DColor
     {
         /// <summary>
-        /// The alpha
+        /// a
         /// </summary>
-        public float Alpha;
+        public float A;

         /// <summary>
-        /// The blue
+        /// The r
         /// </summary>
-        public float Blue;
+        public float R;
+        /// <summary>
+        /// The g
+        /// </summary>
+        public float G;
+        /// <summary>
+        /// The b
+        /// </summary>
+        public float B;

         /// <summary>
-        /// The green
+        /// Initializes a new instance of the <see cref="D2DColor"/> struct.
         /// </summary>
-        public float Green;
+        /// <param name="r">The r.</param>
+        /// <param name="g">The g.</param>
+        /// <param name="b">The b.</param>
+        /// <param name="a">a.</param>
+        public D2DColor(float r, float g, float b, float a = 1.0f)
+        {
+            R = NormalizeColor(r);
+            G = NormalizeColor(g);
+            B = NormalizeColor(b);

-        /// <summary>
-        /// The red
-        /// </summary>
-        public float Red;
-
-        /// <summary>
-        /// Initializes a new instance of the <see cref="D2DColor"/> struct with an alpha of 255
-        /// </summary>
-        /// <param name="red">Red 0 - 255</param>
-        /// <param name="green">Green 0 - 255</param>
-        /// <param name="blue">Blue 0 - 255</param>
-        public D2DColor(int red, int green, int blue)
-        {
-            Red = red / 255.0f;
-            Green = green / 255.0f;
-            Blue = blue / 255.0f;
-            Alpha = 1.0f;
+            A = NormalizeColor(a);
         }

         /// <summary>
-        /// Initializes a new instance of the <see cref="D2DColor"/> struct
+        /// Initializes a new instance of the <see cref="D2DColor"/> struct.
         /// </summary>
-        /// <param name="red">Red 0 - 255</param>
-        /// <param name="green">Green 0 - 255</param>
-        /// <param name="blue">Blue 0 - 255.</param>
-        /// <param name="alpha">Alpha 0 - 255</param>
-        public D2DColor(int red, int green, int blue, int alpha)
+        /// <param name="r">The r.</param>
+        /// <param name="g">The g.</param>
+        /// <param name="b">The b.</param>
+        /// <param name="a">a.</param>
+        public D2DColor(int r, int g, int b, int a = 255)
         {
-            Red = red / 255.0f;
-            Green = green / 255.0f;
-            Blue = blue / 255.0f;
-            Alpha = alpha / 255.0f;
+            R = NormalizeColor(r);
+            G = NormalizeColor(g);
+            B = NormalizeColor(b);
+
+            A = NormalizeColor(a);
         }

         /// <summary>
-        /// Initializes a new instance of the <see cref="D2DColor"/> struct with an alpha of 1.0f
+        /// Initializes a new instance of the <see cref="D2DColor"/> struct.
         /// </summary>
-        /// <param name="red">Red 0.0f - 1.0f</param>
-        /// <param name="green">Green 0.0f - 1.0f</param>
-        /// <param name="blue">Blue 0.0f - 1.0f</param>
-        public D2DColor(float red, float green, float blue)
+        /// <param name="r">The r.</param>
+        /// <param name="g">The g.</param>
+        /// <param name="b">The b.</param>
+        /// <param name="a">a.</param>
+        public D2DColor(byte r, byte g, byte b, byte a = 255)
         {
-            Red = red;
-            Green = green;
-            Blue = blue;
-            Alpha = 1.0f;
+            R = (float)r / 255.0f;
+            G = (float)g / 255.0f;
+            B = (float)b / 255.0f;
+
+            A = (float)a / 255.0f;
         }

-        /// <summary>
-        /// Initializes a new instance of the <see cref="D2DColor"/> struct
-        /// </summary>
-        /// <param name="red">Red 0.0f - 1.0f</param>
-        /// <param name="green">Green 0.0f - 1.0f</param>
-        /// <param name="blue">Blue 0.0f - 1.0f</param>
-        /// <param name="alpha">Alpha 0.0f - 1.0f</param>
-        public D2DColor(float red, float green, float blue, float alpha)
+        private static float NormalizeColor(float color)
         {
-            Red = red;
-            Green = green;
-            Blue = blue;
-            Alpha = alpha;
+            if (color < 0.0f) color *= -1.0f;
+
+            if (color > 1.0f)
+            {
+                while (color > 255.0f) color /= 255.0f;
+
+                return color / 255.0f;
+            }
+
+            return color;
+        }
+
+        private static float NormalizeColor(int color)
+        {
+            if (color < 0) color *= -1;
+
+            while (color > 255) color /= 255;
+
+            return (float)color / 255.0f;
         }

         /// <summary>
@@ -104,7 +115,7 @@
         /// <returns>The result of the conversion.</returns>
         public static implicit operator RawColor4(D2DColor color)
         {
-            return new RawColor4(color.Red, color.Green, color.Blue, color.Alpha);
+            return new RawColor4(color.R, color.G, color.B, color.A);
         }
     }
 }


Remote player updating/drawing

Remote player updating/drawing

--- Games3Project2/JuggernautGame.cs
+++ Games3Project2/JuggernautGame.cs
@@ -332,6 +332,11 @@
                         }
                     }

+                    foreach (RemotePlayer rPlayer in Global.remotePlayers)
+                    {
+                        rPlayer.update();
+                    }
+
                     for (int i = 0; i < Global.bullets.Count; i++)
                     {
                         Global.bullets[i].update(gameTime);
@@ -535,6 +540,11 @@
                         }
                     }

+                    foreach (RemotePlayer rPlayer in Global.remotePlayers)
+                    {
+                        rPlayer.draw();
+                    }
+
                     //SpriteBatch Drawing Section
                     Global.spriteBatch.Begin();


GH-6 Add weather summary string to woppy

--- src/PortalBot/Commands/WeatherModule.cs
+++ src/PortalBot/Commands/WeatherModule.cs
@@ -156,6 +156,7 @@

                 await ReplyAsync($"Weather in ***{city}*** " +
                                  $"is currently ***{(int)currently.Temperature}° {tempUnit}***, " +
+                                 $"{currently.Summary.ToLower()}, " +
                                  $"with wind speed of ***{(int)currently.WindSpeed} {speedUnit}***.");
             }
         }


v0.3.0

--- src/PronoFoot/Views/Day/Forecast.cshtml
+++ src/PronoFoot/Views/Day/Forecast.cshtml
@@ -3,11 +3,6 @@
     ViewBag.Title = Model.Day.Name;
 }

@Model.Day.Name

-Now: @DateTime.Now.ToString()

-UtcNow: @DateTime.UtcNow.ToString()

-Utc time for 06/11/2011 17:54 (French time): @TimeZoneInfo.ConvertTimeToUtc(new DateTime(2011, 11, 6, 17, 54, 0), TimeZoneInfo.FindSystemTimeZoneById("Romance Standard Time")).ToString()

-Time for 1st fixture: @Model.Forecasts.First().Fixture.Date.ToString();
-UtcTime for 1st fixture: @Model.Forecasts.First().Fixture.Date.ToUniversalTime().ToString();

 @using (Html.BeginForm())
 {


Fixed closing and flushing stream before reading bytes

--- src/Image/ApocImageFactory.cs
+++ src/Image/ApocImageFactory.cs
@@ -84,7 +84,7 @@
                 ExtractImageData(absoluteURL));
         }

-        private static Stream GetImageStream(Uri uri)
+		private static T GetImageStream<T>(Uri uri, Converter<Stream, T> loader)
         {
             try
             {
@@ -100,7 +100,7 @@
 				{
 					using(Stream stream = response.GetResponseStream())
 					{
-						return stream;
+						return loader(stream);
 					}
 				}
             }
@@ -129,35 +129,25 @@

         private static byte[] ExtractImageData(Uri absoluteURL)
         {
-            // Otherwise load the image data using a WebRequest.
-            Stream imageStream = GetImageStream(absoluteURL);
+			// Otherwise load the image data using a WebRequest.
+			return GetImageStream<byte[]>(
+				absoluteURL,
+				delegate(Stream imageStream)
+				{
+					using(MemoryStream ms = new MemoryStream())
+					{
+						byte[] buf = new byte[4096];
+						int numBytesRead = 0;

-            // Read the data stream into a byte array.
-            try
-            {
-				using(MemoryStream ms = new MemoryStream())
-				{
-					byte[] buf = new byte[4096];
-					int numBytesRead = 0;
+						// Read contents of JPEG into MemoryStream
+						while((numBytesRead = imageStream.Read(buf, 0, 4096)) != 0)
+						{
+							ms.Write(buf, 0, numBytesRead);
+						}

-					// Read contents of JPEG into MemoryStream
-					while((numBytesRead = imageStream.Read(buf, 0, 4096)) != 0)
-					{
-						ms.Write(buf, 0, numBytesRead);
+						return ms.ToArray();
 					}
-
-					ms.Flush();
-					ms.Close();
-
-					return ms.ToArray();
-				}
-            }
-            finally
-            {
-                imageStream.Flush();
-                imageStream.Close();
-                imageStream = null;
-            }
+				});
         }
     }
 }


Refactor ReplyTo with autoCorrelationSagaId

--- HermaFx.Rebus/RebusExtensions.cs
+++ HermaFx.Rebus/RebusExtensions.cs
@@ -61,28 +61,11 @@
 			bus.Reply(message);
 		}

-		public static void ReplyTo<TResponse>(this IBus bus, string originator, string correlationId, TResponse message)
-		{
-			Guard.IsNotNull(bus, nameof(bus));
-			Guard.IsNotNullNorEmpty(originator, nameof(originator));
-			Guard.IsNotNullNorEmpty(correlationId, nameof(correlationId));
-			Guard.IsNotNull(message, nameof(message));
-
-			bus.AttachHeader(message, Headers.CorrelationId, correlationId);
-			bus.Advanced.Routing.Send(originator, message);
-		}
-
-		public static void ReplyTo<TResponse>(this IBus bus, string originator, string correlationId, Action<TResponse> customizer)
-		{
-			Guard.IsNotNull(bus, nameof(bus));
-
-			var message = Activator.CreateInstance<TResponse>();
-			customizer(message);
-
-			bus.ReplyTo(originator, correlationId, message);
-		}
-
-		public static void ReplyTo<TResponse>(this IBus bus, string originator, TResponse message, Guid sagaId)
+		/// <summary>
+		/// Replies to a simple handler or a handler of saga and correlates the saga with sagaId parameter if it have value.
+		/// </summary>
+		/// <exception cref="System.InvalidOperationException">The message not contains saga context</exception>
+		public static void ReplyTo<TResponse>(this IBus bus, string originator, TResponse message, Guid? sagaId)
 		{
 			Guard.IsNotNull(bus, nameof(bus));
 			Guard.IsNotNullNorEmpty(originator, nameof(originator));
@@ -91,27 +74,35 @@
 			var messageContext = MessageContext.GetCurrent();
 			var sagaContextKey = SagaContext.SagaContextItemKey;

-			if (!messageContext.Items.ContainsKey(sagaContextKey))
+			// If current message must be replayed to a saga handler then chenge currentSagaContext
+			if (sagaId.HasValue)
 			{
-				throw new InvalidOperationException("Current message not contains a saga context");
+				if (!messageContext.Items.ContainsKey(sagaContextKey))
+				{
+					throw new InvalidOperationException("The message context not contains a saga context");
+				}
+
+				// Current saga context
+				var currentSagaContext = messageContext.Items[sagaContextKey];
+				try
+				{
+					// XXX: The .Routing.Send() method is overwriting the AutoCorrelationSagaId header by current SagaConext.Id,
+					//		then we must to replace the current SagaConext.Id of message context by 'autoCorrelationSagaId' in order to reply
+					//		to original saga wicht send the request
+					messageContext.Items[sagaContextKey] = new SagaContext(sagaId.Value);
+					bus.Advanced.Routing.Send(originator, message);
+				}
+				finally
+				{
+					// XXX: Dont forquet restore the current SagaConext in order to correlate the Timeouts message of current saga.
+					messageContext.Items[sagaContextKey] = currentSagaContext;
+				}
 			}
-
-			// Current saga context
-			var currentSagaContext = messageContext.Items[sagaContextKey];
-			try
+			else
 			{
-				// XXX: The .Routing.Send() method is overwriting the AutoCorrelationSagaId header by current SagaConext.Id,
-				//		then we must to replace the current SagaConext.Id of message context by 'autoCorrelationSagaId' in order to reply
-				//		to original saga wicht send the request
-				messageContext.Items[sagaContextKey] = new SagaContext(sagaId);
+				// At this point we reply to a simple handler (No saga)
 				bus.Advanced.Routing.Send(originator, message);
 			}
-			finally
-			{
-				// XXX: Dont forquet restore the current SagaConext in order to correlate the Timeouts message of current saga.
-				messageContext.Items[sagaContextKey] = currentSagaContext;
-			}
-
 		}

 		#endregion


Added support for reference types to JsonTester.

--- src/Qowaiv.UnitTests/Json/JsonTester.cs
+++ src/Qowaiv.UnitTests/Json/JsonTester.cs
@@ -1,47 +1,52 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Qowaiv.Json;
+using Qowaiv.Json;
+using System;

 namespace Qowaiv.UnitTests.Json
 {
-    public class JsonTester
-    {
-        public static T Read<T>() where T : IJsonSerializable
-        {
-            T instance = default(T);
-            instance.FromJson();
-            return instance;
-        }
-        public static T Read<T>(String val) where T : IJsonSerializable
-        {
-            T instance = default(T);
-            instance.FromJson(val);
-            return instance;
-        }
-        public static T Read<T>(Int64 val) where T : IJsonSerializable
-        {
-            T instance = default(T);
-            instance.FromJson(val);
-            return instance;
-        }
-        public static T Read<T>(Double val) where T : IJsonSerializable
-        {
-            T instance = default(T);
-            instance.FromJson(val);
-            return instance;
-        }
-        public static T Read<T>(DateTime val) where T : IJsonSerializable
-        {
-            T instance = default(T);
-            instance.FromJson(val);
-            return instance;
-        }
+	public class JsonTester
+	{
+		public static T Read<T>() where T : IJsonSerializable
+		{
+			T instance = default(T);
+			if(typeof(T).IsValueType)
+			{
+				instance.FromJson();
+			}
+			return instance;
+		}
+		public static T Read<T>(String val) where T : IJsonSerializable
+		{
+			T instance = NewInstance<T>();
+			instance.FromJson(val);
+			return instance;
+		}
+		public static T Read<T>(Int64 val) where T : IJsonSerializable
+		{
+			T instance = NewInstance<T>();
+			instance.FromJson(val);
+			return instance;
+		}
+		public static T Read<T>(Double val) where T : IJsonSerializable
+		{
+			T instance = NewInstance<T>();
+			instance.FromJson(val);
+			return instance;
+		}
+		public static T Read<T>(DateTime val) where T : IJsonSerializable
+		{
+			T instance = NewInstance<T>();
+			instance.FromJson(val);
+			return instance;
+		}

-        public static object Write(IJsonSerializable val)
-        {
-            return val.ToJson();
-        }
-    }
+		private static T NewInstance<T>() where T : IJsonSerializable
+		{
+			return typeof(T).IsValueType ? default(T) : Activator.CreateInstance<T>();
+		}
+
+		public static object Write(IJsonSerializable val)
+		{
+			return val.ToJson();
+		}
+	}
 }


updates

updates

--- Hermod/HTTP/Server/HTTPServer.cs
+++ Hermod/HTTP/Server/HTTPServer.cs
@@ -112,8 +112,6 @@
         }

         #endregion
-
-

     }


REMOVED: Enviroment new line constant.

REMOVED: Enviroment new line constant.

--- src/RobotWars/Commands/CommandRunner.cs
+++ src/RobotWars/Commands/CommandRunner.cs
@@ -32,7 +32,7 @@
                 throw new ArgumentNullException("commandLine");
             }

-            var commands = commandLine.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
+            var commands = commandLine.Split(new[] { '\n' }, StringSplitOptions.None);

             foreach (var command in commands)
             {


selected timeline is remembered when getting activities and sending updates

--- src/SampleClient.Gui/MainWindow.xaml.cs
+++ src/SampleClient.Gui/MainWindow.xaml.cs
@@ -34,6 +34,8 @@
                 EnableControls();
             }
         }
+
+        private string SelectedTimelineId { get; set; }

         private void EnableControls()
         {
@@ -83,15 +85,16 @@
                 Owner = this,
                 WindowStartupLocation = WindowStartupLocation.CenterOwner,
                 Timelines = timelines.Timelines,
-                SelectedTimeline = timelines.Timelines.FirstOrDefault(),
+                SelectedTimeline = timelines.Timelines.SingleOrDefault(t => t.TimelineId == SelectedTimelineId) ??  timelines.Timelines.FirstOrDefault(),
                 FromTime = DateTime.Today,
                 ToTime = DateTime.Today,
                 SizeToContent = SizeToContent.WidthAndHeight
             };
             if (window.ShowDialog() == true && window.FromTime != null && window.ToTime != null)
             {
+                SelectedTimelineId = window.SelectedTimeline.TimelineId;
                 TimelineResource timeline = await ExecuteAsync((client, cancellationToken) => client.GetActivitiesByTimelineIdAsync(
-                    window.SelectedTimeline.TimelineId, window.FromTime.Value, window.ToTime.Value.AddDays(1), cancellationToken));
+                    SelectedTimelineId, window.FromTime.Value, window.ToTime.Value.AddDays(1), cancellationToken));
                 RefreshUpdatedActivitiesUrl(timeline);
             }
         }
@@ -220,12 +223,12 @@
                 Owner = this,
                 WindowStartupLocation = WindowStartupLocation.CenterOwner,
                 Timelines = timelines.Timelines,
-                SelectedTimeline = timelines.Timelines.FirstOrDefault(),
+                SelectedTimeline = timelines.Timelines.SingleOrDefault(t => t.TimelineId == SelectedTimelineId) ?? timelines.Timelines.FirstOrDefault(),
                 SizeToContent = SizeToContent.WidthAndHeight
             };
             if (window.ShowDialog() == true)
             {
-                string timelineId = window.SelectedTimeline.TimelineId;
+                SelectedTimelineId = window.SelectedTimeline.TimelineId;
                 var activityUpdates = new ActivityUpdatesResource
                 {
                     ClientName = window.SelectedTimeline.ClientName,
@@ -237,7 +240,7 @@
                     Groups = window.Groups,
                     DeletedGroupIds = window.DeletedGroupIds
                 };
-                await ExecuteAsync((client, cancellationToken) => client.SendActivityUpdates(timelineId, activityUpdates, cancellationToken));
+                await ExecuteAsync((client, cancellationToken) => client.SendActivityUpdates(SelectedTimelineId, activityUpdates, cancellationToken));
             }
         }


removing put and delete from cors

removing put and delete from cors

--- src/ScSyncr.Agent/ScSyncrHttpHandler.cs
+++ src/ScSyncr.Agent/ScSyncrHttpHandler.cs
@@ -53,7 +53,7 @@
             finally
             {
                 context.Response.Headers["Access-Control-Allow-Origin"] = "*";
-                context.Response.Headers["Access-Control-Allow-Methods"] = "GET,PUT,POST,DELETE";
+                context.Response.Headers["Access-Control-Allow-Methods"] = "GET,POST";
                 if (context.Request.Headers["Access-Control-Request-Headers"] != null)
                     context.Response.Headers["Access-Control-Allow-Headers"] = context.Request.Headers["Access-Control-Request-Headers"];
                 context.Response.Headers["Access-Control-Max-Age"] = "1800";


Removed redundant code.

Removed redundant code.

--- src/Server/Publishing/PackageService.cs
+++ src/Server/Publishing/PackageService.cs
@@ -95,7 +95,6 @@
         }

         private static void WriteAccessDenied(HttpContextBase context, string packageId) {
-            context.Response.StatusCode = 401;
             WriteStatus(context, HttpStatusCode.Unauthorized, String.Format("Access denied for package '{0}'.", packageId));
         }


CalcOscillationTime updated

CalcOscillationTime updated

--- src/MarkovProcess/MainForm.cs
+++ src/MarkovProcess/MainForm.cs
@@ -139,7 +139,7 @@
                     resT = t;
                     succesIterations++;
                 }
-                else if (t - prevT > 1.5 * DeltaT)
+                else if (t - prevT > 0.5 * DeltaT)
                 {
                     resT = t;
                     succesIterations = 1;


changes back isBidrectional spelling in case someone is using it with a named parameter binding :/

--- src/Umbraco.Core/Models/RelationType.cs
+++ src/Umbraco.Core/Models/RelationType.cs
@@ -24,11 +24,11 @@
         {
         }

-        public RelationType(string name, string alias, bool isBidirectional, Guid? parentObjectType, Guid? childObjectType)
+        public RelationType(string name, string alias, bool isBidrectional, Guid? parentObjectType, Guid? childObjectType)
         {
             _name = name;
             _alias = alias;
-            _isBidirectional = isBidirectional;
+            _isBidirectional = isBidrectional;
             _parentObjectType = parentObjectType;
             _childObjectType = childObjectType;
         }


Fix MemberAuthorizeAttribute for UmbracoApiControllers

--- src/Umbraco.Web/Security/WebSecurity.cs
+++ src/Umbraco.Web/Security/WebSecurity.cs
@@ -1,7 +1,6 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
-using System.Text;
 using System.Web;
 using System.Web.Security;
 using Umbraco.Core;
@@ -34,51 +33,53 @@
             IEnumerable<string> allowGroups = null,
             IEnumerable<int> allowMembers = null)
         {
+            if (allowAll)
+                return true;
+
             if (allowTypes == null)
                 allowTypes = Enumerable.Empty<string>();
             if (allowGroups == null)
                 allowGroups = Enumerable.Empty<string>();
             if (allowMembers == null)
                 allowMembers = Enumerable.Empty<int>();
-
+
             // Allow by default
             var allowAction = true;
-
-            // If not set to allow all, need to check current loggined in member
-            if (!allowAll)
-            {
-                // Get member details
-                var member = Member.GetCurrentMember();
-                if (member == null)
-                {
-                    // If not logged on, not allowed
-                    allowAction = false;
-                }
-                else
-                {
-                    // If types defined, check member is of one of those types
-                    if (allowTypes.Any())
-                    {
-                        // Allow only if member's type is in list
-                        allowAction = allowTypes.Select(x => x.ToLowerInvariant()).Contains(member.ContentType.Alias.ToLowerInvariant());
-                    }
-
-                    // If groups defined, check member is of one of those groups
-                    if (allowAction && allowGroups.Any())
-                    {
-                        // Allow only if member's type is in list
-                        var groups = System.Web.Security.Roles.GetRolesForUser(member.LoginName);
-                        allowAction = groups.Select(s => s.ToLower()).Intersect(allowGroups).Any();
-                    }
-
-                    // If specific members defined, check member is of one of those
-                    if (allowAction && allowMembers.Any())
-                    {
-                        // Allow only if member's type is in list
-                        allowAction = allowMembers.Contains(member.Id);
-                    }
-                }
-            }
+
+            // Get member details
+            var member = Member.GetCurrentMember();
+            if (member == null)
+            {
+                // If not logged on, not allowed
+                allowAction = false;
+            }
+            else
+            {
+                // If types defined, check member is of one of those types
+                var allowTypesList = allowTypes as IList<string> ?? allowTypes.ToList();
+                if (allowTypesList.Any(allowType => allowType != string.Empty))
+                {
+                    // Allow only if member's type is in list
+                    allowAction = allowTypesList.Select(x => x.ToLowerInvariant()).Contains(member.ContentType.Alias.ToLowerInvariant());
+                }
+
+                // If groups defined, check member is of one of those groups
+                var allowGroupsList = allowGroups as IList<string> ?? allowGroups.ToList();
+                if (allowAction && allowGroupsList.Any(allowGroup => allowGroup != string.Empty))
+                {
+                    // Allow only if member's type is in list
+                    var groups = Roles.GetRolesForUser(member.LoginName);
+                    allowAction = groups.Select(s => s.ToLowerInvariant()).Intersect(groups.Select(myGroup => myGroup.ToLowerInvariant())).Any();
+                }
+
+                // If specific members defined, check member is of one of those
+                if (allowAction && allowMembers.Any())
+                {
+                    // Allow only if member's type is in list
+                    allowAction = allowMembers.Contains(member.Id);
+                }
+            }
+
             return allowAction;
         }

@@ -92,7 +93,7 @@
         }

         private const long TicksPrMinute = 600000000;
-        private static readonly int UmbracoTimeOutInMinutes = Core.Configuration.GlobalSettings.TimeOutInMinutes;
+        private static readonly int UmbracoTimeOutInMinutes = GlobalSettings.TimeOutInMinutes;

         private User _currentUser;

@@ -122,7 +123,7 @@
             var retVal = Guid.NewGuid();
             SqlHelper.ExecuteNonQuery(
                                       "insert into umbracoUserLogins (contextID, userID, timeout) values (@contextId,'" + userId + "','" +
-                                      (DateTime.Now.Ticks + (TicksPrMinute * UmbracoTimeOutInMinutes)).ToString() +
+                                      (DateTime.Now.Ticks + (TicksPrMinute * UmbracoTimeOutInMinutes)) +
                                       "') ",
                                       SqlHelper.CreateParameter("@contextId", retVal));
             UmbracoUserContextId = retVal.ToString();
@@ -167,7 +168,8 @@
         /// <returns></returns>
         internal bool ValidateBackOfficeCredentials(string username, string password)
         {
-            return Membership.Providers[UmbracoSettings.DefaultBackofficeProvider].ValidateUser(username, password);
+            var membershipProvider = Membership.Providers[UmbracoSettings.DefaultBackofficeProvider];
+            return membershipProvider != null && membershipProvider.ValidateUser(username, password);
         }

         /// <summary>
@@ -180,7 +182,7 @@
         internal bool ValidateUserNodeTreePermissions(User umbracoUser, string path, string action)
         {
             var permissions = umbracoUser.GetPermissions(path);
-            if (permissions.IndexOf(action) > -1 && (path.Contains("-20") || ("," + path + ",").Contains("," + umbracoUser.StartNodeId.ToString() + ",")))
+            if (permissions.IndexOf(action, StringComparison.Ordinal) > -1 && (path.Contains("-20") || ("," + path + ",").Contains("," + umbracoUser.StartNodeId + ",")))
                 return true;

             var user = umbracoUser;
@@ -232,7 +234,7 @@
                                                           SqlHelper.CreateParameter("@contextId", new Guid(UmbracoUserContextId))
                                         );
             }
-
+
             return GetTimeout(UmbracoUserContextId);
         }

@@ -244,21 +246,21 @@
         public int GetUserId(string umbracoUserContextId)
         {
             //need to parse to guid
-            Guid gid;
-            if (!Guid.TryParse(umbracoUserContextId, out gid))
+            Guid guid;
+            if (Guid.TryParse(umbracoUserContextId, out guid) == false)
             {
                 return -1;
             }

-            var id = ApplicationContext.Current.ApplicationCache.GetCacheItem<int?>(
+            var id = ApplicationContext.Current.ApplicationCache.GetCacheItem(
                 CacheKeys.UserContextCacheKey + umbracoUserContextId,
-                new TimeSpan(0, UmbracoTimeOutInMinutes/10, 0),
+                new TimeSpan(0, UmbracoTimeOutInMinutes / 10, 0),
                 () => SqlHelper.ExecuteScalar<int?>(
                     "select userID from umbracoUserLogins where contextID = @contextId",
-                    SqlHelper.CreateParameter("@contextId", gid)));
+                    SqlHelper.CreateParameter("@contextId", guid)));
             if (id == null)
                 return -1;
-            return id.Value;
+            return id.Value;
         }

         /// <summary>
@@ -301,7 +303,7 @@
                     var user = User.GetUser(uid);

                     // Check for console access
-                    if (user.Disabled || (user.NoConsole && GlobalSettings.RequestIsInUmbracoApplication(httpContext) && !GlobalSettings.RequestIsLiveEditRedirector(httpContext)))
+                    if (user.Disabled || (user.NoConsole && GlobalSettings.RequestIsInUmbracoApplication(httpContext) && GlobalSettings.RequestIsLiveEditRedirector(httpContext) == false))
                     {
                         if (throwExceptions) throw new ArgumentException("You have no priviledges to the umbraco console. Please contact your administrator");
                         return ValidateRequestAttempt.FailedNoPrivileges;
@@ -325,9 +327,9 @@
         internal ValidateRequestAttempt AuthorizeRequest(HttpContextBase httpContext, bool throwExceptions = false)
         {
             // check for secure connection
-            if (GlobalSettings.UseSSL && !httpContext.Request.IsSecureConnection)
-            {
-                if (throwExceptions) throw new UserAuthorizationException("This installation requires a secure connection (via SSL). Please update the URL to include https://");
+            if (GlobalSettings.UseSSL && httpContext.Request.IsSecureConnection == false)
+            {
+                if (throwExceptions) throw new UserAuthorizationException("This installation requires a secure connection (via SSL). Please update the URL to include https://");
                 return ValidateRequestAttempt.FailedNoSsl;
             }
             return ValidateCurrentUser(httpContext, throwExceptions);
@@ -377,10 +379,14 @@
                 try
                 {
                     var encTicket = StateHelper.Cookies.UserContext.GetValue();
-                    if (!string.IsNullOrEmpty(encTicket))
-                        return FormsAuthentication.Decrypt(encTicket).UserData;
-                }
-                catch (HttpException ex)
+                    if (string.IsNullOrEmpty(encTicket) == false)
+                    {
+                        var formsAuthenticationTicket = FormsAuthentication.Decrypt(encTicket);
+                        if (formsAuthenticationTicket != null)
+                            return formsAuthenticationTicket.UserData;
+                    }
+                }
+                catch (HttpException)
                 {
                     // we swallow this type of exception as it happens if a legacy (pre 4.8.1) cookie is set
                 }
@@ -400,7 +406,7 @@
                     if (StateHelper.Cookies.UserContext.HasValue)
                         StateHelper.Cookies.ClearAll();

-                    if (!String.IsNullOrEmpty(value))
+                    if (string.IsNullOrEmpty(value) == false)
                     {
                         var ticket = new FormsAuthenticationTicket(1,
                         value,
@@ -411,13 +417,10 @@
                         FormsAuthentication.FormsCookiePath);

                         // Encrypt the ticket.
-                        var encTicket = FormsAuthentication.Encrypt(ticket);
-
-
+                        FormsAuthentication.Encrypt(ticket);
+
                         // Create new cookie.
                         StateHelper.Cookies.UserContext.SetValue(value, 1);
-
-
                     }
                     else
                     {


Update title with tool name, source, & Target (#339)

--- src/VstsSyncMigrator.Console/Program.cs
+++ src/VstsSyncMigrator.Console/Program.cs
@@ -208,7 +208,7 @@
                 me = new MigrationEngine(ec);
             else
                 me = new MigrationEngine(ec, sourceCredentials, targetCredentials);
-
+            Console.Title = $"Azure DevOps Migration Tools: {System.IO.Path.GetFileName(opts.ConfigFile)} - {System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(3)} - {ec.Source.Name} - {ec.Target.Name}";
             Trace.WriteLine("Engine created, running...", "[Info]");
             me.Run();
             Trace.WriteLine("Run complete...", "[Info]");


Changed the key property to be settable internal. Requires users to call Add on NamedConstant<T> to force the NamedConstant dictionary to get updated.

--- src/MvbaCore/NamedConstant.cs
+++ src/MvbaCore/NamedConstant.cs
@@ -11,15 +11,19 @@
 using System;
 using System.Collections.Generic;
 using System.Reflection;
-
+using JetBrains.Annotations;
 using MvbaCore.Extensions;

 namespace MvbaCore
 {
+
 	[Serializable]
 	public class NamedConstant : INamedConstant
 	{
-		public string Key { get; protected set; }
+		/// <summary>
+		/// Use Add to set
+		/// </summary>
+		public string Key { get; internal set; }
 	}

 #pragma warning disable 661,660
@@ -28,7 +32,9 @@
 #pragma warning restore 661,660
 		where T : NamedConstant<T>
 	{
+// ReSharper disable StaticFieldInGenericType
 		private static readonly Dictionary<string, T> NamedConstants = new Dictionary<string, T>();
+// ReSharper restore StaticFieldInGenericType

 		protected void Add(string key, T item)
 		{
@@ -95,16 +101,11 @@
 		{
 			if (NamedConstants.Count == 0)
 			{
-				try
-				{
-					var fieldInfos = typeof(T).GetFields(BindingFlags.Static | BindingFlags.Public);
-					// ensure its static members get created by triggering the type initializer
-					fieldInfos[0].GetValue(null);
-				}
-				catch
-				{
-				}
+				var fieldInfos = typeof (T).GetFields(BindingFlags.Static | BindingFlags.Public);
+				// ensure its static members get created by triggering the type initializer
+				fieldInfos[0].GetValue(null);
 			}
+
 		}
 	}
 }


Add more projects to the project page

Add more projects to the project page

Add more projects to the /projects page and re-order them for grouping.

--- src/Website/Views/Projects/Index.cshtml
+++ src/Website/Views/Projects/Index.cshtml
@@ -52,25 +52,6 @@

-
Alexa London Travel

-

-

-                    An Alexa skill that uses the TfL API. You can find the skill on amazon.co.uk.
-

-

-                    @await Html.PartialAsync("_GitHubStar", "alexa-london-travel")
-                    @await Html.PartialAsync("_GitHubFork", "alexa-london-travel")
-

-

-
-                        Visit project site »
-
-

-

-

-

-

-

This website

@@ -94,17 +75,114 @@

+
Alexa London Travel

+

+

+                    An Alexa skill that uses the TfL API. You can find the skill on amazon.co.uk.
+

+

+                    @await Html.PartialAsync("_GitHubStar", "alexa-london-travel")
+                    @await Html.PartialAsync("_GitHubFork", "alexa-london-travel")
+

+

+
+                        Visit project site »
+
+

+

+

+

+

+

+
Alexa London Travel Site

+

+

+                    A companion website for the London Travel Alexa skill using ASP.NET Core Identity.
+

+

+                    @await Html.PartialAsync("_GitHubStar", "alexa-london-travel-site")
+                    @await Html.PartialAsync("_GitHubFork", "alexa-london-travel-site")
+

+

+
+                        Visit project site »
+
+

+

+

+

+

+

+
Blog

+

+

+                    Martin's
+                    blog,
+                    a static site implemented using Middleman.
+

+

+                    @await Html.PartialAsync("_GitHubStar", "blog")
+                    @await Html.PartialAsync("_GitHubFork", "blog")
+

+

+
+                        Visit project site »
+
+

+

+

+

+

+

Apple Pay JS Sample Code

-                    Sample code for integrating Apple Pay JS into an ASP.NET Core website.
+                    Sample code for integrating Apple Pay JS into an ASP.NET Core website.

                     @await Html.PartialAsync("_GitHubStar", "justeat/ApplePayJSSample")
                     @await Html.PartialAsync("_GitHubFork", "justeat/ApplePayJSSample")

-
+
+                        Visit project site »
+
+

+

+

+

+

+

+
Apple Pay JS Polyfill

+

+

+                    A Bower package containing a polyfill for the Apple Pay JS SDK to use for testing.
+

+

+                    @await Html.PartialAsync("_GitHubStar", "justeat/applepayjs-polyfill")
+                    @await Html.PartialAsync("_GitHubFork", "justeat/applepayjs-polyfill")
+

+

+
+                        Visit project site »
+
+

+

+

+

+

+

+
Apple Pay JS Type Definitions

+

+

+                    A npm package containing type definitions for Apple Pay JS, such as for use with TypeScript.
+

+

+                    @await Html.PartialAsync("_GitHubStar", "applepayjs-typings")
+                    @await Html.PartialAsync("_GitHubFork", "applepayjs-typings")
+

+

+
                         Visit project site »

@@ -128,27 +206,6 @@

-                        Visit project site »
-
-

-

-

-

-

-

-
Blog

-

-

-                    Martin's
-                    blog,
-                    a static site implemented using Middleman.
-

-

-                    @await Html.PartialAsync("_GitHubStar", "blog")
-                    @await Html.PartialAsync("_GitHubFork", "blog")
-

-

-
                         Visit project site »


fix challenge string

fix challenge string

--- src/NCDO/CDOSessionOptions.cs
+++ src/NCDO/CDOSessionOptions.cs
@@ -40,7 +40,19 @@
         /// <summary>
         /// Gets or sets the challenge to put in the "WWW-Authenticate" header.
         /// </summary>
-        public string Challenge => AuthenticationModel.ToString();
+        public string Challenge
+        {
+            get
+            {
+                switch (AuthenticationModel)
+                {
+                    case AuthenticationModel.Bearer_WIA:
+                        return AuthenticationModel.Bearer.ToString();
+                    default:
+                        return AuthenticationModel.ToString();
+                }
+            }
+        }

         /// <summary>
         /// The token passed can be overruled by strictly setting the token in the options


Service requests performance counters fixed + redundant comments removed

--- ITCC.HTTP/Server/StaticServer.cs
+++ ITCC.HTTP/Server/StaticServer.cs
@@ -27,12 +27,6 @@
     public static class StaticServer<TAccount> where TAccount : class
     {
         #region main
-
-        /// <summary>
-        ///     Starts server for incoming connection listening
-        /// </summary>
-        /// <param name="configuration"></param>
-        /// <returns></returns>
         public static ServerStartStatus Start(HttpServerConfiguration<TAccount> configuration)
         {
             if (_started)
@@ -209,11 +203,6 @@

         #region log

-        /// <summary>
-        ///     Simple server logger
-        /// </summary>
-        /// <param name="level">Message level</param>
-        /// <param name="message">Message text</param>
         private static void LogMessage(LogLevel level, string message)
         {
             Logger.LogEntry("HTTP SERVER", level, message);
@@ -228,14 +217,7 @@

         #region handlers

-#pragma warning disable AsyncFixer03 // Avoid fire & forget async void methods
-        /// <summary>
-        ///     Event handler for received HTTP message
-        /// </summary>
-        /// <param name="channel">Client TCP channel</param>
-        /// <param name="message">Receiver request</param>
         private static async void OnMessage(ITcpChannel channel, object message)
-#pragma warning restore AsyncFixer03 // Avoid fire & forget async void methods
         {
             var request = (HttpRequest)message;
             // This Stopwatch will be used by different threads, but sequentially (select processor => handle => completion)
@@ -335,11 +317,6 @@
             }
         }

-        /// <summary>
-        ///     Client connection handler
-        /// </summary>
-        /// <param name="sender">Event context</param>
-        /// <param name="clientConnectedEventArgs">Event params</param>
         private static void OnClientConnected(object sender, ClientConnectedEventArgs clientConnectedEventArgs)
         {
             var sslDescription = string.Empty;
@@ -362,23 +339,11 @@
             LogMessage(LogLevel.Debug, $"Client connected: {clientConnectedEventArgs.Channel.RemoteEndpoint}{sslDescription}");
         }

-        /// <summary>
-        ///     Client disconnection handler
-        /// </summary>
-        /// <param name="sender">Event context</param>
-        /// <param name="clientDisconnectedEventArgs">Event params</param>
         private static void OnClientDisconnected(object sender, ClientDisconnectedEventArgs clientDisconnectedEventArgs)
         {
             LogMessage(LogLevel.Trace, $"Client {clientDisconnectedEventArgs.Channel.RemoteEndpoint} disconnected with status {clientDisconnectedEventArgs.Exception.Message}");
         }

-        /// <summary>
-        ///     Method invoked when response is prepared
-        /// </summary>
-        /// <param name="channel">Client TCP channel</param>
-        /// <param name="response">Server HTTP response</param>
-        /// <param name="uri">For performance statistics</param>
-        /// /// <param name="requestStopwatch">For performance statistics</param>
         private static void OnResponseReady(ITcpChannel channel, HttpResponse response, string uri, Stopwatch requestStopwatch)
         {
             try
@@ -464,7 +429,7 @@
             {
                 response.AddHeader("Retry-After", authResult.Userdata.ToString());
             }
-            OnResponseReady(channel, response, "login", requestStopwatch);
+            OnResponseReady(channel, response, "/login", requestStopwatch);
         }

         private static Delegates.Authentificator _authentificator;
@@ -493,7 +458,7 @@
             var responseBody = JsonConvert.SerializeObject(new PingResponse(request.ToString()), Formatting.None, converter);
             responseBody = responseBody.Replace(@"\", "");
             var response = ResponseFactory.CreateResponse(HttpStatusCode.OK, responseBody, true);
-            OnResponseReady(channel, response, "ping", requestStopwatch);
+            OnResponseReady(channel, response, "/ping", requestStopwatch);
             return Task.CompletedTask;
         }

@@ -539,7 +504,7 @@
                 response.ContentType = "text/plain";
             }

-            OnResponseReady(channel, response, "statistics", requestStopwatch);
+            OnResponseReady(channel, response, "/statistics", requestStopwatch);
         }
         #endregion

@@ -613,7 +578,7 @@
             if (string.IsNullOrEmpty(_faviconPath) || !File.Exists(_faviconPath))
             {
                 response = ResponseFactory.CreateResponse(HttpStatusCode.NotFound, null);
-                OnResponseReady(channel, response, "favicon.ico", requestStopwatch);
+                OnResponseReady(channel, response, "/favicon.ico", requestStopwatch);
                 return Task.CompletedTask;
             }
             response = ResponseFactory.CreateResponse(HttpStatusCode.OK, null);
@@ -622,7 +587,7 @@
             response.ContentType = "image/x-icon";
             response.Body = fileStream;

-            OnResponseReady(channel, response, "favicon.ico", requestStopwatch);
+            OnResponseReady(channel, response, "/favicon.ico", requestStopwatch);
             return Task.CompletedTask;
         }
         #endregion
@@ -844,11 +809,6 @@
             return first.SubUri == second.SubUri && first.Method == second.Method;
         }

-        /// <summary>
-        ///     Add server request processor
-        /// </summary>
-        /// <param name="requestProcessor"></param>
-        /// <returns></returns>
         public static bool AddRequestProcessor(RequestProcessor<TAccount> requestProcessor)
         {
             if (CheckRequestProcessor(requestProcessor) != true)
@@ -893,11 +853,6 @@
             return true;
         }

-        /// <summary>
-        ///     Selects a way to handle incoming request
-        /// </summary>
-        /// <param name="request">Request</param>
-        /// <returns>Request processor or null if it is not found</returns>
         private static RequestProcessorSelectionResult<TAccount> SelectRequestProcessor(HttpRequest request)
         {
             var requestMethod = CommonHelper.HttpMethodToEnum(request.HttpMethod);
@@ -926,9 +881,6 @@
             };
         }

-        /// <summary>
-        ///     Legacy API method -> Request processor map
-        /// </summary>
         public static readonly List<RequestProcessor<TAccount>> RequestProcessors =
             new List<RequestProcessor<TAccount>>();


bomfunc

bomfunc

--- GerberLibrary/Core/BillOfMaterials.cs
+++ GerberLibrary/Core/BillOfMaterials.cs
@@ -1467,18 +1467,21 @@
         }

         public static Dictionary<string, int> RotationOffsets = new Dictionary<string, int>();
+
         public static int GetRotationOffset(string name)
         {
             if (RotationOffsets.ContainsKey(name)) return RotationOffsets[name];
             return 0;

         }
+
         public static void SetRotationOffset(string name, int off)
         {
             RotationOffsets[name] = off;
         }

         public static string DefaultRotationFile = "RotationOffsets.txt";
+
         public static void LoadRotationOffsets(string v = "")
         {
             if (v.Length == 0) v = DefaultRotationFile; else DefaultRotationFile = v;
@@ -1628,6 +1631,24 @@
                         if (rd.NameOnBoard == rdi)
                         {
                             return rd;
+                        }
+                    }
+                }
+            }
+            return null;
+        }
+
+        public BOMEntry GetBOMEntry(string rdi)
+        {
+            foreach (var t in DeviceTree)
+            {
+                foreach (var b in t.Value.Values)
+                {
+                    foreach (var rd in b.RefDes)
+                    {
+                        if (rd.NameOnBoard == rdi)
+                        {
+                            return b;
                         }
                     }
                 }


定義ファイルの最新化。

定義ファイルの最新化。

--- Implem.DefinitionAccessor/Def.cs
+++ Implem.DefinitionAccessor/Def.cs
@@ -1502,6 +1502,7 @@
                     case "_dot_control_slider": Css._dot_control_slider = definitionRow[1].ToString(); SetCssTable(CssTable._dot_control_slider, definitionRow, CssXls); break;
                     case "_dot_control_slider_ui": Css._dot_control_slider_ui = definitionRow[1].ToString(); SetCssTable(CssTable._dot_control_slider_ui, definitionRow, CssXls); break;
                     case "_dot_control_anchor": Css._dot_control_anchor = definitionRow[1].ToString(); SetCssTable(CssTable._dot_control_anchor, definitionRow, CssXls); break;
+                    case "_dot_container_selectable_space__dot_control": Css._dot_container_selectable_space__dot_control = definitionRow[1].ToString(); SetCssTable(CssTable._dot_container_selectable_space__dot_control, definitionRow, CssXls); break;
                     case "_dot_control_selectable": Css._dot_control_selectable = definitionRow[1].ToString(); SetCssTable(CssTable._dot_control_selectable, definitionRow, CssXls); break;
                     case "_dot_control_selectable_space_li": Css._dot_control_selectable_space_li = definitionRow[1].ToString(); SetCssTable(CssTable._dot_control_selectable_space_li, definitionRow, CssXls); break;
                     case "_dot_control_selectable_space__dot_ui_selecting": Css._dot_control_selectable_space__dot_ui_selecting = definitionRow[1].ToString(); SetCssTable(CssTable._dot_control_selectable_space__dot_ui_selecting, definitionRow, CssXls); break;
@@ -5657,6 +5658,7 @@
         public string _dot_control_slider;
         public string _dot_control_slider_ui;
         public string _dot_control_anchor;
+        public string _dot_container_selectable_space__dot_control;
         public string _dot_control_selectable;
         public string _dot_control_selectable_space_li;
         public string _dot_control_selectable_space__dot_ui_selecting;
@@ -5984,6 +5986,7 @@
         public CssDefinition _dot_control_slider = new CssDefinition();
         public CssDefinition _dot_control_slider_ui = new CssDefinition();
         public CssDefinition _dot_control_anchor = new CssDefinition();
+        public CssDefinition _dot_container_selectable_space__dot_control = new CssDefinition();
         public CssDefinition _dot_control_selectable = new CssDefinition();
         public CssDefinition _dot_control_selectable_space_li = new CssDefinition();
         public CssDefinition _dot_control_selectable_space__dot_ui_selecting = new CssDefinition();


Cleanup docs.

Cleanup docs.

--- Gu.Wpf.Geometry/Effects/Desaturate.cs
+++ Gu.Wpf.Geometry/Effects/Desaturate.cs
@@ -16,8 +16,14 @@
             typeof(Desaturate),
             new UIPropertyMetadata(1.0, PixelShaderConstantCallback(0)));

-        private static readonly PixelShader Shader = new PixelShader { UriSource = new Uri("pack://application:,,,/Gu.Wpf.Geometry;component/Effects/Desaturate.ps", UriKind.Absolute) };
+        private static readonly PixelShader Shader = new PixelShader
+        {
+            UriSource = new Uri("pack://application:,,,/Gu.Wpf.Geometry;component/Effects/Desaturate.ps", UriKind.Absolute)
+        };

+        ///
+        /// Initializes a new instance of the <see cref="Desaturate"/> class.
+        ///
         public Desaturate()
         {
             this.PixelShader = Shader;
@@ -25,14 +31,22 @@
             this.UpdateShaderValue(StrengthProperty);
         }

-        /// There has to be a property of type Brush called "Input". This property contains the input image and it is usually not set directly - it is set automatically when our effect is applied to a control.
+        ///
+        /// There has to be a property of type Brush called "Input". This property contains the input image and it is usually not set directly - it is set automatically when our effect is applied to a control.
+        ///
+        // ReSharper disable once UnusedMember.Global
         public Brush Input
         {
             get => (Brush)this.GetValue(InputProperty);
             set => this.SetValue(InputProperty, value);
         }

-        /// Desaturates an image. the value can be betwen 0 and 1. 0 means the origianl image is returned. 1 means a monochrome image is produced.
+        ///
+        /// Desaturates an image.
+        /// The value can be between 0 and 1.
+        /// 0 means the original image is returned.
+        /// 1 means a monochrome image is produced.
+        ///
         public double Strength
         {
             get => (double)this.GetValue(StrengthProperty);


Change version to 0.3

Change version to 0.3

--- IncidentCS/Properties/AssemblyInfo.cs
+++ IncidentCS/Properties/AssemblyInfo.cs
@@ -14,6 +14,5 @@
 [assembly: ComVisible(false)]
 [assembly: Guid("3d979b62-8988-4740-97d3-fca97e9f0277")]

-
-[assembly: AssemblyVersion("0.0.2.0")]
-[assembly: AssemblyFileVersion("0.0.2.0")]
+[assembly: AssemblyVersion("0.0.3.0")]
+[assembly: AssemblyFileVersion("0.0.3.0")]


Improve code

Improve code

--- IntelliRps/IntelliRpsLeap/AppModel.cs
+++ IntelliRps/IntelliRpsLeap/AppModel.cs
@@ -18,7 +18,7 @@
         public ReactiveProperty<Scoreline> Scoreline { get; } = new ReactiveProperty<Scoreline>();
         public ReactiveProperty<bool> IsGameConsecutive { get; } = new ReactiveProperty<bool>();
         public ReactiveProperty<bool> IsMatchActive { get; } = new ReactiveProperty<bool>();
-        public ObservableCollection<MatchInfo> Matches { get; } = new ObservableCollection<MatchInfo>();
+        public ReactiveCollection<MatchInfo> Matches { get; } = new ReactiveCollection<MatchInfo>();

         public AppModel()
         {
@@ -34,7 +34,7 @@
                     ComputerShape.Value = computerShape;
                     IsMatchActive.Value = false;
                     Scoreline.Value = new Scoreline(Game.Value.MatchResultMap);
-                    System.Windows.Application.Current.Dispatcher.InvokeAsync(() => Matches.Add(Game.Value.MatchHistory.Last()));
+                    Matches.AddOnScheduler(Game.Value.MatchHistory.Last());
                 })
                 .Where(_ => IsGameConsecutive.Value)
                 .Subscribe(_ => SetNextMatchTimer());


git-svn-id: https://jumony.svn.codeplex.com/svn/trunk@64300 2327b42d-5241-43d6-9e2a-de5ac946f064

--- Ivony.Html/DocumentExtensions.cs
+++ Ivony.Html/DocumentExtensions.cs
@@ -200,16 +200,17 @@
       constructor.Name = methodName;
       constructor.Attributes = MemberAttributes.Public | MemberAttributes.Static;

-      constructor.Parameters.Add( new CodeParameterDeclarationExpression( typeof( IHtmlDomProvider ), "_provider" ) );
+      constructor.Parameters.Add( new CodeParameterDeclarationExpression( typeof( IHtmlDomProvider ), "provider" ) );
       constructor.ReturnType = new CodeTypeReference( typeof( IHtmlDocument ) );

-      var providerVariable =  new CodeVariableReferenceExpression( "_provider" );
-
-      constructor.Statements.Add( new CodeVariableDeclarationStatement( typeof( IHtmlDocument ), "_document", new CodeMethodInvokeExpression( providerVariable, "CreateDocument" ) ) );//var document = factory.CreateDocument();
-
-      constructor.Statements.Add( new CodeVariableDeclarationStatement( typeof( IFreeNode ), "_node" ) );// var node;
-
-      var documentVariable = new CodeVariableReferenceExpression( "_document" );
+      var providerVariable =  new CodeVariableReferenceExpression( "provider" );
+
+      constructor.Statements.Add( new CodeVariableDeclarationStatement( typeof( IHtmlDocument ), "document", new CodeMethodInvokeExpression( providerVariable, "CreateDocument" ) ) );//var document = factory.CreateDocument();
+
+      constructor.Statements.Add( new CodeVariableDeclarationStatement( typeof( IFreeNode ), "node" ) );// var node;
+      constructor.Statements.Add( new CodeVariableDeclarationStatement( typeof( IDictionary<string, string> ), "attributes" ) );//var attributes
+
+      var documentVariable = new CodeVariableReferenceExpression( "document" );

       BuildChildNodesStatement( document, documentVariable, constructor.Statements, new List<string>() );//build document

@@ -221,80 +222,57 @@
     private static void BuildChildNodesStatement(IHtmlContainer container, CodeVariableReferenceExpression contaienrVariable, CodeStatementCollection statements, IList<string> existsElements)
     {

+
+      var providerVariable = new CodeVariableReferenceExpression( "provider" );
+      var nodeVariable = new CodeVariableReferenceExpression( "node" );
+      var attributesVariable = new CodeVariableReferenceExpression( "attributes" );
+
       int index = 0;

       foreach ( var node in container.Nodes() )
       {
-        var nodeVariable = BuildCreateNodeStatement( node, contaienrVariable, index, statements, existsElements );
-
-        statements.Add( new CodeMethodInvokeExpression( nodeVariable, "Into", contaienrVariable, new CodePrimitiveExpression( index ) ) );
+
+        var textNode = node as IHtmlTextNode;
+        if ( textNode != null )
+          statements.Add( new CodeAssignStatement( nodeVariable, new CodeMethodInvokeExpression( providerVariable, "AddTextNode", contaienrVariable, new CodePrimitiveExpression( index ), new CodePrimitiveExpression( textNode.HtmlText ) ) ) );
+
+
+        var comment = node as IHtmlComment;
+        if ( comment != null )
+          statements.Add( new CodeAssignStatement( nodeVariable, new CodeMethodInvokeExpression( providerVariable, "AddComment", contaienrVariable, new CodePrimitiveExpression( index ), new CodePrimitiveExpression( textNode.HtmlText ) ) ) );
+
+
+        var element = node as IHtmlElement;
+
+        if ( element != null )
+        {
+          var elementId = CreateIdentity( element, false );
+
+          elementId = EnsureUniqueness( elementId, existsElements );
+          existsElements.Add( elementId );
+
+          elementId = "element_" + elementId;
+
+
+          statements.Add( new CodeCommentStatement( ContentExtensions.GenerateTagHtml( element ) ) );
+
+          statements.Add( new CodeAssignStatement( attributesVariable, new CodeObjectCreateExpression( typeof( Dictionary<string, string> ) ) ) );
+
+          foreach ( var attribute in element.Attributes() )
+            statements.Add( new CodeMethodInvokeExpression( attributesVariable, "Add", new CodePrimitiveExpression( attribute.Name ), new CodePrimitiveExpression( attribute.AttributeValue ) ) );
+
+          statements.Add( new CodeVariableDeclarationStatement( typeof( IFreeElement ), elementId, new CodeMethodInvokeExpression( providerVariable, "AddElement", contaienrVariable, new CodePrimitiveExpression( index ), new CodePrimitiveExpression( element.Name ), attributesVariable ) ) );
+
+          var elementVariable = new CodeVariableReferenceExpression( elementId );
+
+
+          BuildChildNodesStatement( element, elementVariable, statements, existsElements );
+
+        }

         index++;
       }
     }
-
-    private static CodeVariableReferenceExpression BuildCreateNodeStatement(IHtmlNode node, CodeVariableReferenceExpression contaienrVariable, int index, CodeStatementCollection statements, IList<string> existsElements)
-    {
-
-      var providerVariable = new CodeVariableReferenceExpression( "_provider" );
-      var nodeVariable = new CodeVariableReferenceExpression( "_node" );
-
-      var textNode = node as IHtmlTextNode;
-      if ( textNode != null )
-      {
-        statements.Add( new CodeAssignStatement( nodeVariable, new CodeMethodInvokeExpression( providerVariable, "AddTextNode", contaienrVariable, new CodePrimitiveExpression( index ), new CodePrimitiveExpression( textNode.HtmlText ) ) ) );
-        return nodeVariable;
-      }
-
-
-      var comment = node as IHtmlComment;
-      if ( comment != null )
-      {
-        statements.Add( new CodeAssignStatement( nodeVariable, new CodeMethodInvokeExpression( providerVariable, "AddComment", contaienrVariable, new CodePrimitiveExpression( index ), new CodePrimitiveExpression( textNode.HtmlText ) ) ) );
-        return nodeVariable;
-      }
-
-
-      var element = node as IHtmlElement;
-
-      if ( element != null )
-      {
-        var elementId = CreateIdentity( element, false );
-
-        elementId = EnsureUniqueness( elementId, existsElements );
-        existsElements.Add( elementId );
-
-        elementId = "element_" + elementId;
-
-        statements.Add( new CodeCommentStatement( ContentExtensions.GenerateTagHtml( element ) ) );
-        statements.Add( new CodeVariableDeclarationStatement( typeof( IFreeElement ), elementId, new CodeMethodInvokeExpression( providerVariable, "CreateElement", new CodePrimitiveExpression( element.Name ) ) ) );
-
-
-        var elementVariable = new CodeVariableReferenceExpression( elementId );
-
-
-        foreach ( var attribute in element.Attributes() )
-        {
-          var addAttribute = new CodeMethodInvokeExpression( elementVariable, "AddAttribute", new CodePrimitiveExpression( attribute.Name ) );
-
-          if ( attribute.AttributeValue != null )
-            statements.Add( new CodeAssignStatement( new CodePropertyReferenceExpression( addAttribute, "AttributeValue" ), new CodePrimitiveExpression( attribute.AttributeValue ) ) );
-          else
-            statements.Add( addAttribute );
-        }
-
-
-
-        BuildChildNodesStatement( element, elementVariable, statements, existsElements );
-
-        return elementVariable;
-
-      }
-
-      throw new NotSupportedException();
-
-    }
-

   }
 }


Increment version number for next release

--- StructuredXmlEditor/Util/VersionInfo.cs
+++ StructuredXmlEditor/Util/VersionInfo.cs
@@ -14,7 +14,7 @@
 {
 	public const int MajorVersion = 1;
 	public const int FeatureVersion = 6;
-	public const int BugFixVersion = 0;
+	public const int BugFixVersion = 1;

 	public static string Version { get { return MajorVersion + "." + FeatureVersion + "." + BugFixVersion; } }