Fix showing potentially outdated message count when merging databases

--- app/Desktop/Main/Pages/DatabasePageModel.cs
+++ app/Desktop/Main/Pages/DatabasePageModel.cs
@@ -92,6 +92,8 @@
 			}

 			var oldStatistics = target.Statistics.Clone();
+			var oldMessageCount = target.CountMessages();
+
 			int successful = 0;
 			int finished = 0;

@@ -132,7 +134,7 @@
 			var newStatistics = target.Statistics;
 			long newServers = newStatistics.TotalServers - oldStatistics.TotalServers;
 			long newChannels = newStatistics.TotalChannels - oldStatistics.TotalChannels;
-			long newMessages = newStatistics.TotalMessages - oldStatistics.TotalMessages;
+			long newMessages = target.CountMessages() - oldMessageCount;

 			StringBuilder message = new StringBuilder();
 			message.Append("Processed ");


FIleWatcher not working.

FIleWatcher not working.

--- TeamCityBuildChanges/Commands/TestTemplateCommand.cs
+++ TeamCityBuildChanges/Commands/TestTemplateCommand.cs
@@ -31,22 +31,28 @@
             var result = resolver.CreateChangeManifestFromBuildTypeId("bt1", null, "1.2", "1.6");
             var renderer = new RazorOutputRenderer(_templateFile);

-            if (!File.Exists(_outputFilename)) TryToRender(renderer, result);
+            if (!File.Exists(_outputFilename ?? "Output.html")) TryToRender(renderer, result, "Rendering on first run...");

-            var watcher = new FileSystemWatcher {Path = Path.GetDirectoryName(_templateFile), Filter = Path.GetFileName(_templateFile), EnableRaisingEvents = true};
+            var watcher = new FileSystemWatcher
+                {
+                    Path = Path.GetDirectoryName(Path.GetFullPath(_templateFile)),
+                    Filter = Path.GetFileName(_templateFile),
+                    EnableRaisingEvents = true,
+                    NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.Size | NotifyFilters.CreationTime
+                };

-            watcher.Changed += (o, e) => TryToRender(renderer, result);
-            while (!Console.KeyAvailable)
-            {
-            }
+            watcher.Changed += (o, e) => TryToRender(renderer, result, "Detected the file has changed, running renderer...");
+            watcher.Created += (o, e) => TryToRender(renderer, result, "Detected the file has changed, running renderer...");
+
+            Console.Read();
             return 0;
         }

-        private void TryToRender(RazorOutputRenderer renderer, ChangeManifest result)
+        private void TryToRender(IOutputRenderer renderer, ChangeManifest result, string message)
         {
             try
             {
-                Console.WriteLine("Detected the file has changed, running renderer...");
+                Console.WriteLine(message);
                 var results = renderer.Render(result);
                 if (!string.IsNullOrEmpty(results))
                     File.WriteAllText(_outputFilename ?? "Output.html", results);


Use non-experimental namespace for UI Elements in Unity 2019.1+

--- Unity/Assets/NativeScript/Editor/GenerateBindings.cs
+++ Unity/Assets/NativeScript/Editor/GenerateBindings.cs
@@ -704,7 +704,11 @@
 			assemblies[27] = typeof(TerrainCollider).Assembly; // Unity terrain physics module
 			assemblies[28] = typeof(Font).Assembly; // Unity text rendering module
 			assemblies[29] = typeof(UnityEngine.Tilemaps.Tile).Assembly; // Unity tilemap module
+#if UNITY_2019_1_OR_NEWER
+			assemblies[30] = typeof(UnityEngine.UIElements.Button).Assembly; // Unity UI elements module
+#else
 			assemblies[30] = typeof(UnityEngine.Experimental.UIElements.Button).Assembly; // Unity UI elements module
+#endif
 			assemblies[31] = typeof(Canvas).Assembly; // Unity UI module
 			assemblies[32] = typeof(UnityEngine.Networking.NetworkTransport).Assembly; // Unity cloth module
 			assemblies[33] = typeof(UnityEngine.Analytics.Analytics).Assembly; // Unity analytics module


more tests

more tests

--- VerbalExpressionsUnitTests/VerbalExpressionsTests.cs
+++ VerbalExpressionsUnitTests/VerbalExpressionsTests.cs
@@ -504,10 +504,83 @@
         public void UseOneLineSearchOption_WhenCalled_ShouldChangeMultilineModifier()
         {
             //Arrange
-
-            //Act
-
-            //Assert
-        }
+            verbEx.UseOneLineSearchOption(false);
+            var regex = verbEx.ToRegex();
+            Assert.IsTrue(regex.Options.HasFlag(RegexOptions.Multiline), "RegexOptions should now be present");
+            //Act
+            verbEx.UseOneLineSearchOption(true);
+            //Assert
+            regex = verbEx.ToRegex();
+            Assert.IsFalse(regex.Options.HasFlag(RegexOptions.Multiline), "RegexOptions should now have been removed");
+        }
+
+        [TestMethod]
+        public void Maybe_WhenCalled_UsesCommonRegexUrl()
+        {
+            verbEx.Maybe(CommonRegex.Url);
+
+            Assert.IsTrue(verbEx.IsMatch("http://www.google.com"), "Should match url address");
+        }
+
+        [TestMethod]
+        public void Maybe_WhenCalled_UsesCommonRegexEmail()
+        {
+            verbEx.Maybe(CommonRegex.Email);
+
+            Assert.IsTrue(verbEx.IsMatch("test@github.com"), "Should match email address");
+        }
+
+        [TestMethod]
+        public void AddModifier_AddModifierI_RemovesCase()
+        {
+            verbEx.Add("teststring")
+                .AddModifier('i');
+
+            Assert.IsTrue(verbEx.IsMatch("TESTSTRING"));
+
+        }
+
+        [TestMethod]
+        public void AddModifier_AddModifierX_IgnoreWhitspace()
+        {
+            verbEx.Add("test string")
+                  .AddModifier('x');
+
+            Assert.IsTrue(verbEx.IsMatch("test string #comment"));
+        }
+
+        [TestMethod]
+        public void AddModifier_AddModifierM_Multiline()
+        {
+            //Arrange
+            string text = string.Format("testin with {0} line break", Environment.NewLine);
+
+            //Act
+            verbEx.AddModifier('m');
+
+            //Assert
+            Assert.IsTrue(verbEx.Test(text));
+        }
+
+        [TestMethod]
+        public void RemoveModifier_RemoveModifierI_RemovesCase()
+        {
+            verbEx.AddModifier('i');
+
+            verbEx.RemoveModifier('i');
+            var regex = verbEx.ToRegex();
+            Assert.IsFalse(regex.Options.HasFlag(RegexOptions.IgnoreCase), "RegexOptions should now have been removed");
+        }
+
+        [TestMethod]
+        public void RemoveModifier_RemoveModifierX_RemovesCase()
+        {
+            verbEx.AddModifier('x');
+
+            verbEx.RemoveModifier('x');
+            var regex = verbEx.ToRegex();
+            Assert.IsFalse(regex.Options.HasFlag(RegexOptions.IgnorePatternWhitespace), "RegexOptions should now have been removed");
+        }
+
     }
 }


[Mac] Fix RadioButtonCellView.Toggled event

* raise Toggled event only on activation
* reset previous state correctly

--- Xwt.XamMac/Xwt.Mac.CellViews/RadioButtonTableCell.cs
+++ Xwt.XamMac/Xwt.Mac.CellViews/RadioButtonTableCell.cs
@@ -46,13 +46,31 @@
 			Title = "";
 		}

+		public override NSCellStateValue State {
+			get {
+				return base.State;
+			}
+			set {
+				if (base.State != value)
+					stateChanging = true;
+				base.State = value;
+			}
+		}
+
+		bool stateChanging;
 		void HandleActivated (object sender, EventArgs e)
 		{
-			var cellView = Frontend;
-			CellContainer.SetCurrentEventRow ();
-			if (cellView.Editable && !cellView.RaiseToggled () && cellView.ActiveField != null) {
-				CellContainer.SetValue (cellView.ActiveField, State != NSCellStateValue.Off);
+			if (State == NSCellStateValue.On && stateChanging) {
+				var cellView = Frontend;
+				CellContainer.SetCurrentEventRow ();
+				Frontend.Load (CellContainer);
+				if (cellView.Editable && !cellView.RaiseToggled ()) {
+					if (cellView.ActiveField != null)
+						CellContainer.SetValue (cellView.ActiveField, State != NSCellStateValue.Off);
+				} else
+					base.State = NSCellStateValue.Off;
 			}
+			stateChanging = false;
 		}

 		public RadioButtonTableCell (IntPtr p): base (p)
@@ -70,7 +88,7 @@
 		public void Fill ()
 		{
 			var cellView = Frontend;
-			State = cellView.Active ? NSCellStateValue.On : NSCellStateValue.Off;
+			base.State = cellView.Active ? NSCellStateValue.On : NSCellStateValue.Off;
 			Editable = cellView.Editable;
 		}


Fix virtual machine type bug on <SQL2008R2


Reverted accidentally pushed change.

Reverted accidentally pushed change.

--- source/Cosmos.Build.Tasks/IL2CPU.cs
+++ source/Cosmos.Build.Tasks/IL2CPU.cs
@@ -90,10 +90,6 @@
             return String.Join(Environment.NewLine, args.Select(a => $"{a.Key}:{a.Value}"));
         }

-        protected override string GetResponseFileSwitch(string responseFilePath)
-        {
-            File.Copy(responseFilePath, @"c:\users\jpedr\Desktop\response.rsp", true);
-            return $"ResponseFile:{responseFilePath}";
-        }
+        protected override string GetResponseFileSwitch(string responseFilePath) => $"ResponseFile:{responseFilePath}";
     }
 }


Fix bad localization string in secret stash.

--- Content.Server/Storage/Components/SecretStashComponent.cs
+++ Content.Server/Storage/Components/SecretStashComponent.cs
@@ -81,7 +81,7 @@
             if (_itemContainer.ContainedEntity == null)
                 return false;

