Fixed bug in MetadataLoader: Tracks wth empty AlbumAritsts / Performers lsits can now be loaded

--- MusicFileCop.Core/src/Private/Metadata/MetadataLoader.cs
+++ MusicFileCop.Core/src/Private/Metadata/MetadataLoader.cs
@@ -49,13 +49,13 @@
                 var tag = audioFile.GetTag(TagTypes.Id3v2);

                 var track = m_MetadataFactory.GetTrack(
-                    tag.AlbumArtists?.Aggregate((a,b) => $"{a}/{b}"),
+                    tag.AlbumArtists != null && tag.AlbumArtists.Any() ? tag.AlbumArtists.Aggregate((a, b) => $"{a}/{b}") : "",
                     tag.Album,
                     (int) tag.Year,
                     (int) tag.Disc,
                     (int) tag.Track,
                     tag.Title,
-                    tag.Performers.Aggregate((a, b) => $"{a}/{b}"));
+                    tag.Performers != null && tag.Performers.Any() ? tag.Performers.Aggregate((a, b) => $"{a}/{b}") : "");

                 m_FileMetadataMapper.AddMapping(track, file);
             }


Fixed weird reminder bug

Fixed weird reminder bug

--- NadekoBot.Core/Modules/Utility/Services/RemindService.cs
+++ NadekoBot.Core/Modules/Utility/Services/RemindService.cs
@@ -13,6 +13,7 @@
 using System.Collections.Generic;
 using System.Collections.Concurrent;
 using Discord.Net;
+using Microsoft.EntityFrameworkCore;

 namespace NadekoBot.Modules.Utility.Services
 {
@@ -103,8 +104,8 @@
             {
                 using (var uow = _db.UnitOfWork)
                 {
-                    uow.Reminders.Remove(r);
-                    await uow.CompleteAsync();
+                    uow._context.Database.ExecuteSqlCommand($"DELETE FROM Reminders WHERE Id={r.Id};");
+                    uow.Complete();
                 }
                 RemoveReminder(r.Id);
             }


The anti-triggered edit 3: This time it's China

--- NadekoBot/Modules/Translator/Helpers/GoogleTranslator.cs
+++ NadekoBot/Modules/Translator/Helpers/GoogleTranslator.cs
@@ -101,6 +101,7 @@
                     { "catalan", "ca"},
                     { "chinese-traditional", "zh-TW"},
                     { "chinese-simplified", "zh-CN"},
+                    { "chinese", "zh-CN"},
                     { "croatian", "hr"},
                     { "czech", "cs"},
                     { "danish", "da"},


Fix...

Fix...

--- OpenSim/Region/Framework/Scenes/Components/IComponent.cs
+++ OpenSim/Region/Framework/Scenes/Components/IComponent.cs
@@ -48,7 +48,7 @@
         /// </summary>
         /// <param name="obj">The object to get the value from</param>
         /// <returns></returns>
-        OSD GetState (UUID obj, bool copyComponent = false);
+        OSD GetState (UUID obj, bool copyComponent);

         /// <summary>
         /// A representation of the current state of the Component


License text

License text

--- PART/Source/Core/Engine.Tests/UpdateDatabasePartTests.cs
+++ PART/Source/Core/Engine.Tests/UpdateDatabasePartTests.cs
@@ -1,4 +1,50 @@
-using System;
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS"basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The CPR Broker concept was initally developed by
+ * Gentofte Kommune / Municipality of Gentofte, Denmark.
+ * Contributor(s):
+ * Steen Deth
+ *
+ *
+ * The Initial Code for CPR Broker and related components is made in
+ * cooperation between Magenta, Gentofte Kommune and IT- og Telestyrelsen /
+ * Danish National IT and Telecom Agency
+ *
+ * Contributor(s):
+ * Beemen Beshara
+ * Niels Elgaard Larsen
+ * Leif Lodahl
+ * Steen Deth
+ *
+ * The code is currently governed by IT- og Telestyrelsen / Danish National
+ * IT and Telecom Agency
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -154,8 +200,8 @@
                     oio.SourceObjectsXml = Utilities.CreateFakePerson(true).SourceObjectsXml;
                     var newRet = CprBroker.Engine.Local.UpdateDatabase.MergePersonRegistration(pId, oio);
                     Assert.True(newRet);
-
-                    var dbPersons = dataContext.PersonRegistrations.Where(pr => pr.UUID == pId.UUID).OrderBy(p=>p.BrokerUpdateDate).ToArray();
+
+                    var dbPersons = dataContext.PersonRegistrations.Where(pr => pr.UUID == pId.UUID).OrderBy(p => p.BrokerUpdateDate).ToArray();
                     Assert.AreEqual(2, dbPersons.Length);

                     var tmpElement = System.Xml.Linq.XElement.Parse(oio.SourceObjectsXml);


Mark out scanner & camera acquisition on Mono, until we have that ability on Linux.

--- PalasoUIWindowsForms/ImageToolbox/ImageToolboxControl.cs
+++ PalasoUIWindowsForms/ImageToolbox/ImageToolboxControl.cs
@@ -34,8 +34,11 @@

 			AddControl("From File", ImageToolboxButtons.browse, "browse", getImageGroup, (x) => new GetImageFromFileSystemControl());
+#if !MONO
+
 			AddControl("From Scan", ImageToolboxButtons.scanner, "scanner", getImageGroup, (x) => new DeviceAcquire(ImageAcquisitionService.DeviceKind.Scanner));
 			AddControl("From Camera", ImageToolboxButtons.scanner, "camera", getImageGroup, (x) => new DeviceAcquire(ImageAcquisitionService.DeviceKind.Camera));
+#endif
 			AddControl("From Gallery", ImageToolboxButtons.searchFolder, "gallery", getImageGroup, (x) => new ArtOfReadingChooser(string.Empty));
 			AddControl("Crop",  ImageToolboxButtons.crop, "crop", editImageGroup, (x) => new ImageCropper());
 			AddControl("Credits", ImageToolboxButtons.credits, "credits", otherGroup, (x) => new ImageCreditsControl());


Don't fail when a nested proxy's type is specified in xml

--- Rock.Core/Serialization/XmlDeserializationProxyEngine.cs
+++ Rock.Core/Serialization/XmlDeserializationProxyEngine.cs
@@ -467,8 +467,15 @@

                         if (typeFromAttribute != null)
                         {
-                            serializer = new XmlSerializer(typeFromAttribute,
-                                new XmlRootAttribute(additionalElement.Name.LocalName));
+                            try
+                            {
+                                serializer = new XmlSerializer(typeFromAttribute,
+                                    new XmlRootAttribute(additionalElement.Name.LocalName));
+                            }
+                            catch (InvalidOperationException)
+                            {
+                                serializer = null;
+                            }
                         }
                     }


to-do's

to-do's

--- Source/HtmlRenderer.PdfSharp/Adapters/GraphicsAdapter.cs
+++ Source/HtmlRenderer.PdfSharp/Adapters/GraphicsAdapter.cs
@@ -75,12 +75,12 @@

         public override void SetClipReplace(RRect rect)
         {
-
+            // TODO:a handle clip (maybe api need to be changed)
         }

         public override void SetClipExclude(RRect rect)
         {
-
+            // TODO:a handle clip (maybe api need to be changed)
         }

         public override Object SetAntiAliasSmoothingMode()


very small redundancy fix

very small redundancy fix

--- SteamMaster/GameRank/GameRankCore/GRCalculateGameRank.cs
+++ SteamMaster/GameRank/GameRankCore/GRCalculateGameRank.cs
@@ -39,7 +39,6 @@
             {
                 Tags[entry.Key].GameRank = entry.Value;
             }
-            UpdateGameRanks();
         }

         #endregion


update annotation

update annotation

update annotation

--- UartOscilloscope/Form1.cs
+++ UartOscilloscope/Form1.cs
@@ -1135,8 +1135,8 @@
 		public static Queue<int> Data_Graphic_Queue_Y;                          //  宣告Y通道資料繪圖用整數型態佇列Data_Graphic_Queue_Y
 		public static Queue<int> Data_Graphic_Queue_Z;                          //  宣告Z通道資料繪圖用整數型態佇列Data_Graphic_Queue_Z
 	}                                                                           //  結束Oscilloscope_function_variable類別
