Protected PromptingClientCredentials some cleanup still required

--- SampleHelper/PromptingClientCredentials.cs
+++ SampleHelper/PromptingClientCredentials.cs
@@ -17,19 +17,39 @@
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.IO;
+using System.Security.Cryptography;
+using System.Text;

 namespace Google.Apis.Samples.Helper
 {
+    /// <summary>
+    /// This class is for use of samples only, on first use this class prompts the user for
+    /// ApiKey and optionaly ClientId and ClientSecret, these are stored encrypted in a file.
+    /// This is not sutible for production use as the user can access these keys.
+    /// </summary>
     public static class PromptingClientCredentials
     {
         private const string ApplicationFolderName = "Google.Apis.Samples";
         private const string ClientCredentialsFileName = "client.dat";
-        private const string FileKeyApiKey = "ApiKey";
-        private const string FileKeyClientId = "ClientId";
-        private const string FileKeyClientSecret = "ClientSecret";
-        private const string PromptSimpleCreate = "Blah Blah Blah please create a Simple For First time";
-
-
+        private const string FileKeyApiKey = "ProtectedApiKey";
+        private const string FileKeyClientId = "ProtectedClientId";
+        private const string FileKeyClientSecret = "ProtectedClientSecret";
+        private const byte[] entropy = new byte[] {
+            150, 116, 112, 35, 243, 210, 144, 9, 188, 122, 157, 253, 124, 115, 87, 51, 84, 178, 43, 176, 239, 198, 198,
+            249, 116, 190, 61, 129, 238, 23, 250, 163, 59, 26, 139 };
+
+        private const string PromptCreate = "This looks like the first time your running the Google(tm) API " +
+            "Samples if you have already got your API key please enter it here (you can find your key " +
+            "at https://code.google.com/apis/console/#:access). Otherwise " +
+            "please follow the instructions at http://code.google.com/p/google-api-dotnet-client/wiki/GettingStarted " +
+            " look out for the API Console.";
+        private const string PromptSimpleCreate = PromptCreate + " For the sample you are running you need just need API Key.";
+        private const string PromptFullCreate = PromptCreate + " For the sample you are running you need both an API Key and " +
+            "a Client ID for installed applications.";
+        private const string PromptFullExtend = "Another sample? Cool! This one requires ClientId for Installed applications " +
+            " as well as the API Key you entered earlier. You can pick up your from new ClientId from " +
+            "https://code.google.com/apis/console/#:access";
+
         private static FileInfo CredentialsFile
         {
             get
@@ -67,33 +87,59 @@

         private static SimpleClientCredentials CreateSimpleClientCredentials()
         {
+            CommandLine.WriteLine(PromptSimpleCreate);
             SimpleClientCredentials simpleCredentials =
                 CommandLine.CreateClassFromUserinput<SimpleClientCredentials>();
             using (FileStream fStream = CredentialsFile.OpenWrite())
             {
                 using (TextWriter tw = new StreamWriter(fStream))
                 {
-                    tw.WriteLine("{0}={1}", FileKeyApiKey, simpleCredentials.ApiKey);
+                    tw.WriteLine("{0}={1}", FileKeyApiKey, Protect(simpleCredentials.ApiKey));
                 }
             }
             return simpleCredentials;
         }

+        private static string Protect(string clearText)
+        {
+            byte[] encryptedData = ProtectedData.Protect(Encoding.ASCII.GetBytes(clearText), entropy, DataProtectionScope.CurrentUser);
+            return Convert.ToBase64String(encryptedData);
+        }
+
+        private static string Unprotect(string encrypted)
+        {
+            byte[] encryptedData = Convert.FromBase64String(encrypted);
+            byte[] clearText = ProtectedData.Unprotect(encryptedData, entropy, DataProtectionScope.CurrentUser);
+            return Encoding.ASCII.GetString(clearText);
+        }
+
         private static FullClientCredentials CreateFullClientCredentials(bool isExtension)
         {
+            if (isExtension)
+            {
+                CommandLine.WriteLine(PromptFullExtend);
+            }
+            else
+            {
+                CommandLine.WriteLine(PromptFullCreate);
+            }
+
             FullClientCredentials fullCredentials = CommandLine.CreateClassFromUserinput<FullClientCredentials>();
             using (FileStream fStream = CredentialsFile.OpenWrite())
             {
                 using (TextWriter tw = new StreamWriter(fStream))
                 {
-                    tw.WriteLine("{0}={1}", FileKeyApiKey, fullCredentials.ApiKey);
-                    tw.WriteLine("{0}={1}", FileKeyClientId, fullCredentials.ClientId);
-                    tw.WriteLine("{0}={1}", FileKeyClientSecret, fullCredentials.ClientSecret);
+                    tw.WriteLine("{0}={1}", FileKeyApiKey, Protect(fullCredentials.ApiKey));
+                    tw.WriteLine("{0}={1}", FileKeyClientId, Protect(fullCredentials.ClientId));
+                    tw.WriteLine("{0}={1}", FileKeyClientSecret, Protect(fullCredentials.ClientSecret));
                 }
             }
             return fullCredentials;
         }

+        /// <summary>
+        /// Fetches the users ApiKey either from local disk or prompts the user in the command line.
+        /// </summary>
         public static SimpleClientCredentials EnsureSimpleClientCredentials()
         {
             if (CredentialsFile.Exists == false)
@@ -106,9 +152,12 @@
             {
                 return CreateSimpleClientCredentials();
             }
-            return new SimpleClientCredentials() { ApiKey = values[FileKeyApiKey] };
-        }
-
+            return new SimpleClientCredentials() { ApiKey = Unprotect(values[FileKeyApiKey]) };
+        }
+
+        /// <summary>
+        /// Fetches the users ApiKey, ClientId and ClientSecreat either from local disk or prompts the user in the command line.
+        /// </summary>
         public static FullClientCredentials EnsureFullClientCredentials()
         {
             if (CredentialsFile.Exists == false)
@@ -125,12 +174,15 @@
             }

             return new FullClientCredentials() {
-                ApiKey = values[FileKeyApiKey],
-                ClientId = values[FileKeyClientId],
-                ClientSecret = values[FileKeyClientSecret]};
-
-        }
-
+                ApiKey = Unprotect(values[FileKeyApiKey]),
+                ClientId = Unprotect(values[FileKeyClientId]),
+                ClientSecret = Unprotect(values[FileKeyClientSecret])};
+
+        }
+
+        /// <summary>
+        /// Removes the stored credentials from this computer
+        /// </summary>
         public static void ClearClientCredentials()
         {
             FileInfo clientCredentials = CredentialsFile;


Update model

Update model

--- Samples/ColorsSample/ColorsWpf/AppModel.cs
+++ Samples/ColorsSample/ColorsWpf/AppModel.cs
@@ -10,7 +10,7 @@
 {
     public class AppModel
     {
-        public ColorInfo[][] ColorClusters { get; private set; }
+        public ColorCluster[] ColorClusters { get; private set; }

         public AppModel()
         {
@@ -28,15 +28,24 @@
                     .Select(r => new ColorInfo(r.Element))
                     .OrderBy(ci => ci.Color.GetHue())
                     .ToArray())
-                .OrderBy(cs => cs.Average(c => c.Color.GetHue()))
+                .Select((cs, i) => new ColorCluster { Id = i, Colors = cs })
+                .OrderBy(cc => cc.Colors.Average(c => c.Color.GetHue()))
                 .ToArray();
         }
+    }
+
+    public struct ColorCluster
+    {
+        public int Id { get; set; }
+        public ColorInfo[] Colors { get; set; }
     }

     [DebuggerDisplay(@"\{{Color}\}")]
     public class ColorInfo
     {
         public Color Color { get; private set; }
+
+        public string Name { get { return Color.Name; } }
         public string RGB { get { return string.Format("#{0:X2}{1:X2}{2:X2}", Color.R, Color.G, Color.B); } }

         public ColorInfo(Color color)


support {version} variable in script include statements

--- Serenity.Web/Script/ScriptBundleManager.cs
+++ Serenity.Web/Script/ScriptBundleManager.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Configuration;
+using System.Linq;
 using System.IO;
 using System.Web;
 using System.Web.Hosting;
@@ -8,6 +9,7 @@
 using Serenity.Configuration;
 using Serenity.Data;
 using Newtonsoft.Json;
+using System.Collections.Concurrent;

 namespace Serenity.Web
 {
@@ -24,7 +26,13 @@
         private static bool isInitialized;
         private static Dictionary<string, string> bundleKeyBySourceUrl;
         private static Dictionary<string, ConcatenatedScript> bundleByKey;
+        private static ConcurrentDictionary<string, string> expandVersion;
         private const string errorLines = "\r\n//\r\n//!!!ERROR: {0}!!!\r\n//\r\n";
+
+        static ScriptBundleManager()
+        {
+            expandVersion = new ConcurrentDictionary<string, string>();
+        }

         public static bool IsEnabled
         {
@@ -89,7 +97,9 @@
                         if (sourceFile.IsNullOrEmpty())
                             continue;

-                        string sourceUrl = VirtualPathUtility.ToAbsolute(sourceFile);
+                        string sourceUrl = ExpandVersionVariable(sourceFile);
+                        sourceUrl = VirtualPathUtility.ToAbsolute(sourceUrl);
+
                         if (sourceUrl.IsNullOrEmpty())
                             continue;

@@ -134,6 +144,8 @@

         public static void ScriptsChanged()
         {
+            expandVersion.Clear();
+
             if (isEnabled && bundleByKey != null)
             {
                 foreach (var bundle in bundleByKey.Values)
@@ -143,11 +155,76 @@
             }
         }

+        public static string ExpandVersionVariable(string scriptUrl)
+        {
+            if (scriptUrl.IsNullOrEmpty())
+                return scriptUrl;
+
+            var tpl = "{version}";
+            var idx = scriptUrl.IndexOf(tpl, StringComparison.OrdinalIgnoreCase);
+
+            if (idx < 0)
+                return scriptUrl;
+
+            string result;
+            if (expandVersion.TryGetValue(scriptUrl, out result))
+                return result;
+
+            var before = scriptUrl.Substring(0, idx);
+            var after = scriptUrl.Substring(idx + tpl.Length);
+            var extension = Path.GetExtension(scriptUrl);
+
+            var path = HostingEnvironment.MapPath(before);
+
+            path = Path.GetDirectoryName(path);
+
+            Func<string, bool> isVersion = s => {
+                if (s.Length < 0)
+                    return false;
+
+                int y;
+                return s.Split('.').All(x => Int32.TryParse(x, out y));
+            };
+
+            var beforeName = Path.GetFileName(before.Replace('/', '\\'));
+
+            var files = Directory.GetFiles(path, beforeName + "*" + extension.Replace('/', '\\'))
+                .Select(x =>
+                {
+                    var filename = Path.GetFileName(x);
+                    return filename.Substring(beforeName.Length, filename.Length - beforeName.Length - after.Length);
+                })
+                .Where(isVersion)
+                .ToArray();
+
+            if (!files.Any())
+                return scriptUrl;
+
+            Array.Sort(files, (x, y) =>
+            {
+                var px = x.Split('.');
+                var py = y.Split('.');
+
+                for (var i = 0; i < Math.Min(px.Length, py.Length); i++)
+                {
+                    var c = Int32.Parse(px[i]).CompareTo(Int32.Parse(py[i]));
+                    if (c != 0)
+                        return c;
+                }
+
+                return px.Length.CompareTo(py.Length);
+            });
+
+            var latest = files.Last();
+
+            result = before + latest + after;
+            expandVersion[scriptUrl] = result;
+            return result;
+        }
+
         public static string GetScriptBundle(string scriptUrl)
         {
-            if (scriptUrl.IsNullOrEmpty())
-                return scriptUrl;
-
+            scriptUrl = ExpandVersionVariable(scriptUrl);
             scriptUrl = VirtualPathUtility.ToAbsolute(scriptUrl);

             Initialize();


Limited Show MessageBox Text & Caption Length

closes #236

--- Server/Forms/FrmShowMessagebox.Designer.cs
+++ Server/Forms/FrmShowMessagebox.Designer.cs
@@ -99,6 +99,7 @@
             // txtText
             //
             this.txtText.Location = new System.Drawing.Point(60, 49);
+            this.txtText.MaxLength = 256;
             this.txtText.Name = "txtText";
             this.txtText.Size = new System.Drawing.Size(249, 22);
             this.txtText.TabIndex = 4;
@@ -107,6 +108,7 @@
             // txtCaption
             //
             this.txtCaption.Location = new System.Drawing.Point(60, 21);
+            this.txtCaption.MaxLength = 256;
             this.txtCaption.Name = "txtCaption";
             this.txtCaption.Size = new System.Drawing.Size(249, 22);
             this.txtCaption.TabIndex = 2;


Use locking around static dictionary

Use locking around static dictionary

--- binding/Binding/SKManagedStream.cs
+++ binding/Binding/SKManagedStream.cs
@@ -97,7 +97,8 @@
 				throw new InvalidOperationException ("Unable to create a new SKManagedStream instance.");
 			}

-			managedStreams.Add (Handle, new WeakReference<SKManagedStream>(this));
+			lock (managedStreams)
+				managedStreams.Add (Handle, new WeakReference<SKManagedStream>(this));

 			stream = managedStream;
 			disposeStream = disposeManagedStream;
@@ -105,8 +106,10 @@

 		protected override void Dispose (bool disposing)
 		{
-			if (managedStreams.ContainsKey(Handle)) {
-				managedStreams.Remove (Handle);
+			lock (managedStreams){
+				if (managedStreams.ContainsKey(Handle)) {
+					managedStreams.Remove (Handle);
+				}
 			}

 			if (disposeStream && stream != null) {
@@ -252,9 +255,11 @@
 		private static bool AsManagedStream(IntPtr ptr, out SKManagedStream target)
 		{
 			WeakReference<SKManagedStream> weak;
-			if (managedStreams.TryGetValue (ptr, out weak)) {
-				if (weak.TryGetTarget(out target)) {
-					return true;
+			lock (managedStreams){
+				if (managedStreams.TryGetValue (ptr, out weak)) {
+					if (weak.TryGetTarget(out target)) {
+						return true;
+					}
 				}
 			}
 			target = null;


[Modify] Edit it

[Modify] Edit it

--- websocket-sharp/Net/WebSockets/HttpListenerWebSocketContext.cs
+++ websocket-sharp/Net/WebSockets/HttpListenerWebSocketContext.cs
@@ -35,8 +35,8 @@
 namespace WebSocketSharp.Net.WebSockets
 {
   /// <summary>
-  /// Provides the properties used to access the information in
-  /// a WebSocket handshake request received by the <see cref="HttpListener"/>.
+  /// Provides the access to the information in a WebSocket handshake request to
+  /// a <see cref="HttpListener"/> instance.
   /// </summary>
   public class HttpListenerWebSocketContext : WebSocketContext
   {


PasswordStrengthExtender documentation updated

--- AjaxControlToolkit/PasswordStrength/PasswordStrengthExtender.cs
+++ AjaxControlToolkit/PasswordStrength/PasswordStrengthExtender.cs
@@ -9,18 +9,8 @@
 namespace AjaxControlToolkit {

     /// <summary>
-    /// PasswordStrength is an ASP.NET AJAX extender that can be attached to an ASP.NET TextBox control used
-    /// for the entry of passwords. The PasswordStrength extender shows the strength of the password in the
-    /// TextBox and updates itself as the user types the password. The indicator can display the strength of
-    /// the password as a text message or with a progress bar indicator. The styling and position of both types
-    /// of indicators is configurable. The required strength of the password is also configurable, allowing
-    /// the page author to tailor the password strength requirements to their needs. The text messages that
-    /// describe the current strength of the password can also be configured and their default values have
-    /// localization support built-in. The second and third extenders' strings are being pulled from Toolkit
-    /// resources files. We do not have strings for all languages currently so they may show non-localized
-    /// values for some languages. A help indicator can be used to provide explicit instructions about what
-    /// changes are required to achieve a strong password. The indicator is displayed when the user begins typing
-    /// into the TextBox and is hidden from view once the TextBox loses focus.
+    /// PasswordStrength is an ASP.NET AJAX extender that can be attached to an ASP.NET TextBox control used for the entry of passwords.
+    /// The PasswordStrength extender shows the strength of the password in the TextBox and updates itself as a user types the password.
     /// </summary>
     [TargetControlType(typeof(TextBox))]
     [Designer(typeof(PasswordStrengthExtenderDesigner))]
@@ -90,8 +80,7 @@
         }

         /// <summary>
-        /// CSS class applied to the help element used to display a dialog box
-        /// describing the password requirements
+        /// A CSS class applied to the help element used to display a dialog box describing password requirements
         /// </summary>
         /// <remarks>
         /// This is used so that the user can click on this image and get a display
@@ -173,7 +162,7 @@
         }

         /// <summary>
-        /// CSS class applied to the bar indicator's border when StrengthIndicatorType=BarIndicator
+        /// A CSS class applied to the bar indicator's border when StrengthIndicatorType=BarIndicator
         /// </summary>
         [DefaultValue(null)]
         [ExtenderControlProperty()]
@@ -184,7 +173,7 @@
         }

         /// <summary>
-        /// CSS class applied to the bar indicator's inner bar when StrengthIndicatorType=BarIndicator
+        /// A CSS class applied to the bar indicator's inner bar when StrengthIndicatorType=BarIndicator
         /// </summary>
         [DefaultValue(null)]
         [ExtenderControlProperty()]
@@ -232,14 +221,15 @@
         }

         /// <summary>
-        /// List of semi-colon separated numeric values used to determine the weighting of a strength characteristic.
-        /// </summary>
-        /// <remarks>
-        /// There must be 4 values specified which must total 100.
-        /// The default weighting values are defined as 50;15;15;20.
-        /// This corresponds to password length is 50% of the strength calculation, Numeric criteria is 15% of
-        /// strength calculation, casing criteria is 15% of calculation, and symbol criteria is 20% of calculation.
-        /// So the format is 'A;B;C;D' where A = length weighting, B = numeric weighting, C = casing weighting, D = symbol weighting.
+        /// A list of semi-colon separated numeric values used to determine the weight of password strength's characteristic.
+        /// </summary>
+        /// <remarks>
+        /// There must be 4 values specified which must total 100.
+        /// The default weighting values are defined as 50;15;15;20.
+        /// This corresponds to password length is 50% of the strength calculation,
+        /// Numeric criteria is 15% of strength calculation, casing criteria is 15% of calculation,
+        /// and symbol criteria is 20% of calculation. So the format is 'A;B;C;D'
+        /// where A = length weighting, B = numeric weighting, C = casing weighting, D = symbol weighting.
         /// </remarks>
         [DefaultValue("")]
         [ExtenderControlProperty()]
@@ -335,8 +325,8 @@
         }

         /// <summary>
-        /// Minimum number of lowercase characters required when requiring mixed case
-        /// characters as part of your password strength considerations
+        /// A minimum number of lowercase characters required when requiring
+        /// mixed case characters as part of your password strength considerations
         /// </summary>
         /// <remarks>
         /// Only in effect if RequiresUpperAndLowerCaseCharacters property is true.


public constructor on abstract type

public constructor on abstract type

--- Core/System/Linq/Expressions/Interpreter/LightCompiler.net30.cs
+++ Core/System/Linq/Expressions/Interpreter/LightCompiler.net30.cs
@@ -3226,7 +3226,7 @@
     {
         public readonly int ArgumentIndex;

-        public ByRefUpdater(int argumentIndex)
+        protected ByRefUpdater(int argumentIndex)
         {
             ArgumentIndex = argumentIndex;
         }


Fix line tool tip

Fix line tool tip

--- Dependinator/ModelViewing/Links/Private/LineViewModelService.cs
+++ Dependinator/ModelViewing/Links/Private/LineViewModelService.cs
@@ -306,7 +306,11 @@
 				string targetName = target.NodeType == NodeType.Type
 					? target.Name.Name : target.Name.ShortName;

-				tip += "\n";
+				if (!isLimitReached)
+				{
+					tip += "\n";
+				}
+
 				foreach (Link link in groupByTarget)
 				{
 					count++;
@@ -321,7 +325,6 @@
 						isLimitReached = true;
 					}
 				}
-
 			}

 			if (isLimitReached)


Bug fix #103 Save User Flag assignment to DB

--- Disco.Web/Areas/API/Controllers/UserFlagAssignmentController.cs
+++ Disco.Web/Areas/API/Controllers/UserFlagAssignmentController.cs
@@ -1,9 +1,9 @@
 using Disco.Models.Repository;
 using Disco.Services;
 using Disco.Services.Authorization;
-using Disco.Services.Users.UserFlags;
 using Disco.Services.Web;
 using System;
+using System.Data.Entity;
 using System.Linq;
 using System.Web.Mvc;

@@ -18,9 +18,9 @@
             try
             {
                 if (id < 0)
-                    throw new ArgumentOutOfRangeException("id");
+                    throw new ArgumentOutOfRangeException(nameof(id));
                 if (string.IsNullOrEmpty(key))
-                    throw new ArgumentNullException("key");
+                    throw new ArgumentNullException(nameof(key));
                 var userFlagAssignment = Database.UserFlagAssignments.FirstOrDefault(a => a.Id == id);
                 if (userFlagAssignment != null)
                 {
@@ -38,7 +38,7 @@
                     throw new Exception("Invalid User Flag Assignment Id");
                 }
                 if (redirect.HasValue && redirect.Value)
-                    return Redirect(string.Format("{0}#UserDetailTab-Flags", Url.Action(MVC.User.Show(userFlagAssignment.UserId))));
+                    return Redirect($"{Url.Action(MVC.User.Show(userFlagAssignment.UserId))}#UserDetailTab-Flags");
                 else
                     return Json("OK", JsonRequestBehavior.AllowGet);
             }
@@ -47,7 +47,7 @@
                 if (redirect.HasValue && redirect.Value)
                     throw;
                 else
-                    return Json(string.Format("Error: {0}", ex.Message), JsonRequestBehavior.AllowGet);
+                    return Json($"Error: {ex.Message}", JsonRequestBehavior.AllowGet);
             }
         }

@@ -79,11 +79,11 @@

             var userFlag = Database.UserFlags.Find(id);
             if (userFlag == null)
-                throw new ArgumentException("Invalid User Flag Id", "id");
+                throw new ArgumentException("Invalid User Flag Id", nameof(id));

-            var user = Database.Users.Include("UserFlagAssignments").FirstOrDefault(u => u.UserId == UserId);
+            var user = Database.Users.Include(u => u.UserFlagAssignments).FirstOrDefault(u => u.UserId == UserId);
             if (user == null)
-                throw new ArgumentException("Invalid User Id", "UserId");
+                throw new ArgumentException("Invalid User Id", nameof(UserId));

             if (!user.CanAddUserFlag(userFlag))
                 throw new InvalidOperationException("Adding user flag is denied");
@@ -92,7 +92,9 @@

             var userFlagAssignment = user.OnAddUserFlag(Database, userFlag, addingUser, Comments);

-            return Redirect(string.Format("{0}#UserDetailTab-Flags", Url.Action(MVC.User.Show(user.UserId))));
+            Database.SaveChanges();
+
+            return Redirect($"{Url.Action(MVC.User.Show(user.UserId))}#UserDetailTab-Flags");
         }

         [DiscoAuthorizeAny(Claims.User.Actions.RemoveFlags)]
@@ -102,7 +104,7 @@

             var userFlagAssignment = Database.UserFlagAssignments.FirstOrDefault(a => a.Id == id);
             if (userFlagAssignment == null)
-                throw new ArgumentException("Invalid User Flag Assignment Id", "id");
+                throw new ArgumentException("Invalid User Flag Assignment Id", nameof(id));

             if (!userFlagAssignment.CanRemove())
                 throw new InvalidOperationException("Removing user flag assignment is denied");
@@ -112,7 +114,7 @@
             userFlagAssignment.OnRemove(Database, removingUser);
             Database.SaveChanges();

-            return Redirect(string.Format("{0}#UserDetailTab-Flags", Url.Action(MVC.User.Show(userFlagAssignment.UserId))));
+            return Redirect($"{Url.Action(MVC.User.Show(userFlagAssignment.UserId))}#UserDetailTab-Flags");
         }

         #endregion


Fix merge error

Fix merge error

--- source/PluginDev/Assets/Extensions/GooglePlayGames/Platforms/Native/NativeClient.cs
+++ source/PluginDev/Assets/Extensions/GooglePlayGames/Platforms/Native/NativeClient.cs
@@ -135,16 +135,15 @@
                 mTokenClient.FetchTokens((int result) => {
                     InitializeGameServices();
                     if (result == 0) {
-                    {
                         GameServices().StartAuthorizationUI();
                     } else {
                         HandleAuthTransition(Types.AuthOperation.SIGN_IN, (Status.AuthStatus)result);
                     }
+                });
             } else {
                 // If game services are uninitialized, creating them will start a silent auth attempt.
                 InitializeGameServices();
                 if (!silent) {
-                {
                     GameServices().StartAuthorizationUI();
                 }
             }


we're servin' beers

we're servin' beers

--- Assets/Scripts/Inventory.cs
+++ Assets/Scripts/Inventory.cs
@@ -105,7 +105,7 @@
                 }
             }

-            this.Update(inventory);
+            this.Update(potentialNewInventory);
             return true;
         }
     }