-            Owner.PopupMessage(user, Loc.GetString("There was something inside {0}!", ("stash", SecretPartName)));
+            Owner.PopupMessage(user, Loc.GetString("comp-secret-stash-action-get-item-found-something", ("stash", SecretPartName)));

             if (user.TryGetComponent(out HandsComponent? hands))
             {


Disabled ssl on mails to make it send.

Disabled ssl on mails to make it send.

--- Core.ApplicationServices/MailerService/Impl/MailSender.cs
+++ Core.ApplicationServices/MailerService/Impl/MailSender.cs
@@ -19,7 +19,7 @@
             {
                 Host = ConfigurationManager.AppSettings["PROTECTED_SMTP_HOST"],
                 Port = int.Parse(ConfigurationManager.AppSettings["PROTECTED_SMTP_HOST_PORT"]),
-                EnableSsl = true,
+                EnableSsl = false,
                 Credentials = new NetworkCredential()
                 {
                     UserName = ConfigurationManager.AppSettings["PROTECTED_SMTP_USER"],


Updated console log

Updated console log

--- samples/ScheduleTestApp/Program.cs
+++ samples/ScheduleTestApp/Program.cs
@@ -10,7 +10,9 @@
     {
         static void Main(string[] args)
         {
-            var runner = new Scheduler.ScheduleRunner(new Scheduler.ExceptionLog());
+            //var runner = new Scheduler.ScheduleRunner(new Scheduler.ExceptionWindowsLog());
+            var runner = new Scheduler.ScheduleRunner(new Scheduler.ExceptionConsoleLog());
+
             Console.ReadLine();
         }
     }


improved respawn so it is on the left or right platform.

--- OneBullet/OneBullet/Game1.cs
+++ OneBullet/OneBullet/Game1.cs
@@ -405,10 +405,10 @@
         void Respawn()
         {

-            Vector2 respawnPoint1 = new Vector2(plat1Pos.X, plat1Pos.Y - 10);
-            Vector2 respawnPoint2 = new Vector2(plat2Pos.X, plat2Pos.Y - 10);
-            Vector2 respawnPoint3 = new Vector2(plat3Pos.X, plat3Pos.Y - 10);
-            Vector2 respawnPoint4 = new Vector2(plat4Pos.X, plat4Pos.Y - 10);
+            Vector2 respawnPoint1 = new Vector2(plat1Pos.X + 30, plat1Pos.Y - 70);
+            Vector2 respawnPoint2 = new Vector2(plat2Pos.X + 30, plat2Pos.Y - 70);
+            Vector2 respawnPoint3 = new Vector2(plat3Pos.X + 30, plat3Pos.Y - 70);
+            Vector2 respawnPoint4 = new Vector2(plat4Pos.X+ 30, plat4Pos.Y - 70);


Changed yet more Warns to Debugs.

Changed yet more Warns to Debugs.

--- OpenSim/Framework/WebUtil.cs
+++ OpenSim/Framework/WebUtil.cs
@@ -967,7 +967,7 @@
                 }
                 catch (Exception e)
                 {
-                    m_log.WarnFormat("[SynchronousRestObjectRequester]: exception in sending data to {0}: {1}", requestUrl, e);
+                    m_log.DebugFormat("[SynchronousRestObjectRequester]: exception in sending data to {0}: {1}", requestUrl, e);
                     return deserial;
                 }
                 finally
@@ -992,18 +992,18 @@
                         respStream.Close();
                     }
                     else
-                        m_log.WarnFormat("[SynchronousRestObjectRequester]: Oops! no content found in response stream from {0} {1}", requestUrl, verb);
+                        m_log.DebugFormat("[SynchronousRestObjectRequester]: Oops! no content found in response stream from {0} {1}", requestUrl, verb);

                 }
             }
             catch (System.InvalidOperationException)
             {
                 // This is what happens when there is invalid XML
-                m_log.WarnFormat("[SynchronousRestObjectRequester]: Invalid XML {0} {1}", requestUrl, typeof(TResponse).ToString());
+                m_log.DebugFormat("[SynchronousRestObjectRequester]: Invalid XML {0} {1}", requestUrl, typeof(TResponse).ToString());
             }
             catch (Exception e)
             {
-                m_log.WarnFormat("[SynchronousRestObjectRequester]: Exception on response from {0} {1}", requestUrl, e);
+                m_log.DebugFormat("[SynchronousRestObjectRequester]: Exception on response from {0} {1}", requestUrl, e);
             }

             return deserial;


minor: log an error rather than info if a connector fails to load.

--- OpenSim/Server/ServerMain.cs
+++ OpenSim/Server/ServerMain.cs
@@ -145,7 +145,7 @@
                 }
                 else
                 {
-                    m_log.InfoFormat("[SERVER]: Failed to load {0}", conn);
+                    m_log.ErrorFormat("[SERVER]: Failed to load {0}", conn);
                 }
             }


Handle System.PlatformNotSupported exception when checking to see if a proxy can be used.

--- Docker.DotNet/Microsoft.Net.Http.Client/ManagedHandler.cs
+++ Docker.DotNet/Microsoft.Net.Http.Client/ManagedHandler.cs
@@ -292,7 +292,14 @@
                 request.SetAddressLineProperty(pathAndQuery);
             }

-            if (!UseProxy || Proxy.IsBypassed(request.RequestUri))
+            try
+            {
+                if (!UseProxy || Proxy.IsBypassed(request.RequestUri))
+                {
+                    return ProxyMode.None;
+                }
+            }
+            catch (System.PlatformNotSupportedException)
             {
                 return ProxyMode.None;
             }


Minor change.

Minor change.

--- InfluxData.Net.Common/RequestClients/RequestClientBase.cs
+++ InfluxData.Net.Common/RequestClients/RequestClientBase.cs
@@ -139,7 +139,6 @@
             var request = new HttpRequestMessage(method, urlBuilder.ToString());
             request.Headers.Add("User-Agent", _userAgent);
             request.Headers.Add("Accept", "application/json");
-
             request.Content = content;

             return request;


- Adding cause property to Chat Purge event

--- Mixer/Mixer.Base/Model/Chat/ChatPurgeMessageEventModel.cs
+++ Mixer/Mixer.Base/Model/Chat/ChatPurgeMessageEventModel.cs
@@ -1,4 +1,6 @@
-namespace Mixer.Base.Model.Chat
+using Newtonsoft.Json.Linq;
+
+namespace Mixer.Base.Model.Chat
 {
     /// <summary>
     /// A user that was purged in chat.
@@ -13,5 +15,9 @@
         /// The user who performed the purge.
         /// </summary>
         public ChatMessageUserModel moderator { get; set; }
+        /// <summary>
+        /// The cause of the purge.
+        /// </summary>
+        public JObject cause { get; set; }
     }
 }


Fix expression evaluation bug An incorrect variable capture was causing all expressions evaluated in a batch to return the same value.

--- Mono.Debugging/Mono.Debugging.Evaluation/BaseBacktrace.cs
+++ Mono.Debugging/Mono.Debugging.Evaluation/BaseBacktrace.cs
@@ -177,9 +177,10 @@
 			if (Adaptor.IsEvaluating) {
 				List<ObjectValue> vals = new List<ObjectValue> ();
 				foreach (string exp in expressions) {
-					ObjectValue val = Adaptor.CreateObjectValueAsync (exp, ObjectValueFlags.Field, delegate {
+					string tmpExp = exp;
+					ObjectValue val = Adaptor.CreateObjectValueAsync (tmpExp, ObjectValueFlags.Field, delegate {
 						EvaluationContext cctx = GetEvaluationContext (frameIndex, options);
-						return Adaptor.GetExpressionValue (cctx, exp);
+						return Adaptor.GetExpressionValue (cctx, tmpExp);
 					});
 					vals.Add (val);
 				}


Fix the bug described in #164

Fix the bug described in #164

--- NBi.Core.SqlServer/IntegrationService/EtlCatalogRunner.cs
+++ NBi.Core.SqlServer/IntegrationService/EtlCatalogRunner.cs
@@ -117,7 +117,7 @@
             }
             var project = folder.Projects[Etl.Project];

-            if (project.Packages.Contains(Etl.Name))
+            if (!project.Packages.Contains(Etl.Name))
             {
                 var names = String.Join(", ", project.Packages.Select(p => p.Name));
                 throw new ArgumentOutOfRangeException("Name", String.Format("The package named '{0}' hasn't been found on the project '{1}'. List of existing packages: {2}.", Etl.Name, Etl.Project, names));
@@ -147,4 +147,4 @@

     }
 }
-#endif+#endif


Refactors the ...NegatedImpl implementation so that it relies on the other corresponding ...Impl method.

--- NFluent/Assertions/ComparableFluentAssertionExtensions.cs
+++ NFluent/Assertions/ComparableFluentAssertionExtensions.cs
@@ -49,12 +49,7 @@

         private static void IsBeforeImpl(IFluentAssertion<IComparable> fluentAssertion, IComparable otherValue)
         {
-            if (fluentAssertion.Value == null)
-            {
-                throw new FluentAssertionException(string.Format("\nThe actual value:\n\t[{0}]{1}\nis not before:\n\t[{2}]{3}.", fluentAssertion.Value.ToStringProperlyFormated(), EqualityHelper.BuildTypeDescriptionMessage(fluentAssertion.Value), otherValue.ToStringProperlyFormated(), EqualityHelper.BuildTypeDescriptionMessage(otherValue)));
-            }
-
-            if (fluentAssertion.Value.CompareTo(otherValue) >= 0)
+            if (fluentAssertion.Value == null || fluentAssertion.Value.CompareTo(otherValue) >= 0)
             {
                 throw new FluentAssertionException(string.Format("\nThe actual value:\n\t[{0}]{1}\nis not before:\n\t[{2}]{3}.", fluentAssertion.Value.ToStringProperlyFormated(), EqualityHelper.BuildTypeDescriptionMessage(fluentAssertion.Value), otherValue.ToStringProperlyFormated(), EqualityHelper.BuildTypeDescriptionMessage(otherValue)));
             }
@@ -62,15 +57,16 @@

         private static void IsBeforeNegatedImpl(IFluentAssertion<IComparable> fluentAssertion, IComparable otherValue)
         {
-            if (fluentAssertion.Value == null)
+            try
             {
-                throw new FluentAssertionException(string.Format("\nThe actual value:\n\t[{0}]{1}\nis before:\n\t[{2}]{3}.", fluentAssertion.Value.ToStringProperlyFormated(), EqualityHelper.BuildTypeDescriptionMessage(fluentAssertion.Value), otherValue.ToStringProperlyFormated(), EqualityHelper.BuildTypeDescriptionMessage(otherValue)));
+                IsBeforeImpl(fluentAssertion, otherValue);
+            }
+            catch (FluentAssertionException)
+            {
+                return;
             }

-            if (fluentAssertion.Value.CompareTo(otherValue) < 0)
-            {
-                throw new FluentAssertionException(string.Format("\nThe actual value:\n\t[{0}]{1}\nis before:\n\t[{2}]{3}.", fluentAssertion.Value.ToStringProperlyFormated(), EqualityHelper.BuildTypeDescriptionMessage(fluentAssertion.Value), otherValue.ToStringProperlyFormated(), EqualityHelper.BuildTypeDescriptionMessage(otherValue)));
-            }
+            throw new FluentAssertionException(string.Format("\nThe actual value:\n\t[{0}]{1}\nis before:\n\t[{2}]{3}.", fluentAssertion.Value.ToStringProperlyFormated(), EqualityHelper.BuildTypeDescriptionMessage(fluentAssertion.Value), otherValue.ToStringProperlyFormated(), EqualityHelper.BuildTypeDescriptionMessage(otherValue)));
         }
     }
 }


Use RegisterCompilationStartAction

Use RegisterCompilationStartAction

Don't bother registering an analyzer for all invocations if we aren't in
a compilation where we can do anything (Need both NFluent and NUnit to
be present)