-	public class ErrorCode_message                                             //  宣告ErrorCode_message類別
-	{                                                                           //  進入ErrorCode_message類別
+	public class ErrorCode_message												//	宣告ErrorCode_message類別
+	{																			//	進入ErrorCode_message類別
 		private struct Error_message_struct                                     //  宣告Error_message_struct結構
 		{
 			public string Error_Message;                                        //  宣告Error_Message(錯誤訊息)字串
@@ -1203,7 +1203,7 @@
 					break;
 			}                                                                   //  結束switch敘述
 		}                                                                       //  結束Error_Message_Show副程式
-	}                                                                           //  結束ErrorCode_message類別
+	}																			//	結束ErrorCode_message類別
 	//-----例外狀況處理-----
 	public class IOException : SystemException
 	{


Fixed external diff path.

Fixed external diff path.

--- Versionr/Commands/Diff.cs
+++ Versionr/Commands/Diff.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -137,7 +138,7 @@
                                     bool nonblocking = Workspace.Directives.NonBlockingDiff.HasValue && Workspace.Directives.NonBlockingDiff.Value;
                                     var t = Utilities.LimitedTaskDispatcher.Factory.StartNew(() =>
                                     {
-                                        var diffResult = Utilities.DiffTool.Diff(tmp, x.Name + "-base", Workspace.GetLocalCanonicalName(x.VersionControlRecord), x.Name, ws.Directives.ExternalDiff, nonblocking);
+                                        var diffResult = Utilities.DiffTool.Diff(tmp, x.Name + "-base", Path.Combine(Workspace.RootDirectory.FullName, Workspace.GetLocalCanonicalName(x.VersionControlRecord)), x.Name, ws.Directives.ExternalDiff, nonblocking);
                                         if (diffResult != null)
                                         {
                                             lock (diffProcesses)


Fix nth selectors with negative factor

Fix nth selectors with negative factor

--- XamlCSS/NthMatcherBase.cs
+++ XamlCSS/NthMatcherBase.cs
@@ -5,7 +5,7 @@
 {
     public abstract class NthMatcherBase : SelectorMatcher
     {
-        private static Regex nthRegex = new Regex(@"((?<factor>[0-9]+)?(?<n>n))?(?<distance>([\+\-]?[0-9]+))?");
+        private static Regex nthRegex = new Regex(@"((?<factor>[\-0-9]+)?(?<n>n))?(?<distance>([\+\-]?[0-9]+))?");

         protected int factor;
         protected int distance;
@@ -24,9 +24,21 @@
         {
             thisPosition = thisPosition - distance;

-            if (thisPosition < 0)
+            if (factor >= 0)
             {
-                return false;
+                if (thisPosition < 0)
+                {
+                    return false;
+                }
+            }
+            else
+            {
+                if (thisPosition > 0)
+                {
+                    return false;
+                }
+                thisPosition *= -1;
+                factor *= -1;
             }

             return (factor != 0 ? thisPosition % factor : thisPosition) == 0;
@@ -55,7 +67,15 @@
             {
                 var matchResult = nthRegex.Match(expression);

-                int.TryParse(matchResult.Groups["factor"]?.Value ?? "", out factor);
+                if (matchResult.Groups["factor"]?.Value == "-")
+                {
+                    factor = -1;
+                }
+                else
+                {
+                    int.TryParse(matchResult.Groups["factor"]?.Value ?? "", out factor);
+                }
+
                 int.TryParse(matchResult.Groups["distance"]?.Value ?? "", out distance);

                 if (factor == 0 &&


CA-109243: Offer to license a host when joining a pool that is licensed
with a per-socket licence (minor code refactoring).

Signed-off-by: Mihaela Stoica <be95049f8e30d921fc7e2579c00c48bd84c40606@citrix.com>

--- XenModel/PoolJoinRules.cs
+++ XenModel/PoolJoinRules.cs
@@ -391,13 +391,8 @@
                 return false;

             // Is using per socket generation licenses?
-            if (Helpers.ClearwaterOrGreater(slave) && Helpers.ClearwaterOrGreater(master) &&
-                slave.IsFreeLicense() && !master.IsFreeLicense())
-            {
-                if (allowLicenseUpgrade)
-                    return false;
-                return true;
-            }
+            if (Helpers.ClearwaterOrGreater(slave) && Helpers.ClearwaterOrGreater(master))
+                return slave.IsFreeLicense() && !master.IsFreeLicense() && !allowLicenseUpgrade;

             if (slave.IsFloodgateOrLater() && master.IsFloodgateOrLater() &&
                 Host.RestrictHAFloodgate(slave) && !Host.RestrictHAFloodgate(master))


fix serializing of enu,ms

fix serializing of enu,ms

--- Tests.Integration.Presentation.Web/Tools/AdviceHelper.cs
+++ Tests.Integration.Presentation.Web/Tools/AdviceHelper.cs
@@ -12,18 +12,23 @@
         {
             var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin);

-            var recipients = advice.Reciepients.Select(x => new { Name = x.Name, RecpientType = x.RecpientType.ToString(), RecieverType = x.RecieverType.ToString() });
+            var recipients = advice.Reciepients.Select(x => new
+            {
+                Name = x.Name,
+                RecpientType = x.RecpientType.ToString(),
+                RecieverType = x.RecieverType.ToString()
+            }).ToList();

             var body = new
             {
                 RelationId = advice.RelationId,
-                Type = advice.Type,
+                Type = advice.Type.ToString(),
                 Scheduling = advice.Scheduling?.ToString(),
                 Subject = advice.Subject,
                 Body = advice.Body,
                 AlarmDate = advice.AlarmDate?.ToString(HttpApi.OdataDateTimeFormat),
                 Reciepients = recipients,
-                AdviceType = advice.AdviceType.ToString(),
+                AdviceType = advice.AdviceType.ToString("D"),
                 StopDate = advice.StopDate?.ToString(HttpApi.OdataDateTimeFormat)
             };


Added test for loading and storing three byte structs

--- Tests/Kernels/Cosmos.Compiler.Tests.TypeSystem/Kernel.cs
+++ Tests/Kernels/Cosmos.Compiler.Tests.TypeSystem/Kernel.cs
@@ -38,6 +38,13 @@
                 Assert.IsTrue(xEnumerable is IEnumerable, "isinst isn't working for interfaces on generic reference types!");
                 Assert.IsTrue(xEnumerable is IList<string>, "isinst isn't working for generic interfaces on generic reference types!");

+                ThreeBytes[] array = new ThreeBytes[1];
+                array[0] = new ThreeBytes(17, 254, 77);
+                Assert.AreEqual(array[0].A, 17, "Three byte struct in array first value read correctly");
+                Assert.AreEqual(array[0].B, 254, "Three byte struct in array second value read correctly");
+                var local = array[0];
+                Assert.AreEqual(local.C, 77, "Three byte struct third value read correctly");
+
                 TestController.Completed();
             }
             catch (Exception e)
@@ -52,4 +59,18 @@
             }
         }
     }
+
+    public struct ThreeBytes
+    {
+        public byte A;
+        public byte B;
+        public byte C;
+
+        public ThreeBytes(byte a, byte b, byte c)
+        {
+            A = a;
+            B = b;
+            C = c;
+        }
+    }
 }


Fix AppShell Setup

Fix AppShell Setup

--- samples/AppStudio.Uwp.Samples/AppShell.xaml.cs
+++ samples/AppStudio.Uwp.Samples/AppShell.xaml.cs
@@ -46,11 +46,11 @@
                 yield return new NavigationItem(Symbol.Home, this.GetResourceString("ShellMenuHome"), (ni) => NavigationService.NavigateToRoot()) { ClearSelection = true };
                 yield return NavigationItem.Separator;

-                yield return new NavigationItem(new Uri("ms-appx:///Assets/Icons/IconLayouts.png"), this.GetResourceString("ShellMenuLayoutControls"), GetControlsByCategory("LayoutControls"), this.GetCategoryBackground("LayoutControls"));
-                yield return new NavigationItem(new Uri("ms-appx:///Assets/Icons/IconFoundation.png"), this.GetResourceString("ShellMenuFoundationControls"), GetControlsByCategory("FoundationControls"), this.GetCategoryBackground("FoundationControls"));
-                yield return new NavigationItem(new Uri("ms-appx:///Assets/Icons/IconAppServices.png"), this.GetResourceString("ShellMenuAppServices"), GetControlsByCategory("AppServices"), this.GetCategoryBackground("AppServices"));
-                yield return new NavigationItem(new Uri("ms-appx:///Assets/Icons/IconUtilities.png"), this.GetResourceString("ShellMenuUtilities"), GetControlsByCategory("Utilities"), this.GetCategoryBackground("Utilities"));
-                yield return new NavigationItem(new Uri("ms-appx:///Assets/Icons/IconDataProviders.png"), this.GetResourceString("ShellMenuDataProviders"), GetControlsByCategory("DataProviders"), this.GetCategoryBackground("DataProviders"));
+                yield return new NavigationItem(new Uri("ms-appx:///Assets/Icons/IconLayouts.png"), this.GetResourceString("ShellMenuLayoutControls"), GetControlsByCategory("LayoutControls"), this.GetCategoryBackground("LayoutControls"), this.GetCategoryBackground("LayoutControls"));
+                yield return new NavigationItem(new Uri("ms-appx:///Assets/Icons/IconFoundation.png"), this.GetResourceString("ShellMenuFoundationControls"), GetControlsByCategory("FoundationControls"), this.GetCategoryBackground("FoundationControls"), this.GetCategoryBackground("FoundationControls"));
+                yield return new NavigationItem(new Uri("ms-appx:///Assets/Icons/IconAppServices.png"), this.GetResourceString("ShellMenuAppServices"), GetControlsByCategory("AppServices"), this.GetCategoryBackground("AppServices"), this.GetCategoryBackground("AppServices"));
+                yield return new NavigationItem(new Uri("ms-appx:///Assets/Icons/IconUtilities.png"), this.GetResourceString("ShellMenuUtilities"), GetControlsByCategory("Utilities"), this.GetCategoryBackground("Utilities"), this.GetCategoryBackground("Utilities"));
+                yield return new NavigationItem(new Uri("ms-appx:///Assets/Icons/IconDataProviders.png"), this.GetResourceString("ShellMenuDataProviders"), GetControlsByCategory("DataProviders"), this.GetCategoryBackground("DataProviders"), this.GetCategoryBackground("DataProviders"));

                 yield return NavigationItem.Separator;
                 yield return new NavigationItem(new Uri("ms-appx:///Assets/Icons/about.png"), "About", new About()) { ClearSelection = true };


Remove extra paranthese that probably came from outer space

--- sar-opal-base/Assets/scripts/GestureManager.cs
+++ sar-opal-base/Assets/scripts/GestureManager.cs
@@ -234,7 +234,7 @@
             {
                 // Send the highlight to the position of the dragged object so it
                 // shows up in the right place.
-                LightOn(1, this.mostRecentlyDraggedGO.transform.position));
+                LightOn(1, this.mostRecentlyDraggedGO.transform.position);

                 if (this.mostRecentlyDraggedGO.transform.position.x
                         < this.cameraRect.xMin


Remove usage of dynamic in command bus

Remove usage of dynamic in command bus

--- Source/EventFlow/CommandBus.cs
+++ Source/EventFlow/CommandBus.cs
@@ -138,9 +138,8 @@
                 command.SourceId,
                 async (a, c) =>
                     {
-                        var task = commandExecutionDetails.Invoker(commandHandler, a, command, c);
-                        await task.ConfigureAwait(false);
-                        return (TResult) ((dynamic) task).Result;
+                        var task = (Task<TResult>) commandExecutionDetails.Invoker(commandHandler, a, command, c);
+                        return await task.ConfigureAwait(false);
                     },
                 cancellationToken)
                 .ConfigureAwait(false);


More info can be found in vents_c now, stop crashing for now vr/vr_command_room.vpk in dota forced this

--- ValveResourceFormat/Resource/ResourceTypes/EntityLump.cs
+++ ValveResourceFormat/Resource/ResourceTypes/EntityLump.cs
@@ -36,11 +36,16 @@
                 {
                     var a = dataReader.ReadUInt32(); // always 1?
                     var valuesCount = dataReader.ReadUInt32();
-                    var c = dataReader.ReadUInt32(); // always 0?
+                    var c = dataReader.ReadUInt32(); // always 0? (Its been seen to be 1, footer count?)

                     var values = new List<Tuple<uint, uint, object>>();
                     while (dataStream.Position != dataStream.Length)
                     {
+                        if (values.Count == valuesCount)
+                        {
+                            Console.WriteLine("We hit our values target without reading every byte?!");
+                            break;
+                        }
                         var miscType = dataReader.ReadUInt32(); //Stuff before type, some pointer?
                         var type = dataReader.ReadUInt32();
                         switch (type)


Added support for enclosing strings in spaces

--- Source/Parser/CommandParser.cs
+++ Source/Parser/CommandParser.cs
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using System.Text.RegularExpressions;

 namespace Pyratron.Frameworks.Commands.Parser
 {
@@ -129,8 +130,11 @@
                 return;

             //Now we are ready to go
-            //Split the string into command
-            var inputArgs = input.Split(' ').ToList();
+            //Split the string into command, ignoring spaces between quotes
+            var inputArgs = Regex.Matches(input, @"[\""].+?[\""]|[^ ]+")
+                .Cast<Match>()
+                .Select(m => m.Value)
+                .ToList();

             //Search the commands for a matching comArgs
             var commands = Commands.Where(cmd => cmd.Aliases.Any(alias => alias.Equals(inputArgs[0])));


Refactored WWCP AuthenticationMode

Refactored WWCP AuthenticationMode

--- WWCP_Core/Entities/ChargingStation/AuthenticationMode.cs
+++ WWCP_Core/Entities/ChargingStation/AuthenticationMode.cs
@@ -39,7 +39,9 @@

     }

-    public class AuthenticationMode
+    public class AuthenticationMode : IEquatable<AuthenticationMode>,
+                                      IComparable<AuthenticationMode>,
+                                      IComparable
     {

         #region Properties
@@ -144,11 +146,118 @@
         }

+
+
+
+        #region IComparable<AuthenticationMode> Members
+
+        #region CompareTo(Object)
+
+        /// <summary>
+        /// Compares two instances of this object.
+        /// </summary>
+        /// <param name="Object">An object to compare with.</param>
+        public Int32 CompareTo(Object Object)
+        {
+
+            if (Object == null)
+                throw new ArgumentNullException("The given object must not be null!");
+
+            // Check if the given object is an authentication mode.
+            var AuthenticationMode = Object as AuthenticationMode;
+            if ((Object) AuthenticationMode == null)
+                throw new ArgumentException("The given object is not an authentication mode!");
+
+            return CompareTo(AuthenticationMode);
+
+        }
+
+        #endregion
+
+        #region CompareTo(AuthenticationMode)
+
+        /// <summary>
+        /// Compares two instances of this object.
+        /// </summary>
+        /// <param name="AuthenticationMode">An authentication mode to compare with.</param>
+        public Int32 CompareTo(AuthenticationMode AuthenticationMode)
+        {
+
+            if ((Object) AuthenticationMode == null)
+                throw new ArgumentNullException("The given authentication mode must not be null!");
+
+            return _Type.CompareTo(AuthenticationMode._Type);
+
+        }
+
+        #endregion
+
+        #endregion
+
+        #region IEquatable<AuthenticationMode> Members
+
+        #region Equals(Object)
+
+        /// <summary>
+        /// Compares two instances of this object.
+        /// </summary>
+        /// <param name="Object">An object to compare with.</param>
+        /// <returns>true|false</returns>
+        public override Boolean Equals(Object Object)
+        {
+
+            if (Object == null)
+                return false;
+
+            // Check if the given object is an authentication mode.
+            var AuthenticationMode = Object as AuthenticationMode;
+            if ((Object) AuthenticationMode == null)
+                return false;
+
+            return this.Equals(AuthenticationMode);
+
+        }
+
+        #endregion
+
+        #region Equals(AuthenticationMode)
+
+        /// <summary>
+        /// Compares two EVSEs for equality.
+        /// </summary>
+        /// <param name="AuthenticationMode">An authentication mode to compare with.</param>
+        /// <returns>True if both match; False otherwise.</returns>
+        public Boolean Equals(AuthenticationMode AuthenticationMode)
+        {
+
+            if ((Object) AuthenticationMode == null)
+                return false;
+
+            return _Type.Equals(AuthenticationMode._Type);
+
+        }
+
+        #endregion
+
+        #endregion
+
+        #region GetHashCode()
+
+        /// <summary>
+        /// Get the hashcode of this object.
+        /// </summary>
+        public override Int32 GetHashCode()
+        {
+            return _Type.GetHashCode();
+        }
+
+        #endregion
+
+
         public virtual JObject ToJSON()
         {
             return new JObject(new JProperty("Type", _Type));
         }
-

         public override String ToString()
         {


Rename

Rename

--- WalletWasabi.Fluent/ViewModels/NavBar/NavBarViewModel.cs
+++ WalletWasabi.Fluent/ViewModels/NavBar/NavBarViewModel.cs
@@ -49,7 +49,7 @@

 			this.WhenAnyValue(x => x.SelectedItem)
 				.OfType<NavBarItemViewModel>()
-				.Subscribe(NavigateToItem);
+				.Subscribe(NavigateItem);

 			Observable.FromEventPattern(Router.NavigationStack, nameof(Router.NavigationStack.CollectionChanged))
 				.ObserveOn(RxApp.MainThreadScheduler)
@@ -165,7 +165,7 @@
 			}
 		}

-		private void NavigateToItem(NavBarItemViewModel item)
+		private void NavigateItem(NavBarItemViewModel item)
 		{
 			if (!_isNavigating)
 			{


Check the content type of response

Check the content type of response

--- WalletWasabi/Extensions/HttpResponseMessageExtensions.cs
+++ WalletWasabi/Extensions/HttpResponseMessageExtensions.cs
@@ -90,7 +90,10 @@
 			string error = null;
 			try
 			{
-				error = await me.Content.ReadAsJsonAsync<string>().ConfigureAwait(false);
+				if (me.Content.Headers?.ContentType?.MediaType != "text/html")
+				{
+					error = await me.Content.ReadAsJsonAsync<string>().ConfigureAwait(false);
+				}
 			}
 			catch (Exception ex)
 			{


remove second winners action

remove second winners action

--- Web/Areas/Procurement/Controllers/FetchDataController.cs
+++ Web/Areas/Procurement/Controllers/FetchDataController.cs
@@ -177,14 +177,7 @@
             return Json(groupedwinners, JsonRequestBehavior.AllowGet);
         }

-        public JsonResult SecondWinners([DataSourceRequest]DataSourceRequest request)
-        {
-            var recentBids =
-                _bidService.FindBy(t => t.StatusID == 5).OrderByDescending(t => t.OpeningDate).Take(10).ToList();
-            var recentBidViewModels = BindBidViewModels(recentBids);
-            return Json(recentBidViewModels, JsonRequestBehavior.AllowGet);
-        }
-
+
         public JsonResult Woredaswithoutoffer([DataSourceRequest]DataSourceRequest request)
         {
             var recentBids =


[Shared] Fix max speed being unset.

[Shared] Fix max speed being unset.

--- XamarinApp/MyTrips/MyTrips/ViewModel/ProfileViewModel.cs
+++ XamarinApp/MyTrips/MyTrips/ViewModel/ProfileViewModel.cs
@@ -56,6 +56,7 @@
                     TotalTime = currentUser.TotalTime;
                     TotalTrips = currentUser.TotalTrips;
                     FuelUsed = currentUser.FuelConsumption;
+					MaxSpeed = currentUser.MaxSpeed;
 #if DEBUG
                     DrivingSkills = 86;
 #else
@@ -108,7 +109,7 @@

         public double DistanceConverted => (Settings.Current.MetricDistance ? (TotalDistance * 1.60934) : TotalDistance);

-        public string SpeedUnits => Settings.MetricUnits ? "km/h" : "mph";
+		public string SpeedUnits => Settings.MetricDistance ? "km/h" : "mph";

         public double MaxSpeedConverted => Settings.MetricDistance ? MaxSpeed : MaxSpeed * 0.621371;


Fix for PR

Fix for PR

--- Assets/MixedRealityToolkit/Utilities/CoreServices.cs
+++ Assets/MixedRealityToolkit/Utilities/CoreServices.cs
@@ -138,10 +138,9 @@
             else
             {
                 T service;
-                MixedRealityServiceRegistry.TryGetService<T>(out service);
-                if (service == null)
+                if (!MixedRealityServiceRegistry.TryGetService(out service))
                 {
-                    return service;
+                    return default(T);
                 }

                 serviceCache.Add(typeof(T), service as IMixedRealityService);


Fix cart table widths

Fix cart table widths

--- BTCPayServer/Views/AppsPublic/ViewPointOfSale.cshtml
+++ BTCPayServer/Views/AppsPublic/ViewPointOfSale.cshtml
@@ -40,11 +40,11 @@


expanded try block in FetchProfile

expanded try block in FetchProfile

--- StatsFetcher/ProfileFetcher.cs
+++ StatsFetcher/ProfileFetcher.cs
@@ -50,11 +50,11 @@

         private async Task FetchBasicProfile(PlayerProfile p)
         {
-            var url = $"https://www.hotslogs.com/API/Players/{(int)game.Region}/{p.BattleTag.Replace('#', '_')}?utm_source=HotsStats&utm_medium=api";
-            var str = await web.GetStringAsync(url);
-            if (string.IsNullOrWhiteSpace(str) || str == "null")
-                return;
             try {
+                var url = $"https://www.hotslogs.com/API/Players/{(int)game.Region}/{p.BattleTag.Replace('#', '_')}?utm_source=HotsStats&utm_medium=api";
+                var str = await web.GetStringAsync(url);
+                if (string.IsNullOrWhiteSpace(str) || str == "null")
+                    return;
                 dynamic json = JObject.Parse(str);
                 p.HotslogsId = json.PlayerID;
                 foreach (var r in json.LeaderboardRankings) {


Added 'classid' and 'url' to GenericInventory.ItemDescription

--- SteamTrade/GenericInventory.cs
+++ SteamTrade/GenericInventory.cs
@@ -8,7 +8,7 @@

 namespace SteamTrade
 {
-
+
     /// <summary>
     /// Generic Steam Backpack Interface
     /// </summary>
@@ -18,7 +18,7 @@
         {
             get
             {
-                if(_loadTask == null)
+                if (_loadTask == null)
                     return null;
                 _loadTask.Wait();
                 return _items;
@@ -29,7 +29,7 @@
         {
             get
             {
-                if(_loadTask == null)
+                if (_loadTask == null)
                     return null;
                 _loadTask.Wait();
                 return _descriptions;
@@ -40,7 +40,7 @@
         {
             get
             {
-                if(_loadTask == null)
+                if (_loadTask == null)
                     return null;
                 _loadTask.Wait();
                 return _errors;
@@ -63,7 +63,7 @@

             public string descriptionid { get; private set; }

-            public override string  ToString()
+            public override string ToString()
             {
                 return string.Format("id:{0}, appid:{1}, contextid:{2}, amount:{3}, descriptionid:{4}",
                     assetid, appid, contextid, amount, descriptionid);
@@ -76,12 +76,14 @@
             public string type { get; set; }
             public bool tradable { get; set; }
             public bool marketable { get; set; }
-
-            public Dictionary<string, string> app_data{ get; set; }
+            public string url { get; set; }
+            public long classid { get; set; }
+
+            public Dictionary<string, string> app_data { get; set; }

             public void debug_app_data()
             {
-                Console.WriteLine("\n\""+name+"\"");
+                Console.WriteLine("\n\"" + name + "\"");
                 if (app_data == null)
                 {
                     Console.WriteLine("Doesn't have app_data");
@@ -90,7 +92,7 @@

                 foreach (var value in app_data)
                 {
-                    Console.WriteLine(string.Format("{0} = {1}",value.Key,value.Value));
+                    Console.WriteLine(string.Format("{0} = {1}", value.Key, value.Value));
                 }
                 Console.WriteLine("");
             }
@@ -98,7 +100,7 @@

         public ItemDescription getDescription(ulong id)
         {
-            if(_loadTask == null)
+            if (_loadTask == null)
                 return null;
             _loadTask.Wait();

@@ -108,7 +110,7 @@
             }
             catch (Exception e)
             {
-                Console.WriteLine(string.Format("ERROR: getDescription({0}) >> {1}",id,e.Message));
+                Console.WriteLine(string.Format("ERROR: getDescription({0}) >> {1}", id, e.ToString()));
                 return null;
             }
         }
@@ -131,7 +133,7 @@

             try
             {
-                foreach(long contextId in contextIds)
+                foreach (long contextId in contextIds)
                 {
                     string response = SteamWeb.Fetch(string.Format("http://steamcommunity.com/profiles/{0}/inventory/json/{1}/{2}/", steamid.ConvertToUInt64(), appid, contextId), "GET", null, null, true);
                     invResponse = JsonConvert.DeserializeObject(response);
@@ -164,28 +166,30 @@
                                 tmpAppData = new Dictionary<string, string>();
                                 foreach (var value in class_instance.app_data)
                                 {
-                                    tmpAppData.Add(""+value.Name,""+value.Value);
+                                    tmpAppData.Add("" + value.Name, "" + value.Value);
                                 }
                             }
                             else
                             {
-                                tmpAppData= null;
+                                tmpAppData = null;
                             }

-                            _descriptions.Add("" + (class_instance.classid??'0') + "_" + (class_instance.instanceid??'0'),
+                            _descriptions.Add("" + (class_instance.classid ?? '0') + "_" + (class_instance.instanceid ?? '0'),
                                 new ItemDescription()
-                                    {
-                                        name = class_instance.name,
-                                        type = class_instance.type,
-                                        marketable = (bool) class_instance.marketable,
-                                        tradable = (bool)class_instance.tradable,
-                                        app_data = tmpAppData
-                                    }
+                                {
+                                    name = class_instance.name,
+                                    type = class_instance.type,
+                                    marketable = (bool)class_instance.marketable,
+                                    tradable = (bool)class_instance.tradable,
+                                    classid = long.Parse((string)class_instance.classid),
+                                    url = (class_instance.actions != null && class_instance.actions.First["link"] != null ? class_instance.actions.First["link"] : ""),
+                                    app_data = tmpAppData
+                                }
                             );
                             break;
                         }
                     }
-
+
                 }//end for (contextId)
             }//end try
             catch (Exception e)


Add simple JSON endpoint for soldiers with access

Fixes #412

--- Battery-Commander.Web/Controllers/AdminController.cs
+++ Battery-Commander.Web/Controllers/AdminController.cs
@@ -1,9 +1,8 @@
 using BatteryCommander.Web.Models;
 using FluentScheduler;
-using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Mvc;
-using System;
-using System.IO;
+using System.Linq;
+using System.Threading.Tasks;

 namespace BatteryCommander.Web.Controllers
 {
@@ -38,10 +37,27 @@

             return File(data, mimeType);
         }
-
+
         public IActionResult Jobs()
         {
             return View(JobManager.AllSchedules);
         }
+
+        public async Task<IActionResult> Users()
+        {
+            var soldiers_with_access =
+                await db
+                .Soldiers
+                .Where(soldier => soldier.CanLogin)
+                .Select(soldier => new
+                {
+                    soldier.FirstName,
+                    soldier.LastName,
+                    soldier.CivilianEmail
+                })
+                .ToListAsync();
+
+            return Json(soldiers_with_access);
+        }
     }
 }


Don't handle culture in current version

Don't handle culture in current version

--- BigEgg.ConsoleExtension/Parameters/ParserSettings.cs
+++ BigEgg.ConsoleExtension/Parameters/ParserSettings.cs
@@ -37,17 +37,6 @@
         /// It is the caller's responsibility to dispose or close the <see cref="TextWriter"/>.
         /// </remarks>
         public TextWriter HelpWriter { get; private set; }
-
-        /// <summary>
-        /// Gets the culture used when parsing arguments to typed properties.
-        /// </summary>
-        /// <value>
-        /// The culture used when parsing arguments to typed properties.
-        /// </value>
-        /// <remarks>
-        /// Default is invariant culture, <see cref="System.Globalization.CultureInfo.InvariantCulture"/>.
-        /// </remarks>
-        public CultureInfo ParsingCulture { get; private set; }

         /// <summary>
         /// Gets a value indicating whether the parser shall ignore the given argument if it is an unknown arguments.
@@ -129,7 +118,6 @@
             public ParserSettingsBuilder WithDefault()
             {
                 instance.HelpWriter = Console.Error;
-                instance.ParsingCulture = CultureInfo.InvariantCulture;
                 instance.CaseSensitive = true;
                 instance.IgnoreUnknownArguments = true;
                 instance.MaximumDisplayWidth = Constants.DEFAULT_MAX_CONSOLE_LENGTH;
@@ -144,17 +132,6 @@
             {
                 if (helpWriter == null) { throw new ArgumentNullException("helpWriter"); }
                 instance.HelpWriter = helpWriter;
-                return this;
-            }
-
-            /// <summary>
-            /// Sets the culture used when parsing arguments to typed properties.
-            /// </summary>
-            /// <returns>The <see cref="ParserSettingsBuilder"/>.</returns>
-            public ParserSettingsBuilder ParsingCulture(CultureInfo parsingCulture)
-            {
-                if (parsingCulture == null) { throw new ArgumentNullException("parsingCulture"); }
-                instance.ParsingCulture = parsingCulture;
                 return this;
             }

@@ -207,7 +184,6 @@
             public ParserSettings Build()
             {
                 if (instance.HelpWriter == null) { throw new ArgumentNullException("HelpWriter"); }
-                if (instance.ParsingCulture == null) { throw new ArgumentNullException("ParsingCulture"); }
                 return instance;
             }
         }


Fix of not unsubscribing to characteristics on disconnect

--- BleLab/Services/CharacteristicSubscriptionService.cs
+++ BleLab/Services/CharacteristicSubscriptionService.cs
@@ -44,7 +44,7 @@
                 return;

             var deviceId = device.DeviceId;
-            var characteristics = _subscribedCharacteristics.Values.Where(t => t.Service.DeviceId == deviceId).ToList();
+            var characteristics = _subscribedCharacteristics.Values.Where(t => t.Service.Device.DeviceId == deviceId).ToList();

             foreach (var characteristic in characteristics)
             {


Added "Add Comments" button to Details View. Fixed bug in CreateCommnent  View : the Comment button leads to details know.

--- BlogProject/BlogProject/Views/Article/Details.cshtml
+++ BlogProject/BlogProject/Views/Article/Details.cshtml
@@ -1,5 +1,9 @@
-@model BlogProject.Models.Article
-@using Microsoft.AspNet.Identity
+@using Microsoft.AspNet.Identity
+@using PagedList;
+@using PagedList.Mvc;
+
+@model BlogProject.Models.Article
+
 @{
     ViewBag.Title = "Details";
 }
@@ -33,4 +37,22 @@

+
+

+@Html.ActionLink("Add Comment", "CreateComment", "Article", new { @id = Model.Id }, new { @class = "btn btn-primary btn-sm" })
+
Comments

+

+

+        @foreach (var comment in Model.Comments)
+        {
+

+
@comment.AutorName

+
@comment.Text

+

+        }
+

+

+@Html.PagedListPager(Model.Comments, page => Url.Action("Details", new { page }))
+
+


Edited DetailsView: I hid the Edit and Delete buttons for users with no authorization.

--- BlogProject/BlogProject/Views/Article/Details.cshtml
+++ BlogProject/BlogProject/Views/Article/Details.cshtml
@@ -1,5 +1,5 @@
 @model BlogProject.Models.Article
-
+@using Microsoft.AspNet.Identity
 @{
     ViewBag.Title = "Details";
 }
@@ -18,8 +18,11 @@
             --author @Model.Author.FullName
         </small>
         <footer class="pull-right">
-            @Html.ActionLink("Edit", "Edit", "Article", new { @id = Model.Id }, new { @class = "btn btn-success btn-xs" })
-            @Html.ActionLink("Delete", "Delete", "Article", new { @id = Model.Id }, new { @class = "btn btn-danger btn-xs" })
+            @if (User.Identity.IsAuthenticated && (User.IsInRole("Admin") || Model.IsAuthor(User.Identity.GetUserId()) ))
+            {
+                @Html.ActionLink("Edit", "Edit", "Article", new { @id = Model.Id }, new { @class = "btn btn-success btn-xs" })
+                @Html.ActionLink("Delete", "Delete", "Article", new { @id = Model.Id }, new { @class = "btn btn-danger btn-xs" })
+            }
             @Html.ActionLink("Back", "List", "Article", null, new { @class = "btn btn-default btn-xs" })
         </footer>
     </article>


fix layout on main layout

fix layout on main layout

--- Cats.Web.Adminstration/Views/Shared/_MainMenu.cshtml
+++ Cats.Web.Adminstration/Views/Shared/_MainMenu.cshtml
@@ -57,14 +57,14 @@

@Html.Translate("Unit")

@Html.Translate("Woredas by Donor")

-

+

cats

-
hub

-

+
hub

+

-
-
+
+

@@ -72,7 +72,7 @@

-

+

@@ -93,7 +93,7 @@

-

+


Fix take 2

Fix take 2

--- Core/System/Threading/Tasks/ITaskCompletionAction.cs
+++ Core/System/Threading/Tasks/ITaskCompletionAction.cs
@@ -108,8 +108,8 @@

             public void Invoke(Task completingTask)
             {
-                var tasks = _tasks;
-                if (tasks == null || completingTask == null)
+                var tasks = Interlocked.CompareExchange(ref _tasks, null, null);
+                if (tasks == null)
                 {
                     return;
                 }
@@ -133,15 +133,15 @@
                     Interlocked.Increment(ref _count);
                     if (awaitedTask.AddTaskContinuation(this, /*addBeforeOthers:*/ true))
                     {
-                        var tasks = _tasks;
+                        var tasks = Interlocked.CompareExchange(ref _tasks, null, null);
                         if (tasks == null)
                         {
                             return;
                         }
-                        var index = Array.IndexOf(_tasks, null);
-                        while (Interlocked.CompareExchange(ref _tasks[index], awaitedTask, null) != null)
-                        {
-                            index = (index + 1) % _tasks.Length;
+                        var index = Array.IndexOf(tasks, null);
+                        while (Interlocked.CompareExchange(ref tasks[index], awaitedTask, null) != null)
+                        {
+                            index = (index + 1) % tasks.Length;
                         }
                     }
                     else


Prevent duplicate recent items.

Prevent duplicate recent items.

--- Tabster/Controls/RecentList.cs
+++ Tabster/Controls/RecentList.cs
@@ -25,8 +25,37 @@

         private bool _hasClearButton;

+        private bool IsRecent(TabFile tab, out int index)
+        {
+            for (var i = 0; i < DropDownItems.Count; i++)
+            {
+                var item = DropDownItems[i] as ToolStripMenuItem;
+
+                if (item == null) //seperator
+                    break;
+
+                var path = item.ToolTipText;
+
+                if (tab.FileInfo.FullName.Equals(path, StringComparison.InvariantCultureIgnoreCase))
+                {
+                    index = i;
+                    return true;
+                }
+            }
+
+            index = 0;
+            return false;
+        }
+
         public void Add(TabFile tab, bool save = true)
         {
+            //check if it's already on the list
+            int existingIndex;
+            if (IsRecent(tab, out existingIndex))
+            {
+                DropDownItems.RemoveAt(existingIndex);
+            }
+
             var item = new ToolStripMenuItem(string.Format("{0} - {1}", tab.TabData.Artist, tab.TabData.Title)) {ToolTipText = tab.FileInfo.FullName};
             item.Click += item_clicked;
             ((ToolStripDropDownMenu) item.DropDown).ShowImageMargin = false;
@@ -35,7 +64,7 @@

             if (DropDownItems.Count == MaxItems)
             {
-                DropDownItems.RemoveAt(MaxItems);
+                DropDownItems.RemoveAt(MaxItems - 1);
             }

             Enabled = true;
@@ -80,6 +109,11 @@
                     var elem = doc.CreateElement("item");
                     elem.InnerText = menuItem.ToolTipText;
                     root.AppendChild(elem);
+                }
+
+                else
+                {
+                    break; //seperator
                 }
             }


Reduce packet queue timeout per client

Reduce packet queue timeout per client

--- TrueCraft/MultiplayerServer.cs
+++ TrueCraft/MultiplayerServer.cs
@@ -186,7 +186,7 @@
                 {
                     Console.WriteLine("Running update " + DateTime.Now);
                     var client = Clients[i] as RemoteClient;
-                    var sendTimeout = DateTime.Now.AddMilliseconds(200);
+                    var sendTimeout = DateTime.Now.AddMilliseconds(50);
                     while (client.PacketQueue.Count != 0 && DateTime.Now < sendTimeout)
                     {
                         idle = false;
@@ -225,7 +225,7 @@
                         Clients.RemoveAt(i);
                         break;
                     }
-                    var receiveTimeout = DateTime.Now.AddMilliseconds(200);
+                    var receiveTimeout = DateTime.Now.AddMilliseconds(50);
                     while (client.DataAvailable && DateTime.Now < receiveTimeout)
                     {
                         idle = false;


added parameter names for clarity

added parameter names for clarity

--- Uwp/UwpSample/MainPage.xaml.cs
+++ Uwp/UwpSample/MainPage.xaml.cs
@@ -31,12 +31,12 @@
             var webView = new UwpWebView(enableWindowsAuthentication: false);

             var options = new OidcClientOptions(
-                authority,
-                "native",
-                "secret",
-                "openid profile api offline_access",
-                WebAuthenticationBroker.GetCurrentApplicationCallbackUri().AbsoluteUri,
-                webView);
+                authority:    authority,
+                clientId:     "native",
+                clientSecret: "secret",
+                scope:        "openid profile api offline_access",
+                redirectUri:  WebAuthenticationBroker.GetCurrentApplicationCallbackUri().AbsoluteUri,
+                webView:      webView);

             var client = new OidcClient(options);
             var result = await client.LoginAsync();


[datatool] that's not quite right

[datatool] that's not quite right

--- DataTool/ToolLogic/Extract/ExtractHeroVoiceBetter.cs
+++ DataTool/ToolLogic/Extract/ExtractHeroVoiceBetter.cs
@@ -82,8 +82,8 @@
             new VoiceGroup { Name = "DeathCharged",    StimulusSetIds = new []{ "000000000022.078" } },
             new VoiceGroup { Name = "DeathExplosion",  StimulusSetIds = new []{ "00000000001E.078" } },
             new VoiceGroup { Name = "Stagger",         StimulusSetIds = new []{ "0000000000B7.078" } },
-            new VoiceGroup { Name = "Cough",           StimulusSetIds = new []{ "0000000000CD.078" } },
-            new VoiceGroup { Name = "Payload",         StimulusSetIds = new []{ "000000000027.078" } },
+            new VoiceGroup { Name = "Payload",         StimulusSetIds = new []{ "0000000000CD.078" } },
+            new VoiceGroup { Name = "Cough",           StimulusSetIds = new []{ "000000000027.078" } },
             new VoiceGroup { Name = "Damaged",         StimulusSetIds = new []{ "000000000283.078" } },
             new VoiceGroup { Name = "Electrocuted",    StimulusSetIds = new []{ "00000000012F.078" } },
             new VoiceGroup { Name = "Scream",          StimulusSetIds = new []{ "000000000113.078" } },


Removing DiplomataData inspector editor class

--- Diplomata/Editor/Inspector/DiplomataDataInspector.cs
+++ Diplomata/Editor/Inspector/DiplomataDataInspector.cs
@@ -1,18 +0,0 @@
-using System.Collections.Generic;
-using LavaLeak.Diplomata;
-using UnityEditor;
-using UnityEngine;
-
-namespace LavaLeak.Diplomata.Editor.Inspector
-{
-  [CustomEditor(typeof(DiplomataData))]
-  public class DiplomataManagerInspector : UnityEditor.Editor
-  {
-    public override void OnInspectorGUI()
-    {
-      EditorGUILayout.HelpBox("\nthis auto-generated file is a object to store all Diplomata data.\n\n" +
-        "The object instantiate just one time in the game build in the first scene it's appear. (It's a Singleton)\n\n" +
-        "The real data are stored in the resources folder, so don't worry if you need to delete this object during development.\n", MessageType.Info);
-    }
-  }
-}


deleted customscheduer

deleted customscheduer

--- Yasb.Common/CustomScheduler.cs
+++ Yasb.Common/CustomScheduler.cs
@@ -1,110 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Threading;
-using System.Collections.Concurrent;
-
-namespace Yasb.Common
-{
-    ///
-    /// Provides a task scheduler that ensures a maximum concurrency level while
-    /// running on top of the ThreadPool.
-    ///
-    public class LimitedConcurrencyLevelTaskScheduler : TaskScheduler
-    {
-        /// Whether the current thread is processing work items.
-        [ThreadStatic]
-        private static bool _currentThreadIsProcessingItems;
-        /// The list of tasks to be executed.
-        private readonly LinkedList<Task> _tasks = new LinkedList<Task>(); // protected by lock(_tasks)
-        /// The maximum concurrency level allowed by this scheduler.
-        private readonly int _maxDegreeOfParallelism;
-        /// Whether the scheduler is currently processing work items.
-        private int _delegatesQueuedOrRunning = 0; // protected by lock(_tasks)
-
-        ///
-        /// Initializes an instance of the LimitedConcurrencyLevelTaskScheduler class with the
-        /// specified degree of parallelism.
-        ///
-        /// <param name="maxDegreeOfParallelism">The maximum degree of parallelism provided by this scheduler.</param>
-        public LimitedConcurrencyLevelTaskScheduler(int maxDegreeOfParallelism)
-        {
-            if (maxDegreeOfParallelism < 1) throw new ArgumentOutOfRangeException("maxDegreeOfParallelism");
-            _maxDegreeOfParallelism = maxDegreeOfParallelism;
-        }
-
-        /// Queues a task to the scheduler.
-        /// <param name="task">The task to be queued.</param>
-        protected sealed override void QueueTask(Task task)
-        {
-            if (Interlocked.Increment(ref _delegatesQueuedOrRunning) <= _maxDegreeOfParallelism)
-            {
-                NotifyThreadPoolOfPendingWork(task);
-            }
-        }
-
-        ///
-        /// Informs the ThreadPool that there's work to be executed for this scheduler.
-        ///
-        private void NotifyThreadPoolOfPendingWork(Task task)
-        {
-            ThreadPool.UnsafeQueueUserWorkItem((state) =>
-            {
-                try
-                {
-                    var item = state as Task;
-                    // Execute the task we pulled out of the queue
-                    base.TryExecuteTask(item);
-                }
-                // We're done processing items on the current thread
-                finally { Interlocked.Decrement(ref _delegatesQueuedOrRunning); }
-            }, task);
-        }
-
-        /// Attempts to execute the specified task on the current thread.
-        /// <param name="task">The task to be executed.</param>
-        /// <param name="taskWasPreviouslyQueued"></param>
-        /// <returns>Whether the task could be executed on the current thread.</returns>
-        protected sealed override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued)
-        {
-            // If this thread isn't already processing a task, we don't support inlining
-            if (!_currentThreadIsProcessingItems) return false;
-
-            // If the task was previously queued, remove it from the queue
-            if (taskWasPreviouslyQueued) TryDequeue(task);
-
-            // Try to run the task.
-            return base.TryExecuteTask(task);
-        }
-
-        /// Attempts to remove a previously scheduled task from the scheduler.
-        /// <param name="task">The task to be removed.</param>
-        /// <returns>Whether the task could be found and removed.</returns>
-        protected sealed override bool TryDequeue(Task task)
-        {
-            lock (_tasks) return _tasks.Remove(task);
-        }
-
-        /// Gets the maximum concurrency level supported by this scheduler.
-        public sealed override int MaximumConcurrencyLevel { get { return _maxDegreeOfParallelism; } }
-
-        /// Gets an enumerable of the tasks currently scheduled on this scheduler.
-        /// <returns>An enumerable of the tasks currently scheduled.</returns>
-        protected sealed override IEnumerable<Task> GetScheduledTasks()
-        {
-            bool lockTaken = false;
-            try
-            {
-                Monitor.TryEnter(_tasks, ref lockTaken);
-                if (lockTaken) return _tasks.ToArray();
-                else throw new NotSupportedException();
-            }
-            finally
-            {
-                if (lockTaken) Monitor.Exit(_tasks);
-            }
-        }
-    }
-}


Make stash grid resizable

Make stash grid resizable

--- Yeena/UI/StashForm.Designer.cs
+++ Yeena/UI/StashForm.Designer.cs
@@ -37,23 +37,26 @@
             this.toolStrip1 = new System.Windows.Forms.ToolStrip();
             this.lblLeague = new System.Windows.Forms.ToolStripLabel();
             this.cboLeague = new System.Windows.Forms.ToolStripComboBox();
-            this.tabControl1 = new System.Windows.Forms.TabControl();
-            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
-            this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
-            this.recipeSelector1 = new Yeena.UI.Controls.RecipeSelector();
-            this.dataGridView1 = new System.Windows.Forms.DataGridView();
             this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
             this.removeFromStashToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.btnTabs = new System.Windows.Forms.Button();
             this.statusStrip1 = new System.Windows.Forms.StatusStrip();
             this.lblStatus = new System.Windows.Forms.ToolStripStatusLabel();
+            this.splitContainer1 = new System.Windows.Forms.SplitContainer();
+            this.tabControl1 = new System.Windows.Forms.TabControl();
+            this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+            this.dataGridView1 = new System.Windows.Forms.DataGridView();
+            this.btnTabs = new System.Windows.Forms.Button();
+            this.recipeSelector1 = new Yeena.UI.Controls.RecipeSelector();
             this.menuStrip1.SuspendLayout();
             this.toolStrip1.SuspendLayout();
-            this.tableLayoutPanel1.SuspendLayout();
+            this.contextMenuStrip1.SuspendLayout();
+            this.statusStrip1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
+            this.splitContainer1.Panel1.SuspendLayout();
+            this.splitContainer1.Panel2.SuspendLayout();
+            this.splitContainer1.SuspendLayout();
             this.tableLayoutPanel2.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
-            this.contextMenuStrip1.SuspendLayout();
-            this.statusStrip1.SuspendLayout();
             this.SuspendLayout();
             //
             // menuStrip1
@@ -167,31 +170,63 @@
             this.cboLeague.Text = "Default";
             this.cboLeague.SelectedIndexChanged += new System.EventHandler(this.cboLeague_SelectedIndexChanged);
             //
+            // contextMenuStrip1
+            //
+            this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.removeFromStashToolStripMenuItem});
+            this.contextMenuStrip1.Name = "contextMenuStrip1";
+            this.contextMenuStrip1.Size = new System.Drawing.Size(171, 26);
+            //
+            // removeFromStashToolStripMenuItem
+            //
+            this.removeFromStashToolStripMenuItem.Name = "removeFromStashToolStripMenuItem";
+            this.removeFromStashToolStripMenuItem.Size = new System.Drawing.Size(170, 22);
+            this.removeFromStashToolStripMenuItem.Text = "Remove From Stash";
+            this.removeFromStashToolStripMenuItem.Click += new System.EventHandler(this.removeFromStashToolStripMenuItem_Click);
+            //
+            // statusStrip1
+            //
+            this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.lblStatus});
+            this.statusStrip1.Location = new System.Drawing.Point(0, 493);
+            this.statusStrip1.Name = "statusStrip1";
+            this.statusStrip1.Size = new System.Drawing.Size(794, 22);
+            this.statusStrip1.TabIndex = 1;
+            this.statusStrip1.Text = "statusStrip1";
+            //
+            // lblStatus
+            //
+            this.lblStatus.Name = "lblStatus";
+            this.lblStatus.Size = new System.Drawing.Size(38, 17);
+            this.lblStatus.Text = "Status";
+            //
+            // splitContainer1
+            //
+            this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.splitContainer1.Location = new System.Drawing.Point(0, 49);
+            this.splitContainer1.Name = "splitContainer1";
+            //
+            // splitContainer1.Panel1
+            //
+            this.splitContainer1.Panel1.Controls.Add(this.tabControl1);
+            //
+            // splitContainer1.Panel2
+            //
+            this.splitContainer1.Panel2.Controls.Add(this.tableLayoutPanel2);
+            this.splitContainer1.Size = new System.Drawing.Size(794, 444);
+            this.splitContainer1.SplitterDistance = 444;
+            this.splitContainer1.TabIndex = 6;
+            //
             // tabControl1
             //
             this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.tabControl1.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed;
-            this.tabControl1.Location = new System.Drawing.Point(3, 3);
+            this.tabControl1.Location = new System.Drawing.Point(0, 0);
             this.tabControl1.Name = "tabControl1";
             this.tabControl1.SelectedIndex = 0;
-            this.tabControl1.Size = new System.Drawing.Size(438, 438);
-            this.tabControl1.TabIndex = 1;
+            this.tabControl1.Size = new System.Drawing.Size(444, 444);
+            this.tabControl1.TabIndex = 2;
             this.tabControl1.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.tabControl1_DrawItem);
-            //
-            // tableLayoutPanel1
-            //
-            this.tableLayoutPanel1.ColumnCount = 2;
-            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
-            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
-            this.tableLayoutPanel1.Controls.Add(this.tabControl1, 0, 0);
-            this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 1, 0);
-            this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 49);
-            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
-            this.tableLayoutPanel1.RowCount = 1;
-            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
-            this.tableLayoutPanel1.Size = new System.Drawing.Size(794, 444);
-            this.tableLayoutPanel1.TabIndex = 5;
             //
             // tableLayoutPanel2
             //
@@ -201,26 +236,14 @@
             this.tableLayoutPanel2.Controls.Add(this.dataGridView1, 0, 2);
             this.tableLayoutPanel2.Controls.Add(this.btnTabs, 0, 1);
             this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.tableLayoutPanel2.Location = new System.Drawing.Point(447, 3);
+            this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0);
             this.tableLayoutPanel2.Name = "tableLayoutPanel2";
             this.tableLayoutPanel2.RowCount = 3;
             this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
             this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
             this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
-            this.tableLayoutPanel2.Size = new System.Drawing.Size(344, 438);
-            this.tableLayoutPanel2.TabIndex = 2;
-            //
-            // recipeSelector1
-            //
-            this.recipeSelector1.AutoSize = true;
-            this.recipeSelector1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
-            this.recipeSelector1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.recipeSelector1.ItemSource = null;
-            this.recipeSelector1.Location = new System.Drawing.Point(3, 3);
-            this.recipeSelector1.Name = "recipeSelector1";
-            this.recipeSelector1.Size = new System.Drawing.Size(338, 27);
-            this.recipeSelector1.TabIndex = 0;
-            this.recipeSelector1.RecipesSolved += new System.EventHandler(this.recipeSelector1_RecipesSolved);
+            this.tableLayoutPanel2.Size = new System.Drawing.Size(346, 444);
+            this.tableLayoutPanel2.TabIndex = 3;
             //
             // dataGridView1
             //
@@ -239,29 +262,15 @@
             this.dataGridView1.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None;
             this.dataGridView1.RowHeadersVisible = false;
             this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
-            this.dataGridView1.Size = new System.Drawing.Size(338, 399);
+            this.dataGridView1.Size = new System.Drawing.Size(340, 399);
             this.dataGridView1.TabIndex = 1;
             this.dataGridView1.SelectionChanged += new System.EventHandler(this.dataGridView1_SelectionChanged);
             this.dataGridView1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.dataGridView1_MouseDown);
             //
-            // contextMenuStrip1
-            //
-            this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.removeFromStashToolStripMenuItem});
-            this.contextMenuStrip1.Name = "contextMenuStrip1";
-            this.contextMenuStrip1.Size = new System.Drawing.Size(171, 26);
-            //
-            // removeFromStashToolStripMenuItem
-            //
-            this.removeFromStashToolStripMenuItem.Name = "removeFromStashToolStripMenuItem";
-            this.removeFromStashToolStripMenuItem.Size = new System.Drawing.Size(170, 22);
-            this.removeFromStashToolStripMenuItem.Text = "Remove From Stash";
-            this.removeFromStashToolStripMenuItem.Click += new System.EventHandler(this.removeFromStashToolStripMenuItem_Click);
-            //
             // btnTabs
             //
             this.btnTabs.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnTabs.Location = new System.Drawing.Point(266, 36);
+            this.btnTabs.Location = new System.Drawing.Point(268, 36);
             this.btnTabs.Name = "btnTabs";
             this.btnTabs.Size = new System.Drawing.Size(75, 23);
             this.btnTabs.TabIndex = 2;
@@ -269,28 +278,24 @@
             this.btnTabs.UseVisualStyleBackColor = true;
             this.btnTabs.Click += new System.EventHandler(this.btnTabs_Click);
             //
-            // statusStrip1
-            //
-            this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.lblStatus});
-            this.statusStrip1.Location = new System.Drawing.Point(0, 493);
-            this.statusStrip1.Name = "statusStrip1";
-            this.statusStrip1.Size = new System.Drawing.Size(794, 22);
-            this.statusStrip1.TabIndex = 1;
-            this.statusStrip1.Text = "statusStrip1";
-            //
-            // lblStatus
-            //
-            this.lblStatus.Name = "lblStatus";
-            this.lblStatus.Size = new System.Drawing.Size(38, 17);
-            this.lblStatus.Text = "Status";
+            // recipeSelector1
+            //
+            this.recipeSelector1.AutoSize = true;
+            this.recipeSelector1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+            this.recipeSelector1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.recipeSelector1.ItemSource = null;
+            this.recipeSelector1.Location = new System.Drawing.Point(3, 3);
+            this.recipeSelector1.Name = "recipeSelector1";
+            this.recipeSelector1.Size = new System.Drawing.Size(340, 27);
+            this.recipeSelector1.TabIndex = 0;
+            this.recipeSelector1.RecipesSolved += new System.EventHandler(this.recipeSelector1_RecipesSolved);
             //
             // StashForm
             //
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(794, 515);
-            this.Controls.Add(this.tableLayoutPanel1);
+            this.Controls.Add(this.splitContainer1);
             this.Controls.Add(this.toolStrip1);
             this.Controls.Add(this.statusStrip1);
             this.Controls.Add(this.menuStrip1);
@@ -303,13 +308,16 @@
             this.menuStrip1.PerformLayout();
             this.toolStrip1.ResumeLayout(false);
             this.toolStrip1.PerformLayout();
-            this.tableLayoutPanel1.ResumeLayout(false);
+            this.contextMenuStrip1.ResumeLayout(false);
+            this.statusStrip1.ResumeLayout(false);
+            this.statusStrip1.PerformLayout();
+            this.splitContainer1.Panel1.ResumeLayout(false);
+            this.splitContainer1.Panel2.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
+            this.splitContainer1.ResumeLayout(false);
             this.tableLayoutPanel2.ResumeLayout(false);
             this.tableLayoutPanel2.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
-            this.contextMenuStrip1.ResumeLayout(false);
-            this.statusStrip1.ResumeLayout(false);
-            this.statusStrip1.PerformLayout();
             this.ResumeLayout(false);
             this.PerformLayout();

@@ -326,19 +334,19 @@
         private System.Windows.Forms.ToolStrip toolStrip1;
         private System.Windows.Forms.ToolStripLabel lblLeague;
         private System.Windows.Forms.ToolStripComboBox cboLeague;
-        private System.Windows.Forms.TabControl tabControl1;
-        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
-        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
-        private Controls.RecipeSelector recipeSelector1;
-        private System.Windows.Forms.DataGridView dataGridView1;
         private System.Windows.Forms.ToolStripMenuItem exportToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem summaryToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem imageToolStripMenuItem;
         private System.Windows.Forms.StatusStrip statusStrip1;
-        private System.Windows.Forms.Button btnTabs;
         private System.Windows.Forms.ToolStripStatusLabel lblStatus;
         private System.Windows.Forms.ToolStripMenuItem refreshAllTabsToolStripMenuItem;
         private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
         private System.Windows.Forms.ToolStripMenuItem removeFromStashToolStripMenuItem;
+        private System.Windows.Forms.SplitContainer splitContainer1;
+        private System.Windows.Forms.TabControl tabControl1;
+        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
+        private Controls.RecipeSelector recipeSelector1;
+        private System.Windows.Forms.DataGridView dataGridView1;
+        private System.Windows.Forms.Button btnTabs;
     }
 }


ResourceRecordの検索時に、検索日時よりも１つ古いレコードを返却する問題を修正

戦果計算でResourceRecordを検索するとき、指定した検索日時よりも１つ古いレコードを返却する問題を修正しました。

--- ElectronicObserver/Resource/Record/ResourceRecord.cs
+++ ElectronicObserver/Resource/Record/ResourceRecord.cs
@@ -189,9 +189,14 @@

 			int i;
 			for ( i = Record.Count - 1; i >= 0; i-- ) {
-				if ( Record[i].Date < target )
+				if ( Record[i].Date < target ) {
+					i++;
 					break;
-			}
+				}
+			}
+			// Record内の全ての記録がtarget以降だった
+			if ( i < 0 )
+				i = 0;

 			if ( 0 <= i && i < Record.Count ) {
 				return Record[i];


Convert to ReactiveCommand

Convert to ReactiveCommand

--- Espera/Espera.View/ViewModels/SongSourceViewModel.cs
+++ Espera/Espera.View/ViewModels/SongSourceViewModel.cs
@@ -1,10 +1,11 @@
 using Espera.Core.Management;
 using Rareform.Extensions;
-using Rareform.Patterns.MVVM;
 using ReactiveUI;
+using ReactiveUI.Xaml;
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Reactive;
 using System.Windows.Input;

 namespace Espera.View.ViewModels
@@ -20,40 +21,38 @@
         {
             this.library = library;
             this.selectableSongs = Enumerable.Empty<T>();
+
+            this.WhenAny(x => x.SelectedSongs, x => Unit.Default)
+                .Subscribe(p => this.RaisePropertyChanged(x => x.IsSongSelected));
+
+            IObservable<bool> canAddToPlaylist = this.WhenAny(x => x.SelectedSongs, x => x.Value != null && x.Value.Any());
+            var addToPlaylistCommand = new ReactiveCommand(canAddToPlaylist);
+            this.AddToPlaylistCommand = addToPlaylistCommand;
+            addToPlaylistCommand.Subscribe(p =>
+            {
+                if (!this.Library.CanAddSongToPlaylist)
+                {
+                    // Trigger the animation
+                    this.TimeoutWarning.RaiseSafe(this, EventArgs.Empty);
+
+                    return;
+                }
+
+                if (this.IsAdmin)
+                {
+                    this.library.AddSongsToPlaylist(this.SelectedSongs.Select(song => song.Model));
+                }
+
+                else
+                {
+                    this.library.AddSongToPlaylist(this.SelectedSongs.Select(song => song.Model).Single());
+                }
+            });
         }

         public event EventHandler TimeoutWarning;

-        public ICommand AddToPlaylistCommand
-        {
-            get
-            {
-                return new RelayCommand
-                (
-                    param =>
-                    {
-                        if (!this.Library.CanAddSongToPlaylist)
-                        {
-                            // Trigger the animation
-                            this.TimeoutWarning.RaiseSafe(this, EventArgs.Empty);
-
-                            return;
-                        }
-
-                        if (this.IsAdmin)
-                        {
-                            this.library.AddSongsToPlaylist(this.SelectedSongs.Select(song => song.Model));
-                        }
-
-                        else
-                        {
-                            this.library.AddSongToPlaylist(this.SelectedSongs.Select(song => song.Model).Single());
-                        }
-                    },
-                    param => this.SelectedSongs != null && this.SelectedSongs.Any()
-                );
-            }
-        }
+        public ICommand AddToPlaylistCommand { get; private set; }

         public bool IsAdmin
         {
@@ -81,11 +80,7 @@
         public IEnumerable<SongViewModelBase> SelectedSongs
         {
             get { return this.selectedSongs; }
-            set
-            {
-                this.RaiseAndSetIfChanged(x => x.SelectedSongs, value);
-                this.RaisePropertyChanged(x => x.IsSongSelected);
-            }
+            set { this.RaiseAndSetIfChanged(x => x.SelectedSongs, value); }
         }

         protected Library Library


Fixed XML docs on `ConsolePrompt`.

Fixed XML docs on `ConsolePrompt`.

--- Evbpc.Framework/Utilities/Prompting/ConsolePrompt.cs
+++ Evbpc.Framework/Utilities/Prompting/ConsolePrompt.cs
@@ -21,7 +21,7 @@
         /// </summary>
         /// <typeparam name="T">The type of input that should be returned.</typeparam>
         /// <param name="message">The message to initally display to the user.</param>
-        /// <param name="requireValue">Whether or not to allow use of a `defaultValue`.</param>
+        /// <param name="options">The <see cref="PromptOptions"/> that specify how the prompt should be treated.</param>
         /// <param name="defaultValue">The default value to be returned if a user enters an empty line (`""`).</param>
         /// <param name="failureMessage">An optional message to display on a failure. If null, then the `message` parameter will be displayed on failure.</param>
         /// <param name="validationMethod">An optional delegate to a method which can perform additional validation if the input is of the target type.</param>


Remove some garbage code

Remove some garbage code

--- Expressions/Tests/Expressions.Linq.Tests/LinqTest.cs
+++ Expressions/Tests/Expressions.Linq.Tests/LinqTest.cs
@@ -98,19 +98,6 @@

     }

-    public class MyTestClass
-    {
-        public void MyTestMethod()
-        {
-            INotifyEnumerable<Customer> customers = GetCustomers();
-            INotifyEnumerable<Order> orders = GetOrders();
-        }
-
-        private INotifyEnumerable<Customer> GetCustomers() { return null; }
-
-        private INotifyEnumerable<Order> GetOrders() { return null; }
-    }
-
     class Person : INotifyPropertyChanged
     {
         #region Name
@@ -211,34 +198,4 @@
         public event PropertyChangedEventHandler PropertyChanged;

     }
-
-    public class Customer
-    {
-        public int CustomerID;
-        public string Name;
-        public string Address;
-        public string City;
-        public string Region;
-        public string PostalCode;
-        public string Country;
-        public string Phone;
-        public List<Order> Orders;
-    }
-    public class Order
-    {
-        public int OrderID;
-        public int CustomerID;
-        public Customer Customer;
-        public DateTime OrderDate;
-        public decimal Total;
-    }
-    public class Product
-    {
-        public int ProductID;
-        public string Name;
-        public string Category;
-        public decimal UnitPrice;
-        public int UnitsInStock;
-    }
-
 }


Updated to 1.0.2

Updated to 1.0.2

--- FTJFundChoice.OrionClient/Properties/AssemblyInfo.cs
+++ FTJFundChoice.OrionClient/Properties/AssemblyInfo.cs
@@ -33,4 +33,4 @@
 // [assembly: AssemblyVersion("1.0.*")]
 [assembly: AssemblyVersion("0.6.0.0")]
 [assembly: AssemblyFileVersion("1.0.0.0")]
-[assembly: AssemblyInformationalVersion("1.0.1")]+[assembly: AssemblyInformationalVersion("1.0.2")]


Updated About page. Closes gh-29.

Updated About page. Closes gh-29.

--- source/NovusCraft.Site/Views/Home/About.cshtml
+++ source/NovusCraft.Site/Views/Home/About.cshtml
@@ -1,7 +1,15 @@
 @model object

 @{
-	ViewBag.Title = "About";
+	ViewBag.Title = "About | novuscraft.com";
 }

-ABOUT PAGE+

+
+
Hi, I'm Arnold and I love writing great software.

+
+
I live in London and work at Novus Craft (my first company, founded in 2010). At Novus Craft, I develop solutions using .NET, ASP.NET MVC and Sitecore and a variety of front-end technologies.

+
Software development has been my passion since I was 18 and I am a big tech geek. My interests include hardware as well as software - I have assembled over a dozen PC (media centres, workstations, gaming rigs).

+
To find out more about my work check out my LinkedIn and StackOverflow Careers pages.

+
If you would like to speak to me about a project, use the @Html.ActionLink("contact form", "Contact") or email me direct at arnold.zokas@novuscraft.com.

+


ContractUtils review

ContractUtils review

--- Framework.Core/System/Dynamic/Utils/ContractUtils.cs
+++ Framework.Core/System/Dynamic/Utils/ContractUtils.cs
@@ -1,4 +1,6 @@
 #if LESSTHAN_NET45
+
+#pragma warning disable RECS0017 // Possible compare of value type with 'null'

 // Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT license.
@@ -19,7 +21,7 @@
         {
             get
             {
-                Debug.Assert(false, "Unreachable");
+                Debug.Fail(nameof(Unreachable));
                 return new InvalidOperationException("Code supposed to be unreachable");
             }
         }
@@ -46,11 +48,6 @@
             }
         }