Fix setting the Z coordinate in the bot following code.

--- Aurora/BotManager/RexBot.cs
+++ Aurora/BotManager/RexBot.cs
@@ -40,7 +40,7 @@
     public class RexBot : IRexBot, IClientAPI
     {
         #region Declares
-        private const bool USE_NEW_FOLLOWING = true;
+        private bool USE_NEW_FOLLOWING = true;
         public enum RexBotState { Idle, Walking, Flying, Unknown }

         private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
@@ -825,7 +825,7 @@
                 return;
             }
             CurrentFollowTimeBeforeUpdate++;
-            if (CurrentFollowTimeBeforeUpdate != 5)
+            if (CurrentFollowTimeBeforeUpdate != 2)
                 return;
             CurrentFollowTimeBeforeUpdate = 0;

@@ -904,7 +904,8 @@
             {
                 //for (i = 0; i < path.Count; i++)
                 {
-                    nextPos = currentPos -= new Vector3 ((11 * resolution) - path[i].X, (11 * resolution) - path[i].Y, 0);
+                    //nextPos = currentPos -= new Vector3 ((11 * resolution) - path[i].X, (11 * resolution) - path[i].Y, 0);
+                    nextPos.Z = targetPos.Z; //Fix the Z coordinate
                     NavMesh mesh = new NavMesh ();

                     bool fly = FollowSP.PhysicsActor == null ? ShouldFly : FollowSP.PhysicsActor.Flying;


Fixed my issue, database logins are the devil

--- FRC_Scouting_V2/events/2015_RecycleRush/RecycleRush_GTR_East.cs
+++ FRC_Scouting_V2/events/2015_RecycleRush/RecycleRush_GTR_East.cs
@@ -640,11 +640,8 @@
                             }
                             catch (MySqlException exception)
                             {
-                                UsefulSnippets.ReportCrash(exception);
-                                Console.WriteLine(exception.ErrorCode);
-                                Console.WriteLine(exception.Message);
-                                Console.Write("Avoided Duplicated When Importing!");
-                                ConsoleWindow.AddItem("Avoided Duplicated When Importing!");
+                                Console.Write(exception.ToString());
+                                ConsoleWindow.AddItem(exception.ToString());
                             }
                         }
                     }


