DNN-20705: check allInstances value with host mode and not only current portal.

--- CKEditorOptions.ascx.cs
+++ CKEditorOptions.ascx.cs
@@ -256,7 +256,7 @@

         /// Gets a value indicating whether this instance is all instances.
         /// <value><c>true</c> if this instance is all instances; otherwise, <c>false</c>.</value>
-        private bool IsAllInstances => _portalSettings == null;
+        private bool IsAllInstances => IsHostMode && !CurrentPortalOnly;

         /// Gets the home directory.
         /// <value>The home directory.</value>
@@ -370,10 +370,10 @@
         {
             AddJavaScripts();
             LocalResourceFile = ResXFile;
+            _portalSettings = GetPortalSettings();

             if (IsAllInstances ? UserController.Instance.GetCurrentUserInfo().IsSuperUser : Utility.IsInRoles(_portalSettings.AdministratorRoleName, _portalSettings))
             {
-                _portalSettings = GetPortalSettings();
                 listToolbars = ToolbarUtil.GetToolbars(HomeDirectory, configFolder);

                 if (Page.IsPostBack)


初期表示位置を修正

初期表示位置を修正


Add Send(uint) for printing operation

Add Send(uint) for printing operation

--- TinySato/TinySato.cs
+++ TinySato/TinySato.cs
@@ -181,6 +181,12 @@
                 Encoding.ASCII.GetBytes(ESC + operation));
         }

+        public void Send(uint number_of_pages)
+        {
+            this.SetPageNumber(number_of_pages);
+            Send();
+        }
+
         public void Send()
         {
             operations.Insert(operation_start_index,


Moved SetCanvasBound to GetChildCanvasBounds

--- Dependiator/Modeling/Item.cs
+++ Dependiator/Modeling/Item.cs
@@ -98,7 +98,7 @@
 			{
 				itemBounds = value;

-				SetItemBounds();
+				ItemCanvasBounds = ParentItem?.GetChildItemCanvasBounds(itemBounds) ?? itemBounds;

 				SetElementBounds();
 			}
@@ -336,23 +336,16 @@
 		}

-		private void SetItemBounds()
-		{
-			if (ParentItem != null)
-			{
-				Rect bounds = itemBounds;
-				bounds.Scale(ItemScaleFactor, ItemScaleFactor);
-
-				ItemCanvasBounds = new Rect(
-					ParentItem.ItemCanvasBounds.X + (bounds.X),
-					ParentItem.ItemCanvasBounds.Y + (bounds.Y),
-					bounds.Width,
-					bounds.Height);
-			}
-			else
-			{
-				ItemCanvasBounds = itemBounds;
-			}
+		private Rect GetChildItemCanvasBounds(Rect childItemBounds)
+		{
+			double childItemScale = ItemScaleFactor / ThisItemScaleFactor;
+			childItemBounds.Scale(childItemScale, childItemScale);
+
+			return new Rect(
+				ItemCanvasBounds.X + (childItemBounds.X),
+				ItemCanvasBounds.Y + (childItemBounds.Y),
+				childItemBounds.Width,
+				childItemBounds.Height);
 		}


disbale 2nd demo for now

disbale 2nd demo for now

--- UserGraph/Program.cs
+++ UserGraph/Program.cs
@@ -14,9 +14,11 @@
     [STAThread]
     static void Main()
     {
-      Application.EnableVisualStyles();
-      Application.SetCompatibleTextRenderingDefault(false);
-      Application.Run(new MainForm());
+      MessageBox.Show("This demo is under construction. Use another demo in solution");
+
+      //Application.EnableVisualStyles();
+      //Application.SetCompatibleTextRenderingDefault(false);
+      //Application.Run(new MainForm());
     }
   }
 }


Using TestInitialize instead of calling the init method many times