-        /// <summary>
-        /// Requires the range [offset, offset + count] to be a subset of [0, array.Count].
-        /// </summary>
-        /// <exception cref="ArgumentNullException">Array is <c>null</c>.</exception>
-        /// <exception cref="ArgumentOutOfRangeException">Offset or count are out of range.</exception>
         public static void RequiresArrayRange<T>(IList<T> array, int offset, int count, string offsetName, string countName)
         {
             Debug.Assert(!string.IsNullOrEmpty(offsetName));


Added extension method for the storage dictionary.

--- Framework/Lokad.Cqrs.Azure/AzureStorageDictionary.cs
+++ Framework/Lokad.Cqrs.Azure/AzureStorageDictionary.cs
@@ -19,6 +19,17 @@
             return _dictionary.TryGetValue(accountId, out config);
         }

+        public IAzureStorageConfiguration GetOrThrow(string accountId)
+        {
+            IAzureStorageConfiguration value;
+            if (_dictionary.TryGetValue(accountId,out value))
+            {
+                return value;
+            }
+            var message = string.Format("Failed to locate Azure config with id '{0}'. Have you registered it in Azure?", accountId);
+            throw new InvalidOperationException(message);
+        }
+
         public ICollection<IAzureStorageConfiguration> GetAll()
         {
             return _dictionary.Values;


More EDM.

More EDM.

--- source2/Debug/Cosmos.Debug.Common/DebugInfo.cs
+++ source2/Debug/Cosmos.Debug.Common/DebugInfo.cs
@@ -134,43 +134,20 @@
         }
         xDB.SaveChanges();
       }