removed old abnormality size arguments

removed old abnormality size arguments

--- TCC.Core/Data/Player.cs
+++ TCC.Core/Data/Player.cs
@@ -303,7 +303,7 @@
         }

-        public void AddOrRefreshBuff(Abnormality ab, uint duration, int stacks, double size, double margin)
+        public void AddOrRefreshBuff(Abnormality ab, uint duration, int stacks)
         {
             var existing = Buffs.FirstOrDefault(x => x.Abnormality.Id == ab.Id);
             if (existing == null)
@@ -325,7 +325,7 @@
             existing.Refresh();

         }
-        public void AddOrRefreshDebuff(Abnormality ab, uint duration, int stacks, double size, double margin)
+        public void AddOrRefreshDebuff(Abnormality ab, uint duration, int stacks)
         {

             var existing = Debuffs.FirstOrDefault(x => x.Abnormality.Id == ab.Id);
@@ -341,7 +341,7 @@
             existing.Stacks = stacks;
             existing.Refresh();
         }
-        public void AddOrRefreshInfBuff(Abnormality ab, uint duration, int stacks, double size, double margin)
+        public void AddOrRefreshInfBuff(Abnormality ab, uint duration, int stacks)
         {
             var existing = InfBuffs.FirstOrDefault(x => x.Abnormality.Id == ab.Id);
             if (existing == null)


locale fix

locale fix

updated tool to force using US local (period as decimal separator) when parsing extent in WMC file, ignoring machine locale setting.

--- components/desktop/WMCOpener/trunk/src/WMCDocument.cs
+++ components/desktop/WMCOpener/trunk/src/WMCDocument.cs
@@ -303,10 +303,11 @@

             Double xmax, xmin, ymax, ymin;

-            xmax = Double.Parse(getAttribute(theAttributes, "maxx"));
-            xmin = Double.Parse(getAttribute(theAttributes, "minx"));
-            ymax = Double.Parse(getAttribute(theAttributes, "maxy"));
-            ymin = Double.Parse(getAttribute(theAttributes, "miny"));
+            CultureInfo culture = new CultureInfo("us");
+            xmax = Double.Parse(getAttribute(theAttributes, "maxx"), culture);
+            xmin = Double.Parse(getAttribute(theAttributes, "minx"), culture);
+            ymax = Double.Parse(getAttribute(theAttributes, "maxy"), culture);
+            ymin = Double.Parse(getAttribute(theAttributes, "miny"), culture);

             extent = new EnvelopeClass();
             extent.XMax = xmax;


api_enemyが削除されていることを確認

--- KanColleLib/TransmissionData/api_req_map/values/NextCellData.cs
+++ KanColleLib/TransmissionData/api_req_map/values/NextCellData.cs
@@ -98,6 +98,7 @@

         /// <summary>
         /// 敵艦隊情報
+        /// 2015年7月17日のメンテに伴って削除？
         /// </summary>
         public EnemyValue enemy;


add comment

add comment

--- src/main/Plugins/ValidationPlugins/Dns/Script/Script.cs
+++ src/main/Plugins/ValidationPlugins/Dns/Script/Script.cs
@@ -57,6 +57,10 @@
             var ret = args;
             ret = ret.Replace("{Identifier}", _identifier);
             ret = ret.Replace("{RecordName}", recordName);
+            // Some tokens start with - which confuses Powershell. We did not want to
+            // make a breaking change for .bat or .exe files, so instead escape the
+            // token with double quotes, as Powershell discards the quotes anyway and
+            // thus it's functionally equivalant.
             if (escapeToken && (ret.Contains(" {Token} ") || ret.EndsWith(" {Token}")))
             {
                 ret.Replace("{Token}", "\"{Token}\"");


loading next tut room working

loading next tut room working

--- MIMWebClient/Core/World/Tutorial/Tutorial.cs
+++ MIMWebClient/Core/World/Tutorial/Tutorial.cs
@@ -4,6 +4,7 @@
 using System.Threading.Tasks;
 using System.Web;
 using System.Web.Caching;
+using MIMWebClient.Core.Events;
 using MIMWebClient.Core.Room;
 using Cache = MIMWebClient.Core.Events.Cache;

@@ -160,6 +161,18 @@
             }
             else
             {
+
+                var loadRoom = new LoadRoom
+                {
+                    Area = player.Area,
+                    id = player.AreaId,
+                    Region = player.Region
+                };
+
+
+                var newRoom = loadRoom.LoadRoomFile();
+
+                Movement.EnterRoom(player, newRoom);
                 //load from DB
             }
         }


Add NRT annotations to serialized .NET dir.


Review comments

Review comments

--- src/Compilers/Core/Portable/Compilation/Compilation.cs
+++ src/Compilers/Core/Portable/Compilation/Compilation.cs
@@ -1252,7 +1252,7 @@
             {
                 // A module cannot be signed. The native compiler allowed one to create a netmodule with an AssemblyKeyFile
                 // or Container attribute (or specify a key via the cmd line). When the module was linked into an assembly,
-                // a link would sign the assembly. So rather than give an error we just don't sign when outputting a module.
+                // alink would sign the assembly. So rather than give an error we just don't sign when outputting a module.

                 return !IsDelaySigned
                     && Options.OutputKind != OutputKind.NetModule


Remove unrequired method.

Remove unrequired method.

--- Mono.Debugging/Mono.Debugging.Evaluation/ExpressionEvaluator.cs
+++ Mono.Debugging/Mono.Debugging.Evaluation/ExpressionEvaluator.cs
@@ -159,39 +159,6 @@
 			return sb.ToString ();
 		}

-		public static string UnEscapeString (string text)
-		{
-			StringBuilder sb = new StringBuilder ();
-			for (int i = 0; i < text.Length; i++) {
-				char escape = text[i];
-				if ('\\' == escape && i+1 < text.Length) {
-					char c = text[i+1];
-					char replacement = c;
-					switch (c) {
-						case '"':
-						case '\\':
-							break;
-						case '0': replacement = '\0'; break;
-						case 'a': replacement = '\a'; break;
-						case 'b': replacement = '\b'; break;
-						case 'f': replacement = '\f'; break;
-						case 'v': replacement = '\v'; break;
-						case 'n': replacement = '\n'; break;
-						case 'r': replacement = '\r'; break;
-						case 't': replacement = '\t'; break;
-						default:
-							sb.Append (escape);
-							break;
-					}
-					sb.Append (replacement);
-					++i;
-					continue;
-				}
-				sb.Append (escape);
-			}
-			return sb.ToString ();
-		}
-
 		public abstract string Resolve (DebuggerSession session, SourceLocation location, string exp);
 	}


Further refactored Shortcuts/RouterDbExtensions on the advice of @airbreather