--- Either-Tests/JsonNetTests.cs
+++ Either-Tests/JsonNetTests.cs
@@ -9,6 +9,7 @@
     [TestClass]
     public class JsonNetTests
     {
+        [TestInitialize]
         private static void InitJsonConvert()
         {
             JsonConvert.DefaultSettings = () =>
@@ -22,8 +23,6 @@
         [TestMethod]
         public void TestMethod1()
         {
-            InitJsonConvert();
-
             var either = (Either<int, string>)Either.Factory.Create(1, typeof(int), typeof(string));

             var jsonStr = JsonConvert.SerializeObject(either);
@@ -34,8 +33,6 @@
         [TestMethod]
         public void TestMethos2()
         {
-            InitJsonConvert();
-
             var jsonStr = "1";

             var either = JsonConvert.DeserializeObject<Either<int, string>>(jsonStr);
@@ -46,8 +43,6 @@
         [TestMethod]
         public void TestMethos3()
         {
-            InitJsonConvert();
-
             var jsonStr = "1.1";

             var either = JsonConvert.DeserializeObject<Either<float, string>>(jsonStr);
@@ -58,8 +53,6 @@
         [TestMethod]
         public void TestMethos4()
         {
-            InitJsonConvert();
-
             var jsonStr = "{Either:1.1}";

             var obj = JsonConvert.DeserializeObject<SomethingWithEither<float, string>>(jsonStr);
@@ -70,8 +63,6 @@
         [TestMethod]
         public void TestMethos5()
         {
-            InitJsonConvert();
-
             var jsonStr = @"{Either:{Name:""Miguel""}}";

             var obj = JsonConvert.DeserializeObject<SomethingWithEither<SomeClass, int>>(jsonStr);
@@ -82,8 +73,6 @@
         [TestMethod]
         public void TestMethos6()
         {
-            InitJsonConvert();
-
             var obj = new SomethingWithEither<SomeClass, int>
             {
                 Either = new Either<SomeClass, int>(new SomeClass { Name = "Miguel" })
@@ -97,8 +86,6 @@
         [TestMethod]
         public void TestMethos7()
         {
-            InitJsonConvert();
-
             var obj = new SomethingWithEither<SomeClass, int>
             {
                 Either = new Either<SomeClass, int>(new SomeClass { Name = "Miguel" })
@@ -116,8 +103,6 @@
         [TestMethod]
         public void TestMethos8()
         {
-            InitJsonConvert();
-
             var jsonStr = @"{""A"":""a""}";

             var obj = JsonConvert.DeserializeObject<Either<IList<string>, IDictionary<string, string>>>(jsonStr);
@@ -128,8 +113,6 @@
         [TestMethod]
         public void TestMethos9()
         {
-            InitJsonConvert();
-
             var jsonStr = @"[""A"",""B""]";

             var obj = JsonConvert.DeserializeObject<Either<IList<string>, IDictionary<string, string>>>(jsonStr);
@@ -141,8 +124,6 @@
         [TestMethod]
         public void TestMethos10()
         {
-            InitJsonConvert();
-
             Either<IList<string>, IDictionary<string, string>> obj = new[] { "1", "2" };

             var jsonStr = JsonConvert.SerializeObject(obj);


removed configuration

removed configuration

--- Main.cs
+++ Main.cs
@@ -6,10 +6,7 @@
 {
     public string Identifier { get; set; }
 	public static AssetBundleManager AssetBundleManager = null;
-    public static Configuration Configeration = null;

-
-
     private TrackRiderBinder binder;

    public void onEnabled()


Full Screen

Full Screen

--- Android/MichaelTCC/MichaelTCC/Activities/VideoActivity.cs
+++ Android/MichaelTCC/MichaelTCC/Activities/VideoActivity.cs
@@ -30,9 +30,9 @@

             SetContentView(Resource.Layout.fragment_video);

-
+            Window.ClearFlags(WindowManagerFlags.Fullscreen);
             Window.AddFlags(WindowManagerFlags.Fullscreen);
-            Window.ClearFlags(WindowManagerFlags.Fullscreen);
+            Window.DecorView.SystemUiVisibility = (StatusBarVisibility)((int)SystemUiFlags.Immersive | (int)SystemUiFlags.Fullscreen | (int)SystemUiFlags.HideNavigation | (int)SystemUiFlags.LayoutFullscreen);

             if (!string.IsNullOrEmpty(_url))
             {


Custom XML part/collection example

Custom XML part/collection example

--- ApiExamples/CSharp/ApiExamples/ExStructuredDocumentTag.cs
+++ ApiExamples/CSharp/ApiExamples/ExStructuredDocumentTag.cs
@@ -945,5 +945,37 @@
             doc.Save(ArtifactsDir + "StructuredDocumentTag.RepeatingSectionItem.docx");
 			//ExEnd
         }
+
+        [Test]
+        public void CustomXmlPart()
+        {
+            // Obtain an XML in the form of a string
+            string xmlString = "<?xml version=\"1.0\"?>" +
+                               "<Company>" +
+                               "<Employee id=\"1\">" +
+                               "<FirstName>John</FirstName>" +
+                               "<LastName>Doe</LastName>" +
+                               "</Employee>" +
+                               "<Employee id=\"2\">" +
+                               "<FirstName>Jane</FirstName>" +
+                               "<LastName>Doe</LastName>" +
+                               "</Employee>" +
+                               "</Company>";
+
+            // Create a blank document
+            Document doc = new Document();
+
+            // Insert the full XML document as a custom document part
+            // The mapping for this part will be seen in the "XML Mapping Pane" in the "Developer" tab, if it is enabled
+            CustomXmlPart xmlPart = doc.CustomXmlParts.Add(Guid.NewGuid().ToString("B"), xmlString);
+
+            // None of the XML is in the document body at this point
+            // Create a StructuredDocumentTag, which will refer to a single element from the XML with an XPath
+            StructuredDocumentTag sdt = new StructuredDocumentTag(doc, SdtType.PlainText, MarkupLevel.Block);
+            sdt.XmlMapping.SetMapping(xmlPart, "Company//Employee[@id='2']/FirstName", "");
+
+            // Add the StructuredDocumentTag to the document to display the element in the text
+            doc.FirstSection.Body.AppendChild(sdt);
+        }
     }
 }


Stop logging useless errors in UriExtensions

--- src/Umbraco.Core/UriExtensions.cs
+++ src/Umbraco.Core/UriExtensions.cs
@@ -23,21 +23,21 @@
         /// <returns></returns>
         ///  <remarks>
         ///  There are some special routes we need to check to properly determine this:
-        ///
+        ///
         ///      If any route has an extension in the path like .aspx = back office
-        ///
+        ///
         ///      These are def back office:
         ///          /Umbraco/BackOffice     = back office
         ///          /Umbraco/Preview        = back office
         ///      If it's not any of the above, and there's no extension then we cannot determine if it's back office or front-end
         ///      so we can only assume that it is not back office. This will occur if people use an UmbracoApiController for the backoffice
         ///      but do not inherit from UmbracoAuthorizedApiController and do not use [IsBackOffice] attribute.
-        ///
+        ///
         ///      These are def front-end:
         ///          /Umbraco/Surface        = front-end
         ///          /Umbraco/Api            = front-end
         ///      But if we've got this far we'll just have to assume it's front-end anyways.
-        ///
+        ///
         ///  </remarks>
         internal static bool IsBackOfficeRequest(this Uri url, string applicationPath, IGlobalSettings globalSettings)
         {
@@ -152,9 +152,9 @@
                 var toInclude = new[] {".aspx", ".ashx", ".asmx", ".axd", ".svc"};
                 return toInclude.Any(ext.InvariantEquals) == false;
             }
-            catch (ArgumentException ex)
-            {
-                Current.Logger.Error(typeof(UriExtensions), ex, "Failed to determine if request was client side");
+            catch (ArgumentException)
+            {
+                Current.Logger.Debug(typeof(UriExtensions), "Failed to determine if request was client side (invalid chars in path \"{Path}\"?)", url.LocalPath);
                 return false;
             }
         }


Handling responses with incorrect encoding (issue #1)

--- src/WebDav.Client/WebDavClient.cs
+++ src/WebDav.Client/WebDavClient.cs
@@ -3,6 +3,7 @@
 using System.IO;
 using System.Net;
 using System.Net.Http;
+using System.Text;
 using System.Threading;
 using System.Threading.Tasks;
 using WebDav.Infrastructure;
@@ -96,7 +97,7 @@
             var requestBody = PropfindRequestBuilder.BuildRequestBody(parameters.CustomProperties, parameters.Namespaces);
             var requestParams = new RequestParameters { Headers = headers, Content = new StringContent(requestBody) };
             var response = await _dispatcher.Send(requestUri, WebDavMethod.Propfind, requestParams, parameters.CancellationToken);
-            var responseContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
+            var responseContent = await ReadContentAsString(response.Content).ConfigureAwait(false);
             return _propfindResponseParser.Parse(responseContent, response.StatusCode, response.Description);
         }

@@ -127,7 +128,7 @@
                     parameters.Namespaces);
             var requestParams = new RequestParameters { Headers = new RequestHeaders(), Content = new StringContent(requestBody) };
             var response = await _dispatcher.Send(requestUri, WebDavMethod.Proppatch, requestParams, parameters.CancellationToken);
-            var responseContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
+            var responseContent = await ReadContentAsString(response.Content).ConfigureAwait(false);
             return _proppatchResponseParser.Parse(responseContent, response.StatusCode, response.Description);
         }

@@ -580,10 +581,9 @@
             if (!response.IsSuccessful)
                 return new LockResponse(response.StatusCode, response.Description);

-            var responseContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
+            var responseContent = await ReadContentAsString(response.Content).ConfigureAwait(false);
             return _lockResponseParser.Parse(responseContent, response.StatusCode, response.Description);
         }
-

         /// <summary>
         /// Removes the lock identified by the lock token from the resource identified by the request URI.
@@ -725,6 +725,27 @@
                     "An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set.");
         }

+        private static Encoding GetResponseEncoding(HttpContent content, Encoding fallbackEncoding)
+        {
+            if (content.Headers.ContentType == null || content.Headers.ContentType.CharSet == null)
+                return fallbackEncoding;
+
+            try
+            {
+                return Encoding.GetEncoding(content.Headers.ContentType.CharSet);
+            }
+            catch (ArgumentException)
+            {
+                return fallbackEncoding;
+            }
+        }
+
+        private static async Task<string> ReadContentAsString(HttpContent content)
+        {
+            var data = await content.ReadAsByteArrayAsync();
+            return GetResponseEncoding(content, Encoding.UTF8).GetString(data);
+        }
+
         private Uri GetAbsoluteUri(Uri uri)
         {
             if (uri == null && _dispatcher.BaseAddress == null)


undine renamed to elemental

undine renamed to elemental

--- Assets/Scripts/Game/Defined/Characters/Areas/OceanNPCs.cs
+++ Assets/Scripts/Game/Defined/Characters/Areas/OceanNPCs.cs
@@ -140,7 +140,7 @@
             return CharacterUtil.StandardEnemy(
                 new Stats(9, 5, 20, 15, 20),
                 new Look(
-                    "Undine",
+                    "Elemental",
                     "villager",
                     "Sea elemental.",
                     Breed.FISH


fix: update namespace

fix: update namespace

--- src/Yaapii.Atoms/Bytes/BytesOf.cs
+++ src/Yaapii.Atoms/Bytes/BytesOf.cs
@@ -29,7 +29,8 @@
 using Yaapii.Atoms.Scalar;

 #pragma warning disable MaxClassLength // Class length max
-namespace Yaapii.Atoms.IO
+
+namespace Yaapii.Atoms.Bytes
 {
     /// <summary>
     /// Bytes out of other objects.
@@ -39,7 +40,7 @@
         /// <summary>
         /// original
         /// </summary>
-        private readonly IScalar<byte[]> _origin;
+        private readonly IScalar<byte[]> origin;

         /// <summary>
         /// Bytes out of a input.
@@ -194,7 +195,7 @@
         /// <param name="bytes">scalar of bytes</param>
         private BytesOf(IScalar<Byte[]> bytes)
         {
-            this._origin = bytes;
+            this.origin = bytes;
         }

         /// <summary>
@@ -203,7 +204,7 @@
         /// <returns>content as byte array</returns>
         public byte[] AsBytes()
         {
-            return this._origin.Value();
+            return this.origin.Value();
         }
     }
 }


use corert friendly marshalling (#46)

use corert friendly marshalling (#46)

--- Commons.Music.Midi.DesktopShared/winmm/WinmmMidiAccess.cs
+++ Commons.Music.Midi.DesktopShared/winmm/WinmmMidiAccess.cs
@@ -19,7 +19,7 @@
 				for (uint i = 0; i < devs; i++)
 				{
 					MidiInCaps caps;
-					WinMMNatives.midiInGetDevCaps ((UIntPtr) i, out caps, (uint) Marshal.SizeOf (typeof (MidiInCaps)));
+					WinMMNatives.midiInGetDevCaps ((UIntPtr) i, out caps, (uint) Marshal.SizeOf<MidiInCaps>());
 					yield return new WinMMPortDetails (i, caps.Name, caps.DriverVersion);
 				}
 			}
@@ -30,7 +30,7 @@
 				int devs = WinMMNatives.midiOutGetNumDevs ();
 				for (uint i = 0; i < devs; i++) {
 					MidiOutCaps caps;
-					var err = WinMMNatives.midiOutGetDevCaps ((UIntPtr) i, out caps, (uint) Marshal.SizeOf (typeof (MidiOutCaps)));
+					var err = WinMMNatives.midiOutGetDevCaps ((UIntPtr) i, out caps, (uint) Marshal.SizeOf<MidiOutCaps>());
                     if (err != 0)
                         throw new Win32Exception (err);
 					yield return new WinMMPortDetails (i, caps.Name, caps.DriverVersion);


resolve InAppBrowser plugin for xface showCordovaBrowser failed

--- src/wp/InAppBrowser.cs
+++ src/wp/InAppBrowser.cs
@@ -80,14 +80,21 @@
                     PhoneApplicationPage page = frame.Content as PhoneApplicationPage;
                     if (page != null)
                     {
-                        CordovaView cView = page.FindName("CordovaView") as CordovaView;
-                        if (cView != null)
+                        Grid layoutRoot = page.FindName("LayoutRoot") as Grid;
+                        if (layoutRoot != null)
                         {
-                            WebBrowser br = cView.Browser;
-                            br.Navigate(loc);
+                            if (layoutRoot.Children.Count > 0)
+                            {
+                                string type = layoutRoot.Children[layoutRoot.Children.Count - 1].ToString();
+                                if (type.Contains("CordovaView"))//取最顶层的View并进行type比较判断确定当前的CordovaView
+                                {
+                                    CordovaView cView = layoutRoot.Children[layoutRoot.Children.Count - 1] as CordovaView;
+                                    WebBrowser br = cView.Browser;
+                                    br.Navigate(loc);
+                                }
+                            }
                         }
                     }
-
                 }
             });
         }


Converted all logging commands to a new Log function, which appends the plugin name for easy log checking.

--- GatherAssist/GatherAssist.cs
+++ GatherAssist/GatherAssist.cs
@@ -109,7 +109,7 @@
         {
             try
             {
-                Logging.Write(LogMajorColor, "[" + pluginName + "] v" + Version.ToString() + " Enabled");
+                Log(LogMajorColor, "[" + pluginName + "] v" + Version.ToString() + " Enabled");
             }
             catch (Exception ex)
             {
@@ -139,7 +139,7 @@

                 if (currentGatherRequest == null) // if no valid gather requests remain
                 {
-                    Logging.Write(LogMajorColor, "Gather requests complete!  GatherAssist will stop now.");
+                    Log(LogMajorColor, "Gather requests complete!  GatherAssist will stop now.");
                     GatherAssistTimer.Stop();
                     TreeRoot.Stop(); // stop the bot
                     return;
@@ -159,7 +159,7 @@
         {
             try
             {
-                Logging.Write(LogMajorColor, "[" + pluginName + "] v" + Version.ToString() + " Disabled");
+                Log(LogMajorColor, "[" + pluginName + "] v" + Version.ToString() + " Disabled");
                 GatherAssistTimer.Stop();
             }
             catch (Exception ex)
@@ -180,7 +180,7 @@

                 foreach (DataRow dataRow in requestTable.Rows)
                 {
-                    Logging.Write(LogMajorColor, "DEBUG: Adding " + dataRow["ItemName"] + " to request list");
+                    Log(LogMajorColor, "DEBUG: Adding " + dataRow["ItemName"] + " to request list");
                     requestList.Add(new GatherRequest(Convert.ToString(dataRow["ItemName"]), Convert.ToInt32(dataRow["Count"])));
                 }
             }
@@ -214,13 +214,13 @@

                 foreach (InventoryBagId curBagId in validBags)
                 {
-                    Logging.Write(LogMajorColor, curBagId.ToString()); // debug
+                    Log(LogMajorColor, curBagId.ToString()); // debug
                     foreach (BagSlot curSlot in InventoryManager.GetBagByInventoryBagId(curBagId))
                     {
                         var obj = requestList.FirstOrDefault(x => x.ItemName == curSlot.Name);
                         if (obj != null)
                         {
-                            Logging.Write(LogMajorColor, "DEBUG: Updating count");
+                            Log(LogMajorColor, "DEBUG: Updating count");
                             obj.CurrentCount += curSlot.Count;
                         }
                     }
@@ -242,10 +242,10 @@
                 foreach (GatherRequest curRequest in requestList)
                 {
                     Color logColor = curRequest.RequestedTotal <= curRequest.CurrentCount ? LogMinorColor : LogMajorColor;
-                    Logging.Write(logColor, string.Format("Item: {0}, Count: {1}, Requested: {2}", curRequest.ItemName, curRequest.CurrentCount, curRequest.RequestedTotal));
+                    Log(logColor, string.Format("Item: {0}, Count: {1}, Requested: {2}", curRequest.ItemName, curRequest.CurrentCount, curRequest.RequestedTotal));
                     if (currentGatherRequest == null && curRequest.CurrentCount < curRequest.RequestedTotal)
                     {
-                        Logging.Write(LogMajorColor, string.Format("DEBUG: Updating gather request to {0}", curRequest.ItemName));
+                        Log(LogMajorColor, string.Format("DEBUG: Updating gather request to {0}", curRequest.ItemName));
                         currentGatherRequest = curRequest;
                     }
                 }
@@ -264,15 +264,15 @@

                 if (currentGatherRequest == null)
                 {
-                    Logging.Write(LogErrorColor, string.Format("Error: LoadProfile was executed without an active gather request; this should not be done.  Shutting down {0} plugin."));
+                    Log(LogErrorColor, string.Format("Error: LoadProfile was executed without an active gather request; this should not be done.  Shutting down {0} plugin."));
                     isValid = false;
                 }

-                Logging.Write(LogMajorColor, string.Format("DEBUG: Current Gather Request is {0}", currentGatherRequest.ItemName));
+                Log(LogMajorColor, string.Format("DEBUG: Current Gather Request is {0}", currentGatherRequest.ItemName));
                 ItemRecord itemRecord = GetItemRecord(currentGatherRequest.ItemName);
                 if (itemRecord == null)
                 {
-                    Logging.Write(LogErrorColor, string.Format("Error: item {0} cannot be located.  A new items entry must be created for this gather request to function properly.", currentGatherRequest.ItemName));
+                    Log(LogErrorColor, string.Format("Error: item {0} cannot be located.  A new items entry must be created for this gather request to function properly.", currentGatherRequest.ItemName));
                     isValid = false;
                 }

@@ -445,12 +445,12 @@
                 int itemCount = itemRows.Count<DataRow>();
                 if (itemCount > 1)
                 {
-                    Logging.Write(LogErrorColor, string.Format("CONTACT DEVELOPER! Requested item record {0} exists in {1} records; remove duplicates for this item before continuing.", itemName, itemCount));
+                    Log(LogErrorColor, string.Format("CONTACT DEVELOPER! Requested item record {0} exists in {1} records; remove duplicates for this item before continuing.", itemName, itemCount));
                     isValid = false;
                 }
                 else if (itemCount == 0)
                 {
-                    Logging.Write(LogErrorColor, string.Format("CONTACT DEVELOPER! Requested item name {0} does not exist in the item table; plesae create a record for this item before continuing.", itemName));
+                    Log(LogErrorColor, string.Format("CONTACT DEVELOPER! Requested item name {0} does not exist in the item table; plesae create a record for this item before continuing.", itemName));
                     isValid = false;
                 }

@@ -474,12 +474,12 @@

                     if (mapCount > 1)
                     {
-                        Logging.Write(LogErrorColor, string.Format("CONTACT DEVELOPER!  Requested Aetheryte ID {0} exists in {1} records; remove duplicates for this aetheryte before continuing.", itemRecord.AetheryteId, mapCount));
+                        Log(LogErrorColor, string.Format("CONTACT DEVELOPER!  Requested Aetheryte ID {0} exists in {1} records; remove duplicates for this aetheryte before continuing.", itemRecord.AetheryteId, mapCount));
                         isValid = false;
                     }
                     else if (mapCount == 0)
                     {
-                        Logging.Write(LogErrorColor, string.Format("CONTACT DEVELOPER!  Requested Aetheryte ID {0} does not exist in the maps table; please create a record for this aetheryte before continuing.", itemRecord.AetheryteId));
+                        Log(LogErrorColor, string.Format("CONTACT DEVELOPER!  Requested Aetheryte ID {0} does not exist in the maps table; please create a record for this aetheryte before continuing.", itemRecord.AetheryteId));
                         isValid = false;
                     }

@@ -506,13 +506,18 @@

         public void LogException(Exception ex)
         {
-            Logging.Write(LogErrorColor, string.Format("Exception in plugin {0}: {1} {2}", pluginName, ex.Message, ex.StackTrace));
+            Log(LogErrorColor, string.Format("Exception in plugin {0}: {1} {2}", pluginName, ex.Message, ex.StackTrace));
             GatherAssistTimer.Stop();
         }

         public static IEnumerable<T> GetValues<T>()
         {
             return Enum.GetValues(typeof(T)).Cast<T>();
+        }
+
+        public void Log(Color color, string message)
+        {
+            Logging.Write(color, string.Format("[{0}] {1}", pluginName, message));
         }
     }
 }


foreach instead for loop

foreach instead for loop

--- GildedRose/QualityService.cs
+++ GildedRose/QualityService.cs
@@ -17,74 +17,74 @@

         public void UpdateQuality()
         {
-            for (var i = 0; i < Items.Count; i++)
+            foreach (var item in Items)
             {
-                if (Items[i].Name != "Aged Brie" && Items[i].Name != "Backstage passes to a TAFKAL80ETC concert")
+                if (item.Name != "Aged Brie" && item.Name != "Backstage passes to a TAFKAL80ETC concert")
                 {
-                    if (Items[i].Quality > 0)
+                    if (item.Quality > 0)
                     {
-                        if (Items[i].Name != "Sulfuras, Hand of Ragnaros")
+                        if (item.Name != "Sulfuras, Hand of Ragnaros")
                         {
-                            Items[i].Quality = Items[i].Quality - 1;
+                            item.Quality = item.Quality - 1;
                         }
                     }
                 }
                 else
                 {
-                    if (Items[i].Quality < 50)
+                    if (item.Quality < 50)
                     {
-                        Items[i].Quality = Items[i].Quality + 1;
+                        item.Quality = item.Quality + 1;

-                        if (Items[i].Name == "Backstage passes to a TAFKAL80ETC concert")
+                        if (item.Name == "Backstage passes to a TAFKAL80ETC concert")
                         {
-                            if (Items[i].SellIn < 11)
+                            if (item.SellIn < 11)
                             {
-                                if (Items[i].Quality < 50)
+                                if (item.Quality < 50)
                                 {
-                                    Items[i].Quality = Items[i].Quality + 1;
+                                    item.Quality = item.Quality + 1;
                                 }
                             }

-                            if (Items[i].SellIn < 6)
+                            if (item.SellIn < 6)
                             {
-                                if (Items[i].Quality < 50)
+                                if (item.Quality < 50)
                                 {
-                                    Items[i].Quality = Items[i].Quality + 1;
+                                    item.Quality = item.Quality + 1;
                                 }
                             }
                         }
                     }
                 }

-                if (Items[i].Name != "Sulfuras, Hand of Ragnaros")
+                if (item.Name != "Sulfuras, Hand of Ragnaros")
                 {
-                    Items[i].SellIn = Items[i].SellIn - 1;
+                    item.SellIn = item.SellIn - 1;
                 }

-                if (Items[i].SellIn < 0)
+                if (item.SellIn < 0)
                 {
-                    if (Items[i].Name != "Aged Brie")
+                    if (item.Name != "Aged Brie")
                     {
-                        if (Items[i].Name != "Backstage passes to a TAFKAL80ETC concert")
+                        if (item.Name != "Backstage passes to a TAFKAL80ETC concert")
                         {
-                            if (Items[i].Quality > 0)
+                            if (item.Quality > 0)
                             {
-                                if (Items[i].Name != "Sulfuras, Hand of Ragnaros")
+                                if (item.Name != "Sulfuras, Hand of Ragnaros")
                                 {
-                                    Items[i].Quality = Items[i].Quality - 1;
+                                    item.Quality = item.Quality - 1;
                                 }
                             }
                         }
                         else
                         {
-                            Items[i].Quality = Items[i].Quality - Items[i].Quality;
+                            item.Quality = item.Quality - item.Quality;
                         }
                     }
                     else
                     {
-                        if (Items[i].Quality < 50)
+                        if (item.Quality < 50)
                         {
-                            Items[i].Quality = Items[i].Quality + 1;
+                            item.Quality = item.Quality + 1;
                         }
                     }
                 }


fix timestamp format for API_REQUEST_DATE header on non-en_US locales

The API_REQUEST_DATE header has to be in the Unix timestamp format with
optional micro-seconds. If the micro-seconds are specified, a dot "." must be
used as the decimal point seperator.

The API server will reject timestamps that contain a culture dependent comma ","
as a separator. Double.ToString() uses by default a culture dependent saparator
though, e.g.:

    $ LANG=de_DE csharp -e 'var foo = 3.1d; foo.ToString();'
    "3,1"

So for the API server the serialization of the header needs to explicitely
specify the format in a culture independent way, e.g.:

    $ LANG=de_DE csharp -e 'var foo = 3.1d; foo.ToString("F3", System.Globalization.CultureInfo.InvariantCulture);'
    "3.100"

This way this API client library will correctly serialize the timestamps
regardless of what locale/culture the computer is using.

--- Client/ServiceClient.cs
+++ Client/ServiceClient.cs
@@ -46,7 +46,8 @@
                 if (HasAuthenticationKeys)
                 {
                     request.ContentType = ServiceStack.Common.Web.ContentType.Json;
-                    string unixTimestamp = ToUnixTimeStamp(DateTime.Now).ToString();
+                    // always use fixed-point with 3 digits after the decimal point independent of the current culture
+                    var unixTimestamp = ToUnixTimeStamp(DateTime.Now).ToString("F3", System.Globalization.CultureInfo.InvariantCulture);

                     var secret = privateKey;
                     var token = ServiceSignature.CreateToken(request, secret, unixTimestamp);


Debug creation of backup script feature finalized

--- GitAutoUpdateGUI/FormMain.cs
+++ GitAutoUpdateGUI/FormMain.cs
@@ -1691,7 +1691,20 @@
       backupScript = GenerateUniqueFileName(backupScript);
       CreateNewFile(backupScript);
       AddBeginningOfBackupScript(backupScript);
-
+      listViewVSProjects.Items.Clear();
+
+      listViewVSProjects.Columns.Add("To be updated", 240, HorizontalAlignment.Left);
+      listViewVSProjects.Columns.Add("Solution Name", 240, HorizontalAlignment.Left);
+      listViewVSProjects.Columns.Add("Solution Path", 640, HorizontalAlignment.Left);
+      listViewVSProjects.Columns.Add("Git URL", 640, HorizontalAlignment.Left);
+
+      listViewVSProjects.View = View.Details;
+      listViewVSProjects.LabelEdit = false;
+      listViewVSProjects.AllowColumnReorder = true;
+      listViewVSProjects.CheckBoxes = true;
+      listViewVSProjects.FullRowSelect = true;
+      listViewVSProjects.GridLines = true;
+      listViewVSProjects.Sorting = SortOrder.None;
       int projectCount = 0;
       foreach (var directory in Directory.EnumerateDirectories(textBoxVSProjectPath.Text))
       {
@@ -1718,10 +1731,12 @@
               ListViewItem item1 = new ListViewItem(tmpSolNameOnly) { Checked = true };
               item1.SubItems.Add(tmpSolNameOnly);
               item1.SubItems.Add(tmpSolPath);
-              if (!IsInlistView(listViewVSProjects, item1, 2))
+              item1.SubItems.Add(gitUrl);
+              if (!IsInlistView(listViewVSProjects, item1, 2) && gitUrl != string.Empty)
               {
                 listViewVSProjects.Items.Add(item1);
                 projectCount++;
+                Application.DoEvents();
               }
             }
           }
@@ -1745,9 +1760,10 @@

       foreach (ListViewItem selectedProj in selectedProjects)
       {
-        var projectName = selectedProj.Text;
-        AddGitCloneToScript(backupScript, projectName);
-        Logger.Add(textBoxLog, Translate("Adding the gitted project") + Punctuation.OneSpace + projectName);
+        var gitUrl = selectedProj.SubItems[3].Text;
+        if (gitUrl == string.Empty) continue;
+        AddGitCloneToScript(backupScript, gitUrl);
+        Logger.Add(textBoxLog, Translate("Adding the gitted project") + Punctuation.OneSpace + gitUrl);
       }

       AddPauseToFile(backupScript);


Bumped up timeout on long test

Bumped up timeout on long test

--- GlyssenTests/ProjectTests.cs
+++ GlyssenTests/ProjectTests.cs
@@ -398,7 +398,7 @@

 		[TestCase("Boaz")]
 		[TestCase("Mr. Rogers")]
-		[Timeout(8000)]
+		[Timeout(10000)]
 		public void UpdateFromParatextData_ProjectHasCustomCharacterVerseDecisions_UserDecisionsReapplied(string character)
 		{
 			var originalBundleAndFile = GlyssenBundleTests.GetNewGlyssenBundleAndFile();


Adding some comments to datacache (#1347)

* Adding some comments to datacache

* Adding Exception comment tip of @Tommo-L

Co-authored-by: Shargon <27a1effff19d0c1fff0ef6bfddcb4f3b3fe8334a@gmail.com>

--- src/neo/IO/Caching/DataCache.cs
+++ src/neo/IO/Caching/DataCache.cs
@@ -43,6 +43,16 @@
             }
         }

+        /// <summary>
+        /// Try to Add a specific key, with associated value, to the current cached dictionary.
+        /// It will not read from internal state.
+        /// However, if previously cached into Dictionary, request may fail.
+        /// </summary>
+        /// <param name="key">Key to be possible added.
+        /// Key will not be added if value exists cached and the modification was not a Deleted one.
+        /// </param>
+        /// <param name="value">Corresponding value to be added, in the case of sucess.</param>
+        /// <exception cref="ArgumentException">If cached on dictionary, with any state rather than `Deleted`, an Exception will be raised.</exception>
         public void Add(TKey key, TValue value)
         {
             lock (dictionary)
@@ -60,6 +70,9 @@

         protected abstract void AddInternal(TKey key, TValue value);

+        /// <summary>
+        /// Update internals with all changes cached on Dictionary which are not None.
+        /// </summary>
         public void Commit()
         {
             foreach (Trackable trackable in GetChangeSet())
@@ -82,6 +95,10 @@
             return new CloneCache<TKey, TValue>(this);
         }

+        /// <summary>
+        /// Delete key from cached Dictionary or search in Internal.
+        /// </summary>
+        /// <param name="key">Key to be deleted.</param>
         public void Delete(TKey key)
         {
             lock (dictionary)
@@ -186,6 +203,14 @@

         protected abstract TValue GetInternal(TKey key);

+        /// <summary>
+        /// Try to Get a specific key from current cached dictionary.
+        /// Otherwise, tries to get from internal data with TryGetInternal.
+        /// </summary>
+        /// <param name="key">Key to be searched.</param>
+        /// <param name="factory">Function that may replace current object stored.
+        /// If object already exists the factory passed as parameter will not be used.
+        /// </param>
         public TValue GetAndChange(TKey key, Func<TValue> factory = null)
         {
             lock (dictionary)


Remove another CSharp6 macro include

Remove another CSharp6 macro include

--- stdlib/corlib/Array.cs
+++ stdlib/corlib/Array.cs
@@ -1,5 +1,3 @@
-#importMacros(LeMP.CSharp6);
-
 namespace System
 {
     // TODO: tweak the compiler to make all arrays implement 'System.Array'.


Adding the missing line for setting entity_item_group_id for the versioned entries.

--- eFormCore/Persistance/SqlController.cs
+++ eFormCore/Persistance/SqlController.cs
@@ -5219,6 +5219,7 @@
             entityItemVer.updated_at = entityItem.updated_at;
             entityItemVer.entity_item_uid = entityItem.entity_item_uid;
             entityItemVer.microting_uid = entityItem.microting_uid;
+            entityItemVer.entity_group_id = entityItem.entity_group_id;
             entityItemVer.name = entityItem.name;
             entityItemVer.description = entityItem.description;
             entityItemVer.synced = entityItem.synced;


ScopeStore modify

ScopeStore modify

--- source/IdentityServer3.Dapper/Stores/ScopeStore.cs
+++ source/IdentityServer3.Dapper/Stores/ScopeStore.cs
@@ -5,7 +5,6 @@
 using IdentityServer3.Dapper.Mappers;
 using System;
 using System.Collections.Generic;
-using System.Collections.ObjectModel;
 using System.Linq;
 using System.Threading.Tasks;

@@ -14,13 +13,6 @@
     public class ScopeStore : IScopeStore
     {
         private readonly DapperServiceOptions options;
-
-        private readonly Func<Scope, ScopeClaim, ScopeSecret, Scope> func = (scope, claim, secret) =>
-        {
-            scope.ScopeClaims = claim != null ? new Collection<ScopeClaim>() { claim } : null;
-            scope.ScopeSecrets = secret != null ? new Collection<ScopeSecret>() { secret } : null;
-            return scope;
-        };

         public ScopeStore(DapperServiceOptions options)
         {


Added CreateDirectories method

Added CreateDirectories method

This method should make it easier to create multiple directories for
some archives.

--- HedgeLib/Archives/Archive.cs
+++ HedgeLib/Archives/Archive.cs
@@ -64,6 +64,33 @@
             Data.AddRange(GetFilesFromDir(dir, includeSubDirectories));
         }

+        public ArchiveDirectory CreateDirectories(string dirPath)
+        {
+            ArchiveDirectory dir = null;
+            foreach (string dirName in dirPath.Split('/'))
+            {
+                var data = (dir == null) ? Data : dir.Data;
+                if (data.Exists(t => t.Name == dirName))
+                {
+                    dir = data.Find(t => t.Name == dirName) as ArchiveDirectory;
+                }
+                else if (dir == null)
+                {
+                    var directory = new ArchiveDirectory(dirName);
+                    Data.Add(directory);
+                    dir = directory;
+                }
+                else
+                {
+                    var newDirectory = new ArchiveDirectory(dirName);
+                    dir.Data.Add(newDirectory);
+                    newDirectory.Parent = dir;
+                    dir = newDirectory;
+                }
+            }
+            return dir;
+        }
+
         public static List<ArchiveData> GetFilesFromDir(string dir,
             bool includeSubDirectories = false)
         {


Some refactorings...

Some refactorings...

--- Hermod/HTTP/Request/Parsy.cs
+++ Hermod/HTTP/Request/Parsy.cs
@@ -170,20 +170,24 @@

                 Log.Timestamp("Bad request: Missing \"" + ParameterName + "\" JSON property!");

-                Value = DefaultValue;
-                HTTPResp = CreateBadRequest(Context, ParameterName);
-
-                return false;
-
-            }
-
-            if (!DateTime.TryParse(JSONToken.Value<String>(), out Value))
+                Value     = DefaultValue;
+                HTTPResp  = CreateBadRequest(Context, ParameterName);
+
+                return false;
+
+            }
+
+            try
+            {
+                Value = JSONToken.Value<DateTime>();
+            }
+            catch (Exception)
             {

                 Log.Timestamp("Bad request: Invalid \"" + ParameterName + "\" property value!");

-                Value = DefaultValue;
-                HTTPResp = CreateBadRequest(Context, ParameterName, JSONToken.Value<String>());
+                Value     = DefaultValue;
+                HTTPResp  = CreateBadRequest(Context, ParameterName, JSONToken.Value<String>());

                 return false;


Added comments to Updater for clarity.

Added comments to Updater for clarity.

--- Core/Objects/Updater.cs
+++ Core/Objects/Updater.cs
@@ -3,6 +3,11 @@

 namespace Atlas.Core.Objects
 {
+	/// <summary>
+	/// Updater is a class used to test the update loop of the IEngine in environments where you don't have
+	/// a framework or other engine to provide an update loop for you. For example, in MonoGame the best practice
+	/// is to put your AtlasEngine.Update() call directly into Game.Update() so MonoGame can provide the time.
+	/// </summary>
 	public class Updater
 	{
 		private readonly Stopwatch timer = new Stopwatch();


Added OnExportXaml method

Added OnExportXaml method

--- Core2D/Editor/Editor.cs
+++ Core2D/Editor/Editor.cs
@@ -574,6 +574,27 @@
         }

         /// <summary>
+        /// Export Xaml from file.
+        /// </summary>
+        /// <param name="path">The xaml file path.</param>
+        /// <param name="item">The object item.</param>
+        public void OnExportXaml(string path, object item)
+        {
+            try
+            {
+                var xaml = _xamlSerializer?.Serialize(item);
+                if (!string.IsNullOrWhiteSpace(xaml))
+                {
+                    Project.WriteUtf8Text(path, xaml);
+                }
+            }
+            catch (Exception ex)
+            {
+                _log?.LogError($"{ex.Message}{Environment.NewLine}{ex.StackTrace}");
+            }
+        }
+
+        /// <summary>
         /// Import object from file.
         /// </summary>
         /// <param name="path">The object file path.</param>


Added reflection based Caching Platform logic

--- jcDC.Library/jcCACHEAttribute.cs
+++ jcDC.Library/jcCACHEAttribute.cs
@@ -3,8 +3,10 @@

 using System;
 using System.Configuration;
+using System.Linq;
 using System.Net.Http;
 using System.Net.Http.Formatting;
+using System.Reflection;
 using System.Web.Http.Controllers;

 namespace jcDC.Library {
@@ -35,16 +37,16 @@
                     selectedCachePlatform = (CACHINGPLATFORMS)Enum.Parse(typeof(CACHINGPLATFORMS), selectedCachePlatformStr);
                 }

-                // todo replace with reflection
-                switch(selectedCachePlatform) {
-                    case CACHINGPLATFORMS.ASP:
-                        _currentCachePlatform = new ASPCachePlatform();
-                        break;
-                    case CACHINGPLATFORMS.SQL:
-                        _currentCachePlatform = new SQLCachePlatform();
-                        break;
+                foreach (Type type in Assembly.GetAssembly(typeof(BaseCachePlatform)).GetTypes().Where(myType => myType.IsClass && !myType.IsAbstract && myType.IsSubclassOf(typeof(BaseCachePlatform)))) {
+                    var classItem = (BaseCachePlatform)Activator.CreateInstance(type, null);
+
+                    if (classItem.GetCachingPlatformType() != selectedCachePlatform) {
+                        continue;
+                    }
+
+                    _currentCachePlatform = classItem;
                 }
-
+
                 return _currentCachePlatform;
             }
         }


Fixed modopt/modreq handling

Fixed modopt/modreq handling

--- ILRepack/ReferenceFixator.cs
+++ ILRepack/ReferenceFixator.cs
@@ -388,12 +388,12 @@
                 return new SentinelType(fet);
             if (type is OptionalModifierType)
             {
-                TypeReference fmt = ((OptionalModifierType)type).ModifierType;
+                TypeReference fmt = Fix(((OptionalModifierType)type).ModifierType, context);
                 return new OptionalModifierType(fmt, fet);
             }
             if (type is RequiredModifierType)
             {
-                TypeReference fmt = ((RequiredModifierType)type).ModifierType;
+                TypeReference fmt = Fix(((RequiredModifierType)type).ModifierType);
                 return new RequiredModifierType(fmt, fet);
             }
             if (type is GenericInstanceType)


Fixed param comment

Fixed param comment

--- Core2D/Editor/Editor.cs
+++ Core2D/Editor/Editor.cs
@@ -712,7 +712,7 @@
         /// Export object to a file.
         /// </summary>
         /// <param name="path">The object file path.</param>
-        /// <param name="item">The parent object.</param>
+        /// <param name="item">The object item.</param>
         /// <param name="type">The object type.</param>
         public void OnExportObject(string path, object item, ExportType type)
         {


Moved the board and size

Moved the board and size

--- AFTH/Game/Game.cs
+++ AFTH/Game/Game.cs
@@ -9,12 +9,12 @@
 {
     class Game
     {
+        public static int[] size = { 8, 8 };
+        public static char[,] board = new char[size[0], size[1]];
+
         static void Main()
         {
-            Console.WriteLine();
             Console.Clear();
-            int[] size = {8, 8};
-            char[,] board = new char[size[0], size[1]];

             while (true)
             {


code config

code config

--- DataAccess/DbContext.cs
+++ DataAccess/DbContext.cs
@@ -1,10 +1,9 @@
 using System.Data.Entity;
-using System.Security.Claims;
-using System.Threading.Tasks;
 using WebApplication.DataAccess.Entities;

 namespace WebApplication.DataAccess
 {
+    [DbConfigurationType(typeof(CodeConfig))]
     public class ApplicationDbContext : DbContext
     {
         public ApplicationDbContext()
@@ -26,4 +25,14 @@
         public DbSet<Post> Posts { get; set; }
         public DbSet<Comment> Comments { get; set; }
     }
+
+    public class CodeConfig : DbConfiguration
+    {
+        public CodeConfig()
+        {
+            SetDefaultConnectionFactory(new System.Data.Entity.Infrastructure.SqlConnectionFactory());
+            SetProviderServices("System.Data.SqlClient",
+                        System.Data.Entity.SqlServer.SqlProviderServices.Instance);
+        }
+    }
 }


added a tostringfilter method

added a tostringfilter method

--- DataGen/Types/Filter.cs
+++ DataGen/Types/Filter.cs
@@ -10,7 +10,11 @@
         protected Filter(IEnumerable<TData> enumerable) {
             Enumerable = enumerable;
         }
-        //Todo add method to change the filter type which is similiar to select that will work in the current class
+
+
+        public StringFilter ToStringFilter(Func<Filter<TData,TArg>, IEnumerable<string>> func) {
+            return new StringFilter(func(this));
+        }

         private IEnumerable<TData> Enumerable { get; }


Make mainObject an instance field

Make mainObject an instance field

--- Debugger/ModToolsMod.cs
+++ Debugger/ModToolsMod.cs
@@ -13,7 +13,7 @@

         public static GameObject MainWindowObject;

-        private static GameObject mainObject;
+        private GameObject mainObject;

         public static string Version { get; } = GitVersion.GetAssemblyVersion(typeof(ModToolsMod).Assembly);


updates BnfGrammar corrects error in grammar

--- libraries/Pliant/Bnf/BnfGrammar.cs
+++ libraries/Pliant/Bnf/BnfGrammar.cs
@@ -66,10 +66,10 @@

             var implements = new StringLiteralLexerRule("::=", new TokenType("implements"));
             var eol = new StringLiteralLexerRule("\r\n", new TokenType("eol"));
-
+
             var grammarBuilder = new GrammarBuilder("syntax")
                 .Production("syntax", r => r
-                    .Rule("syntax")
+                    .Rule("rule")
                     .Rule("rule", "syntax"))
                 .Production("rule", r => r
                     .Rule("identifier", implements, "expression", "line-end"))


HACK: For arithmetic expressions that produce an implicit intptr (basically only used for stackalloc, i think?) don't MemberwiseClone the result since it's not actually a struct.

--- JSIL/JavascriptAstEmitter.cs
+++ JSIL/JavascriptAstEmitter.cs
@@ -792,11 +792,21 @@
         }

         public void VisitNode (JSStructCopyExpression sce) {
-            Visit(sce.Struct);
-            Output.Dot();
-            Output.Identifier("MemberwiseClone");
-            Output.LPar();
-            Output.RPar();
+            // HACK: Arithmetic can produce values of implicit type IntPtr. Gross.
+            if (
+                sce.GetActualType(TypeSystem).Name.EndsWith("IntPtr") &&
+                sce.AllChildrenRecursive.All(
+                    n => (n is JSOperatorExpressionBase) || (n is JSLiteral)
+                )
+            ) {
+                Visit(sce.Struct);
+            } else {
+                Visit(sce.Struct);
+                Output.Dot();
+                Output.Identifier("MemberwiseClone");
+                Output.LPar();
+                Output.RPar();
+            }
         }

         public void VisitNode (JSConditionalStructCopyExpression sce) {


simpler repo

simpler repo

--- JilTests/DeserializeTests.cs
+++ JilTests/DeserializeTests.cs
@@ -7359,11 +7359,10 @@
         [TestMethod]
         public void Issue227()
         {
-            var obj = new _Issue227() { EnumProperty = _Issue227_1.AddInSettingsDetail };
-            var ser = JSON.Serialize(obj);
-
-            var val = JSON.Deserialize<_Issue227>(ser);
-            Assert.IsNull(val);
+            var ser = JSON.Serialize(_Issue227_1.AddInSettingsDetail);
+
+            var val = JSON.Deserialize<_Issue227_1>(ser);
+            Assert.AreEqual(_Issue227_1.AddInSettingsDetail, val);
         }

 #if !DEBUG


Fix texture bind early return bypassing glActiveTexture()

--- osu.Framework/Graphics/OpenGL/GLWrapper.cs
+++ osu.Framework/Graphics/OpenGL/GLWrapper.cs
@@ -396,6 +396,8 @@

         private static readonly int[] last_bound_texture = new int[16];
         private static readonly bool[] last_bound_texture_is_atlas = new bool[16];
+        private static TextureUnit lastActiveTextureUnit;
+
         internal static int GetTextureUnitId(TextureUnit unit) => (int)unit - (int)TextureUnit.Texture0;
         internal static bool AtlasTextureIsBound(TextureUnit unit) => last_bound_texture_is_atlas[GetTextureUnitId(unit)];

@@ -441,7 +443,7 @@
                 CurrentWrapModeT = wrapModeT;
             }

-            if (last_bound_texture[index] == textureId)
+            if (lastActiveTextureUnit == unit && last_bound_texture[index] == textureId)
                 return false;

             FlushCurrentBatch();
@@ -451,6 +453,7 @@

             last_bound_texture[index] = textureId;
             last_bound_texture_is_atlas[GetTextureUnitId(unit)] = false;
+            lastActiveTextureUnit = unit;

             FrameStatistics.Increment(StatisticsCounterType.TextureBinds);
             return true;


Change seed control type in line with changes

--- osu.Game.Rulesets.Osu/Mods/OsuModTarget.cs
+++ osu.Game.Rulesets.Osu/Mods/OsuModTarget.cs
@@ -17,6 +17,7 @@
 using osu.Game.Configuration;
 using osu.Game.Graphics;
 using osu.Game.Graphics.Containers;
+using osu.Game.Overlays.Settings;
 using osu.Game.Rulesets.Mods;
 using osu.Game.Rulesets.Objects;
 using osu.Game.Rulesets.Objects.Drawables;
@@ -46,7 +47,7 @@

         public override Type[] IncompatibleMods => new[] { typeof(IMutateApproachCircles) };

-        [SettingSource("Seed", "Use a custom seed instead of a random one", SettingControlType = typeof(SeedSettingsControl))]
+        [SettingSource("Seed", "Use a custom seed instead of a random one", SettingControlType = typeof(SettingsNumberBox))]
         public Bindable<int?> Seed { get; } = new Bindable<int?>
         {
             Default = null,


Fix missing copy implementation in LegacySampleControlPiont

--- osu.Game/Beatmaps/Formats/LegacyDecoder.cs
+++ osu.Game/Beatmaps/Formats/LegacyDecoder.cs
@@ -203,6 +203,13 @@
                 => base.IsRedundant(existing)
                    && existing is LegacySampleControlPoint existingSample
                    && CustomSampleBank == existingSample.CustomSampleBank;
+
+            public override void CopyFrom(ControlPoint other)
+            {
+                base.CopyFrom(other);
+
+                CustomSampleBank = ((LegacySampleControlPoint)other).CustomSampleBank;
+            }
         }
     }
 }


Fix score multiplier being cut off in mod select at higher ui scales

--- osu.Game/Overlays/Mods/ModSelectOverlay.cs
+++ osu.Game/Overlays/Mods/ModSelectOverlay.cs
@@ -103,7 +103,7 @@
                     {
                         new Dimension(GridSizeMode.Absolute, 90),
                         new Dimension(GridSizeMode.Distributed),
-                        new Dimension(GridSizeMode.Absolute, 70),
+                        new Dimension(GridSizeMode.AutoSize),
                     },
                     Content = new[]
                     {
@@ -197,7 +197,8 @@
                             // Footer
                             new Container
                             {
-                                RelativeSizeAxes = Axes.Both,
+                                RelativeSizeAxes = Axes.X,
+                                AutoSizeAxes = Axes.Y,
                                 Origin = Anchor.TopCentre,
                                 Anchor = Anchor.TopCentre,
                                 Children = new Drawable[]
@@ -215,7 +216,6 @@
                                         AutoSizeAxes = Axes.Y,
                                         RelativeSizeAxes = Axes.X,
                                         Width = content_width,
-                                        Direction = FillDirection.Horizontal,
                                         Padding = new MarginPadding
                                         {
                                             Vertical = 15,


Add back mod validation

Add back mod validation

--- osu.Game/Overlays/Mods/ModSelectOverlay.cs
+++ osu.Game/Overlays/Mods/ModSelectOverlay.cs
@@ -412,9 +412,12 @@

             foreach (var section in ModSectionsContainer.Children)
             {
-                section.Mods = Stacked
-                    ? availableMods.Value[section.ModType]
-                    : ModUtils.FlattenMods(availableMods.Value[section.ModType]);
+                IEnumerable<Mod> modEnumeration = availableMods.Value[section.ModType];
+
+                if (!Stacked)
+                    modEnumeration = ModUtils.FlattenMods(modEnumeration);
+
+                section.Mods = modEnumeration.Where(isValidMod);
             }
         }


Fix SettingsItem bindable logic (#7080)

Fix SettingsItem bindable logic (#7080)

Fix SettingsItem bindable logic

--- osu.Game/Overlays/Settings/SettingsItem.cs
+++ osu.Game/Overlays/Settings/SettingsItem.cs
@@ -53,27 +53,10 @@
             }
         }

-        // hold a reference to the provided bindable so we don't have to in every settings section.
-        private Bindable<T> bindable;
-
         public virtual Bindable<T> Bindable
         {
-            get => bindable;
-
-            set
-            {
-                if (bindable != null)
-                    controlWithCurrent?.Current.UnbindFrom(bindable);
-
-                bindable = value;
-                controlWithCurrent?.Current.BindTo(bindable);
-
-                if (ShowsDefaultIndicator)
-                {
-                    restoreDefaultButton.Bindable = bindable.GetBoundCopy();
-                    restoreDefaultButton.Bindable.TriggerChange();
-                }
-            }
+            get => controlWithCurrent.Current;
+            set => controlWithCurrent.Current = value;
         }

         public virtual IEnumerable<string> FilterTerms => Keywords == null ? new[] { LabelText } : new List<string>(Keywords) { LabelText }.ToArray();
@@ -110,7 +93,12 @@
         private void load()
         {
             if (controlWithCurrent != null)
+            {
                 controlWithCurrent.Current.DisabledChanged += disabled => { Colour = disabled ? Color4.Gray : Color4.White; };
+
+                if (ShowsDefaultIndicator)
+                    restoreDefaultButton.Bindable = controlWithCurrent.Current;
+            }
         }

         private class RestoreDefaultValueButton : Container, IHasTooltip
@@ -125,6 +113,7 @@
                     bindable = value;
                     bindable.ValueChanged += _ => UpdateState();
                     bindable.DisabledChanged += _ => UpdateState();
+                    UpdateState();
                 }
             }


Remove local specification for file selector search path

--- osu.Game/Screens/Edit/Setup/SetupScreen.cs
+++ osu.Game/Screens/Edit/Setup/SetupScreen.cs
@@ -235,7 +235,7 @@

         public void DisplayFileChooser()
         {
-            Target.Child = new FileSelector("/Users/Dean/.osu/Songs", new[] { ".mp3", ".ogg" })
+            Target.Child = new FileSelector(validFileExtensions: new[] { ".mp3", ".ogg" })
             {
                 RelativeSizeAxes = Axes.X,
                 Height = 400,


Expand on comment

Expand on comment

--- osu.Game/Screens/Select/BeatmapCarousel.cs
+++ osu.Game/Screens/Select/BeatmapCarousel.cs
@@ -413,7 +413,8 @@
         protected override bool OnKeyDown(KeyDownEvent e)
         {
             // allow for controlling volume when alt is held.
-            // mostly for compatibility with osu-stable.
+            // this is required as the VolumeControlReceptor uses OnPressed, which is
+            // executed after all OnKeyDown events.
             if (e.AltPressed)
                 return base.OnKeyDown(e);


Only attempt to restore CurrentItem state if present

--- osu.Game/Screens/Select/MatchSongSelect.cs
+++ osu.Game/Screens/Select/MatchSongSelect.cs
@@ -60,9 +60,12 @@
             if (base.OnExiting(next))
                 return true;

-            Beatmap.Value = beatmaps.GetWorkingBeatmap(CurrentItem.Value?.Beatmap);
-            Beatmap.Value.Mods.Value = selectedMods.Value = CurrentItem.Value?.RequiredMods;
-            Ruleset.Value = CurrentItem.Value?.Ruleset;
+            if (CurrentItem.Value != null)
+            {
+                Ruleset.Value = CurrentItem.Value.Ruleset;
+                Beatmap.Value = beatmaps.GetWorkingBeatmap(CurrentItem.Value.Beatmap);
+                Beatmap.Value.Mods.Value = selectedMods.Value = CurrentItem.Value.RequiredMods;
+            }

             Beatmap.Disabled = true;
             Ruleset.Disabled = true;


Improve visuals of circle gameplay mode

Improve visuals of circle gameplay mode

--- osu.Game/Screens/Utility/CircleGameplay.cs
+++ osu.Game/Screens/Utility/CircleGameplay.cs
@@ -4,6 +4,7 @@
 #nullable enable
 using System;
 using System.Collections.Generic;
+using osu.Framework.Allocation;
 using osu.Framework.Bindables;
 using osu.Framework.Graphics;
 using osu.Framework.Graphics.Containers;
@@ -17,7 +18,6 @@
 using osu.Game.Rulesets.Scoring;
 using osu.Game.Screens.Utility.SampleComponents;
 using osuTK;
-using osuTK.Graphics;

 namespace osu.Game.Screens.Utility
 {
@@ -150,8 +150,8 @@

             public readonly double HitTime;

-            private readonly CircularContainer approach;
-            private readonly Circle circle;
+            private CircularContainer approach = null!;
+            private Circle circle = null!;

             private const float size = 100;

@@ -163,23 +163,25 @@
                 HitTime = hitTime;

                 Origin = Anchor.Centre;
-
                 AutoSizeAxes = Axes.Both;
-
                 AlwaysPresent = true;
-
+            }
+
+            [BackgroundDependencyLoader]
+            private void load()
+            {
                 InternalChildren = new Drawable[]
                 {
                     circle = new Circle
                     {
-                        Colour = Color4.White,
+                        Colour = OverlayColourProvider.Content1,
                         Size = new Vector2(size),
                         Anchor = Anchor.Centre,
                         Origin = Anchor.Centre,
                     },
                     approach = new CircularContainer
                     {
-                        BorderColour = Color4.Yellow,
+                        BorderColour = OverlayColourProvider.Colour1,
                         Size = new Vector2(size),
                         Masking = true,
                         BorderThickness = 4,
@@ -189,7 +191,6 @@
                         {
                             new Box
                             {
-                                Colour = Color4.Black,
                                 Alpha = 0,
                                 AlwaysPresent = true,
                                 RelativeSizeAxes = Axes.Both,


Extract variable to avoid redundant accesses

--- osu.Game/Users/Drawables/DrawableAvatar.cs
+++ osu.Game/Users/Drawables/DrawableAvatar.cs
@@ -34,8 +34,9 @@
         [BackgroundDependencyLoader]
         private void load(LargeTextureStore textures)
         {
-            if (api != null && user?.AvatarUrl != null)
-                Texture = textures.Get(user.AvatarUrl.StartsWith('/') ? $"{api.WebsiteRootUrl}{user.AvatarUrl}" : user.AvatarUrl);
+            string avatarUrl = user?.AvatarUrl;
+            if (api != null && avatarUrl != null)
+                Texture = textures.Get(avatarUrl.StartsWith('/') ? $"{api.WebsiteRootUrl}{avatarUrl}" : avatarUrl);
             else if (user != null && user.Id > 1)
                 Texture = textures.Get($@"https://a.ppy.sh/{user.Id}");


Delete commented-out code.

Delete commented-out code.

--- ChangeDatabase.cs
+++ ChangeDatabase.cs
@@ -184,7 +184,6 @@
 					if (handler != null)
 					{
 						handler(this, new LinearWorkflowUploadedEventArgs(new RhinoCycles.LinearWorkflow(LinearWorkflow), Gamma));
-						//m_render_engine.Session.Scene.Background.Shader = m_env_db.CurrentBackgroundShader.GetShader();
 					}
 				}


Add handler for AppDomain.UnhandledException

instead of wrapping the entire program in a try/catch-all block. This
seems nicer.

--- Client/Program.cs
+++ Client/Program.cs
@@ -8,19 +8,22 @@
 namespace ShiftDrive {
 #if WINDOWS || LINUX
     public static class Program {
+
         [STAThread]
         public static void Main() {
-#if !DEBUG
-            try {
-#endif
+            // handler for logging crashes
+            AppDomain.CurrentDomain.UnhandledException += Program_UnhandledException;
+            // run the game
             using (var game = new SDGame())
                 game.Run();
-#if !DEBUG
-            } catch (Exception ex) {
+        }
+
+        private static void Program_UnhandledException(object sender, UnhandledExceptionEventArgs e) {
+            Exception ex = e.ExceptionObject as Exception;
+            if (ex != null)
                 Logger.WriteExceptionReport(ex);
-            }
-#endif
         }
+
     }
 #endif
 }


Reworked SendMail implementation dropping use of TeamFoundationMailService Class

--- Facade/ScriptLibrary.cs
+++ Facade/ScriptLibrary.cs
@@ -6,6 +6,8 @@
 using Microsoft.TeamFoundation.Framework.Client;
 using Microsoft.TeamFoundation.Framework.Common;
 using Microsoft.TeamFoundation.Framework.Server;
+using System;
+using System.Net.Mail;

 namespace Aggregator.Core.Facade
 {
@@ -14,27 +16,83 @@
         private readonly ILogEvents logger;
         private readonly IRequestContext requestContext;
         private readonly ConnectionInfo connectionInfo;
+        private readonly Mailer mailer;

         public ScriptLibrary(IRuntimeContext context)
         {
             this.connectionInfo = context.GetConnectionInfo();
             this.requestContext = context.RequestContext;
             this.logger = context.Logger;
+            this.mailer = new Mailer(context.RequestContext.VssContext);
+        }
+
+        private class Mailer
+        {
+            private readonly bool Enabled;
+            private readonly string SmtpServer;
+            private readonly int SmtpPort;
+            private readonly bool EnableSsl;
+            private readonly MailAddress FromAddress;
+
+            internal Mailer(IVssRequestContext requestContext)
+            {
+                this.Enabled = false;
+                try
+                {
+                    TeamFoundationRegistryService service = requestContext.GetService<TeamFoundationRegistryService>();
+                    Microsoft.TeamFoundation.Framework.Server.RegistryEntryCollection registryEntryCollection = service.ReadEntriesFallThru(requestContext, FrameworkServerConstants.NotificationRootPath + "/*");
+                    if (registryEntryCollection["EmailEnabled"].GetValue<bool>(true))
+                    {
+                        this.SmtpServer = registryEntryCollection["SmtpServer"].GetValue(string.Empty);
+                        this.SmtpPort = registryEntryCollection["SmtpPort"].GetValue<int>(-1);
+                        this.EnableSsl = registryEntryCollection["SmtpEnableSsl"].GetValue<bool>(false);
+                        this.FromAddress = null;
+
+                        string value = registryEntryCollection["EmailNotificationFromAddress"].GetValue(string.Empty);
+                        if (!string.IsNullOrEmpty(value) && !string.IsNullOrEmpty(this.SmtpServer))
+                        {
+                            this.FromAddress = new MailAddress(value);
+                            this.Enabled = true;
+                        }
+                    }
+                }
+                catch (System.Exception ex)
+                {
+                    System.Diagnostics.Debug.WriteLine($"SendMail failed: {ex.Message}");
+                }
+            }
+
+            internal void Send(string to, string subject, string body)
+            {
+                if (this.Enabled)
+                {
+                    using (SmtpClient client = new SmtpClient())
+                    {
+                        client.Host = this.SmtpServer;
+                        client.Port = this.SmtpPort;
+                        client.EnableSsl = this.EnableSsl;
+
+                        MailMessage message = new MailMessage();
+                        message.From = this.FromAddress;
+                        message.To.Add(to);
+                        message.Subject = subject;
+                        message.Body = body;
+
+                        client.Send(message);
+                    }
+                }
+            }
         }

         public void SendMail(string to, string subject, string body)
         {
-            var mailService = new TeamFoundationMailService();
-            var vssContext = this.requestContext.VssContext;
-            mailService.LoadSettings(vssContext);
-
-            string from = mailService.FromAddress.Address;
-
-            this.logger.LibrarySendMail(from, to, subject, body);
-            using (var message = new System.Net.Mail.MailMessage(from, to, subject, body))
+            try
             {
-                mailService.ValidateMessage(vssContext, message);
-                mailService.Send(vssContext, message);
+                this.mailer.Send(to, subject, body);
+            }
+            catch (System.Exception ex)
+            {
+                System.Diagnostics.Debug.WriteLine($"SendMail failed: {ex.Message}");
             }
         }


Converters is from formats

Converters is from formats

--- FileFormat/Converter.cs
+++ FileFormat/Converter.cs
@@ -25,6 +25,8 @@

 	[TypeExtensionPoint]
 	public abstract class Converter<TSrc, TDst>
+		where TSrc : Format
+		where TDst : Format
 	{
 		public Type From {
 			get { return typeof(TSrc); }


Remove loggin

Remove loggin

--- MasterServer/MasterServer.cs
+++ MasterServer/MasterServer.cs
@@ -121,11 +121,15 @@
                     break;
                 case MasterServerMessageSubType.RequestServers:
                     var version = ((MsRequestServersMsgData)message.Data).CurrentVersion;
+#if DEBUG
                     Form.WriteLine($"Received LIST REQUEST from: {netMsg.SenderEndPoint} version: {version}");
+#endif
                     SendServerLists(netMsg, peer, version);
                     break;
                 case MasterServerMessageSubType.Introduction:
+#if DEBUG
                     Form.WriteLine($"Received INTRODUCTION request from: {netMsg.SenderEndPoint}");
+#endif
                     var msgData = (MsIntroductionMsgData)message.Data;
                     Server server;
                     if (ServerDictionary.TryGetValue(msgData.Id, out server))


SumUp client example

SumUp client example

--- Mina.Example/SumUp/Client.cs
+++ Mina.Example/SumUp/Client.cs
@@ -1,14 +1,111 @@
 using System;
-using System.Collections.Generic;
-using System.Text;
+using System.Net;
+using System.Threading;
+using Mina.Core.Future;
+using Mina.Core.Session;
+using Mina.Example.SumUp.Codec;
+using Mina.Example.SumUp.Message;
+using Mina.Filter.Codec;
+using Mina.Filter.Logging;
+using Mina.Transport.Socket;

 namespace Mina.Example.SumUp
 {
     class Client
     {
+        private static readonly int PORT = 8080;
+        private static readonly long CONNECT_TIMEOUT = 30 * 1000L; // 30 seconds
+
         static void Main(string[] args)
         {
-            // TODO
+            if (args.Length == 0)
+            {
+                Console.WriteLine("Please specify the list of any integers");
+                return;
+            }
+
+            // prepare values to sum up
+            int[] values = new int[args.Length];
+            for (int i = 0; i < args.Length; i++)
+            {
+                values[i] = Int32.Parse(args[i]);
+            }
+
+            AsyncSocketConnector connector = new AsyncSocketConnector();
+
+            // Configure the service.
+            connector.ConnectTimeoutInMillis = CONNECT_TIMEOUT;
+
+            connector.FilterChain.AddLast("codec", new ProtocolCodecFilter(
+                                    new SumUpProtocolCodecFactory(false)));
+
+            connector.FilterChain.AddLast("logger", new LoggingFilter());
+
+            connector.SessionOpened += s =>
+            {
+                // send summation requests
+                for (int i = 0; i < values.Length; i++)
+                {
+                    AddMessage m = new AddMessage();
+                    m.Sequence = i;
+                    m.Value = values[i];
+                    s.Write(m);
+                }
+            };
+
+            connector.ExceptionCaught += (s, e) =>
+            {
+                Console.WriteLine(e);
+                s.Close(true);
+            };
+
+            connector.MessageReceived += (s, m) =>
+            {
+                // server only sends ResultMessage. otherwise, we will have to identify
+                // its type using instanceof operator.
+                ResultMessage rm = (ResultMessage)m;
+                if (rm.OK)
+                {
+                    // server returned OK code.
+                    // if received the result message which has the last sequence
+                    // number,
+                    // it is time to disconnect.
+                    if (rm.Sequence == values.Length - 1)
+                    {
+                        // print the sum and disconnect.
+                        Console.WriteLine("The sum: " + rm.Value);
+                        s.Close(true);
+                    }
+                }
+                else
+                {
+                    // seever returned error code because of overflow, etc.
+                    Console.WriteLine("Server error, disconnecting...");
+                    s.Close(true);
+                }
+            };
+
+            IoSession session;
+            while (true)
+            {
+                try
+                {
+                    IConnectFuture future = connector.Connect(new IPEndPoint(IPAddress.Loopback, PORT));
+                    future.Await();
+                    session = future.Session;
+                    break;
+                }
+                catch (Exception ex)
+                {
+                    Console.WriteLine(ex);
+                    Thread.Sleep(3000);
+                }
+            }
+
+            // wait until the summation is done
+            session.CloseFuture.Await();
+            Console.WriteLine("Press any key to exit");
+            Console.Read();
         }
     }
 }


Rename methods

Rename methods

--- Mono.Cecil/AssemblyWriter.cs
+++ Mono.Cecil/AssemblyWriter.cs
@@ -1265,7 +1265,7 @@
 				return;

 			AttachTokens ();
-			AddTypeDefs ();
+			AddTypes ();
 			AddGenericParameters ();
 		}

@@ -1274,33 +1274,33 @@
 			var types = module.Types;

 			for (int i = 0; i < types.Count; i++)
-				AttachTypeDefToken (types [i]);
-		}
-
-		void AttachTypeDefToken (TypeDefinition type)
+				AttachTypeToken (types [i]);
+		}
+
+		void AttachTypeToken (TypeDefinition type)
 		{
 			type.token = new MetadataToken (TokenType.TypeDef, type_rid++);
 			type.fields_range.Start = field_rid;
 			type.methods_range.Start = method_rid;

 			if (type.HasFields)
-				AttachFieldsDefToken (type);
+				AttachFieldsToken (type);

 			if (type.HasMethods)
-				AttachMethodsDefToken (type);
+				AttachMethodsToken (type);

 			if (type.HasNestedTypes)
-				AttachNestedTypesDefToken (type);
-		}
-
-		void AttachNestedTypesDefToken (TypeDefinition type)
+				AttachNestedTypesToken (type);
+		}
+
+		void AttachNestedTypesToken (TypeDefinition type)
 		{
 			var nested_types = type.NestedTypes;
 			for (int i = 0; i < nested_types.Count; i++)
-				AttachTypeDefToken (nested_types [i]);
-		}
-
-		void AttachFieldsDefToken (TypeDefinition type)
+				AttachTypeToken (nested_types [i]);
+		}
+
+		void AttachFieldsToken (TypeDefinition type)
 		{
 			var fields = type.Fields;
 			type.fields_range.Length = (uint) fields.Count;
@@ -1308,7 +1308,7 @@
 				fields [i].token = new MetadataToken (TokenType.Field, field_rid++);
 		}

-		void AttachMethodsDefToken (TypeDefinition type)
+		void AttachMethodsToken (TypeDefinition type)
 		{
 			var methods = type.Methods;
 			type.methods_range.Length = (uint) methods.Count;
@@ -1407,7 +1407,7 @@
 			return token;
 		}

-		void AddTypeDefs ()
+		void AddTypes ()
 		{
 			var types = module.Types;

@@ -3210,7 +3210,7 @@

 #endif

-			static partial class Mixin {
+	static partial class Mixin {

 		public static bool TryGetUniqueDocument (this MethodDebugInformation info, out Document document)
 		{


do not emit a param row if not needed

do not emit a param row if not needed

--- Mono.Cecil/AssemblyWriter.cs
+++ Mono.Cecil/AssemblyWriter.cs
@@ -1477,11 +1477,18 @@
 		{
 			var parameters = method.Parameters;

-			if (RequiresReturnParameter (method.MethodReturnType))
-				AddParameter (0, method.MethodReturnType.Parameter, param_table);
-
-			for (int i = 0; i < parameters.Count; i++)
-				AddParameter ((ushort) (i + 1), parameters [i], param_table);
+			var return_parameter = method.MethodReturnType.parameter;
+
+			if (return_parameter != null && RequiresParameterRow (return_parameter))
+				AddParameter (0, return_parameter, param_table);
+
+			for (int i = 0; i < parameters.Count; i++) {
+				var parameter = parameters [i];
+				if (!RequiresParameterRow (parameter))
+					continue;
+
+				AddParameter ((ushort) (i + 1), parameter, param_table);
+			}
 		}

 		void AddPInvokeInfo (MethodDefinition method)
@@ -1511,13 +1518,10 @@
 			}
 		}

-		static bool RequiresReturnParameter (MethodReturnType return_type)
-		{
-			var parameter = return_type.parameter;
-			if (parameter == null)
-				return false;
-
-			return parameter.Attributes != ParameterAttributes.None
+		static bool RequiresParameterRow (ParameterDefinition parameter)
+		{
+			return !string.IsNullOrEmpty (parameter.Name)
+				|| parameter.Attributes != ParameterAttributes.None
 				|| parameter.HasMarshalInfo
 				|| parameter.HasConstant
 				|| parameter.HasCustomAttributes;


Fix for iOS 7.

Fix for iOS 7.

The new date and time picker does not appear on a black background.

--- MonoTouch.Dialog/Elements.cs
+++ MonoTouch.Dialog/Elements.cs
@@ -1708,7 +1708,7 @@
 		public DateTime DateValue;
 		public UIDatePicker datePicker;
 		public event Action<DateTimeElement> DateSelected;
-		public UIColor BackgroundColor = UIColor.Black;
+		public UIColor BackgroundColor = (UIDevice.CurrentDevice.CheckSystemVersion (7, 0)) ? UIColor.White : UIColor.Black;

 		protected internal NSDateFormatter fmt = new NSDateFormatter () {
 			DateStyle = NSDateFormatterStyle.Short


npm install silent

npm install silent

--- Framework/Build/Util.cs
+++ Framework/Build/Util.cs
@@ -131,7 +131,7 @@
         public static void NpmInstall(string workingDirectory, bool isThrowException = true)
         {
             string fileName = Framework.Build.ConnectionManager.NpmFileName;
-            Start(workingDirectory, fileName, "install", isThrowException);
+            Start(workingDirectory, fileName, "install --silent", isThrowException);
         }

         public static void NpmRun(string workingDirectory, string script)


scrypt test

scrypt test

--- NBitcoin.Tests/util_tests.cs
+++ NBitcoin.Tests/util_tests.cs
@@ -1,4 +1,5 @@
-using NBitcoin.DataEncoders;
+using NBitcoin.Crypto;
+using NBitcoin.DataEncoders;
 using Newtonsoft.Json.Linq;
 using System;
 using System.Collections.Generic;
@@ -96,6 +97,17 @@
 					Space = true
 				}.EncodeData(ParseHex_vec),
 				"04 67 8a fd b0");
+		}
+
+		[Fact]
+		[Trait("UnitTest", "UnitTest")]
+		public void ScryptTest()
+		{
+			var message = "Hello world message";
+			var salt = Encoding.UTF8.GetBytes("This is salt");
+			var result = SCrypt.BitcoinComputeDerivedKey(message, salt);
+			Assert.Equal("2331e1fe210127c9ac8fa95eb388e9dd072893890e2ee5646318ceb66089bbfe5ab45f762feeddf53d21c9a2cb183869247c9814f2bff1917fbea8239c548d1d"
+				, Encoders.Hex.EncodeData(result));
 		}

 		[Fact]


as it's not possible to write static extensions methods, move this in its own namespace

--- GLib.Sources/Sources.cs
+++ GLib.Sources/Sources.cs
@@ -21,16 +21,17 @@

 using System;
 using System.Runtime.InteropServices;
+using GLib;

-namespace GLib {
-	static class SourceExtensions {
+namespace GLibBeans {
+	public class Sources {
 		[DllImport("libglib-2.0-0.dll")]
 		static extern void g_source_set_priority (IntPtr source, int priority);

 		[DllImport("libglib-2.0-0.dll")]
 		static extern IntPtr g_main_context_find_source_by_id (IntPtr context, uint source_id);

-		public static void SetPriority (this Source source, uint source_id, Priority priority)
+		public static void SetPriority (uint source_id, Priority priority)
 		{
 			g_source_set_priority (g_main_context_find_source_by_id (IntPtr.Zero, source_id), (int)priority);
 		}


Move the old launcher to backup.

Move the old launcher to backup.

--- Launcher/MainWindow.xaml.cs
+++ Launcher/MainWindow.xaml.cs
@@ -127,6 +127,7 @@
             new Thread(delegate ()

             {
+                ForceMove(H2Ek_install_path + "Halo_2_Map_Editor_Launcher.exe", H2Ek_install_path + "backup\\Halo_2_Map_Editor_Launcher.exe");
                 file_list files_to_patch = file_list.none;
                 if (!check_files(ref files_to_patch))
                 {
@@ -160,6 +161,8 @@

         private void ForceMove(string sourceFilename, string destinationFilename)
         {
+            if (!File.Exists(sourceFilename))
+                return;
             if (File.Exists(destinationFilename))
             {
                 System.IO.File.Delete(destinationFilename);


Fixed: couldn't click Detect Devices if no devices on startup

--- MultiMiner.Win/MainForm.cs
+++ MultiMiner.Win/MainForm.cs
@@ -415,7 +415,8 @@
             stopButton.Enabled = miningEngine.Mining;
             startMenuItem.Enabled = startButton.Enabled;
             stopMenuItem.Enabled = stopButton.Enabled;
-            detectDevicesButton.Enabled = startButton.Enabled;
+            //allow clicking Detect Devices with invalid configuration
+            detectDevicesButton.Enabled = !miningEngine.Mining;

             startButton.Visible = startButton.Enabled;
             stopButton.Visible = stopButton.Enabled;


Refactoring

Refactoring

--- MultiMiner.Win/MainForm.cs
+++ MultiMiner.Win/MainForm.cs
@@ -10,7 +10,6 @@
 using System.Net.Sockets;
 using System.ComponentModel;
 using System.Diagnostics;
-using System.Text.RegularExpressions;

 namespace MultiMiner.Win
 {


Show Errors and Rejected as % returned by the RPC API

--- MultiMiner.Win/MainForm.cs
+++ MultiMiner.Win/MainForm.cs
@@ -1238,10 +1238,10 @@
             item.SubItems["Accepted"].Tag = 0;

             item.SubItems["Rejected"].Text = String.Empty;
-            item.SubItems["Rejected"].Tag = 0;
+            item.SubItems["Rejected"].Tag = 0.00;

             item.SubItems["Errors"].Text = String.Empty;
-            item.SubItems["Errors"].Tag = 0;
+            item.SubItems["Errors"].Tag = 0.00;

             item.SubItems["Utility"].Text = String.Empty;
             item.SubItems["Utility"].Tag = 0.00;
@@ -1259,23 +1259,23 @@
                 if (deviceInformation.Name.Equals("PXY", StringComparison.OrdinalIgnoreCase))
                 {
                     item.SubItems["Hashrate"].Tag = (double)(item.SubItems["Hashrate"].Tag ?? 0.00) + deviceInformation.AverageHashrate;
-                    item.SubItems["Rejected"].Tag = (int)(item.SubItems["Rejected"].Tag ?? 0) + deviceInformation.RejectedShares;
-                    item.SubItems["Errors"].Tag = (int)(item.SubItems["Errors"].Tag ?? 0) + deviceInformation.HardwareErrors;
+                    item.SubItems["Rejected"].Tag = (double)(item.SubItems["Rejected"].Tag ?? 0.00) + deviceInformation.RejectedSharesPercent;
+                    item.SubItems["Errors"].Tag = (double)(item.SubItems["Errors"].Tag ?? 0.00) + deviceInformation.HardwareErrorsPercent;
                     item.SubItems["Accepted"].Tag = (int)(item.SubItems["Accepted"].Tag ?? 0) + deviceInformation.AcceptedShares;
                     item.SubItems["Utility"].Tag = (double)(item.SubItems["Utility"].Tag ?? 0.00) + deviceInformation.Utility;
                 }
                 else
                 {
                     item.SubItems["Hashrate"].Tag = deviceInformation.AverageHashrate;
-                    item.SubItems["Rejected"].Tag = deviceInformation.RejectedShares;
-                    item.SubItems["Errors"].Tag = deviceInformation.HardwareErrors;
+                    item.SubItems["Rejected"].Tag = deviceInformation.RejectedSharesPercent;
+                    item.SubItems["Errors"].Tag = deviceInformation.HardwareErrorsPercent;
                     item.SubItems["Accepted"].Tag = deviceInformation.AcceptedShares;
                     item.SubItems["Utility"].Tag = deviceInformation.Utility;
                 }

                 item.SubItems["Hashrate"].Text = ((double)item.SubItems["Hashrate"].Tag).ToHashrateString();
-                item.SubItems["Rejected"].Text = (int)item.SubItems["Rejected"].Tag > 0 ? ((int)item.SubItems["Rejected"].Tag).ToString() : String.Empty;
-                item.SubItems["Errors"].Text = (int)item.SubItems["Errors"].Tag > 0 ? ((int)item.SubItems["Errors"].Tag).ToString() : String.Empty;
+                item.SubItems["Rejected"].Text = (double)item.SubItems["Rejected"].Tag > 0.00 ? ((double)item.SubItems["Rejected"].Tag).ToString("0.#") + "%" : String.Empty;
+                item.SubItems["Errors"].Text = (double)item.SubItems["Errors"].Tag > 0.00 ? ((double)item.SubItems["Errors"].Tag).ToString("0.#") + "%" : String.Empty;
                 item.SubItems["Accepted"].Text = (int)item.SubItems["Accepted"].Tag > 0 ? ((int)item.SubItems["Accepted"].Tag).ToString() : String.Empty;

                 item.SubItems["Utility"].Text = (double)item.SubItems["Utility"].Tag > 0.00 ? ((double)item.SubItems["Utility"].Tag).ToString("0.###") : String.Empty;


Improve the error reporting

Improve the error reporting

--- LibGit2Sharp/Core/Ensure.cs
+++ LibGit2Sharp/Core/Ensure.cs
@@ -41,11 +41,14 @@
         /// <param name = "result">The result.</param>
         public static void Success(int result)
         {
-            if (result < 0)
+            if (result == 0)
             {
-                throw new ApplicationException(
-                    String.Format("There was an error in libgit2, but error handling sucks right now, so I can't tell you what it was. Error code = {0}", result));
+                return;
             }
+
+            throw new ApplicationException(
+                String.Format("There was an error in libgit2, but error handling sucks right now, so I can't tell you what it was. Error code = {0} ({1})", Enum.GetName(typeof(GitErrorCode), result)
+, result));
         }

         /// <summary>


Changed back to using HashList as an ICollider

--- GameEngine/TeeEngine.cs
+++ GameEngine/TeeEngine.cs
@@ -130,8 +130,8 @@
             DrawingOptions.ShowBoundingBoxes = false;
             DrawingOptions.ShowDrawableComponents = false;

-            //Collider = new HashList(64, 64);
-            Collider = new QuadTree();
+            Collider = new HashList(64, 64);
+            //Collider = new QuadTree();

             EntitiesOnScreen = new List<Entity>();


Dead RoomMaster can send All

Dead RoomMaster can send All

--- GameServer/Room/Room.cs
+++ GameServer/Room/Room.cs
@@ -117,6 +117,9 @@
             {
                 // Dead
                 modes.Add(RoomMessage.Mode.Ghost);
+                // DeadRoomMaster can send All
+                if (IsRoomMaster(actor))
+                    modes.Add(RoomMessage.Mode.All);
             }
             else
             {


Removed unnecessary initialization on one of PersonIdent's constructor.

--- GitSharp/PersonIdent.cs
+++ GitSharp/PersonIdent.cs
@@ -62,31 +62,32 @@
             string email = config.getString("user", null, "email");
             Name = username;
             EmailAddress = email;
-            DateTimeOffset now = DateTimeOffset.Now;
-            When = now.Millisecond;
-            tzOffset = now.Offset.Minutes;
-        }
-
-        public PersonIdent(PersonIdent pi) :
-            this(pi.Name, pi.EmailAddress)
-        {}
-
-        public PersonIdent(string name, string emailAddress) :
-            this(name, emailAddress, DateTime.Now, TimeZoneInfo.Local)
-        {}
-
-        public PersonIdent(PersonIdent pi, DateTime when, TimeZoneInfo tz) :
-            this(pi.Name, pi.EmailAddress, when, tz)
-        {}
-
-        public PersonIdent(PersonIdent pi, DateTime when) :
-            this(pi.Name, pi.EmailAddress, when.ToUnixTime() * 1000, pi.tzOffset)
-        {
-        }
-
-        public PersonIdent(string name, string emailAddress, DateTime when, TimeZoneInfo tz) :
-            this (name, emailAddress, when.ToUnixTime() * 1000, tz.GetUtcOffset(when).Minutes)
-        { }
+        }
+
+        public PersonIdent(PersonIdent pi)
+			: this(pi.Name, pi.EmailAddress)
+        {
+        }
+
+        public PersonIdent(string name, string emailAddress)
+			: this(name, emailAddress, DateTime.Now, TimeZoneInfo.Local)
+        {
+        }
+
+        public PersonIdent(PersonIdent pi, DateTime when, TimeZoneInfo tz)
+			: this(pi.Name, pi.EmailAddress, when, tz)
+        {
+        }
+
+        public PersonIdent(PersonIdent pi, DateTime when)
+			: this(pi.Name, pi.EmailAddress, when.ToUnixTime() * 1000, pi.tzOffset)
+        {
+        }
+
+        public PersonIdent(string name, string emailAddress, DateTime when, TimeZoneInfo tz)
+			: this(name, emailAddress, when.ToUnixTime() * 1000, tz.GetUtcOffset(when).Minutes)
+        {
+        }

         public PersonIdent(string name, string emailAddress, long when, int tz)
         {
@@ -96,8 +97,10 @@
             tzOffset = tz;
         }

-        public PersonIdent(PersonIdent pi, long git_time, int offset_in_minutes) : this(pi.Name, pi.EmailAddress, git_time, offset_in_minutes)
-        {}
+        public PersonIdent(PersonIdent pi, long git_time, int offset_in_minutes)
+			: this(pi.Name, pi.EmailAddress, git_time, offset_in_minutes)
+        {
+        }

         public PersonIdent(string str)
         {


Add custom GameTag for 1398

Add custom GameTag for 1398

--- HearthDb/Enums/Enums.cs
+++ HearthDb/Enums/Enums.cs
@@ -812,6 +812,7 @@
         INVOKE_COUNTER = 1366,
         PLAYER_LEADERBOARD_PLACE = 1373,
         PLAYER_TECH_LEVEL = 1377,
+        PENDING_TRIGGER = 1398,
         BACON_USE_FAST_ANIMATIONS = 1402,
         DECK_RULE_COUNT_AS_COPY_OF_CARD_ID = 1413,
         BACON_ODD_PLAYER_OUT = 1415,


received remote notification

received remote notification

--- HvzApple/AppDelegate.cs
+++ HvzApple/AppDelegate.cs
@@ -110,5 +110,10 @@
         {
             new UIAlertView("Error registering push notifications", error.LocalizedDescription, null, "OK", null).Show();
         }
+
+        public override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo)
+        {
+            new UIAlertView("HvZ Announcement", userInfo["alert"] as NSString, null, "OK", null).Show();
+        }
     }
 }


fix https://github.cds.internal.unity3d.com/unity/com.unity.ide.rider/issues/21 (#1232)

on mac empty string in quotes is causing additional solution to be opened https://github.cds.internal.unity3d.com/unity/com.unity.ide.rider/issues/21

--- unity/EditorPlugin/OnOpenAssetHandler.cs
+++ unity/EditorPlugin/OnOpenAssetHandler.cs
@@ -100,7 +100,8 @@
         }
       }

-      var args = string.Format("{0}{1}{0} --line {2} {0}{3}{0}", "\"", mySlnFile, line, assetFilePath);
+      var argsString = assetFilePath == "" ? "" : $" --line {line} \"{assetFilePath}\""; // on mac empty string in quotes is causing additional solution to be opened https://github.cds.internal.unity3d.com/unity/com.unity.ide.rider/issues/21
+      var args = string.Format("{0}{1}{0}{2}", "\"", mySlnFile, argsString);
       return CallRider(args);
     }

@@ -117,7 +118,7 @@
       if (myPluginSettings.OperatingSystemFamilyRider == OperatingSystemFamilyRider.MacOSX)
       {
         proc.StartInfo.FileName = "open";
-        proc.StartInfo.Arguments = string.Format("-n {0}{1}{0} --args {2}", "\"", "/" + defaultApp, args);
+        proc.StartInfo.Arguments = string.Format("-n {0}{1}{0} --args {2}", "\"", defaultApp, args);
         myLogger.Verbose("{0} {1}", proc.StartInfo.FileName, proc.StartInfo.Arguments);
       }
       else


Support for "column" argument for running rider (RIDER-27450) (#1486)

* Support for "column" argument for running rider (RIDER-27450)

* fix column argument

--- unity/EditorPlugin/OnOpenAssetHandler.cs
+++ unity/EditorPlugin/OnOpenAssetHandler.cs
@@ -102,7 +102,7 @@
         }
       }

-      var argsString = assetFilePath == "" ? "" : $" --line {line} \"{assetFilePath}\""; // on mac empty string in quotes is causing additional solution to be opened https://github.cds.internal.unity3d.com/unity/com.unity.ide.rider/issues/21
+      var argsString = assetFilePath == "" ? "" : $" --line {line} --column {column} \"{assetFilePath}\""; // on mac empty string in quotes is causing additional solution to be opened https://github.cds.internal.unity3d.com/unity/com.unity.ide.rider/issues/21
       var args = string.Format("{0}{1}{0}{2}", "\"", mySlnFile, argsString);
       return CallRider(args);
     }


Add TryGetComponent() method (#635)

Add TryGetComponent() method (#635)

--- Nez.Portable/ECS/Entity.cs
+++ Nez.Portable/ECS/Entity.cs
@@ -435,6 +435,17 @@
 		public T GetComponent<T>() where T : Component => Components.GetComponent<T>(false);

 		/// <summary>
+		/// Tries to get the component of type T. If no components are found returns false.
+		/// </summary>
+		/// <returns>true if a component has been found.</returns>
+		/// <typeparam name="T">The 1st type parameter.</typeparam>
+		public bool TryGetComponent<T>(out T component) where T : Component
+		{
+			component = Components.GetComponent<T>(false);
+			return component != null;
+		}
+
+		/// <summary>
 		/// checks to see if the Entity has the component
 		/// </summary>
 		public bool HasComponent<T>() where T : Component => Components.GetComponent<T>(false) != null;


Optimize performance of callstack depth control

--- NiL.JS/Expressions/Call.cs
+++ NiL.JS/Expressions/Call.cs
@@ -118,7 +118,8 @@
             else if (func == null)
             {
                 checkStack();
-                Context.CurrentGlobalContext._callDepth++;
+                var currentGlobalContext = Context.CurrentGlobalContext;
+                currentGlobalContext._callDepth++;
                 try
                 {
                     switch (_callMode)
@@ -136,8 +137,8 @@
                     }
                 }
                 finally
-                {
-                    Context.CurrentGlobalContext._callDepth--;
+                {
+                    currentGlobalContext._callDepth--;
                 }
             }
             else
@@ -158,7 +159,8 @@
                     context._objectSource = null;

                 checkStack();
-                Context.CurrentGlobalContext._callDepth++;
+                var currentGlobalContext = Context.CurrentGlobalContext;
+                currentGlobalContext._callDepth++;
                 try
                 {
                     if (_callMode == CallMode.Construct)
@@ -171,7 +173,7 @@
                 }
                 finally
                 {
-                    Context.CurrentGlobalContext._callDepth--;
+                    currentGlobalContext._callDepth--;
                 }
             }
         }


Removing assumptions from the BinarySearchTree.Insert method. Insertion on a node will happen to that subtree.

--- src/AM.Core.DataStructures/BinarySearchTreeNode.cs
+++ src/AM.Core.DataStructures/BinarySearchTreeNode.cs
@@ -78,13 +78,12 @@
         /// Inserts the specified node to the current subtree
         /// </summary>
         /// <param name="node">The node to insert to the subtree.</param>
-        /// <remark>Call to this method on any node of a tree will cause the insertion to run from the root of the tree.</remarks>
         public BinarySearchTreeNode<T> Insert(T nodeValue)
         {
             BinarySearchTreeNode<T> node = new BinarySearchTreeNode<T>(nodeValue);

             // We shold always insert nodes from the root, to not break the BST properties.
-            BinarySearchTreeNode<T> currentParentNode = this.Root;
+            BinarySearchTreeNode<T> currentParentNode = this;
             do
             {
                 if (node.Value.CompareTo(currentParentNode.Value) <= 0)


Update document object with string/long to datetime conversion.

--- src/Arango/Arango.Client/API/Documents/Document.cs
+++ src/Arango/Arango.Client/API/Documents/Document.cs
@@ -873,6 +873,14 @@
                 TimeSpan span = (((DateTime)value).ToUniversalTime() - DocumentSettings.UnixEpoch);
                 value = (long)span.TotalSeconds;
             }
+            else if ((valueType.Name == "String") && (type.Name == "DateTime"))
+            {
+                value = System.DateTime.Parse((string)value, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.AdjustToUniversal);
+            }
+            else if ((valueType.Name == "Int64") && (type.Name == "DateTime"))
+            {
+                value = DocumentSettings.UnixEpoch.AddSeconds((long)value);
+            }
             else
             {
                 value = System.Convert.ChangeType(value, type);


Bug fix in MidiChordDef.UpsideDown()

Bug fix in MidiChordDef.UpsideDown()

Forgot to copy Lyric.

--- Moritz.Spec/MidiChordDef.cs
+++ Moritz.Spec/MidiChordDef.cs
@@ -276,6 +276,7 @@
                     pitches.Add((byte)(pitches[pitches.Count - 1] + interval));
                 }
                 mcdInverted = new MidiChordDef(pitches, NotatedMidiVelocities, MsDuration, true);
+                mcdInverted.Lyric = (Lyric == null) ? null : String.Copy(Lyric);
             }
             else
             {


get-version -v should be case-insensitive

--- src/nbgv/Program.cs
+++ src/nbgv/Program.cs
@@ -5,6 +5,7 @@
     using System.CommandLine;
     using System.IO;
     using System.Linq;
+    using System.Reflection;
     using System.Threading;
     using System.Threading.Tasks;
     using Newtonsoft.Json;
@@ -24,6 +25,8 @@
         private const string DefaultVersionInfoFormat = "text";

         private const string DefaultRef = "HEAD";
+
+        private const BindingFlags CaseInsensitiveFlags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.IgnoreCase;

         private enum ExitCodes
         {
@@ -316,7 +319,7 @@
                     return ExitCodes.UnsupportedFormat;
                 }

-                var property = oracle.GetType().GetProperty(singleVariable);
+                var property = oracle.GetType().GetProperty(singleVariable, CaseInsensitiveFlags);
                 if (property == null)
                 {
                     Console.Error.WriteLine("Variable \"{0}\" not a version property.", singleVariable);