--- NFluentAnalyzers/NFluentAnalyzers/ReplaceNUnitAnalyzer.cs
+++ NFluentAnalyzers/NFluentAnalyzers/ReplaceNUnitAnalyzer.cs
@@ -1,7 +1,6 @@
 namespace NFluentAnalyzers
 {
     using System.Collections.Immutable;
-    using System.Linq;
     using Microsoft.CodeAnalysis;
     using Microsoft.CodeAnalysis.CSharp;
     using Microsoft.CodeAnalysis.CSharp.Syntax;
@@ -28,10 +27,24 @@

         public override void Initialize(AnalysisContext context)
         {
-            context.RegisterSyntaxNodeAction(AnalyzeInvocation, SyntaxKind.InvocationExpression);
+            context.RegisterCompilationStartAction(CompilationStart);
         }

-        private static void AnalyzeInvocation(SyntaxNodeAnalysisContext context)
+        static readonly SyntaxKind[] wantedKinds = { SyntaxKind.InvocationExpression };
+
+        void CompilationStart(CompilationStartAnalysisContext context)
+        {
+            var nfluentCheck = context.Compilation.NFluentCheckType();
+            if (nfluentCheck == null) return;
+
+            var nunitAssert = context.Compilation.NUnitAssertType();
+            if (nunitAssert == null) return;
+
+            var nunitAssertForClosure = nunitAssert;
+            context.RegisterSyntaxNodeAction(c => AnalyzeInvocation(c, nunitAssertForClosure), wantedKinds);
+        }
+
+        private static void AnalyzeInvocation(SyntaxNodeAnalysisContext context, INamedTypeSymbol nunitAssert)
         {
             var invocation = (InvocationExpressionSyntax)context.Node;
             if (!(invocation.Expression is MemberAccessExpressionSyntax))
@@ -46,20 +59,15 @@
             }

             var symbol = context.SemanticModel.GetSymbolInfo(memberAccess).Symbol as IMethodSymbol;
-            AnalyzeInvocation(context, symbol, invocation);
+            AnalyzeInvocation(context, symbol, invocation, nunitAssert);
         }

         static void AnalyzeInvocation(SyntaxNodeAnalysisContext context, IMethodSymbol symbol,
-            InvocationExpressionSyntax invocation)
+            InvocationExpressionSyntax invocation, INamedTypeSymbol nunitAssert)
         {
             if (symbol?.MethodKind != MethodKind.Ordinary
                 || !symbol.IsStatic
                 || !NUnitAssertMethods.Type.Equals(symbol.ContainingType)) return;
-
-            if (context.SemanticModel.Compilation.NFluentCheckType() == null) return;
-
-            var nunitAssert = context.SemanticModel.Compilation.NUnitAssertType();
-            if (nunitAssert == null) return;

             if (!symbol.ContainingType.Equals(nunitAssert)) return;


Fix crash when the file mods.txt is not found

--- OpenKh.Tools.ModsManager/Services/ConfigurationService.cs
+++ OpenKh.Tools.ModsManager/Services/ConfigurationService.cs
@@ -59,7 +59,7 @@

         public static ICollection<string> EnabledMods
         {
-            get => File.ReadAllLines(EnabledModsPath);
+            get => File.Exists(EnabledModsPath) ? File.ReadAllLines(EnabledModsPath) : new string[0];
             set => File.WriteAllLines(EnabledModsPath, value);
         }


* Switched from ASCII encoding to llRetardedEncoding.

--- OpenSim/OpenSim.RegionServer/ClientView.PacketHandlers.cs
+++ OpenSim/OpenSim.RegionServer/ClientView.PacketHandlers.cs
@@ -153,7 +153,7 @@
                 {
                     Hashtable mp = (Hashtable)simMapProfiles[iii];
                     mbReply.Data[iii] = new MapBlockReplyPacket.DataBlock();
-                    mbReply.Data[iii].Name = System.Text.Encoding.ASCII.GetBytes((string)mp["name"]);
+                    mbReply.Data[iii].Name = libsecondlife.Helpers.StringToField((string)mp["name"]);
                     mbReply.Data[iii].Access = System.Convert.ToByte(mp["access"]);
                     mbReply.Data[iii].Agents = System.Convert.ToByte(mp["agents"]);
                     mbReply.Data[iii].MapImageID = new LLUUID((string)mp["map-image-id"]);


More long consonant restoring

More long consonant restoring

--- OpenUtau.Plugin.Builtin/SpanishSyllableBasedPhonemizer.cs
+++ OpenUtau.Plugin.Builtin/SpanishSyllableBasedPhonemizer.cs
@@ -31,7 +31,7 @@
                 .Where(parts => parts[0] != parts[1])
                 .ToDictionary(parts => parts[0], parts => parts[1]);

-        private readonly string[] longConsonants = "ch,dz,sh,ts,l,m,n".Split(',');
+        private readonly string[] longConsonants = "ch,dz,s,sh,t,ts,z,l,m,n".Split(',');

         protected override string[] GetVowels() => vowels;
         protected override string[] GetConsonants() => consonants;


Fix iOS check system version issue

Fix iOS check system version issue

--- PopColorPicker.iOS.Shared/PopColorPickerViewController.cs
+++ PopColorPicker.iOS.Shared/PopColorPickerViewController.cs
@@ -69,7 +69,7 @@
 			this.View.BackgroundColor = UIColor.FromRGB(83, 83, 83);
 			this.PreferredContentSize = new SizeF(320f, 568f);

-			if (float.Parse(UIDevice.CurrentDevice.SystemVersion) >= 7.0f)
+			if (UIDevice.CurrentDevice.CheckSystemVersion (7,0))
 			{
 				this.EdgesForExtendedLayout = UIRectEdge.None;
 				this.ExtendedLayoutIncludesOpaqueBars = false;


Add new unit test

Add new unit test

--- PortableExtensions.Testing/Utilities/Tree/TreeNodeTest.cs
+++ PortableExtensions.Testing/Utilities/Tree/TreeNodeTest.cs
@@ -437,6 +437,23 @@
             node2.Children = node1Children;
         }

+        [Test]
+        public void ChildrenTestCase3()
+        {
+            var target = new TreeNode<String>();
+            var children = new TreeNodeCollection<String>( target ) { "Item1", "Item2" };
+
+            target.Children = children;
+            Assert.AreSame( children, target.Children );
+            Assert.AreEqual( 2, target.Children.Count );
+            children.ForEach( x => Assert.AreSame( target, x.Parent ) );
+
+            target.Children = children;
+            Assert.AreSame( children, target.Children );
+            Assert.AreEqual( 2, target.Children.Count );
+            children.ForEach( x => Assert.AreSame( target, x.Parent ) );
+        }
+
         /// <summary>
         ///     Constructor with no parameters
         /// </summary>
@@ -662,16 +679,16 @@
         public void CtorTestCase8()
         {
             var value = RandomValueEx.GetRandomString();
-            var parent = new TreeNode<String>("parent");
-            var children = new TreeNodeCollection<String>(parent)
-            {
-                new TreeNode<String>("1")
-            };
-
-            var actual = new TreeNode<String>(value, parent, children);
-            Assert.AreEqual(value, actual.Value);
-            Assert.AreSame(parent, actual.Parent);
-            Assert.AreSame(children, actual.Children);
+            var parent = new TreeNode<String>( "parent" );
+            var children = new TreeNodeCollection<String>( parent )
+            {
+                new TreeNode<String>( "1" )
+            };
+
+            var actual = new TreeNode<String>( value, parent, children );
+            Assert.AreEqual( value, actual.Value );
+            Assert.AreSame( parent, actual.Parent );
+            Assert.AreSame( children, actual.Children );
         }

         [Test]
@@ -761,13 +778,13 @@
         [Test]
         public void DescendantsTestCase1()
         {
-            var target = new TreeNode<String>("root");
+            var target = new TreeNode<String>( "root" );
             var actual = target.Descendants.ToList();
-            Assert.AreEqual(0, actual.Count);
+            Assert.AreEqual( 0, actual.Count );

             target.Children = null;
             actual = target.Descendants.ToList();
-            Assert.AreEqual(0, actual.Count);
+            Assert.AreEqual( 0, actual.Count );
         }

         [Test]
@@ -1434,8 +1451,8 @@
         [Test]
         public void HasChildrenTestCase1()
         {
-            var target = new TreeNode<String>("root") {Children = null};
-            Assert.IsFalse(target.HasChildren);
+            var target = new TreeNode<String>( "root" ) { Children = null };
+            Assert.IsFalse( target.HasChildren );
         }

         [Test]
@@ -1659,6 +1676,20 @@
         }

         [Test]
+        public void SetParentTestCase1()
+        {
+            var targetA = new TreeNode<String>( "a" )
+            {
+                Children = null
+            };
+            var node1 = new TreeNode<String>( "1" );
+
+            //Add 1 to A
+            node1.SetParent( targetA );
+            Assert.AreSame( node1.Parent, targetA );
+        }
+
+        [Test]
         public void ToStringTestCase()
         {
             var target = new TreeNode<String>( "1" );


Added UT for serializing null rule

Added UT for serializing null rule

--- RecurringDates.UnitTests/Serialization/SerializationUT.cs
+++ RecurringDates.UnitTests/Serialization/SerializationUT.cs
@@ -22,5 +22,13 @@
             rehydratedRule.Should().NotBeNull();
         }

+        [Test]
+        public void ANullRuleIsSerialized()
+        {
+            var result = RuleSerializer.Instance.Serialize(null);
+            var rule = RuleSerializer.Instance.Deserialize(result);
+            rule.Should().BeNull();
+        }
+
     }
 }


cleanup references

cleanup references

--- Rsk.Samples.IdentityServer4.AdminUiIntegration/Startup.cs
+++ Rsk.Samples.IdentityServer4.AdminUiIntegration/Startup.cs
@@ -1,16 +1,8 @@
 using System;
-using System.Collections.Generic;
 using System.IO;
-using System.Linq;
 using System.Reflection;
-using System.Security.Claims;
 using System.Security.Cryptography.X509Certificates;
 using IdentityExpress.Identity;
-using IdentityModel;
-using IdentityServer4.EntityFramework.DbContexts;
-using IdentityServer4.EntityFramework.Interfaces;
-using IdentityServer4.EntityFramework.Mappers;
-using IdentityServer4.Models;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.EntityFrameworkCore;
@@ -18,8 +10,6 @@
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Logging;
 using Microsoft.AspNetCore.Identity;
-using Microsoft.Extensions.Logging.Console;
-using Microsoft.IdentityModel.Tokens;

 namespace Rsk.Samples.IdentityServer4.AdminUiIntegration
 {
@@ -138,7 +128,6 @@
                 return new X509Certificate2(AppDomain.CurrentDomain.BaseDirectory + "CN=RSKSampleIdentityServer.pfx", "Password123!");

             }
-
         }
     }
 }


Fix from devins commit

Fix from devins commit

--- RunApproachStatistics/ViewModel/VideoPlaybackViewModel.cs
+++ RunApproachStatistics/ViewModel/VideoPlaybackViewModel.cs
@@ -109,7 +109,7 @@

             // Set Graph
-            GraphViewModel graphVM = new GraphViewModel(_app, this, 10,2000);
+            GraphViewModel graphVM = new GraphViewModel(_app, this, false ,2000);
             GraphView = graphVM;
         }


finished with attributesyntaxparser

finished with attributesyntaxparser

--- SharpSwift/SharpSwift/Converters/AttributeSyntaxParser.cs
+++ SharpSwift/SharpSwift/Converters/AttributeSyntaxParser.cs
@@ -13,24 +13,17 @@
         /// <returns>A boolean value representing whether it is or isn't the SharpSwift attribute</returns>
         private static bool IsSharpSwiftAttribute(AttributeSyntax attribute, string expectingName = null)
         {
-            var symbolInfo = Model.GetSymbolInfo(attribute.Name);
+            var symbol = Model.GetSymbolInfo(attribute.Name).Symbol;
+            if (symbol == null) return false;

-            if (symbolInfo.Symbol == null)
-            {
-                return false;
-            }
-
-            var containingNamespace = symbolInfo.Symbol.ContainingSymbol.ContainingNamespace;
+            var containingNamespace = symbol.ContainingSymbol.ContainingNamespace;

             var containingContainingNamespace = containingNamespace.ContainingNamespace;
-            if (containingContainingNamespace == null)
-            {
-                return false;
-            }
+            if (containingContainingNamespace == null) return false;

             return containingContainingNamespace.Name == "SharpSwift"
                    && containingNamespace.Name == "Attributes"
-                   && (expectingName == null || symbolInfo.Symbol.ContainingSymbol.Name == expectingName);
+                   && (expectingName == null || symbol.ContainingSymbol.Name == expectingName);
         }

         /// <summary>


Update DiscountCodeService.cs

Update DiscountCodeService.cs

Tested