--- src/Itinero/Algorithms/Shortcuts/RouterDbExtensions.cs
+++ src/Itinero/Algorithms/Shortcuts/RouterDbExtensions.cs
@@ -31,19 +31,11 @@
         /// <summary>
         /// Adds multiple shortcut db's at the same time.
         /// </summary>
-        public static void AddShortcuts(this RouterDb routerDb, params ShortcutSpecs[] shortcutSpecs)
-        {
-            //This overload is done manually instead of by default parameter to offer the parameter list interface without moving
-            //the cancellation token to an unusual position in the parameter list. The wrapped method below does not include
-            //a default cancellation token in its parameter set because this will create an ambiguous method spec and, potentially,
-            //a stack overflow at runtime (depending on the whims of the compiler.)
-            AddShortcuts(routerDb, shortcutSpecs, new CancellationToken());
-        }
-
+        public static void AddShortcuts(this RouterDb routerDb, params ShortcutSpecs[] shortcutSpecs) => AddShortcuts(routerDb, shortcutSpecs, new CancellationToken());
         /// <summary>
         /// Adds multiple shortcut db's at the same time.
         /// </summary>
-        public static void AddShortcuts(this RouterDb routerDb, ShortcutSpecs[] shortcutSpecs, CancellationToken cancellationToken)
+        public static void AddShortcuts(this RouterDb routerDb, ShortcutSpecs[] shortcutSpecs, CancellationToken cancellationToken = new CancellationToken())
         {
             // check all specs.
             if (shortcutSpecs == null) { throw new ArgumentNullException(); }


#212/#271: Rephrased the TODO comment to be more readable.

--- CefSharp.Wpf/WebView.cs
+++ CefSharp.Wpf/WebView.cs
@@ -258,7 +258,8 @@

         private static void OnApplicationExit(object sender, ExitEventArgs e)
         {
-            //TODO: this prevents accessviolation on shutdown but should be handled by Cef not the view class explicit call to shutdown shoulld not be necesary
+            // TODO: This prevents AccessViolation on shutdown, but it would be better handled by the Cef class; the WebView control
+            // should not explicitly have to perform this.
             if (Cef.IsInitialized)
             {
                 foreach (var item in cleanup)


Fixing unity fragment resolvers to work across bff files

--- Sharpmake.Generators/FastBuild/Bff.Util.cs
+++ Sharpmake.Generators/FastBuild/Bff.Util.cs
@@ -131,14 +131,11 @@
                 foreach (var unitySection in unities)
                 {
                     var unity = unitySection.Key;
-                    var configurations = unitySection.Value;
-                    var fragmentValuesComparisonBase = configurations[0].Target.GetFragmentsValue();
-
-                    var merged = GetFragmentsAcrossFastBuildConfigurations(project);
-
-                    var differentFragmentIndices = GetDifferentFragmentIndices(merged, fragmentValuesComparisonBase);
-
-                    int hashcode = unity.GetHashCode() ^ projectPath.GetHashCode() ^ differentFragmentIndices.GetHashCode();
+                    var unityConfigurations = unitySection.Value;
+
+                    int[] unityFragments = GetMergedFragmentValuesAcrossConfigurations(unityConfigurations);
+
+                    int hashcode = unity.GetHashCode() ^ projectPath.GetHashCode() ^ unityFragments.GetHashCode();

                     unity.UnityName = $"{project.Name}_unity_{hashcode:X8}";
                     unity.UnityOutputPattern = unity.UnityName.ToLower() + "*.cpp";
@@ -156,9 +153,7 @@

                 List<FieldInfo> fragmentsInfos = null;

-                var merged = GetFragmentsAcrossFastBuildConfigurations(project);
-
-                // then we merge the fragment values of all configurations sharing a unity
+                // merge the fragment values of all configurations sharing a unity
                 foreach (var unitySection in unities)
                 {
                     var configurations = unitySection.Value;
@@ -173,15 +168,16 @@
                     masks.Add(Tuple.Create(unitySection.Key, unityMerged));
                 }

+                // get the fragment values for the whole project: could span multiple bff files
+                IEnumerable<Project.Configuration> fastBuildConfigurations = project.Configurations.Where(c => c.IsFastBuild);
+                int[] merged = GetMergedFragmentValuesAcrossConfigurations(fastBuildConfigurations);

                 // finally, create a unity name that only contains the varying fragments
                 foreach (var unitySection in masks)
                 {
                     var unity = unitySection.Item1;
                     var unityFragments = unitySection.Item2;
-                    var fragmentValuesComparisonBase = unityFragments;
-
-                    var differentFragmentIndices = GetDifferentFragmentIndices(merged, fragmentValuesComparisonBase);
+                    var differentFragmentIndices = GetDifferentFragmentIndices(merged, unityFragments);

                     string fragmentString = string.Empty;
                     for (int i = 0; i < unityFragments.Length; ++i)
@@ -242,23 +238,19 @@
             return merged;
         }

-        private static int[] GetFragmentsAcrossFastBuildConfigurations(Project project)
-        {
-            // we only need the projects across files which are using FastBuild
-            var projectConfigurations = project.Configurations.Where(c => c.IsFastBuild);
-
-            // figure out which fragments are different across all configurations
-            var fragments = projectConfigurations.Select(x => x.Target.GetFragmentsValue()).ToList();
+        private static int[] GetMergedFragmentValuesAcrossConfigurations(IEnumerable<Project.Configuration> configurations)
+        {
+            var fragments = configurations.Select(x => x.Target.GetFragmentsValue()).ToList();
             var merged = GetMergedFragments(fragments);

             return merged;
         }

-        private static UniqueList<int> GetDifferentFragmentIndices(int[] merged, int[] fragmentValuesComparisonBase)
-        {
-            var differentFragmentIndices = new UniqueList<int>();
-
-            // we want to store in a list what makes the configuration different than all the others available
+        private static List<int> GetDifferentFragmentIndices(int[] merged, int[] fragmentValuesComparisonBase)
+        {
+            var differentFragmentIndices = new List<int>();
+
+            // we want to store in that list the indices of fragments that are different from the base
             for (int j = 0; j < merged.Length; ++j)
             {
                 if (fragmentValuesComparisonBase[j] != merged[j])


Another fix for cherry-pick

Another fix for cherry-pick

--- VersionrCore/Area.cs
+++ VersionrCore/Area.cs
@@ -488,6 +488,10 @@

                     Status.StatusEntry ws = null;
                     st.Map.TryGetValue(x.CanonicalName, out ws);
+                    if (ws == null && File.Exists(GetRecordPath(x.CanonicalName)))
+                    {
+                        ws = st.Map.Where(m => m.Key.Equals(x.CanonicalName, StringComparison.OrdinalIgnoreCase)).Select(m => m.Value).FirstOrDefault();
+                    }

                     string rpath = GetRecordPath(x.CanonicalName);


Support group signals

Support group signals

--- SignalR.Client.HubProxyObject/HubSignal.cs
+++ SignalR.Client.HubProxyObject/HubSignal.cs
@@ -34,6 +34,16 @@
         public Task Caller(Hub hub = null)
         {
             var cp = hub.Clients.Caller;
+            return cp.Invoke(SignalName);
+        }
+        public Task Group(string group)
+        {
+            var cp = hub.Clients.Group(group);
+            return cp.Invoke(SignalName);
+        }
+        public Task OthersInGroup(string group)
+        {
+            var cp = hub.Clients.OthersInGroup(group);
             return cp.Invoke(SignalName);
         }

@@ -88,6 +98,16 @@
             var cp = hub.Clients.Caller;
             return cp.Invoke(SignalName, arg);
         }
+        public Task Group(string group, T arg)
+        {
+            var cp = hub.Clients.Group(group);
+            return cp.Invoke(SignalName, arg);
+        }
+        public Task OthersInGroup(string group, T arg)
+        {
+            var cp = hub.Clients.OthersInGroup(group);
+            return cp.Invoke(SignalName, arg);
+        }

         public event Action<T> On;
         internal override object GetCaller() { return (Action <T>)(arg => On?.Invoke((T)arg)); }


force build with new tag

force build with new tag

--- src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api/Controllers/ApprenticeshipController.cs
+++ src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api/Controllers/ApprenticeshipController.cs
@@ -262,4 +262,4 @@
             return Ok(response);
         }
     }
-}
+}


Fix VersionSchemaTests

Fix VersionSchemaTests

--- src/NerdBank.GitVersioning.Tests/VersionSchemaTests.cs
+++ src/NerdBank.GitVersioning.Tests/VersionSchemaTests.cs
@@ -92,6 +92,7 @@
     [InlineData(@"{ ""version"": ""2.3"", ""release"":  { ""branchName"" : ""prefix{0}suffix"" } }")]
     [InlineData(@"{ ""version"": ""2.3"", ""release"":  { ""branchName"" : ""{0}"", ""versionIncrement"" : ""major"" } }")]
     [InlineData(@"{ ""version"": ""2.3"", ""release"":  { ""branchName"" : ""{0}"", ""versionIncrement"" : ""minor"" } }")]
+    [InlineData(@"{ ""version"": ""2.3"", ""release"":  { ""branchName"" : ""{0}"", ""versionIncrement"" : ""build"" } }")]
     [InlineData(@"{ ""version"": ""2.3"", ""release"":  { ""firstUnstableTag"" : ""pre"" } }")]
     public void ReleaseProperty_ValidJson(string json)
     {
@@ -100,7 +101,7 @@
     }

     [Theory]
-    [InlineData(@"{ ""version"": ""2.3"", ""release"":  { ""versionIncrement"" : ""build"" } }")]
+    [InlineData(@"{ ""version"": ""2.3"", ""release"":  { ""versionIncrement"" : ""revision"" } }")]
     [InlineData(@"{ ""version"": ""2.3"", ""release"":  { ""branchName"" : ""formatWithoutPlaceholder"" } }")]
     [InlineData(@"{ ""version"": ""2.3"", ""release"":  { ""unknownProperty"" : ""value"" } }")]
     public void ReleaseProperty_InvalidJson(string json)


global .vruser

global .vruser

--- VersionrCore/Area.cs
+++ VersionrCore/Area.cs
@@ -2053,14 +2053,27 @@
 			return Database.GetMergeInfo(iD);
 		}

-		private void LoadDirectives()
-		{
-
+		private void LoadVRMeta()
+		{
 			Configuration = null;
 			FileInfo info = new FileInfo(Path.Combine(Root.FullName, ".vrmeta"));
-
+			if (info.Exists)
+			{
+				string data = string.Empty;
+				using (var sr = info.OpenText())
+				{
+					data = sr.ReadToEnd();
+				}
+				Configuration = Newtonsoft.Json.Linq.JObject.Parse(data);
+				Directives = LoadConfigurationElement<Directives>("Versionr");
+			}
+			else
 				Directives = new Directives();
-			FileInfo localInfo = new FileInfo(Path.Combine(Root.FullName, ".vruser"));
+		}
+
+		private void LoadVRUser(string path)
+		{
+			FileInfo localInfo = new FileInfo(path);
 			if (localInfo.Exists)
 			{
 				string data = string.Empty;
@@ -2082,6 +2095,13 @@
 					}
 				}
 			}
+		}
+
+		private void LoadDirectives()
+		{
+			LoadVRMeta();
+			LoadVRUser(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".vruser"));
+			LoadVRUser(Path.Combine(Root.FullName, ".vruser"));
 		}


force 0 instead of null for valueToken="Sum"