-
-      //var xTx = mConnection.BeginTransaction();
-      //try {
-      //  using (var xCmd = mConnection.CreateCommand()) {
-      //    xCmd.Transaction = xTx;
-      //    xCmd.CommandText = "INSERT INTO FIELD_MAPPING (ID, TYPE_NAME, FIELD_NAME)"
-      //      + " VALUES (NEWID(), @TYPE_NAME, @FIELD_NAME)";
-      //    xCmd.Parameters.Add("@TYPE_NAME", SqlDbType.NVarChar);
-      //    xCmd.Parameters.Add("@FIELD_NAME", SqlDbType.NVarChar);
-      //    // Is a real DB now, but we still store all in RAM. We don't need to. Need to change to query DB as needed instead.
-      //    foreach (var xItem in xMaps) {
-      //      xCmd.Parameters[0].Value = xItem.TypeName;
-      //      foreach (var xFieldName in xItem.FieldNames) {
-      //        xCmd.Parameters[1].Value = xFieldName;
-      //        xCmd.ExecuteNonQuery();
-      //      }
-      //    }
-      //  }
-      //  xTx.Commit();
-      //} catch (Exception) {
-      //  xTx.Rollback();
-      //  throw;
-      //}
-    }
-
-    public Field_Map GetFieldMap(string name) {
-      var mp = new Field_Map();
-      using (var xCmd = mConnection.CreateCommand()) {
-        xCmd.CommandText = "select TYPE_NAME, FIELD_NAME from FIELD_MAPPING where(TYPE_NAME='" + name + "')";
-        using (var xReader = xCmd.ExecuteReader()) {
-          mp.TypeName = name;
-          while (xReader.Read()) {
-            mp.FieldNames.Add(xReader.GetString(1));
-          }
-        }
-      }
-      return mp;
+    }
+
+    public Field_Map GetFieldMap(string aName) {
+      var xMap = new Field_Map();
+      xMap.TypeName = aName;
+      using (var xDB = new Entities(mEntConn)) {
+        var xRows = from x in xDB.FIELD_MAPPING
+                    where x.TYPE_NAME == aName
+                    select x.FIELD_NAME;
+        foreach (var xFieldName in xRows) {
+          xMap.FieldNames.Add(xFieldName);
+        }
+      }
+      return xMap;
     }

     public void ReadFieldMappingList(List<Field_Map> aSymbols) {


updates based on review feedback

updates based on review feedback

--- Kudu.Services/Deployment/PushDeploymentController.cs
+++ Kudu.Services/Deployment/PushDeploymentController.cs
@@ -890,7 +890,7 @@

                 // Store only if zip file size < 100 MB
                 long fileBytes = new FileInfo(filePath).Length;
-                float fileMB = (float)fileBytes / (1024 * 1024);
+                float fileMB = (float)fileBytes / (1_024 * 1_024);
                 if (fileMB < 100)
                 {
                     // Make sure D:\home\LogFiles\kudu\deployment\BackupErrorZip exists
@@ -898,8 +898,7 @@
                     FileSystemHelpers.EnsureDirectory(errorDirPath);

                     // Store only 1 zip file with error
-                    IEnumerable<string> zipFiles = FileSystemHelpers.GetFiles(errorDirPath, "*.zip");
-                    if (zipFiles.Count() == 0)
+                    if (FileSystemHelpers.GetFiles(errorDirPath, "*.zip").Length == 0)
                     {
                         var errorFilePath = Path.Combine(errorDirPath, zipDeploymentInfo.ArtifactFileName);
                         using (_tracer.Step("{0}: Saving zip file with error to {1} of size {2} MB.", nameof(BackupErrorZip), errorFilePath, fileMB))


Fixed innocuous bad logic.

Fixed innocuous bad logic.

--- src/AttributeRouting/Framework/RouteBuilder.cs
+++ src/AttributeRouting/Framework/RouteBuilder.cs
@@ -152,10 +152,11 @@
             // Inspect the url for optional parameters, specified with a leading or trailing (or both) ?
             foreach (var parameter in urlParameters.Where(p => Regex.IsMatch(p, @"^\?|\?$")))
             {
-                if (defaults.ContainsKey(parameter))
-                    continue;
-
                 var parameterName = parameter.Trim('?');
+
+                if (defaults.ContainsKey(parameterName))
+                    continue;
+
                 defaults.Add(parameterName, UrlParameter.Optional);
             }


cosmetic

cosmetic

--- src/AutoMapper/Execution/TypeMapPlanBuilder.cs
+++ src/AutoMapper/Execution/TypeMapPlanBuilder.cs
@@ -548,7 +548,7 @@
             else if (!memberMap.TypeMap.Profile.AllowNullDestinationValues)
             {
                 var toCreate = memberMap.SourceType ?? destinationPropertyType;
-                if (!toCreate.IsAbstract() && toCreate.IsClass() && !toCreate.IsArray)
+                if (!toCreate.IsAbstract && toCreate.IsClass && !toCreate.IsArray)
                     valueResolverFunc = Coalesce(
                         valueResolverFunc,
                         ToType(DelegateFactory.GenerateNonNullConstructorExpression(toCreate), memberMap.SourceType)


Code style

Code style

--- src/Avalonia.Visuals/Media/PathMarkupParser.cs
+++ src/Avalonia.Visuals/Media/PathMarkupParser.cs
@@ -83,7 +83,6 @@
         public void Parse(string pathData)
         {
             var normalizedPathData = NormalizeWhiteSpaces(pathData);
-
             var tokens = ParseTokens(normalizedPathData);

             CreateGeometry(tokens);
@@ -129,11 +128,14 @@
                     }

                     source[index++] = c;
+
                     skip = true;
+
                     continue;
                 }

                 skip = false;
+
                 source[index++] = c;
             }


filter can introduce variables in generator expressions

git-svn-id: c3b8989232654601f1acea7403f771adaaa44a81@485 2c1201b4-01cd-e047-a400-b836ae1fbc61

--- src/Boo.Lang.Compiler/Pipeline/SemanticStep.cs
+++ src/Boo.Lang.Compiler/Pipeline/SemanticStep.cs
@@ -1419,9 +1419,9 @@
 				node.Iterator = newIterator;
 			}

-			PushNamespace(new DeclarationsNamespace(CurrentNamespace, BindingManager, node.Declarations));
+			PushNamespace(new DeclarationsNamespace(CurrentNamespace, BindingManager, node.Declarations));
+			Switch(node.Filter);
 			Switch(node.Expression);
-			Switch(node.Filter);
 			PopNamespace();
 		}


MongoDB: Read preference and write concern suitable for a replica set

--- src/Framework/MongoDB/MongoDatabaseProvider.cs
+++ src/Framework/MongoDB/MongoDatabaseProvider.cs
@@ -114,8 +114,13 @@
             var settings = MongoClientSettings.FromUrl(new MongoUrl(connectionString));
             settings.ConnectTimeout = TimeSpan.FromSeconds(10);
             var client = new MongoClient(settings);
-            var server = client.GetServer();
-            Database = server.GetDatabase(config.Sections.Database.TablePrefix);
+            var server = client.GetServer();
+            var databaseSettings = new MongoDatabaseSettings()
+            {
+                ReadPreference = ReadPreference.Nearest,
+                WriteConcern = WriteConcern.Acknowledged,
+            };
+            Database = server.GetDatabase(config.Sections.Database.TablePrefix, databaseSettings);
             try
             {
                 GetCollection<ContentItem>().EnsureIndex("Details.Name", "Details.LinkedItem", "Details.StringValue");


Last fix in loading the model space (for 3.5.0)

--- src/Kephas.Model/Elements/DefaultModelSpace.cs
+++ src/Kephas.Model/Elements/DefaultModelSpace.cs
@@ -207,15 +207,16 @@

             // then sort them, to be able to have all the dependencies constructed completely
             // before moving on.
-            var classifierComparer = ClassifierDependencyComparer;
+            constructionContext.ConstructedClassifiers = unsortedClassifiers;
             var orderGraphNodes = unsortedClassifiers.Select(
                 c => new KeyValuePair<IClassifier, IEnumerable<IElementInfo>>(
                     c,
                     ((IWritableNamedElement)c).GetDependencies(constructionContext)));
-            var orderedSet = new PartialOrderedSet<KeyValuePair<IClassifier, IEnumerable<IElementInfo>>>(orderGraphNodes, classifierComparer);
+            var orderedSet = new PartialOrderedSet<KeyValuePair<IClassifier, IEnumerable<IElementInfo>>>(orderGraphNodes, ClassifierDependencyComparer);
             var classifiers = orderedSet.Select(cd => cd.Key).ToList();

             // having ordered classifiers, go complete their construction
+            // the constructed classifiers are now in the proper order
             constructionContext.ConstructedClassifiers = classifiers;
             classifiers.ForEach(c => (c as IWritableNamedElement)?.CompleteConstruction(constructionContext));


Add support for more compilation options - Added keyFile - Added delaySign - Added pdb generation

--- src/Microsoft.DotNet.Tools.Compiler/Program.cs
+++ src/Microsoft.DotNet.Tools.Compiler/Program.cs
@@ -171,24 +171,45 @@
         private static void ApplyCompilationOptions(CompilerOptions compilationOptions, List<string> cscArgs)
         {
             var targetType = compilationOptions.EmitEntryPoint.GetValueOrDefault() ? "exe" : "library";
+
             cscArgs.Add($"-target:{targetType}");
+
             if (compilationOptions.AllowUnsafe.GetValueOrDefault())
             {
                 cscArgs.Add("-unsafe+");
             }
+
             cscArgs.AddRange(compilationOptions.Defines.Select(d => $"-d:{d}"));
+
             if (compilationOptions.Optimize.GetValueOrDefault())
             {
                 cscArgs.Add("-optimize");
             }
+
             if (!string.IsNullOrEmpty(compilationOptions.Platform))
             {
                 cscArgs.Add($"-platform:{compilationOptions.Platform}");
             }
+
             if (compilationOptions.WarningsAsErrors.GetValueOrDefault())
             {
                 cscArgs.Add("-warnaserror");
             }
+
+            if (compilationOptions.DelaySign.GetValueOrDefault())
+            {
+                cscArgs.Add("-delaysign+");
+            }
+
+            if (!string.IsNullOrEmpty(compilationOptions.KeyFile))
+            {
+                cscArgs.Add($"-keyFile:\"{compilationOptions.KeyFile}\"");
+            }
+
+            // TODO: Support debug portable
+            cscArgs.Add("-debug:full");
+
+            // TODO: OSS signing
         }

         private static void ShowDependencyInfo(IEnumerable<LibraryExport> dependencies)


shamed again...

shamed again...

--- src/Nirvana.Web/Generation/CqrsApiGenerator.cs
+++ src/Nirvana.Web/Generation/CqrsApiGenerator.cs
@@ -128,7 +128,7 @@
             builder.Append(
                 $"public class {rootType}Controller:Nirvana.Web.Controllers.CommandQueryApiControllerBase{{");

-            builder.Append($"public {rootType}Controller(Nirvana.Mediation.IMediatorFactory mediator): base(Nirvana.Mediation.IMediatorFactory mediator){{}}");
+            builder.Append($"public {rootType}Controller(Nirvana.Mediation.IMediatorFactory mediator): base(mediator){{}}");

             if (_setup.CanProcess(TaskType.Query))
             {


asp.net core content-type set by default

- some php scripts don't set content-type -> lets set the default content-type to "text/html"

--- src/Peachpie.NETCore.Web/RequestContextCore.cs
+++ src/Peachpie.NETCore.Web/RequestContextCore.cs
@@ -304,7 +304,8 @@

         void SetupHeaders()
         {
-            _httpctx.Response.Headers["X-Powered-By"] = new StringValues(XPoweredBy);
+            _httpctx.Response.ContentType = "text/html; charset=UTF-8";                 // default content type if not set anything by the application
+            _httpctx.Response.Headers["X-Powered-By"] = new StringValues(XPoweredBy);   //
         }

         static void AddVariables(PhpArray target, IEnumerable<KeyValuePair<string, StringValues>> values)


Fix DevTools bug.

Fix DevTools bug.

--- src/Perspex.Diagnostics/ViewModels/TreeNode.cs
+++ src/Perspex.Diagnostics/ViewModels/TreeNode.cs
@@ -21,7 +21,7 @@

             var classesChanged = Observable.FromEventPattern<
                     NotifyCollectionChangedEventHandler,
-                    NotifyCollectionChangedEventHandler>(
+                    NotifyCollectionChangedEventArgs>(
                 x => control.Classes.CollectionChanged += x,
                 x => control.Classes.CollectionChanged -= x);


Re-protected event handler

Re-protected event handler

--- src/Potato.Core/Events/PushEventsController.cs
+++ src/Potato.Core/Events/PushEventsController.cs
@@ -171,7 +171,10 @@
             return base.Execute();
         }

-        public void MasterEvents_EventLogged(object sender, IGenericEvent e) {
+        /// <summary>
+        /// Called whenever an event is logged.
+        /// </summary>
+        protected void MasterEvents_EventLogged(object sender, IGenericEvent e) {
             foreach (var endPoint in this.EndPoints) {
                 endPoint.Value.Append(e);
             }


Update documentation

Update documentation

--- src/PowerBI.Api.Client.Common/PowerBIClient.cs
+++ src/PowerBI.Api.Client.Common/PowerBIClient.cs
@@ -234,7 +234,7 @@
 		}

 		/// <summary>
-		/// Clean a table
+		/// Clear a table
 		/// </summary>
 		/// <param name="datasetId">Dataset identifier.</param>
 		/// <typeparam name="T">The 1st type parameter.</typeparam>