--- ShopifySharp/Services/DiscountCode/DiscountCodeService.cs
+++ ShopifySharp/Services/DiscountCode/DiscountCodeService.cs
@@ -51,13 +51,21 @@
         /// Retrieves the <see cref="PriceRuleDiscountCode"/> with the given code.
         /// </summary>
         /// <param name="code">The code of the associated price rule.</param>
-        /// <param name="fields">A comma-separated list of fields to return.</param>
         /// <param name="cancellationToken">Cancellation Token</param>
         /// <returns>The <see cref="PriceRuleDiscountCode"/>.</returns>
-        public virtual async Task<PriceRuleDiscountCode> GetAsync(string code, string fields = null, CancellationToken cancellationToken = default)
+        public virtual async Task<PriceRuleDiscountCode> GetAsync(string code, CancellationToken cancellationToken = default)
         {
-            return await ExecuteGetAsync<PriceRuleDiscountCode>($"/discount_codes/lookup.json?code={code}", "discount_code", fields, cancellationToken);
+            return await ExecuteGetAsync<PriceRuleDiscountCode>($"discount_codes/lookup.json","discount_code",queryParams: new DiscountCodeFilter { Code=code},cancellationToken);
         }
+
+        class DiscountCodeFilter : Parameterizable
+            {
+                /// <summary>
+                /// Restrict results to the specified Code.
+                /// </summary>
+                [JsonProperty("code")]
+                public string Code { get; set; }
+            }

         /// <summary>
         /// Creates a new discount code.


Change format on default logger formatter.