--- Signum.Engine/DynamicQuery/DynamicQuery.cs
+++ Signum.Engine/DynamicQuery/DynamicQuery.cs
@@ -933,7 +933,7 @@

             var body = at.Parent!.BuildExpression(context);

-            var type = at.Type;
+            var type = at.AggregateFunction == AggregateFunction.Sum ? at.Type.UnNullify() : at.Type;

             if (body.Type != type)
                 body = body.TryConvert(type);


Fix for #5690.

Fix for #5690.


Update ImmutableSegmentedDictionary KeyNotFound test to work regardless of locale

--- src/Compilers/Core/CodeAnalysisTest/Collections/ImmutableSegmentedDictionaryTest.cs
+++ src/Compilers/Core/CodeAnalysisTest/Collections/ImmutableSegmentedDictionaryTest.cs
@@ -295,8 +295,9 @@
         {
             var map = ImmutableSegmentedDictionary.Create<string, string>()
                 .Add("a", "1").Add("b", "2");
-            var exception = Assert.Throws<KeyNotFoundException>(() => map["c"]);
-            Assert.Contains("'c'", exception.Message);
+            var missingKey = "__ThisKeyDoesNotExist__";
+            var exception = Assert.Throws<KeyNotFoundException>(() => map[missingKey]);
+            Assert.Contains(missingKey, exception.Message);
         }

         protected override IImmutableDictionary<TKey, TValue> Empty<TKey, TValue>()


(TFS CS 6175)

(TFS CS 6175)

--- Signum.Web.Extensions.Sample.Test/Login.cs
+++ Signum.Web.Extensions.Sample.Test/Login.cs
@@ -58,6 +58,7 @@
             try
             {
                 selenium.Stop();
+                selenium.ShutDownSeleniumServer();
                 SeleniumExtensions.KillSelenium(seleniumServerProcess);
             }
             catch (Exception)


Remove usage of TypeSwitch.

Remove usage of TypeSwitch.

--- src/Features/CSharp/Portable/ExtractMethod/CSharpSelectionResult.StatementResult.cs
+++ src/Features/CSharp/Portable/ExtractMethod/CSharpSelectionResult.StatementResult.cs
@@ -32,12 +32,15 @@
                 var node = this.GetContainingScope();
                 var semanticModel = this.SemanticDocument.SemanticModel;

-                return node.TypeSwitch(
-                    (AccessorDeclarationSyntax access) => false,
-                    (MethodDeclarationSyntax method) => method.Modifiers.Any(SyntaxKind.AsyncKeyword),
-                    (ParenthesizedLambdaExpressionSyntax lambda) => lambda.AsyncKeyword.Kind() == SyntaxKind.AsyncKeyword,
-                    (SimpleLambdaExpressionSyntax lambda) => lambda.AsyncKeyword.Kind() == SyntaxKind.AsyncKeyword,
-                    (AnonymousMethodExpressionSyntax anonymous) => anonymous.AsyncKeyword.Kind() == SyntaxKind.AsyncKeyword);
+                switch (node)
+                {
+                    case AccessorDeclarationSyntax access: return false;
+                    case MethodDeclarationSyntax method: return method.Modifiers.Any(SyntaxKind.AsyncKeyword);
+                    case ParenthesizedLambdaExpressionSyntax lambda: return lambda.AsyncKeyword.Kind() == SyntaxKind.AsyncKeyword;
+                    case SimpleLambdaExpressionSyntax lambda: return lambda.AsyncKeyword.Kind() == SyntaxKind.AsyncKeyword;
+                    case AnonymousMethodExpressionSyntax anonymous: return anonymous.AsyncKeyword.Kind() == SyntaxKind.AsyncKeyword;
+                    default: return false;
+                }
             }

             public override SyntaxNode GetContainingScope()


fix misspelling

fix misspelling

--- WasatchNET/EEPROM.cs
+++ WasatchNET/EEPROM.cs
@@ -1338,7 +1338,7 @@
                             Dictionary<string, int> pageIdxs = new Dictionary<string, int>();
                             for(int i = 0; i < librarySpectraNum; i++)
                             {
-                                pageIdxs = namePageIndecies(namesWritten);
+                                pageIdxs = namePageIndices(namesWritten);
                                 readNames.Add(ParseData.toString(pages[pageIdxs["namePage"]],pageIdxs["startIndex"],16));
                                 namesWritten++;
                             }
@@ -2016,7 +2016,7 @@
                     Dictionary<string, int> pageIdx = new Dictionary<string, int>();
                     foreach(string libName in libNames)
                     {
-                        pageIdx = namePageIndecies(namesWritten);
+                        pageIdx = namePageIndices(namesWritten);
                         if (!ParseData.writeString(libName, pages[pageIdx["namePage"]], pageIdx["startIndex"], libName.Length - 1)) return false;
                         namesWritten++;
                     }
@@ -2040,7 +2040,7 @@
             return true;
         }

-        private Dictionary<string,int> namePageIndecies(int namesWritten)
+        private Dictionary<string,int> namePageIndices(int namesWritten)
         {
             Dictionary<string, int> pageIndecies = new Dictionary<string, int>();
             int namePage;


HTML spacing and form added.

HTML spacing and form added.

--- src/SFA.DAS.EmployerAccounts.Web/Views/EmployerAgreement/WhenDoYouWantToView.cshtml
+++ src/SFA.DAS.EmployerAccounts.Web/Views/EmployerAgreement/WhenDoYouWantToView.cshtml
@@ -12,160 +12,171 @@
 @{Layout = "~/Views/Shared/_Layout_CDN.cshtml"; }

+

+

+
+            @if(Model.InError){
+

+

+                    There is a problem
+

+

+

+

+                            Select if you want to view the employer agreement now or later
+

+

+

+

+}
+
+

+            <form method="POST" action="@Url.Action(ControllerConstants.WhenDoYouWantToView)">
+                @Html.AntiForgeryToken()
+                <fieldset class="govuk-fieldset" aria-describedby="intro-hint">
+
+                    <legend class="govuk-fieldset__legend govuk-fieldset__legend--xl">
+

+                            When do you want to view the employer agreement?
+

+                    </legend>
+
+
+                        This agreement is between @Model.EmployerAgreement.LegalEntityName and the Education and Skills Funding Agency (ESFA).
+
+
+
+                        Error: Select whether you want to view the employer agreement now or later
+
+
+

+

+                            <input class="govuk-radios__input" type="radio" name="choice" id="view-it-now" value="1">
+
+                                I'll view it now
+
+

+

+                            <input class="govuk-radios__input" type="radio" name="choice" id="view-it-later" value="2" aria-describedby="skip-hint">
+
+                                I'll view it later, after I've created an account
+
+
+
+                                You can skip the agreement and view it when @Model.EmployerAgreement.LegalEntityName is ready to get or reserve apprenticeship funding.
+
+

+

+
+                    <button class="govuk-button" type="submit" id="submit-when-do-you-want-to-view-button">
+                        Continue
+                    </button>
+
+                </fieldset>
+            </form>
+

+
+

+

-@if(Model.InError){
-

-

-            There is a problem
-

-

-

-

-                    Select if you want to view the employer agreement now or later
-

-

-

-

-}
+            @*

+

-

-    <fieldset class="govuk-fieldset" aria-describedby="intro-hint">
+

+
There is a problem

+

+

+                                Select whether you want to view the employer agreement now or later
+

+

+

-        <legend class="govuk-fieldset__legend govuk-fieldset__legend--xl">
-

-                When do you want to view the employer agreement?
-

-        </legend>
+

+                        When do you want to view the employer agreement?
+

-
-            This agreement is between @Model.EmployerAgreement.LegalEntityName and the Education and Skills Funding Agency (ESFA).
-
+
This agreement is between @Model.EmployerAgreement.LegalEntityName and the Education and Skills Funding Agency (ESFA).

-
-            Error: Select whether you want to view the employer agreement now or later
-
+                    <form method="POST" action="@Url.Action(ControllerConstants.WhenDoYouWantToView)">
+                        @Html.AntiForgeryToken()

-

-

-                <input class="govuk-radios__input" type="radio" name="choice" id="view-it-now" value="1">
-
-                    I'll view it now
-
-

-

-                <input class="govuk-radios__input" type="radio" name="choice" id="view-it-later" value="2" aria-describedby="skip-hint">
-
-                    I'll view it later, after I've created an account
-
+

+                            <fieldset class="govuk-fieldset">

-
-                    You can skip the agreement and view it when @Model.EmployerAgreement.LegalEntityName is ready to get or reserve apprenticeship funding.
-
-

-

+
+                                    Select whether you want to view the employer agreement now or later
+

-    </fieldset>
-

+

+

+                                        <input class="govuk-radios__input" type="radio" name="choice" id="view-it-now" value="1">
+
+                                            I'll view it now
+
+

+

+                                        <input class="govuk-radios__input" type="radio" name="choice" id="view-it-later" value="2" aria-describedby="skip-hint">
+
+                                            I'll view it later, after I've created an account
+
+
+
+                                            You can skip the agreement and view it when @Model.EmployerAgreement.LegalEntityName is ready to get or reserve apprenticeship funding.
+
+

+

+
+                            </fieldset>
+

+
+                        <button class="govuk-button" type="submit" id="submit-when-do-you-want-to-view-button">
+                            Continue
+                        </button>
+
+                    </form>
+

+
*@

-@*

-

+            @*

+

+

+
There is a problem

+

+

+                                Select whether you want to view the employer agreement now or later
+

+

+

+

+                        When do you want to view the employer agreement?
+

-

-
There is a problem

-

-

-                        Select whether you want to view the employer agreement now or later
-

-

-

+
This agreement is between @Model.EmployerAgreement.LegalEntityName and the Education and Skills Funding Agency (ESFA)

-

-                When do you want to view the employer agreement?
-

+                    <form method="POST" action="@Url.Action(ControllerConstants.WhenDoYouWantToView)">
+                        @Html.AntiForgeryToken()
+

-
This agreement is between @Model.EmployerAgreement.LegalEntityName and the Education and Skills Funding Agency (ESFA).

-
-            <form method="POST" action="@Url.Action(ControllerConstants.WhenDoYouWantToView)">
-                @Html.AntiForgeryToken()
-
-

-                    <fieldset class="govuk-fieldset">
-
-
-                            Select whether you want to view the employer agreement now or later
-
-
-

-

-                                <input class="govuk-radios__input" type="radio" name="choice" id="view-it-now" value="1">
-
+                            <fieldset>
+
+                                    Select whether you want to view the employer agreement now or later
+
+
+                                    <input type="radio" name="choice" id="view-it-now" value="1" />
                                     I'll view it now

-

-

-                                <input class="govuk-radios__input" type="radio" name="choice" id="view-it-later" value="2" aria-describedby="skip-hint">
-
-                                    I'll view it later, after I've created an account
+
+                                    <input type="radio" name="choice" id="view-it-later" value="2" />
+                                    I'll view it later, after I have created an account

+                            </fieldset>

-
-                                    You can skip the agreement and view it when @Model.EmployerAgreement.LegalEntityName is ready to get or reserve apprenticeship funding.
-
-

+

+
<button class="button" type="submit" id="submit-when-do-you-want-to-view-button">Continue</button>

+

-
-                    </fieldset>
+                    </form>

-
-                <button class="govuk-button" type="submit" id="submit-when-do-you-want-to-view-button">
-                    Continue
-                </button>
-
-            </form>
-

-
*@
-
-
-@*

-

-

-
There is a problem

-

-

-                        Select whether you want to view the employer agreement now or later
-

-

-

-

-                When do you want to view the employer agreement?
-

-
-
This agreement is between @Model.EmployerAgreement.LegalEntityName and the Education and Skills Funding Agency (ESFA)

-
-            <form method="POST" action="@Url.Action(ControllerConstants.WhenDoYouWantToView)">
-                @Html.AntiForgeryToken()
-

-
-                    <fieldset>
-
-                            Select whether you want to view the employer agreement now or later
-
-
-                            <input type="radio" name="choice" id="view-it-now" value="1" />
-                            I'll view it now
-
-
-                            <input type="radio" name="choice" id="view-it-later" value="2" />
-                            I'll view it later, after I have created an account
-
-                    </fieldset>
-
-

-
<button class="button" type="submit" id="submit-when-do-you-want-to-view-button">Continue</button>

-
-

-            </form>
-

-
*@
+
*@


raw tests

raw tests

--- Sdl.Web.Tridion.Templates.Tests/DataModelBuilderPipelineTest.cs
+++ Sdl.Web.Tridion.Templates.Tests/DataModelBuilderPipelineTest.cs
@@ -4,6 +4,7 @@
 using System.Linq;
 using System.Reflection;
 using System.Text.RegularExpressions;
+using System.Xml;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
 using Sdl.Web.DataModel;
 using Sdl.Web.Tridion.Common;
@@ -141,6 +142,8 @@

         }

+        #region Native Region tests
+
         /// <summary>
         /// CM Page contains native region hierarcy (with nested regions and CP).
         /// Check that generated PageModel reflects that hierarcy.
@@ -153,12 +156,8 @@
             if (!IsCmHasNativeRegions(testPage)) return;
             IList<IRegion> cmRegions = testPage.GetPropertyValue<IList<IRegion>>("Regions");

-            //TODO ensure some cm regions exist
-
-            //testPage.Checkout();
-            //var newRegion = new Region("testRegion", testPage, testPage);
-            //propValue.Add(newRegion);
-            //testPage.Save(true);
+            var newRegion = new Region("testRegion", testPage, testPage);
+            cmRegions.Add(newRegion);

             // Act
             RenderedItem testRenderedItem;
@@ -199,25 +198,27 @@
             // Assign
             Page testPage = (Page)TestSession.GetObject(TestFixture.ExampleSiteHomePageWebDavUrl);
             if (!IsCmHasNativeRegions(testPage)) return;
+
+            // Act
+            RenderedItem testRenderedItem;
+            PageModelData pageModel = CreatePageModel(testPage, out testRenderedItem);
+
+            //need to read Regions property second time, otherwise adding region to list will not work
             IList<IRegion> cmRegions = testPage.GetPropertyValue<IList<IRegion>>("Regions");
-
-            // Act
-            RenderedItem testRenderedItem;
-            PageModelData pageModel = CreatePageModel(testPage, out testRenderedItem);
-
             const string regionName = "Hero";
-            cmRegions.Add(new Region(regionName, testPage, testPage));
+            var region = new Region(regionName, testPage, testPage);
+            cmRegions.Add(region);

             PageModelData pageModelWithNativeRegion = CreatePageModel(testPage, out testRenderedItem);

             // Assert
-            Assert.Equals(pageModel.Regions.Count(r => r.Name == regionName), 1);
-            Assert.Equals(pageModelWithNativeRegion.Regions.Count(r => r.Name == regionName), 1);
+            Assert.AreEqual(pageModel.Regions.Count(r => r.Name == regionName), 1);
+            Assert.AreEqual(pageModelWithNativeRegion.Regions.Count(r => r.Name == regionName), 1);

             RegionModelData regionModelData = pageModel.Regions.First(r => r.Name == regionName);
             RegionModelData regionModelDataNative = pageModelWithNativeRegion.Regions.First(r => r.Name == regionName);

-            Assert.Equals(regionModelDataNative.Entities.First().Id, regionModelData.Entities.First().Id);
+            Assert.AreEqual(regionModelDataNative.Entities.First().Id, regionModelData.Entities.First().Id);
         }

         /// <summary>
@@ -250,7 +251,7 @@

             // Assert
             RegionModelData regionModelData = pageModelData.Regions.First(r => r.Name == regionNameHero);
-            Assert.Equals(regionModelData.Entities.Count(e => e.Id == DataModelBuilder.GetDxaIdentifier(componentPresentation.Component)), 2);
+            Assert.AreEqual(regionModelData.Entities.Count(e => e.Id == DataModelBuilder.GetDxaIdentifier(componentPresentation.Component)), 2);
         }

         /// <summary>
@@ -261,13 +262,36 @@
         public void CreatePageModel_ExampleSiteHomePage_NativeCmRegions_MetadataConflict_Success()
         {
             // Assign
-            Page testPage = (Page) TestSession.GetObject(TestFixture.ExampleSiteHomePageWebDavUrl);
+            var xml = new XmlDocument();
+            Page testPage = (Page)TestSession.GetObject(TestFixture.ExampleSiteHomePageWebDavUrl);
             if (!IsCmHasNativeRegions(testPage)) return;
+
+            var region = new Region("Hero", testPage, testPage);
+
+            var nativeRegionMetadataXml = "<Metadata xmlns=\"uuid:a94a82b5-5a3e-4256-a75d-52b6014dbf22\"><RegionMetadataField1>nativeValue1</RegionMetadataField1><RegionMetadataField2>nativeValue2</RegionMetadataField2></Metadata>";
+            xml.LoadXml(nativeRegionMetadataXml);
+            region.Metadata = xml.DocumentElement;
+
+            var dxaPTMetadataXML =
+                "<Metadata xmlns=\"uuid:a94a82b5-5a3e-4256-a75d-52b6014dbf22\"><regions><name>Hero</name><view></view><RegionMetadataField1>dxaValue1</RegionMetadataField1><RegionMetadataField2>dxaValue2</RegionMetadataField2></regions></Metadata>";
+            xml.LoadXml(dxaPTMetadataXML);
+
+            //testPage.PageTemplate.SetPropertyValue("Metadata", xml.DocumentElement);
+            testPage.PageTemplate.Metadata = xml.DocumentElement;
+
             IList<IRegion> cmRegions = testPage.GetPropertyValue<IList<IRegion>>("Regions");
-
+            cmRegions.Add(region);
+
+            // Act
             RenderedItem testRenderedItem;
             PageModelData pageModelData = CreatePageModel(testPage, out testRenderedItem);
-        }
+
+            // Assert
+
+            Assert.AreEqual(nativeRegionMetadataXml, pageModelData.Metadata);
+        }
+
+        #endregion Native Region tests

         [TestMethod]
         public void CreatePageModel_Article_Success()
@@ -493,7 +517,6 @@
             Assert.AreEqual(pageModelWithMeta.Title, ogTitle, "ogTite");
         }

-
         [TestMethod]
         public void CreatePageModel_KeywordModel_Success()
         {


Tune first heading margin

Tune first heading margin

--- SlicerConfiguration/SliceSettingsWidget.cs
+++ SlicerConfiguration/SliceSettingsWidget.cs
@@ -435,7 +435,7 @@
 								TextColor = ActiveTheme.Instance.PrimaryTextColor,
 								BorderColor = ActiveTheme.Instance.PrimaryTextColor,
 								HAnchor = HAnchor.Stretch,
-								Margin = new BorderDouble(bottom: 16),
+								Margin = new BorderDouble(bottom: 8, top: 8),
 								Padding = new BorderDouble(left: 4),
 							};
 							groupBox.AddChild(topToBottomSettings);