--- SimpleLogger/Logging/Formatters/DefaultLoggerFormatter.cs
+++ SimpleLogger/Logging/Formatters/DefaultLoggerFormatter.cs
@@ -4,7 +4,7 @@
     {
         public string ApplyFormat(LogMessage logMessage)
         {
-            return string.Format("{0:dd.MM.yyyy HH:mm}: {1} ln: {2}  [{3} -> {4}()]: {5}",
+            return string.Format("{0:dd.MM.yyyy HH:mm}: {1} [line: {2} {3} -> {4}()]: {5}",
                             logMessage.DateTime, logMessage.Level, logMessage.LineNumber, logMessage.CallingClass,
                             logMessage.CallingMethod, logMessage.Text);
         }


More 'correct' way of implementing Dispose?

--- Source/Clients/Shared/Utility/IsolatedStorageDirectory.cs
+++ Source/Clients/Shared/Utility/IsolatedStorageDirectory.cs
@@ -41,11 +41,26 @@
                 IsolatedStorage.CreateDirectory(SubDirectory);
         }

-        public void Dispose() {
+        private bool _disposed;
+        public void Dispose()
+        {
+            Dispose(true);
+            GC.SuppressFinalize(this);
+        }
+
+        protected void Dispose(bool disposing)
+        {
+            if (_disposed)
+                return;
+
+            if (disposing)
+            {
 #if !SILVERLIGHT
-            IsolatedStorage.Close();
+                IsolatedStorage.Close();
 #endif
-            IsolatedStorage.Dispose();
+                IsolatedStorage.Dispose();
+            }
+            _disposed = true;
         }

         public string GetFullPath(string filename) {


[Toolkit.Graphics] Add comments to GraphicsDevice.GetRenderTargets. Improve efficiency when setting render tagets.

--- Source/Toolkit/SharpDX.Toolkit.Graphics/GraphicsDevice.cs
+++ Source/Toolkit/SharpDX.Toolkit.Graphics/GraphicsDevice.cs
@@ -40,7 +40,7 @@
         internal IntPtr ResetSlotsPointers { get; private set; }
         private int maxSlotCountForVertexBuffer;

-        private const int SimultaneousRenderTargetCount = 8; // TODO: Should be D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT
+        private const int SimultaneousRenderTargetCount = OutputMergerStage.SimultaneousRenderTargetCount;
         private readonly RenderTargetView[] currentRenderTargetViews = new RenderTargetView[SimultaneousRenderTargetCount];
         private RenderTargetView currentRenderTargetView;
         private int actualRenderTargetViewCount;
@@ -1209,6 +1209,11 @@
             OutputMergerStage.ResetTargets();
         }

+        /// <summary>
+        /// Gets the render targets currently binded to the <see cref="OutputMergerStage"/> through this <see cref="GraphicsDevice"/>instance.
+        /// </summary>
+        /// <param name="depthStencilViewRef">The depth stencil view, may ne null.</param>
+        /// <returns>An array of <see cref="RenderTargetView"/>.</returns>
         public RenderTargetView[] GetRenderTargets(out DepthStencilView depthStencilViewRef)
         {
             var renderTargets = new RenderTargetView[actualRenderTargetViewCount];
@@ -1597,7 +1602,7 @@
         {
             Texture texture;
             currentRenderTargetViews[0] = rtv;
-            for (int i = 1; i < currentRenderTargetViews.Length; i++)
+            for (int i = 1; i < actualRenderTargetViewCount; i++)
                 currentRenderTargetViews[i] = null;
             actualRenderTargetViewCount = 1;
             currentRenderTargetView = rtv;
@@ -1613,7 +1618,7 @@
             var rtv0 = rtvs.Length > 0 ? rtvs[0] : null;
             for (int i = 0; i < rtvs.Length; i++)
                 currentRenderTargetViews[i] = rtvs[i];
-            for (int i = rtvs.Length; i < currentRenderTargetViews.Length; i++)
+            for (int i = rtvs.Length; i < actualRenderTargetViewCount; i++)
                 currentRenderTargetViews[i] = null;
             actualRenderTargetViewCount = rtvs.Length;
             currentRenderTargetView = rtv0;


Updated entity type configuration addition method.

--- SourceCodes/DataAccessFramework/ApplicationDataContext.cs
+++ SourceCodes/DataAccessFramework/ApplicationDataContext.cs
@@ -75,32 +75,27 @@
             //  http://romiller.com/2012/03/26/dynamically-building-a-model-with-code-first

             //  Gets the MethodInfo instance for "Add".
-            var addMethod = (typeof(ConfigurationRegistrar))
+            var addMethod = (typeof (ConfigurationRegistrar))
                 .GetMethods()
                 .Single(m => m.Name == "Add" && m.GetGenericArguments()
                                                  .Any(a => a.Name == "TEntityType"));

-            //  Gets the list of assemblies that contain entity type configurations.
-            var assemblies = AppDomain.CurrentDomain
-                                      .GetAssemblies()
-                                      .Where(p => p.GetName().Name.StartsWith("DataAccessFramework"))
-                                      .OrderBy(p => p.GetName().Name)
-                                      .ToList();
+            //  Gets an assembly that contains entity type configurations.
+            var assembly = AppDomain.CurrentDomain
+                                    .GetAssemblies()
+                                    .Single(p => p.GetName().Name.StartsWith("DataAccessFramework.Entities"));

-            //  Adds all types found.
-            foreach (var assembly in assemblies)
+            //  Adds all types found within the assembly.
+            foreach (var type in assembly.GetTypes()
+                                         .Where(t => t.BaseType != null
+                                                     && t.BaseType.IsGenericType
+                                                     && t.BaseType.GetGenericTypeDefinition() == typeof (EntityTypeConfiguration<>)))
             {
-                foreach (var type in assembly.GetTypes()
-                                             .Where(t => t.BaseType != null
-                                                         && t.BaseType.IsGenericType
-                                                         && t.BaseType.GetGenericTypeDefinition() == typeof(EntityTypeConfiguration<>)))
-                {
-                    var entityType = type.BaseType.GetGenericArguments().Single();
-                    var entityConfig = assembly.CreateInstance(type.FullName);
+                var entityType = type.BaseType.GetGenericArguments().Single();
+                var entityConfig = assembly.CreateInstance(type.FullName);

-                    addMethod.MakeGenericMethod(entityType)
-                             .Invoke(modelBuilder.Configurations, new object[] { entityConfig });
-                }
+                addMethod.MakeGenericMethod(entityType)
+                         .Invoke(modelBuilder.Configurations, new object[] {entityConfig});
             }

             base.OnModelCreating(modelBuilder);


Fixed bug in reflecting on upgrade script resx

--- Src/ElasticScale.Client/ShardManagement/Utils/SqlUtils.cs
+++ Src/ElasticScale.Client/ShardManagement/Utils/SqlUtils.cs
@@ -493,7 +493,7 @@
             List<UpgradeSteps> upgradeSteps = new List<UpgradeSteps>();

             // Previously Scripts.ResourceManager.GetResourceSet was used, but that is not available in .NET Core
-            IEnumerable<PropertyInfo> props = typeof(Scripts).GetProperties(BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy).Where(p => p.PropertyType == typeof(string));
+            IEnumerable<PropertyInfo> props = typeof(Scripts).GetProperties(BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.FlattenHierarchy).Where(p => p.PropertyType == typeof(string));

             string upgradeFileNameFilter = @"^UpgradeShardMapManagerGlobalFrom(\d*).(\d*)";


httprequest proxy

httprequest proxy

--- Terradue.Tep/Terradue/Tep/Controller/Community/UserTep.cs
+++ Terradue.Tep/Terradue/Tep/Controller/Community/UserTep.cs
@@ -223,6 +223,7 @@
                                     this.Username,
                                     this.Email);
             HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
+            request.Proxy = null;
             request.Method = "GET";
             request.ContentType = "application/json";
             request.Accept = "application/json";
@@ -252,6 +253,7 @@
             request.Method = "POST";
             request.ContentType = "application/json";
             request.Accept = "application/json";
+            request.Proxy = null;

             var validatedUserName = this.Username.Replace(" ", "");

@@ -298,6 +300,7 @@
             request.Method = "GET";
             request.ContentType = "application/json";
             request.Accept = "application/json";
+            request.Proxy = null;

             using (var httpResponse = (HttpWebResponse)request.GetResponse ()){
                 using (var streamReader = new StreamReader (httpResponse.GetResponseStream ())) {


ConfigIniTest work with migrated .printer Files

--- Tests/MatterControl.Tests/MatterControl/ConfigIniTests.cs
+++ Tests/MatterControl.Tests/MatterControl/ConfigIniTests.cs
@@ -9,6 +9,7 @@
 using System.Text;
 using System.Globalization;
 using MatterHackers.MatterControl.SlicerConfiguration;
+using System.Collections.ObjectModel;

 namespace MatterControl.Tests.MatterControl
 {
@@ -17,30 +18,63 @@
 	{
 		private static List<PrinterConfig> allPrinters;
 		private static string matterControlDirectory = Path.GetFullPath(Path.Combine("..", "..", "..", ".."));
-		private static string printerSettingsDirectory = Path.GetFullPath(Path.Combine(matterControlDirectory, "StaticData", "PrinterSettings"));
+		private static string printerSettingsDirectory = Path.GetFullPath(Path.Combine(matterControlDirectory, "StaticData", "Profiles"));

 		static ConfigIniTests()
 		{
-			allPrinters = (from configIni in new DirectoryInfo(printerSettingsDirectory).GetFiles("config.ini", System.IO.SearchOption.AllDirectories)
-						   let oemProfile = new PrinterSettings() { OemLayer = PrinterSettingsLayer.LoadFromIni(configIni.FullName) }
+			//allPrinters = (from configIni in new DirectoryInfo(printerSettingsDirectory).GetFiles("config.ini", System.IO.SearchOption.AllDirectories)
+			//			   let oemProfile = new PrinterSettings() { OemLayer = PrinterSettingsLayer.LoadFromIni(configIni.FullName) }
+			//			   select new PrinterConfig
+			//			   {
+			//				   PrinterName = configIni.Directory.Name,
+			//				   Oem = configIni.Directory.Parent.Name,
+			//				   ConfigPath = configIni.FullName,
+			//				   ConfigIni = new LayerInfo()
+			//				   {
+			//					   RelativeFilePath = configIni.FullName.Substring(printerSettingsDirectory.Length + 1),
+
+			//					   // The config.ini layered profile only contains itself and does not fall back to or cascade to anything
+			//					   PrinterSettings = new PrinterSettings()
+			//					   {
+			//						   OemLayer = oemProfile.OemLayer
+			//					   },
+			//				   },
+			//				   MatterialLayers = LoadLayers(Path.Combine(configIni.Directory.FullName, "material"), oemProfile),
+			//				   QualityLayers = LoadLayers(Path.Combine(configIni.Directory.FullName, "quality"), oemProfile)
+			//			   }).ToList();
+
+			allPrinters = (from printerFile in new DirectoryInfo(printerSettingsDirectory).GetFiles("*.printer")
+						   let oemProfile = PrinterSettings.LoadFile(printerFile.FullName)
 						   select new PrinterConfig
 						   {
-							   PrinterName = configIni.Directory.Name,
-							   Oem = configIni.Directory.Parent.Name,
-							   ConfigPath = configIni.FullName,
+							   PrinterName = printerFile.Name,
+							   Oem = printerFile.Directory.Parent.Name,
+							   ConfigPath = printerFile.FullName,
 							   ConfigIni = new LayerInfo()
 							   {
-								   RelativeFilePath = configIni.FullName.Substring(printerSettingsDirectory.Length + 1),
-
-								   // The config.ini layered profile only contains itself and does not fall back to or cascade to anything
-								   PrinterSettings = new PrinterSettings()
-								   {
-									   OemLayer = oemProfile.OemLayer
-								   },
+								   RelativeFilePath = printerFile.FullName.Substring(printerSettingsDirectory.Length + 1),
+								   PrinterSettings = oemProfile
 							   },
-							   MatterialLayers = LoadLayers(Path.Combine(configIni.Directory.FullName, "material"), oemProfile),
-							   QualityLayers = LoadLayers(Path.Combine(configIni.Directory.FullName, "quality"), oemProfile)
+							   MatterialLayers = LoadLayersPrinterFile(printerFile.FullName.Substring(printerSettingsDirectory.Length + 1),oemProfile.MaterialLayers),
+							   QualityLayers = LoadLayersPrinterFile(printerFile.FullName.Substring(printerSettingsDirectory.Length + 1),oemProfile.QualityLayers)
 						   }).ToList();
+
+		}
+
+		private static List<LayerInfo> LoadLayersPrinterFile(string relativePath, ObservableCollection<PrinterSettingsLayer> layers)
+		{
+			var list = new List<LayerInfo>();
+
+			foreach( var layer in layers)
+			{
+				new LayerInfo()
+				{
+					RelativeFilePath = relativePath,
+					PrinterSettings = new PrinterSettings() { OemLayer = layer},
+				};
+			}
+
+			return list;
 		}

 		private static List<LayerInfo> LoadLayers(string layersDirectory, PrinterSettings oemProfile)


Updated PlayerSearchParameters.cs

Updated PlayerSearchParameters.cs

added code to correctly set resource id, fixed a bug where resource id would always be set.

--- UltimateTeam.Toolkit/Parameters/PlayerSearchParameters.cs
+++ UltimateTeam.Toolkit/Parameters/PlayerSearchParameters.cs
@@ -38,10 +38,13 @@
             if (MaxBid > 0)
                 uriString += "&macr=" + MaxBid;

-            if (ResourceId <= 16777216)
-                uriString += "&maskedDefId=" + ResourceId.CalculateBaseId();
-            else
-                uriString += "&definitionId=" + ResourceId;
+            if (ResourceId != 0)
+            {
+                if (ResourceId <= 16777216)
+                    uriString += "&maskedDefId=" + ResourceId.CalculateBaseId();
+                else
+                    uriString += "&definitionId=" + ResourceId;
+            }

             SetPosition(ref uriString);

@@ -78,4 +81,4 @@
                              + Position;
         }
     }
-}+}


Fix view item c# struct, was missing WID

--- src/ui/windows/TogglDesktop/TogglDesktop/KopsikApi.cs
+++ src/ui/windows/TogglDesktop/TogglDesktop/KopsikApi.cs
@@ -62,6 +62,7 @@
         public struct KopsikViewItem
         {
             public UInt64 ID;
+            public UInt64 WID;
             public string GUID;
             public string Name;
             public IntPtr Next;


Add unit test for the Clear() method of IRecentPackageRepository.

--HG--
branch : 1.1
extra : rebase_source : e1e3360eba7947fc14c72d03272baffdbde24c01

--- test/VisualStudio.Test/RecentPackageRepositoryTest.cs
+++ test/VisualStudio.Test/RecentPackageRepositoryTest.cs
@@ -7,6 +7,7 @@
 namespace NuGet.VisualStudio.Test {

     using PackageUtility = NuGet.Test.PackageUtility;
+    using System.Collections.Generic;

     [TestClass]
     public class RecentPackageRepositoryTest {
@@ -76,6 +77,19 @@
             Assert.AreEqual(new Version("2.0"), packages[0].Version);
         }

+        [TestMethod]
+        public void CallingClearMethodClearsAllPackagesFromSettingsStore() {
+            // Arrange
+            var repository = CreateRecentPackageRepository();
+
+            // Act
+            repository.Clear();
+            var packages = repository.GetPackages().ToList();
+
+            // Assert
+            Assert.AreEqual(0, packages.Count);
+        }
+
         private RecentPackagesRepository CreateRecentPackageRepository(bool empty = false) {
             var packageA = PackageUtility.CreatePackage("A", "1.0");
             var packageB = PackageUtility.CreatePackage("C", "2.0");
@@ -88,16 +102,16 @@
             var mockRepositoryFactory = new Mock<IPackageRepositoryFactory>();
             mockRepositoryFactory.Setup(f => f.CreateRepository(It.IsAny<PackageSource>())).Returns(mockRepository.Object);

-            var mockSettingsManager = new Mock<IPersistencePackageSettingsManager>();
+            var mockSettingsManager = new MockSettingsManager();

             if (!empty) {
                 var A = new PersistencePackageMetadata("A", "1.0", "bing.com");
                 var B = new PersistencePackageMetadata("B", "2.0", "live.com");

-                mockSettingsManager.Setup(p => p.LoadPackageMetadata(It.IsAny<int>())).Returns(new IPersistencePackageMetadata[] { A, B });
+                mockSettingsManager.SavePackageMetadata(new IPersistencePackageMetadata[] { A, B });
             }

-            return new RecentPackagesRepository(null, mockRepositoryFactory.Object, mockSettingsManager.Object);
+            return new RecentPackagesRepository(null, mockRepositoryFactory.Object, mockSettingsManager);
         }

         private class PersistencePackageMetadata : IPersistencePackageMetadata {
@@ -112,5 +126,23 @@
             public Version Version { get; private set; }
             public string Source { get; private set; }
         }
+
+        private class MockSettingsManager : IPersistencePackageSettingsManager {
+
+            List<IPersistencePackageMetadata> _items = new List<IPersistencePackageMetadata>();
+
+            public System.Collections.Generic.IEnumerable<IPersistencePackageMetadata> LoadPackageMetadata(int maximumCount) {
+                return _items.Take(maximumCount);
+            }
+
+            public void SavePackageMetadata(System.Collections.Generic.IEnumerable<IPersistencePackageMetadata> packageMetadata) {
+                _items.Clear();
+                _items.AddRange(packageMetadata);
+            }
+
+            public void ClearPackageMetadata() {
+                _items.Clear();
+            }
+        }
     }
 }


Constrain player, fill screen.

Constrain player, fill screen.

--- Vol6-CodeCamps/Ch03-SpaceGame/SpaceGame/SpaceGame/Game.cs
+++ Vol6-CodeCamps/Ch03-SpaceGame/SpaceGame/SpaceGame/Game.cs
@@ -22,17 +22,20 @@
 		// reference our spaceship
 		protected Texture2D texShip;

-		// NEW: our ship's location
+		// our ship's location
 		protected Vector2 locShip = Vector2.Zero;

-		// NEW: reference our starfield
+		// reference our starfield
 		protected Texture2D texStars;

-		// NEW: our background's location
+		// our background's location
 		protected Vector2 locStars = Vector2.Zero;

-		// NEW: screen resolution
+		// screen resolution
 		protected Rectangle rectViewBounds = Rectangle.Empty;
+
+		// NEW: player bounds
+		protected Rectangle rectPlayerBounds = Rectangle.Empty;

         public SpaceGame()
         {
@@ -65,17 +68,24 @@
 			// load our spaceship image
 			texShip = Content.Load<Texture2D> ("playerShip1_red");

-			// NEW: load our spacey background
+			// load our space background
 			texStars = Content.Load<Texture2D> ("purple");

-			// NEW: screen bounds
+			// screen bounds
 			rectViewBounds = graphics.GraphicsDevice.Viewport.Bounds;

-			// NEW: start ship in center of screen
+			// NEW: player bounds
+			rectPlayerBounds = rectViewBounds;
+			rectPlayerBounds.X = 10;
+			rectPlayerBounds.Width = rectViewBounds.Width - 10 * 2;
+			rectPlayerBounds.Y = rectViewBounds.Height / 3;
+			rectPlayerBounds.Height = rectViewBounds.Height - rectPlayerBounds.Top - 10;
+
+			// NEW: start ship at center, bottom of screen
 			locShip.X = rectViewBounds.Width / 2 - texShip.Bounds.Width / 2;
-			locShip.Y = rectViewBounds.Height / 2 - texShip.Bounds.Height / 2;
+			locShip.Y = rectViewBounds.Height - texShip.Bounds.Height - 10.0f;

-			// NEW: start stars off screen
+			// start stars off screen
 			locStars.Y = -texStars.Bounds.Height;
         }

@@ -85,7 +95,7 @@
 			if (gamepad1.IsButtonDown (Buttons.Back)) {
 				this.Exit ();
 			} else {
-				// NEW: move the ship
+				// move the ship
 				var elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds;
 				var dX =
 					gamepad1.ThumbSticks.Left.X +
@@ -96,7 +106,23 @@
 				locShip.X += dX * SPEED_SHIP * elapsed;
 				locShip.Y -= dY * SPEED_SHIP * elapsed;

-				// NEW: move the stars
+				// NEW: keep ship in bounds (Horizontal)
+				var maxX = rectPlayerBounds.Right - texShip.Bounds.Width;
+				if (locShip.X < rectPlayerBounds.X) {
+					locShip.X = rectPlayerBounds.X;
+				} else if(locShip.X > maxX) {
+					locShip.X = maxX;
+				}
+
+				// NEW: keep ship in bounds (Vertical)
+				var maxY = rectPlayerBounds.Bottom - texShip.Bounds.Height;
+				if (locShip.Y < rectPlayerBounds.Y) {
+					locShip.Y = rectPlayerBounds.Y;
+				} else if(locShip.Y > maxY) {
+					locShip.Y = maxY;
+				}
+
+				// move the stars
 				locStars.Y += SPEED_STARS * elapsed;
 				if (locStars.Y >= 0.0f) {
 					locStars.Y = -texStars.Bounds.Height;
@@ -110,10 +136,18 @@
 			graphics.GraphicsDevice.Clear (Color.CornflowerBlue);
 			spriteBatch.Begin ();

-			// NEW: draw our space image at current location
-			spriteBatch.Draw (texStars, locStars, Color.White);
+			// NEW: draw our space image at current location, filling screen
+			var loc = locStars;
+			while (loc.Y < rectViewBounds.Bottom) {
+				loc.X = 0.0f;
+				while (loc.X < rectViewBounds.Right) {
+					spriteBatch.Draw (texStars, loc, Color.White);
+					loc.X += texStars.Bounds.Width;
+				}
+				loc.Y += texStars.Bounds.Height;
+			}

-			// NEW: draw our spaceship image at current location
+			// draw our spaceship image at current location
 			spriteBatch.Draw (texShip, locShip, Color.White);

 			spriteBatch.End ();


project code UI message template fix

project code UI message template fix

--- Web/Areas/Logistics/Views/ProjectAllocation/Assign.cshtml
+++ Web/Areas/Logistics/Views/ProjectAllocation/Assign.cshtml
@@ -179,6 +179,9 @@
     var freeSI = {};
     var freePC = {};
     var currentAmount;
+    $("#si_validation_message").html("");
+    $("#pc_validation_message").html("");
+
     $(document).ready(function () {
         // storing selected value to hidden field
         $(".freeSI").each(function () {


API adjustments for WbMonolingualTextsCollection.

--- WikiClientLibrary/Wikibase/WbMonolingualTextCollection.cs
+++ WikiClientLibrary/Wikibase/WbMonolingualTextCollection.cs
@@ -190,7 +190,7 @@
     /// Provides convenient access to 1:n language-text pairs of multilingual text.
     /// </summary>
     /// <remarks>All the language codes are normalized to lower-case and are case-insensitive.</remarks>
-    [DebuggerDisplay("LanguagesCount = {LanguagesCount}")]
+    [DebuggerDisplay("Count = {Count}")]
     public class WbMonolingualTextsCollection : ICollection<WbMonolingualText>
     {

@@ -283,7 +283,12 @@
         {
             if (language == null || text == null) return false;
             AssertMutable();
-            return dict.TryGetValue(language, out var slot) && slot.Remove(text);
+            if (dict.TryGetValue(language, out var slot) && slot.Remove(text))
+            {
+                if (slot.Count == 0) dict.Remove(language);
+                return true;
+            }
+            return false;
         }

         /// <inheritdoc />
@@ -300,6 +305,11 @@
             AssertMutable();
             dict.Clear();
         }
+
+        /// <summary>
+        /// Gets a view of all the languages.
+        /// </summary>
+        public ICollection<string> Languages => dict.Keys;

         /// <summary>
         /// Gets/sets the associated text to the specified language.
@@ -353,27 +363,8 @@
                 : Enumerable.Empty<WbMonolingualText>();
         }

-        /// <summary>Gets the count of languages that has associated text.</summary>
-        public int LanguagesCount => dict.Count;
-
-        /// <summary>
-        /// Gets the count of text entries associated with the specified language.
-        /// </summary>
-        /// <param name="language">The language code that text entries will be counted in.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="language"/> is <c>null</c>.</exception>
-        /// <returns>A non-negative integer.</returns>
-        public int TextCount(string language)
-        {
-            if (dict.TryGetValue(language, out var slot))
-            {
-                Debug.Assert(slot.Count > 0);
-                return slot.Count;
-            }
-            return 0;
-        }
-
-        /// <inheritdoc />
-        int ICollection<WbMonolingualText>.Count => dict.Values.Sum(slot => slot.Count);
+        /// <inheritdoc />
+        public int Count => dict.Values.Sum(slot => slot.Count);

         public bool ContainsLanguage(string language)
         {
@@ -434,6 +425,7 @@
         {
             if (_IsReadOnly) throw new NotSupportedException("The dictionary is read-only.");
         }
+
     }

 }


Minor typo fix

Minor typo fix

--- ZScriptTests/Runtime/Execution/FunctionVmCallableTests.cs
+++ ZScriptTests/Runtime/Execution/FunctionVmCallableTests.cs
@@ -92,7 +92,7 @@
         /// Tests nesting multiple callables one next to another
         /// </summary>
         [TestMethod]
-        public void TestNestedMethodCallablecall()
+        public void TestNestedMethodCallableCall()
         {
             // Create the set of tokens
             IntermediaryTokenList t = new IntermediaryTokenList


NSString2: fix stringsByAppendingPaths: selector

--- src/foundation.cs
+++ src/foundation.cs
@@ -3829,7 +3829,7 @@
  		[Export("stringByResolvingSymlinksInPath")]
  		NSString ResolveSymlinksInPath();

- 		[Export("stringsByAppendingPaths")]
+		[Export("stringsByAppendingPaths:")]
  		string[] AppendPaths( string[] paths );

 		// end methods from NSStringPathExtensions category


Drop support for Unity 4, to support push notifications.

Push notifications on Unity 5 were broken due to IL2CPP not supporting PropertyInfo being exported by any type.

Fixes #36.

--- Parse/PlatformHooks.Unity.cs
+++ Parse/PlatformHooks.Unity.cs
@@ -1023,36 +1023,15 @@
     ///
     /// <param name="action">Action to be completed when device token is received.</param>
     internal static void RegisterDeviceTokenRequest(Action<byte[]> action) {
-      // Basically what we want to achieve here is:
-      //
-      // deviceToken = UnityEngine.iOS.NotificationServices.deviceToken
-      //
-      // But because we want to support backward compatibility, we're forced to use Reflection.
-      // We need to return to the non-reflection way once Unity 5 is stable on 95% developers use Unity 5.
-
-      // Warning (iOS Only): Unity 5 namespace for iOS notification is under `iOS.NotificationServices`,
-      // while Unity 4.x put them under `NotificationServices`. They're basically the same class.
-      Type notificationServicesType = PlatformHooks.GetTypeFromUnityEngine("iOS.NotificationServices");
-      if (notificationServicesType == null) {
-        notificationServicesType = PlatformHooks.GetTypeFromUnityEngine("NotificationServices");
-      }
-
-      PropertyInfo deviceTokenProperty = null;
-      if (notificationServicesType != null) {
-        deviceTokenProperty = notificationServicesType.GetProperty("deviceToken");
-      }
-
       RunOnMainThread(() => {
-        if (deviceTokenProperty != null) {
-          byte[] deviceToken = (byte[])deviceTokenProperty.GetValue(null, null);
-          if (deviceToken != null) {
-            action(deviceToken);
-            RegisteriOSPushNotificationListener((payload) => {
-              ParsePush.parsePushNotificationReceived.Invoke(ParseInstallation.CurrentInstallation, new ParsePushNotificationEventArgs(payload));
-            });
-          } else {
-            RegisterDeviceTokenRequest(action);
-          }
+        var deviceToken = UnityEngine.iOS.NotificationServices.deviceToken;
+        if (deviceToken != null) {
+          action(deviceToken);
+          RegisteriOSPushNotificationListener((payload) => {
+            ParsePush.parsePushNotificationReceived.Invoke(ParseInstallation.CurrentInstallation, new ParsePushNotificationEventArgs(payload));
+          });
+        } else {
+          RegisterDeviceTokenRequest(action);
         }
       });
     }
@@ -1062,79 +1041,26 @@
     ///
     /// <param name="action">Action to be completed when push notification is received.</param>
     internal static void RegisteriOSPushNotificationListener(Action<IDictionary<string, object>> action) {
-      // Basically what we want to achieve here is:
-      //
-      // if (UnityEngine.iOS.NotificationServices.remoteNotificationCount > 0) {
-      //   var remoteNotifications = UnityEngine.iOS.NotificationServices.remoteNotifications;
-      //   foreach (var val in remoteNotifications) {
-      //     var userInfo = val.userInfo;
-      //     var payload = new Dictionary<string, object>();
-      //
-      //     foreach (var key in userInfo.Keys) {
-      //       payload[key.ToString()] = userInfo[key];
-      //     }
-      //
-      //     action(payload);
-      //   }
-      //   UnityEngine.iOS.NotificationServices.ClearRemoteNotifications();
-      // }
-      //
-      // But because we want to support backward compatibility, we're forced to use Reflection.
-      // We need to return to the non-reflection way once Unity 5 is stable on 95% developers use Unity 5.
-
-      // Warning (iOS Only): Unity 5 namespace for iOS notification is under `iOS.NotificationServices`,
-      // while Unity 4.x put them under `NotificationServices`. They're basically the same class.
-      Type notificationServicesType = PlatformHooks.GetTypeFromUnityEngine("iOS.NotificationServices");
-      if (notificationServicesType == null) {
-        notificationServicesType = PlatformHooks.GetTypeFromUnityEngine("NotificationServices");
-      }
-
-      PropertyInfo remoteNotificationCountProperty = null;
-      if (notificationServicesType != null) {
-        remoteNotificationCountProperty = notificationServicesType.GetProperty("remoteNotificationCount");
-      }
-
-      MethodInfo clearRemoteNotificationsMethod = null;
-      PropertyInfo remoteNotificationsProperty = null;
-      if (notificationServicesType != null) {
-        clearRemoteNotificationsMethod = notificationServicesType.GetMethod("ClearRemoteNotifications");
-        remoteNotificationsProperty = notificationServicesType.GetProperty("remoteNotifications");
-      }
-
-      // Warning (iOS Only): Unity 5 namespace for iOS notification is under `iOS.RemoteNotification`,
-      // while Unity 4.x put them under `RemoteNotification`. They're basically the same class.
-      Type remoteNotificationType = PlatformHooks.GetTypeFromUnityEngine("iOS.RemoteNotification");
-      if (remoteNotificationType == null) {
-        remoteNotificationType = PlatformHooks.GetTypeFromUnityEngine("RemoteNotification");
-      }
-
-      PropertyInfo userInfoProperty = null;
-      if (remoteNotificationType != null) {
-        userInfoProperty = remoteNotificationType.GetProperty("userInfo");
-      }
-
       RunOnMainThread(() => {
-        if (remoteNotificationCountProperty != null) {
-          int remoteNotificationCount = (int)remoteNotificationCountProperty.GetValue(null, null);
-          if (remoteNotificationCount > 0) {
-            Array remoteNotifications = (Array)remoteNotificationsProperty.GetValue(null, null);
-            IEnumerator enumerator = remoteNotifications.GetEnumerator();
-            while (enumerator.MoveNext()) {
-              var userInfo = (IDictionary)userInfoProperty.GetValue(enumerator.Current, null);
-              var payload = new Dictionary<string, object>();
-              foreach (var key in userInfo.Keys) {
-                payload[key.ToString()] = userInfo[key];
-              }
-
-              // Finally, do the action for each remote notification payload.
-              action(payload);
+        int remoteNotificationCount = UnityEngine.iOS.NotificationServices.remoteNotificationCount;
+        if (remoteNotificationCount > 0) {
+          var remoteNotifications = UnityEngine.iOS.NotificationServices.remoteNotifications;
+          foreach (var val in remoteNotifications) {
+            var userInfo = val.userInfo;
+            var payload = new Dictionary<string, object>();
+            foreach (var key in userInfo.Keys) {
+              payload[key.ToString()] = userInfo[key];
             }

-            clearRemoteNotificationsMethod.Invoke(null, null);
+            // Finally, do the action for each remote notification payload.
+            action(payload);
           }
-          // Check in every frame.
-          RegisteriOSPushNotificationListener(action);
-        }
+
+          UnityEngine.iOS.NotificationServices.ClearRemoteNotifications();
+        }
+
+        // Check in every frame.
+        RegisteriOSPushNotificationListener(action);
       });
     }

@@ -1203,26 +1129,9 @@
       // from main thread.
       isWebPlayer = Application.isWebPlayer;
       osVersion = SystemInfo.deviceModel;
-      // Unity 5 has `Application.version`, but will compile-error in earlier version.
-      // Reflection is the best way we can do for now.
-      PropertyInfo appVersionProp = typeof(Application).GetProperty("version");
-      if (appVersionProp != null) {
-        appBuildVersion = (string)appVersionProp.GetValue(null, null);
-      }
-
-      // Unity 5 has `Application.bundleIdentifier`, but will compile error in earlier version.
-      // Reflection is the best way we can do for now.
-      PropertyInfo bundleIdProp = typeof(Application).GetProperty("bundleIdentifier");
-      if (bundleIdProp != null) {
-        appDisplayVersion = (string)bundleIdProp.GetValue(null, null);
-      }
-
-      // Unity 5 has `Application.productName`, but will compile error in earlier version.
-      // Reflection is the best way we can do for now.
-      PropertyInfo productNameProp = typeof(Application).GetProperty("productName");
-      if (productNameProp != null) {
-        appName = (string)productNameProp.GetValue(null, null);
-      }
+      appBuildVersion = Application.version;
+      appDisplayVersion = Application.bundleIdentifier;
+      appName = Application.productName;

       settings = SettingsWrapper.Wrapper;


callingMethod tweak

callingMethod tweak

--- Pocket.Logger/Core/Logger.cs
+++ Pocket.Logger/Core/Logger.cs
@@ -39,20 +39,19 @@

         public LogSection(
             bool requireConfirm = false,
-            string name = null,
+            [CallerMemberName] string callingMethod = null,
             string category = null,
             string id = null,
-            [CallerMemberName] string callingMethod = null,
             params object[] args) : base(category)
         {
             Id = id ?? Guid.NewGuid().ToString();
             RequireConfirm = requireConfirm;

-            Name = name ?? callingMethod;
+            Name = callingMethod;

             logEntries.Add(new LogEntry(
                                LogLevel.Information,
-                               name,
+                               callingMethod,
                                null,
                                category,
                                callingMethod,
@@ -79,6 +78,8 @@
                 return;
             }

+            logEntries.Add(logEntry);
+
             base.Log(logEntry);
         }

@@ -86,7 +87,6 @@
             bool isSuccessful,
             string message = null,
             Exception exception = null,
-            [CallerMemberName] string callingMethod = null,
             params object[] args)
         {
             if (IsComplete)
@@ -104,7 +104,6 @@
             Log(new LogEntry(initialLogEntry.LogLevel,
                              message,
                              exception: exception,
-                             callingMethod: callingMethod,
                              category: initialLogEntry.Category,
                              section: this,
                              args: args));
@@ -115,15 +114,13 @@
         public void Fail(
             Exception exception = null,
             string message = null,
-            [CallerMemberName] string callingMethod = null,
             params object[] args) =>
-            Complete(false, message, exception, callingMethod, args);
+            Complete(false, message, exception, args);

         public void Success(
             string message = "",
-            [CallerMemberName] string callingMethod = null,
             params object[] args) =>
-            Complete(true, message, null, callingMethod, args);
+            Complete(true, message, null, args);

         public void Dispose()
         {
@@ -348,17 +345,13 @@
         public void Add(string key, object value) => properties.Add(new KeyValuePair<string, object>(key, value));

         public override string ToString() =>
-            $"{Timestamp:o} {ScopeString()}[{LogLevelString()}] {Message} {Exception}";
-
-        private string ScopeString()
-        {
-            if (string.IsNullOrWhiteSpace(Category))
-            {
-                return "";
-            }
-
-            return $"[{Category}] ";
-        }
+            $"{Timestamp:o} {CategoryString()}{OperationString()}[{LogLevelString()}] {Message} {Exception}";
+
+        private string CategoryString() =>
+            string.IsNullOrWhiteSpace(Category) ? "" : $"[{Category}] ";
+
+        private string OperationString() =>
+            string.IsNullOrWhiteSpace(CallingMethod) ? "" : $"[{CallingMethod}] ";

         public IEnumerator<KeyValuePair<string, object>> GetEnumerator() =>
             properties.GetEnumerator();
@@ -377,8 +370,4 @@
             properties.Select(p => p.Value)
                       .OfType<T>();
     }
-
-    internal interface ILogEntryEnricher
-    {
-    }
 }


update podcasts media info

update podcasts media info

--- Podcasts/Entities/RSSFeed.cs
+++ Podcasts/Entities/RSSFeed.cs
@@ -108,6 +108,25 @@
                 }
             }

+            string container = null;
+            string audioCodec = null;
+            int? audioBitrate = null;
+
+            if (string.Equals(Path.GetExtension(link), ".mp3", StringComparison.OrdinalIgnoreCase))
+            {
+                container = "mp3";
+                audioCodec = "mp3";
+                // Just take a guess to try and encourage direct play
+                audioBitrate = 128000;
+            }
+            else if (string.Equals(Path.GetExtension(link), ".aac", StringComparison.OrdinalIgnoreCase))
+            {
+                container = "aac";
+                audioCodec = "aac";
+                // Just take a guess to try and encourage direct play
+                audioBitrate = 128000;
+            }
+
             return new ChannelItemInfo
             {
                 Name = title,
@@ -122,7 +141,10 @@
                     {
                         new ChannelMediaInfo
                         {
-                            Path = link
+                            Path = link,
+                            Container = container,
+                            AudioCodec = audioCodec,
+                            AudioBitrate = audioBitrate
                         }
                     },

@@ -201,6 +223,9 @@
         /// <returns><c>true</c> if [is audio file] [the specified args]; otherwise, <c>false</c>.</returns>
         public static bool IsAudioFile(string path)
         {
+            // strip off query string
+            path = path.Split('?').FirstOrDefault() ?? string.Empty;
+
             var extension = Path.GetExtension(path);

             if (string.IsNullOrEmpty(extension))


Tuned some options, expose other through Unity user interface, write some testing code (based on WaitUntil). Work in progress.

--- scripts/SaveOctaneFrameSequence.cs
+++ scripts/SaveOctaneFrameSequence.cs
@@ -5,56 +5,154 @@

 public class SaveOctaneFrameSequence : MonoBehaviour
 {
+    public int m_CaptureFramerate = 30;
+    public int m_VSynchCount = 0;
+    public uint m_MaxSamplesPerPixel = 0; // this will automatically take later its value from Octane Kernel configuration
+    public bool m_CaptureOctane = true;
+    public bool m_CaptureUnity = true;

-    private string mOutputDir;
+    private string mOctaneOutputDir;
+    private string mUnityOutputDir;
     private bool   mCapturedFrame;
-    private uint   mMaxSamplesPerPixel;
+    private uint m_OctaneSavedFrames = 0;
+
+    private bool condition;
+    //private int frame;
+
+    public IEnumerator Run() {
+        yield return new WaitForSeconds(1f);
+        print("::::::::::::: Bomb exploded ::::::::::: !!!!");
+        UnityEditor.EditorApplication.isPlaying = false;
+        Debug.Log("Real Time (The real time in seconds since the game started): " + Time.realtimeSinceStartup);
+        Debug.Log("Fixed Time (This is the time in seconds since the start of the game): " + Time.fixedTime);
+        Debug.Log("Time: " + Time.time);
+        Application.Quit();
+    }

     // Use this for initialization
     void Start()
     {
-        mOutputDir = Application.dataPath + "/octane_output";
-        Directory.CreateDirectory(mOutputDir);
-        Debug.Log("Created directory Octane Capture Script!");
+        // Create output directories
+        mOctaneOutputDir = Application.dataPath + "/../Output/Octane";
+        Directory.CreateDirectory(mOctaneOutputDir);
+        mUnityOutputDir = Application.dataPath + "/../Output/Unity";
+        Directory.CreateDirectory(mUnityOutputDir);
+
+        m_OctaneSavedFrames = 0;
         mCapturedFrame = false;
-        mMaxSamplesPerPixel = Octane.Renderer.GetLatestRenderStatistics().maxSamplesPerPixel;
+        m_MaxSamplesPerPixel = Octane.Renderer.GetLatestRenderStatistics().maxSamplesPerPixel;
+        // Configure framerate specifications
+        QualitySettings.vSyncCount = m_VSynchCount;
+        Time.captureFramerate = m_CaptureFramerate;
+        //Application.targetFrameRate = 10;
+
+        // Tests
+        //StartCoroutine(Run());
+        //StartCoroutine(Example());
+        condition = false;
+        //frame = 0;
     }

     IEnumerator WaitForOctaneRender()
     {
-        string frame_str = "frame_" + Time.frameCount.ToString();
-        while (!Octane.Renderer.GetLatestRenderStatistics().samplesPerPixel.Equals(mMaxSamplesPerPixel))
+        while (!Octane.Renderer.GetLatestRenderStatistics().samplesPerPixel.Equals(m_MaxSamplesPerPixel) /*&& Octane.Renderer.IsRendering*/
+            || !Octane.Renderer.GetLatestRenderStatistics().state.Equals(Octane.RenderState.RSTATE_FINISHED))
         {
             //print("Waiting for Octane to finish render ...");
             mCapturedFrame = false;
-            Time.timeScale = 0.0f;
+            Time.timeScale = 0;
+            Time.captureFramerate = -1;
             yield return 0;
         }

         if (!mCapturedFrame)
         {
-            Octane.Renderer.SaveImage(Octane.RenderPassId.RENDER_PASS_BEAUTY,
-                                      mOutputDir + "/" + frame_str + "_" + Octane.Renderer.SampleCount + "spp",
-                                      Octane.ImageSaveType.IMAGE_SAVE_TYPE_PNG8,
-                                      false/*synchronous*/);
-            Octane.Renderer.SaveImage(Octane.RenderPassId.RENDER_PASS_AMBIENT_OCCLUSION,
-                                      mOutputDir + "/" + frame_str + "_AO_" + Octane.Renderer.SampleCount + "spp",
-                                      Octane.ImageSaveType.IMAGE_SAVE_TYPE_PNG16,
-                                      false/*synchronous*/);
-            Octane.Renderer.SaveImage(Octane.RenderPassId.RENDER_PASS_Z_DEPTH,
-                                      mOutputDir + "/" + frame_str + "_depth_" + Octane.Renderer.SampleCount + "spp",
-                                      Octane.ImageSaveType.IMAGE_SAVE_TYPE_PNG16,
-                                      false/*synchronous*/);
-            print("Writing Octane image rendered with " + Octane.Renderer.GetLatestRenderStatistics().samplesPerPixel + "spp.");
+            if (m_CaptureOctane)
+            {
+                m_OctaneSavedFrames++;
+                string frame_str = "octane_fr_" + m_OctaneSavedFrames/*+ "_realfr_" + Time.frameCount.ToString()*/;
+                Octane.Renderer.SaveImage(Octane.RenderPassId.RENDER_PASS_BEAUTY,
+                                        mOctaneOutputDir + "/" + frame_str + "_" + Octane.Renderer.SampleCount + "spp",
+                                        Octane.ImageSaveType.IMAGE_SAVE_TYPE_PNG8,
+                                        false/*synchronous*/);
+                //Octane.Renderer.SaveImage(Octane.RenderPassId.RENDER_PASS_AMBIENT_OCCLUSION,
+                //                          mOctaneOutputDir + "/" + frame_str + "_AO_" + Octane.Renderer.SampleCount + "spp",
+                //                          Octane.ImageSaveType.IMAGE_SAVE_TYPE_PNG16,
+                //                          false/*synchronous*/);
+                //Octane.Renderer.SaveImage(Octane.RenderPassId.RENDER_PASS_Z_DEPTH,
+                //                          mOctaneOutputDir + "/" + frame_str + "_depth_" + Octane.Renderer.SampleCount + "spp",
+                //                          Octane.ImageSaveType.IMAGE_SAVE_TYPE_PNG16,
+                //                          false/*synchronous*/);
+                print("Writing Octane image " + m_OctaneSavedFrames + " rendered with " + Octane.Renderer.GetLatestRenderStatistics().samplesPerPixel + "spp.");
+            }
             mCapturedFrame = true;
+            Time.captureFramerate = m_CaptureFramerate;
+            Time.timeScale = 1;
         }
+    }
+
+    /////////////////////////////////////////////////////////////////////////////////////////////
+    // EXAMPLE TEST
+    /////////////////////////////////////////////////////////////////////////////////////////////
+    IEnumerator Example()
+    {
+        Debug.Log("Waiting for prince/princess to rescue me...");
+        Time.timeScale = 0;
+        Time.captureFramerate = 0;
+        yield return new WaitWhile(() => condition);
+
+        Debug.Log("Finally I have been rescued!");
+        string frame_str = "octframe_" + Time.frameCount.ToString();
+        Octane.Renderer.SaveImage(Octane.RenderPassId.RENDER_PASS_BEAUTY,
+                                 mOctaneOutputDir + "/" + frame_str + "_" + Octane.Renderer.SampleCount + "spp",
+                                 Octane.ImageSaveType.IMAGE_SAVE_TYPE_PNG8,
+                                 false/*synchronous*/); // TO DO : CHECK ASYNCH Vs SYNCH
         Time.timeScale = 1;
-        yield break;
+        Time.captureFramerate = 10;
     }

     // Update is called once per frame
     void Update()
     {
         StartCoroutine(WaitForOctaneRender());
+        if (m_CaptureUnity)
+        {
+            // Capture Unity Render
+            // To do: Append filename to folder name (format is '0005 shot.png"')
+            //string name = string.Format("{0}/{1:D04} shot.png", folder, Time.frameCount);
+            string name_str = "unity_fr_" + Time.frameCount.ToString();
+            // Capture the screenshot to the specified file.
+            ScreenCapture.CaptureScreenshot(mUnityOutputDir + "/" + name_str + ".png");
+        }
+
+        /////////////////////////////////////////////////////////////////////////////////////////////
+        // TESTS
+        /////////////////////////////////////////////////////////////////////////////////////////////
+#if FALSE
+        //        condition = ( (Octane.Renderer.GetLatestRenderStatistics().samplesPerPixel == mMaxSamplesPerPixel) &&
+        (Octane.Renderer.GetLatestRenderStatistics().state == Octane.RenderState.RSTATE_FINISHED) );
+        //frame++;
+
+        //StartCoroutine(Example());
+#endif
+
+#if FALSE
+        if (Octane.Renderer.SampleCount.Equals(mMaxSamplesPerPixel))
+        {
+            Debug.Log("Octane Renderer save image !!!");
+            string frame_str = "frame_" + Time.frameCount.ToString();
+            Octane.Renderer.SaveImage(Octane.RenderPassId.RENDER_PASS_BEAUTY,
+                                  mOutputDir + "/" + frame_str + "_" + Octane.Renderer.SampleCount + "spp",
+                                  Octane.ImageSaveType.IMAGE_SAVE_TYPE_PNG8,
+                                  false/*synchronous*/);
+            Time.timeScale = 1;
+        }
+
+        else if (Octane.Renderer.IsRendering || Octane.Renderer.HasFrameWaiting || Octane.Renderer.IsCompiling)
+        {
+            Debug.Log("Octane Renderer is busy ...");
+            Time.timeScale = 0;
+        }
+#endif
     }
 }


Restore com Hidden

Restore com Hidden

--- src/DescontosFidelidade/DBHelper.cs
+++ src/DescontosFidelidade/DBHelper.cs
@@ -50,10 +50,12 @@
             if (File.Exists(localAppData))
             {
                 File.Copy(localAppData, DataBaseLocation);
+                File.SetAttributes(DataBaseLocation, FileAttributes.Hidden);
                 return true;
             } else if (File.Exists(localProgramFiles))
             {
                 File.Copy(localProgramFiles, DataBaseLocation);
+                File.SetAttributes(DataBaseLocation, FileAttributes.Hidden);
                 return true;
             }
             return false;


Update ChildNode.cs

Update ChildNode.cs

--- src/Draw2D.Skia/Bounds/ChildNode.cs
+++ src/Draw2D.Skia/Bounds/ChildNode.cs
@@ -1,10 +1,7 @@
 // Copyright (c) Wiesław Šoltés. All rights reserved.
 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
 using System;
-using System.Collections.Generic;
 using Draw2D.ViewModels;
-using Draw2D.ViewModels.Containers;
-using Draw2D.ViewModels.Shapes;
 using SkiaSharp;

 namespace Draw2D.Bounds


Minor fix in XenVif.NetworkSettingsSaveRestore()

Call VifDisableEnable() only when restoring the settings.
Also, renamed 'function' to the more appropriate 'action'.

Signed-off-by: Kostas Ladopoulos <7920ee5edb7fd3a4c6c6e3ebe9bd13d4a7f2eff1@citrix.com>

--- src/InstallAgent/PVDevice/XenVif.cs
+++ src/InstallAgent/PVDevice/XenVif.cs
@@ -67,9 +67,9 @@

         public static void NetworkSettingsSaveRestore(bool save)
         {
-            // Combined the 2 functions since they
+            // Combined the 2 actions since they
             // only differ in these 3 words
-            string[] function = save ?
+            string[] action = save ?
                 new string[] { "Saving", "/save", "saved" } :
                 new string[] { "Restoring", "/restore", "restored" };

@@ -85,10 +85,10 @@
                 );
             }

-            Trace.WriteLine(function[0] + " network settings");
+            Trace.WriteLine(action[0] + " network settings");

             ProcessStartInfo start = new ProcessStartInfo();
-            start.Arguments = "/log " + function[1];
+            start.Arguments = "/log " + action[1];
             start.FileName = qNetExe;
             start.WindowStyle = ProcessWindowStyle.Hidden;
             start.CreateNoWindow = true;
@@ -98,10 +98,13 @@
                 proc.WaitForExit();
             }

-            VifDisableEnable(false);
-            VifDisableEnable(true);
-
-            Trace.WriteLine("Network settings " + function[2]);
+            if (!save) // == restore
+            {
+                VifDisableEnable(false);
+                VifDisableEnable(true);
+            }
+
+            Trace.WriteLine("Network settings " + action[2]);
         }

         public static void FixupAliases()


Fix 8.1 app

Fix 8.1 app

--- src/MiFare.Shared.UAP/CardReader.cs
+++ src/MiFare.Shared.UAP/CardReader.cs
@@ -21,8 +21,7 @@
             if (!ApiInformation.IsTypePresent(typeof(SmartCardConnection).FullName))
                 return null;
 #endif
-
-            var devices = await DeviceInformation.FindAllAsync(SmartCardReader.GetDeviceSelector(SmartCardReaderKind.Generic));
+            var devices = await DeviceInformation.FindAllAsync(SmartCardReader.GetDeviceSelector(SmartCardReaderKind.Nfc));

             // There is a bug on some devices that were updated to WP8.1 where an NFC SmartCardReader is
             // enumerated despite that the device does not support it. As a workaround, we can do an additonal check


Documentation for MusicPlayer added - all default StyleCop rules are passed!

--- src/Minesweeper/Core/MusicPlayer.cs
+++ src/Minesweeper/Core/MusicPlayer.cs
@@ -1,10 +1,22 @@
-namespace Minesweeper.Core
+//-----------------------------------------------------------------------
+// <copyright file="MusicPlayer.cs" company="Team Minesweeper 5">
+//     No copyright here. You can use whatever you want!
+// </copyright>
+// <summary>This file contains the music player for our minesweeper game</summary>
+//-----------------------------------------------------------------------
+namespace Minesweeper.Core
 {
     using System;
     using System.Threading;

+    /// <summary>
+    /// The music player for the minesweeper game. This class is responsible for all sounds within our console game.
+    /// </summary>
     public class MusicPlayer
     {
+        /// <summary>
+        /// Plays music when player has won the game.
+        /// </summary>
         public void PlayWinMusic()
         {
             Console.Beep(600, 280);
@@ -13,12 +25,18 @@
             Console.Beep(600, 680);
         }

+        /// <summary>
+        /// Plays a sound when an error has been made.
+        /// </summary>
         public void PlayErrorSound()
         {
             Console.Beep(500, 280);
             Console.Beep(500, 280);
         }

+        /// <summary>
+        /// Plays sound when the game is over.
+        /// </summary>
         public void PlayGameOverMusic()
         {
             Console.Beep(800, 300);
@@ -26,6 +44,9 @@
             Console.Beep(400, 300);
         }

+        /// <summary>
+        /// Plays game music.
+        /// </summary>
         public void PlayGameMusic()
         {
             const int SoundLenght = 320;


Fix the parsing of c++ type names so classes named 'Class' are not confused with the c++ keyword 'class'.

--- src/Mono.VisualC.Interop/CppType.cs
+++ src/Mono.VisualC.Interop/CppType.cs
@@ -201,7 +201,6 @@
 					// if we have something left, it must be a type name
 					strPart = strPart.Trim ();
 					if (strPart != "") {
-
 						string [] qualifiedName = strPart.Split (new string [] { "::" }, StringSplitOptions.RemoveEmptyEntries);
 						int numNamespaces = qualifiedName.Length - 1;
 						if (numNamespaces > 0) {
@@ -211,15 +210,31 @@
 						}
 						strPart = qualifiedName [numNamespaces];

-						// FIXME: Use Enum.TryParse here if we decide to make this NET_4_0 only
-						try {
-							CppTypes cppTypes = (CppTypes)Enum.Parse (typeof (CppTypes), strPart, true);
-							ElementType = cppTypes;
-							continue;
-						} catch { }
-
-						// otherwise it is the element type name...
-						ElementTypeName = strPart;
+						// FIXME: Fix this mess
+						switch (strPart) {
+						case "void":
+							ElementType = CppTypes.Void;
+							break;
+						case "bool":
+							ElementType = CppTypes.Bool;
+							break;
+						case "char":
+							ElementType = CppTypes.Char;
+							break;
+						case "int":
+							ElementType = CppTypes.Int;
+							break;
+						case "float":
+							ElementType = CppTypes.Float;
+							break;
+						case "double":
+							ElementType = CppTypes.Double;
+							break;
+						default:
+							// otherwise it is the element type name...
+							ElementTypeName = strPart;
+							break;
+						}
 					}
 				}
 			}


Fix EF InvalidOperationException on Startup

The code that does an 'UPSERT' of seed data on app start was querying
existing instances and attaching as modified of seed instances on the
same context. Now that we track query results this will throw because
the context has two instances of the same entity (same key value).

Swapping to use a temporary context to query existing data.

--- src/MusicStore/Models/SampleData.cs
+++ src/MusicStore/Models/SampleData.cs
@@ -36,9 +36,15 @@
         private static void AddOrUpdate<TEntity>(Func<TEntity, object> propertyToMatch, IEnumerable<TEntity> entities)
             where TEntity : class
         {
+            // Query in a separate context so that we can attach existing entities as modified
+            List<TEntity> existingData;
             using (var db = new MusicStoreContext())
             {
-                var existingData = db.Set<TEntity>().ToList();
+                existingData = db.Set<TEntity>().ToList();
+            }
+
+            using (var db = new MusicStoreContext())
+            {
                 foreach (var item in entities)
                 {
                     db.ChangeTracker.Entry(item).State = existingData.Any(g => propertyToMatch(g).Equals(propertyToMatch(item)))