Fix MediaDownload overflow bug (#778)

Fix MediaDownload overflow bug (#778)

Fixes #748

--- Src/Support/GoogleApis/Apis/[Media]/Download/MediaDownloader.cs
+++ Src/Support/GoogleApis/Apis/[Media]/Download/MediaDownloader.cs
@@ -243,7 +243,7 @@
             var request = new HttpRequestMessage(HttpMethod.Get, uri.ToString());

             // Number of bytes sent to the caller's stream.
-            int bytesReturned = 0;
+            long bytesReturned = 0;

             try
             {
@@ -275,7 +275,7 @@
                             // Send one chunk to the caller's stream.
                             int bytesToReturn = Math.Min(ChunkSize, buffer.Count);
                             await stream.WriteAsync(buffer.Data, 0, bytesToReturn, cancellationToken).ConfigureAwait(false);
-                            checked { bytesReturned += bytesToReturn; }
+                            bytesReturned += bytesToReturn;

                             buffer.RemoveFromFront(ChunkSize);
                             if (buffer.IsEmpty)


Checkpoint

Checkpoint

Minor documentation update.

--- src/Splunk.Client/Splunk/Client/XmlReaderExtensions.cs
+++ src/Splunk.Client/Splunk/Client/XmlReaderExtensions.cs
@@ -42,8 +42,8 @@
         /// Expected XML node type.
         /// </param>
         /// <param name="names">
-        /// Optional list of names to match <paramref name="reader"/>.Name
-        /// against.
+        /// Optional list of names which the expected <paramref name="nodeType"/>
+        /// may have.
         /// </param>
         /// <exception cref="ArgumentNullExeption">
         /// <paramref name="reader"/> is <c>null</c>.


No need for this one.

No need for this one.

--- src/AutoMoq/Mocking.cs
+++ src/AutoMoq/Mocking.cs
@@ -15,7 +15,6 @@
         MockCreationResult CreateAMockObjectFor(Type type);
         MockCreationResult CreateAMockObjectFor(Type type, MockBehavior mockBehavior);
         MockCreationResult CreateANewMockObjectAndRegisterIt(Type type);
-        MockCreationResult CreateANewMockObjectAndRegisterIt<T>() where T : class;
         void SetMock(Type type, object mock);
         void SetInstance<T>(T instance) where T : class;
         Mock<T> GetMockByCreatingAMockIfOneHasNotAlreadyBeenCreated<T>() where T : class;
@@ -84,11 +83,6 @@
             return result;
         }

-        public MockCreationResult CreateANewMockObjectAndRegisterIt<T>() where T : class
-        {
-            throw new NotImplementedException();
-        }
-
         public MockCreationResult CreateANewMockObjectAndRegisterIt<T>(MockBehavior mockBehavior = MockBehavior.Default) where T : class
         {
             var result = CreateAMockObjectFor(typeof (T), mockBehavior);


Don't null ref if we can't find the host document in SetDocumentContext

Fixes internal bug #237579

--- src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.cs
+++ src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.cs
@@ -847,6 +847,12 @@
         internal override void SetDocumentContext(DocumentId documentId)
         {
             var hostDocument = GetHostDocument(documentId);
+            if (hostDocument == null)
+            {
+                // the document or project is not being tracked
+                return;
+            }
+
             var itemId = hostDocument.GetItemId();
             if (itemId == (uint)VSConstants.VSITEMID.Nil)
             {


修复Include错误

修复Include错误

--- src/Wodsoft.ComBoost.Data.Core/Wodsoft/ComBoost/Data/Entity/EntityWrappedContext.cs
+++ src/Wodsoft.ComBoost.Data.Core/Wodsoft/ComBoost/Data/Entity/EntityWrappedContext.cs
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Linq.Expressions;
+using System.Reflection;
 using System.Threading.Tasks;
 using Wodsoft.ComBoost.Data.Entity.Metadata;

@@ -38,13 +39,7 @@
         {
             return InnerContext.CountAsync(query.Unwrap<T, M>());
         }
-
-        protected virtual Expression<Func<M, TResult>> WrapExpression<TResult>(Expression<Func<T, TResult>> expression)
-        {
-            ExpressionWrapper<T, M> wrapper = new ExpressionWrapper<T, M>();
-            return (Expression<Func<M, TResult>>)wrapper.Visit(expression);
-        }
-
+
         public T Create()
         {
             return InnerContext.Create();
@@ -107,8 +102,12 @@

         public IQueryable<T> Include<TProperty>(IQueryable<T> query, Expression<Func<T, TProperty>> expression)
         {
-            var newExpression = WrapExpression(expression);
-            return InnerContext.Include(query.Unwrap<T, M>(), newExpression).Wrap<T, M>();
+            ExpressionWrapper<T, M> wrapper = new ExpressionWrapper<T, M>();
+            LambdaExpression newExpression = (LambdaExpression)wrapper.Visit(expression);
+            var propertyType = newExpression.Type.GetGenericArguments()[1];
+            var queryable = query.Unwrap<T, M>();
+            queryable = (IQueryable<M>)InnerContext.GetType().GetMethod("Include").MakeGenericMethod(propertyType).Invoke(InnerContext, new object[] { queryable, newExpression });
+            return queryable.Wrap<T, M>();
         }

         public async Task<T> GetAsync(object key)


Subversion\Svn.cs: Fix Commit message issue #12712     Svn Commit tasks break on upgrade to 4.0.8.0

--- Solutions/Main/Framework/Subversion/Svn.cs
+++ Solutions/Main/Framework/Subversion/Svn.cs
@@ -87,10 +87,10 @@
     ///         <MSBuild.ExtensionPack.Subversion.Svn TaskAction="Delete" Items="c:\path\something"/>
     ///         <!-- Move -->
     ///         <MSBuild.ExtensionPack.Subversion.Svn TaskAction="Move" Items="c:\path\file1;c:\path\file2" Destination="c:\path\directory"/>
-    ///         <!-- Commit with default committ message -->
+    ///         <!-- Commit with default commit message -->
     ///         <MSBuild.ExtensionPack.Subversion.Svn TaskAction="Commit" Items="c:\path\something"/>
-    ///         <!-- Commit with committ message -->
-    ///         <MSBuild.ExtensionPack.Subversion.Svn TaskAction="Commit" Items="c:\path\something" CommittMessage="MsBuild committed from something directory" />
+    ///         <!-- Commit with commit message -->
+    ///         <MSBuild.ExtensionPack.Subversion.Svn TaskAction="Commit" Items="c:\path\something" CommitMessage="MsBuild committed from something directory" />
     ///         <!-- Export -->
     ///         <MSBuild.ExtensionPack.Subversion.Svn TaskAction="Export" Item="c:\path\workingcopy" Destination="c:\path\exported"/>
     ///     </Target>
@@ -157,7 +157,7 @@
         public string PropertyValue { get; set; }

         /// <summary>
-        /// The committ message that the Commit action sends with the committ to the repository
+        /// The commit message that the Commit action sends with the commit to the repository
         /// </summary>
         public string CommitMessage { get; set; }

@@ -786,15 +786,15 @@
                 return;
             }

+            if (string.IsNullOrWhiteSpace(this.CommitMessage))
+            {
+                this.CommitMessage = DefaultCommitMessage;
+            }
+
             if (this.CommitMessage.Contains("\""))
             {
                 Log.LogError("There appears to be quotes in the commit message. This is not supported yet.");
                 return;
-            }
-
-            if (this.CommitMessage.Length == 0)
-            {
-                this.CommitMessage = DefaultCommitMessage;
             }

             // execute the tool


Subversion\Svn.cs: Fix 11734 - Add CommitMesssage property to the Svn commit action #11734     Add CommitMesssage property to the Svn commit action

--- Solutions/Main/Framework/Subversion/Svn.cs
+++ Solutions/Main/Framework/Subversion/Svn.cs
@@ -87,8 +87,10 @@
     ///         <MSBuild.ExtensionPack.Subversion.Svn TaskAction="Delete" Items="c:\path\something"/>
     ///         <!-- Move -->
     ///         <MSBuild.ExtensionPack.Subversion.Svn TaskAction="Move" Items="c:\path\file1;c:\path\file2" Destination="c:\path\directory"/>
-    ///         <!-- Commit -->
+    ///         <!-- Commit with default committ message -->
     ///         <MSBuild.ExtensionPack.Subversion.Svn TaskAction="Commit" Items="c:\path\something"/>
+    ///         <!-- Commit with committ message -->
+    ///         <MSBuild.ExtensionPack.Subversion.Svn TaskAction="Commit" Items="c:\path\something" CommittMessage="MsBuild committed from something directory" />
     ///         <!-- Export -->
     ///         <MSBuild.ExtensionPack.Subversion.Svn TaskAction="Export" Item="c:\path\workingcopy" Destination="c:\path\exported"/>
     ///     </Target>
@@ -111,6 +113,7 @@
         private const string MoveTaskAction = "Move";
         private const string CommitTaskAction = "Commit";
         private const string ExportTaskAction = "Export";
+        private const string DefaultCommitMessage = "MsBuild";

         private static readonly string SvnPath = FindSvnPath();

@@ -152,6 +155,11 @@
         /// </summary>
         [Output]
         public string PropertyValue { get; set; }
+
+        /// <summary>
+        /// The committ message that the Commit action sends with the committ to the repository
+        /// </summary>
+        public string CommitMessage { get; set; }

         protected override void InternalExecute()
         {
@@ -764,12 +772,23 @@
                 return;
             }

+            if (this.CommitMessage.Contains("\""))
+            {
+                Log.LogError("There appears to be quotes in the commit message. This is not supported yet.");
+                return;
+            }
+
+            if (this.CommitMessage.Length == 0)
+            {
+                this.CommitMessage = DefaultCommitMessage;
+            }
+
             // execute the tool
             var cmd = this.CreateCommandLineBuilder();
             cmd.AppendSwitch("commit");
             cmd.AppendSwitch("--non-interactive");
             cmd.AppendSwitch("-m");
-            cmd.AppendFixedParameter("MSBuild");
+            cmd.AppendFixedParameter("\"" + this.CommitMessage + "\"");
             cmd.AppendFileNamesIfNotNull(this.Items, " ");
             Utilities.ExecuteWithLogging(this.Log, Path.Combine(SvnPath, SvnExecutableName), cmd.ToString(), true);
         }


RadioButton/ToggleButton TextColor - fix #9

--- MonoGame.PortableUI/Controls/ToggleButton.cs
+++ MonoGame.PortableUI/Controls/ToggleButton.cs
@@ -21,6 +21,7 @@
                 if (_backgroundColor == null)
                     _backgroundColor = BackgroundBrush;
                 BackgroundBrush = IsChecked ? ToggleBrush : _backgroundColor;
+                OnStateChanged();
             }
         }

@@ -32,7 +33,7 @@
             {
                 var textBlock = Content as TextBlock;
                 if (textBlock != null && ToggleTextColor.HasValue)
-                    textBlock.TextColor = (Color) ToggleTextColor;
+                    textBlock.TextColor = (Color)ToggleTextColor;
             }
         }


Add failing test

Add failing test

`CallBase` currently tries to call the base method implementation even
for methods of additional interfaces (i. e. interfaces that were added
to the proxy using `.As<TInterface>()` that the base class does not
implement).

--- Moq.Tests/Regressions/IssueReportsFixture.cs
+++ Moq.Tests/Regressions/IssueReportsFixture.cs
@@ -1810,6 +1810,31 @@

 		#endregion

+		#region 582
+
+		public sealed class Issue582
+		{
+			public interface IFoo
+			{
+				void Method();
+			}
+
+			public class Bar
+			{
+			}
+
+			[Fact]
+			public void CallBase_has_no_effect_for_methods_of_additional_interfaces()
+			{
+				var bar = new Mock<Bar>() { CallBase = true };
+				var foo = bar.As<IFoo>().Object;
+
+				foo.Method();
+			}
+		}
+
+		#endregion
+
 		// Old @ Google Code

 		#region #47


Version upped due to POE commands

Version upped due to POE commands

--- NadekoBot.Core/Services/Impl/StatsService.cs
+++ NadekoBot.Core/Services/Impl/StatsService.cs
@@ -21,7 +21,7 @@
         private readonly IBotCredentials _creds;
         private readonly DateTime _started;

-        public const string BotVersion = "2.8.3";
+        public const string BotVersion = "2.9.0";
         public string Author => "Kwoth#2560";
         public string Library => "Discord.Net";


Version upped to 2.5.5

Version upped to 2.5.5

--- NadekoBot.Core/Services/Impl/StatsService.cs
+++ NadekoBot.Core/Services/Impl/StatsService.cs
@@ -21,7 +21,7 @@
         private readonly IBotCredentials _creds;
         private readonly DateTime _started;

-        public const string BotVersion = "2.5.4";
+        public const string BotVersion = "2.5.5";

         public string Author => "Kwoth#2560";
         public string Library => "Discord.Net";


A stab at brute force fixing the locking - one, make m_itemLock volatile, two, reset the lock even if the write lock is not apparently held.

--- OpenSim/Framework/TaskInventoryDictionary.cs
+++ OpenSim/Framework/TaskInventoryDictionary.cs
@@ -62,7 +62,7 @@
         /// <value>
         /// An advanced lock for inventory data
         /// </value>
-        private System.Threading.ReaderWriterLockSlim m_itemLock = new System.Threading.ReaderWriterLockSlim();
+        private volatile System.Threading.ReaderWriterLockSlim m_itemLock = new System.Threading.ReaderWriterLockSlim();

         /// <summary>
         /// Are we readlocked by the calling thread?
@@ -143,8 +143,8 @@
                 while (!m_itemLock.TryEnterReadLock(60000))
                 {
                     m_log.Error("Thread lock detected while trying to aquire READ lock in TaskInventoryDictionary. Locked by thread " + LockedByThread.Name + ". I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
-                    if (m_itemLock.IsWriteLockHeld)
-                    {
+                    //if (m_itemLock.IsWriteLockHeld)
+                    //{
                         m_itemLock = new System.Threading.ReaderWriterLockSlim();
 //                        System.Console.WriteLine("------------------------------------------");
 //                        System.Console.WriteLine("My call stack:\n" + Environment.StackTrace);
@@ -153,7 +153,7 @@
 //                        System.Console.WriteLine("------------------------------------------");
 //                        LockedByThread = null;
 //                        ReadLockers.Clear();
-                    }
+                    //}
                 }
 //                ReadLockers[Thread.CurrentThread] = Environment.StackTrace;
             }


make some arrays static to prevent excessive re-initialization - suggested by jhurliman

--- OpenSim/Region/Physics/Meshing/PrimMesher.cs
+++ OpenSim/Region/Physics/Meshing/PrimMesher.cs
@@ -384,7 +384,7 @@
     {
         private float iX, iY; // intersection point

-        private Angle[] angles3 =
+        private static Angle[] angles3 =
         {
             new Angle(0.0f, 1.0f, 0.0f),
             new Angle(0.33333333333333333f, -0.5f, 0.86602540378443871f),
@@ -392,7 +392,7 @@
             new Angle(1.0f, 1.0f, 0.0f)
         };

-        private Coord[] normals3 =
+        private static Coord[] normals3 =
         {
             new Coord(0.25f, 0.4330127019f, 0.0f).Normalize(),
             new Coord(-0.5f, 0.0f, 0.0f).Normalize(),
@@ -400,7 +400,7 @@
             new Coord(0.25f, 0.4330127019f, 0.0f).Normalize()
         };

-        private Angle[] angles4 =
+        private static Angle[] angles4 =
         {
             new Angle(0.0f, 1.0f, 0.0f),
             new Angle(0.25f, 0.0f, 1.0f),
@@ -409,7 +409,7 @@
             new Angle(1.0f, 1.0f, 0.0f)
         };

-        private Coord[] normals4 =
+        private static Coord[] normals4 =
         {
             new Coord(0.5f, 0.5f, 0.0f).Normalize(),
             new Coord(-0.5f, 0.5f, 0.0f).Normalize(),
@@ -418,7 +418,7 @@
             new Coord(0.5f, 0.5f, 0.0f).Normalize()
         };

-        private Angle[] angles24 =
+        private static Angle[] angles24 =
         {
             new Angle(0.0f, 1.0f, 0.0f),
             new Angle(0.041666666666666664f, 0.96592582628906831f, 0.25881904510252074f),


checking the privacy mode added

checking the privacy mode added

--- WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabViewModel.cs
+++ WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabViewModel.cs
@@ -59,7 +59,7 @@
 						}

 						var newAddress = new AddressViewModel(newKey, Wallet.KeyManager, this);
-						if (Addresses.Count == 0)
+						if (Addresses.Count == 0 && !Global.UiConfig.PrivacyMode)
 						{
 							newAddress.IsExpanded = true;
 						}


revert temporary

revert temporary

--- Source/LinqToDB/Async/AsyncDbConnection.cs
+++ Source/LinqToDB/Async/AsyncDbConnection.cs
@@ -114,9 +114,9 @@
 			Connection.ChangeDatabase(databaseName);
 		}

-		public virtual DbCommand CreateCommand()
+		public virtual IDbCommand CreateCommand()
 		{
-			return (DbCommand)Connection.CreateCommand();
+			return Connection.CreateCommand();
 		}

 		public virtual void Open()


Replace use of List<T>.Zip() with simple for loop. This restores compatibility with .NET 3.5 and should also increase performance.

--- Source/OxyPlot.Wpf/Axes/LinearColorAxis.cs
+++ Source/OxyPlot.Wpf/Axes/LinearColorAxis.cs
@@ -209,15 +209,18 @@
             var palletePosition = stops[0].Offset;
             var step = (double)stops.Count / paletteSize;

-            foreach (var pair in stops.Zip(stops.Skip(1), (g1, g2) => new { Start = g1, End = g2 }))
-            {
-                while (palletePosition <= pair.End.Offset)
+            for (int i = 0; i < stops.Count - 1; i++)
+            {
+                GradientStop start = stops[i];
+                GradientStop end = stops[i + 1];
+
+                while (palletePosition <= end.Offset)
                 {
                     palette.Add(
                         OxyColor.Interpolate(
-                            pair.Start.Color.ToOxyColor(),
-                            pair.End.Color.ToOxyColor(),
-                            (palletePosition - pair.Start.Offset) / (pair.End.Offset - pair.Start.Offset)));
+                            start.Color.ToOxyColor(),
+                            end.Color.ToOxyColor(),
+                            (palletePosition - start.Offset) / (end.Offset - start.Offset)));
                     palletePosition += step;
                 }
             }


#1249 Fix reflection of inherited properties for UWP causing plots to not show up

--- Source/OxyPlot/Utilities/TypeExtensions.cs
+++ Source/OxyPlot/Utilities/TypeExtensions.cs
@@ -26,7 +26,12 @@
         /// <returns>An object that represents the specified property, or null if the property is not found.</returns>
         public static PropertyInfo GetRuntimeProperty(this Type type, string name)
         {
-            return type.GetTypeInfo().DeclaredProperties.FirstOrDefault(pi => pi.Name == name);
+            var typeInfo = type.GetTypeInfo();
+            var source = typeInfo.AsType().GetRuntimeProperties();
+
+            return (from x in source
+                    where x.Name == name
+                    select x).FirstOrDefault();
         }
     }
-}+}


Fixed an infinite loop bug

Fixed an infinite loop bug

If a command assigning to variable "v" and using "v" in its right-hand
side would be reachable from two other commands, one containing "v" in its
live set and the other not, the data-flow analysis would enter an infinite
loop, due to always visiting commands in the same order.

Furthermore, for the split memory optimisation, drastically reduced time
allowed per assert, from 300s to 10s. However, there are instances where
the imposed timeout is not respected.

--- CfiVerifier/source/utils.cs
+++ CfiVerifier/source/utils.cs
@@ -2186,7 +2186,7 @@

           private void CheckAssertion(int i)
           {
-              string args = Options.outputPath + @"/" + Options.splitFilesDir + @"/intermediate_" + i.ToString() + ".bpl /timeLimit:300 /z3opt:smt.RELEVANCY=0 /z3opt:smt.CASE_SPLIT=0";
+              string args = Options.outputPath + @"/" + Options.splitFilesDir + @"/intermediate_" + i.ToString() + ".bpl /timeLimit:10 /z3opt:smt.RELEVANCY=0 /z3opt:smt.CASE_SPLIT=0";
               bool boogie_result = ExecuteBoogieBinary(args);
               shared_result_struct.Add(i, boogie_result);
           }
@@ -2368,15 +2368,22 @@
                     this.live_set[prev_cmd].UnionWith(this.live_set[this_cmd]);
                     if (as_assign_cmd != null)
                     {
-                        HashSet<Variable> assign_cmd_lhs_vars = GetReferencedVars(as_assign_cmd.Lhss.First().AsExpr);
-                        this.live_set[prev_cmd] = new HashSet<Variable>(this.live_set[prev_cmd].Except(assign_cmd_lhs_vars).ToList());
-                        if (this.live_set[this_cmd].Contains(assign_cmd_lhs_vars.First()))
+                        Utils.Assert(as_assign_cmd.Lhss.Count == 1);
+                        Variable assign_cmd_lhs_var = GetReferencedVars(as_assign_cmd.Lhss.First().AsExpr).First();
+                        HashSet<Variable> assign_cmd_rhs_vars = new HashSet<Variable>();
+                        this.live_set[prev_cmd].Remove(assign_cmd_lhs_var);
+                        foreach (Expr rhs_expr in as_assign_cmd.Rhss)
                         {
-                            foreach (Expr rhs_expr in as_assign_cmd.Rhss)
-                            {
-                                this.live_set[prev_cmd].UnionWith(GetReferencedVars(rhs_expr));
-                                this.keep_set.Add(prev_cmd);
-                            }
+                            assign_cmd_rhs_vars.UnionWith(GetReferencedVars(rhs_expr));
+                        }
+                        if (this.live_set[this_cmd].Contains(assign_cmd_lhs_var))
+                        {
+                            this.live_set[prev_cmd].UnionWith(assign_cmd_rhs_vars);
+                            this.keep_set.Add(prev_cmd);
+                        }
+                        if (assign_cmd_rhs_vars.Contains(assign_cmd_lhs_var))
+                        {
+                            this.live_set[prev_cmd].Add(assign_cmd_lhs_var);
                         }
                     }
                     if (prev_cmd is AssumeCmd)
@@ -2384,7 +2391,9 @@
                         this.live_set[prev_cmd].UnionWith(GetReferencedVars(prev_cmd));
                         this.keep_set.Add(prev_cmd);
                     }
+                    Utils.Assert(this.live_set[prev_cmd].Count >= size_before);
                     if (this.live_set[prev_cmd].Count > size_before || this.keep_set.Contains(prev_cmd) != keep_before) {
+                        //Console.WriteLine("Changing {0} -- {1}.", this_cmd.ToString(), prev_cmd.ToString());
                         changed = true;
                     }
                 }
@@ -2438,6 +2447,7 @@
                 else if (e is ForallExpr)
                 {
                     referenced_vars.UnionWith(GetReferencedVars((e as ForallExpr).Body));
+                    (e as ForallExpr).Dummies.ForEach(i => referenced_vars.Remove(i));
                 }
                 return referenced_vars;
             }


Fix ScriptInliningTagHelper

Fix ScriptInliningTagHelper

--- src/live.asp.net/TagHelpers/ScriptInliningTagHelper.cs
+++ src/live.asp.net/TagHelpers/ScriptInliningTagHelper.cs
@@ -9,6 +9,7 @@
 using Microsoft.AspNetCore.Mvc.Rendering;
 using Microsoft.AspNetCore.Mvc.ViewFeatures;
 using Microsoft.AspNetCore.Razor.TagHelpers;
+using Microsoft.AspNetCore.Html;

 namespace live.asp.net.TagHelpers
 {
@@ -36,10 +37,39 @@

             var src = output.Attributes["src"];

-            var path = src?.Value.ToString();
-            if (path == null)
+            if (src == null)
             {
                 return;
+            }
+
+            string path = null;
+            if (src.Value is string)
+            {
+                path = (string)src.Value;
+            }
+            else
+            {
+                var pathHtmlString = src.Value as HtmlString;
+                if (pathHtmlString != null)
+                {
+                    path = pathHtmlString.Value;
+                }
+                else
+                {
+                    var pathHtmlContent = src.Value as IHtmlContent;
+                    if (pathHtmlContent != null)
+                    {
+                        using (var tw = new StringWriter())
+                        {
+                            pathHtmlContent.WriteTo(tw, NullHtmlEncoder.Default);
+                            path = tw.ToString();
+                        }
+                    }
+                    else
+                    {
+                        path = src.Value.ToString();
+                    }
+                }
             }

             var resolvedPath = path;


Updated BroadPhase.cs bounds movement to be more stable

--- SourceFiles/Box2DX/Collision/BroadPhase.cs
+++ SourceFiles/Box2DX/Collision/BroadPhase.cs
@@ -452,12 +452,12 @@
                             }

                             ++_proxyPool[prevProxyId].UpperBounds[axis];
-                            ++bounds[index].StabbingCount;
+                            ++bound.StabbingCount;
                         }
                         else
                         {
                             ++_proxyPool[prevProxyId].LowerBounds[axis];
-                            --bounds[index].StabbingCount;
+                            --bound.StabbingCount;
                         }

                         --_proxyPool[proxyId].LowerBounds[axis];
@@ -486,12 +486,12 @@
                             }

                             --_proxyPool[nextProxyId].LowerBounds[axis];
-                            ++bounds[index].StabbingCount;
+                            ++bound.StabbingCount;
                         }
                         else
                         {
                             --_proxyPool[nextProxyId].UpperBounds[axis];
-                            --bounds[index].StabbingCount;
+                            --bound.StabbingCount;
                         }

                         ++_proxyPool[proxyId].UpperBounds[axis];
@@ -525,12 +525,12 @@
                             }

                             --_proxyPool[nextProxyId].UpperBounds[axis];
-                            --bounds[index].StabbingCount;
+                            --bound.StabbingCount;
                         }
                         else
                         {
                             --_proxyPool[nextProxyId].LowerBounds[axis];
-                            ++bounds[index].StabbingCount;
+                            ++bound.StabbingCount;
                         }

                         ++_proxyPool[proxyId].LowerBounds[axis];
@@ -560,12 +560,12 @@
                             }

                             ++_proxyPool[prevProxyId].LowerBounds[axis];
-                            --bounds[index].StabbingCount;
+                            --bound.StabbingCount;
                         }
                         else
                         {
                             ++_proxyPool[prevProxyId].UpperBounds[axis];
-                            ++bounds[index].StabbingCount;
+                            ++bound.StabbingCount;
                         }

                         --_proxyPool[proxyId].UpperBounds[axis];