Accept null for data to decode

Accept null for data to decode

--- src/Gablarski/Audio/AudioCodec.cs
+++ src/Gablarski/Audio/AudioCodec.cs
@@ -90,9 +90,6 @@

 		public byte[] Decode (byte[] data)
 		{
-			if (data == null)
-				throw new ArgumentNullException("data");
-
 			if (this.decoder == null) {
 				lock (this.codecLock) {
 					if (this.decoder == null) {
@@ -101,8 +98,10 @@
 				}
 			}

+			int length = (data != null) ? data.Length : 0;
+
 			int decodedLength;
-			byte[] decoded = this.decoder.Decode (data, data.Length, out decodedLength);
+			byte[] decoded = this.decoder.Decode (data, length, out decodedLength);
 			if (decoded.Length != decodedLength) {
 				byte[] final = new byte[decodedLength];
 				Buffer.BlockCopy (decoded, 0, final, 0, decodedLength);


Remove .Net Foundation license header

Remove .Net Foundation license header

--- src/Markdig/Helpers/CharHelper.cs
+++ src/Markdig/Helpers/CharHelper.cs
@@ -1,36 +1,6 @@
 // Copyright (c) Alexandre Mutel. All rights reserved.
 // This file is licensed under the BSD-Clause 2 license.
 // See the license.txt file in the project root for more information.
-
-
-// The IsHighSurrogate, IsLowSurrogate and ConvertToUtf32 methods are copied from
-// .Net Core source code which is under MIT license. They are copied here because
-// they don't exist in `portable40-net40+sl5+win8+wp8+wpa81`, We probably should remove them
-// once we dropped support for that target platform and use the official .Net methods.
-
-//The MIT License(MIT)
-
-//Copyright(c) .NET Foundation and Contributors
-
-//All rights reserved.
-
-//Permission is hereby granted, free of charge, to any person obtaining a copy
-//of this software and associated documentation files (the "Software"), to deal
-//in the Software without restriction, including without limitation the rights
-//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-//copies of the Software, and to permit persons to whom the Software is
-//furnished to do so, subject to the following conditions:
-
-//The above copyright notice and this permission notice shall be included in all
-//copies or substantial portions of the Software.
-
-//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-//SOFTWARE.

 using System;
 using System.Globalization;


Renamed ThreadSessionHandler to BasicSessionHandler

--- src/MeasureMap/ProfilerSession.cs
+++ src/MeasureMap/ProfilerSession.cs
@@ -25,7 +25,7 @@
         {
             _settings = new ProfilerSettings();
             _assertions = new List<Func<IResult, bool>>();
-            _executor = new ThreadSessionHandler();
+            _executor = new BasicSessionHandler();

             _sessionPipeline = new TaskExecutionChain();
             _sessionPipeline.SetNext(new ElapsedTimeSessionHandler());


Removed some warnings

Removed some warnings

svn path=/trunk/bitsharp/; revision=65433

--- src/MonoTorrent.Common/ToolBox.cs
+++ src/MonoTorrent.Common/ToolBox.cs
@@ -36,8 +36,6 @@
 {
     public class ToolBox
     {
-#warning If you want to encode the infohash to a string, use: System.Web.HttpUtility.UrlEncode(torrent.InfoHash)
-        [Obsolete]
         public static string GetHex(byte[] infoHash)
         {
             StringBuilder sb = new StringBuilder();


Added simple FindAndRender() method that writes to a StringWriter and then returns the string

git-svn-id: 223c0ba935819ffdcafdc68147dc609b4e469b1e@312079 13f79535-47bb-0310-9956-ffa450edef68

--- src/ObjectRenderer/RendererMap.cs
+++ src/ObjectRenderer/RendererMap.cs
@@ -50,6 +50,25 @@
 		/// <summary>
 		/// Render <paramref name="obj"/> using the appropriate renderer.
 		/// </summary>
+		/// <param name="obj">the object to render to a string</param>
+		/// <returns>the object rendered as a string</returns>
+		/// <remarks>
+		/// <para>
+		/// This is a convenience method used to render an object to a string.
+		/// The alternative method <see cref="FindAndRender(object,TextWriter)"/>
+		/// should be used when streaming output to a <see cref="TextWriter"/>.
+		/// </para>
+		/// </remarks>
+		public string FindAndRender(object obj)
+		{
+			StringWriter stringWriter = new StringWriter();
+			FindAndRender(obj, stringWriter);
+			return stringWriter.ToString();
+		}
+
+		/// <summary>
+		/// Render <paramref name="obj"/> using the appropriate renderer.
+		/// </summary>
 		/// <remarks>
 		/// <para>Find the appropriate renderer for the type of the
 		/// <paramref name="obj"/> parameter. This is accomplished by calling the


Fix crash when no external IPAdress available

--- src/OpenSage.Game/Network/UPnP.cs
+++ src/OpenSage.Game/Network/UPnP.cs
@@ -47,7 +47,7 @@
             try
             {
                 IPAddress.NatExternal = await NatDevice.GetExternalIPAsync();
-                Status = UPnPStatus.Enabled;
+                Status = (IPAddress.NatExternal == null) ? UPnPStatus.Disabled : UPnPStatus.Enabled;
             }
             catch (Exception e)
             {


+ forceNuget param to Bootstrapper.Program.GetEffectiveDownloadStrategy

If true, the Nuget download strategy is used, and no fallback strategy
is provided; ignores the value of preferNuget. If false, continues
existing evaluation, checking the preferNuget parameter.

--- src/Paket.Bootstrapper/Program.cs
+++ src/Paket.Bootstrapper/Program.cs
@@ -44,7 +44,7 @@
             }
             var dlArgs = EvaluateCommandArgs(commandArgs, silent);

-            var effectiveStrategy = GetEffectiveDownloadStrategy(dlArgs, preferNuget);
+            var effectiveStrategy = GetEffectiveDownloadStrategy(dlArgs, preferNuget, false);

             StartPaketBootstrapping(effectiveStrategy, dlArgs, silent);
         }
@@ -130,13 +130,18 @@
             }
         }

-        private static IDownloadStrategy GetEffectiveDownloadStrategy(DownloadArguments dlArgs, bool preferNuget)
+        private static IDownloadStrategy GetEffectiveDownloadStrategy(DownloadArguments dlArgs, bool preferNuget, bool forceNuget)
         {
             var gitHubDownloadStrategy = new GitHubDownloadStrategy(BootstrapperHelper.PrepareWebClient, BootstrapperHelper.PrepareWebRequest, BootstrapperHelper.GetDefaultWebProxyFor);
             var nugetDownloadStrategy = new NugetDownloadStrategy(BootstrapperHelper.PrepareWebClient, BootstrapperHelper.GetDefaultWebProxyFor, dlArgs.Folder, dlArgs.NugetSource);

             IDownloadStrategy effectiveStrategy;
-            if (preferNuget)
+            if (forceNuget)
+            {
+                effectiveStrategy = nugetDownloadStrategy;
+                nugetDownloadStrategy.FallbackStrategy = null;
+            }
+            else if (preferNuget)
             {
                 effectiveStrategy = nugetDownloadStrategy;
                 nugetDownloadStrategy.FallbackStrategy = gitHubDownloadStrategy;


warning message fix

warning message fix

--- src/Peachpie.Library/Functions.cs
+++ src/Peachpie.Library/Functions.cs
@@ -97,7 +97,8 @@
             var args = argsData.Value.Arguments;
             if (args == null || index >= args.Length)
             {
-                PhpException.Throw(PhpError.Warning, LibResources.GetString("argument_not_passed_to_function", index));
+                // Argument #{0} not passed to the function/method
+                PhpException.Throw(PhpError.Warning, Core.Resources.ErrResources.argument_not_passed_to_function, index.ToString(System.Globalization.CultureInfo.InvariantCulture));
                 return PhpValue.False;
             }


Fix alias usage in Add(PhpArray, PhpValue)

--- src/Peachpie.Runtime/PhpNumber.cs
+++ src/Peachpie.Runtime/PhpNumber.cs
@@ -542,9 +542,10 @@
         /// </summary>
         public static PhpArray Add(PhpArray x, PhpValue y)
         {
-            if (y.IsArray)
-            {
-                return PhpArray.Union(x, y.Array);
+            var arr = y.AsArray();  // array or &array
+            if (arr != null)
+            {
+                return PhpArray.Union(x, arr);
             }

             //PhpException.UnsupportedOperandTypes();


fix #107

fix #107

--- Assembly-CSharp/Assets/Sources/Graphics/Movie/MovieMaterial.cs
+++ Assembly-CSharp/Assets/Sources/Graphics/Movie/MovieMaterial.cs
@@ -417,9 +417,10 @@
 			}
 			set
 			{
-				this.playMode = value;
-				this.shouldSync = true;
-				this.playSpeed = ((this.playMode != MovieMaterial.FastForwardMode.Normal) ? ((Single)FF9StateSystem.Settings.FastForwardFactor) : 1f);
+				// It's realy bad idea to speed up movies!
+				// this.playMode = value;
+				// this.shouldSync = true;
+				// this.playSpeed = 1f; //((this.playMode != MovieMaterial.FastForwardMode.Normal) ? ((Single)FF9StateSystem.Settings.FastForwardFactor) : 1f);
 			}
 		}


Update asset version number

Update asset version number

--- Assets/Plugins/RainbowFolders/Editor/Scripts/Info/AssetInfo.cs
+++ Assets/Plugins/RainbowFolders/Editor/Scripts/Info/AssetInfo.cs
@@ -18,6 +18,6 @@
     {
         public const string NAME = "Rainbow Folders";
         public const string STORE_ID = "50668";
-        public const string VERSION = "0.5.0";
+        public const string VERSION = "0.7";
     }
 }


Fixed issue where getting the version number results in an error for issue #369.

--- Cognifide.PowerShell/Core/VersionDecoupling/VersionResolver.cs
+++ Cognifide.PowerShell/Core/VersionDecoupling/VersionResolver.cs
@@ -1,14 +1,11 @@
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
 using Sitecore.Configuration;

 namespace Cognifide.PowerShell.Core.VersionDecoupling
 {
     public class VersionResolver
     {
-        public static Version SitecoreVersionCurrent = Version.Parse(About.Version);
+        public static Version SitecoreVersionCurrent = GetVersionNumber(About.Version);
         public static Version SitecoreVersion72 = new Version(7, 2);
         public static Version SitecoreVersion75 = new Version(7, 5);
         public static Version SitecoreVersion80 = new Version(8, 0);
@@ -17,5 +14,16 @@
         {
             return version <= SitecoreVersionCurrent;
         }
+
+        public static Version GetVersionNumber(string version)
+        {
+            Version result;
+            if (Version.TryParse(version, out result))
+            {
+                return result;
+            }
+
+            return Version.TryParse(About.GetVersionNumber(false), out result) ? result : new Version(0, 0);
+        }
     }
 }


CA-293 fixes

CA-293 fixes

--- CollAction/Models/ProjectViewModels/DisplayProjectViewModel.cs
+++ CollAction/Models/ProjectViewModels/DisplayProjectViewModel.cs
@@ -44,7 +44,7 @@
         {
             get
             {
-                return Project.End;
+                return Project.Start;
             }
         }


Finished updating repository tests

Finished updating repository tests

git-tfs-id: [https://tfs.caes.ucdavis.edu:8088/tfs]$/Commencement/Trunk/Commencement;C8506

--- Commencement.Tests/Repositories/TemplateTypeRepositoryTests.cs
+++ Commencement.Tests/Repositories/TemplateTypeRepositoryTests.cs
@@ -5,6 +5,7 @@
 using Commencement.Tests.Core;
 using Commencement.Tests.Core.Extensions;
 using Commencement.Tests.Core.Helpers;
+using FluentNHibernate.Testing;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
 using UCDArch.Core.PersistanceSupport;
 using UCDArch.Data.NHibernate;
@@ -101,6 +102,27 @@

         #endregion Init and Overrides

+        #region Fluent Mapping Tests
+        [TestMethod]
+        public void TestCanCorrectlyMapAttachment()
+        {
+            #region Arrange
+            var id = TemplateTypeRepository.Queryable.Max(x => x.Id) + 1;
+            var session = NHibernateSessionManager.Instance.GetSession();
+            #endregion Arrange
+
+            #region Act/Assert
+            new PersistenceSpecification<TemplateType>(session)
+                .CheckProperty(c => c.Id, id)
+                .CheckProperty(c => c.Code, "Code")
+                .CheckProperty(c => c.Description, "Description")
+                .CheckProperty(c => c.Name, "Name")
+                .VerifyTheMappings();
+            #endregion Act/Assert
+        }
+
+        #endregion Fluent Mapping Tests
+
         #region Name Tests
         #region Invalid Tests

@@ -409,8 +431,128 @@
         #endregion Valid Tests
         #endregion Description Tests

-
-
+        #region Code Tests
+
+        #region Valid Tests
+
+        /// <summary>
+        /// Tests the Code with null value saves.
+        /// </summary>
+        [TestMethod]
+        public void TestCodeWithNullValueSaves()
+        {
+            #region Arrange
+            var templateType = GetValid(9);
+            templateType.Code = null;
+            #endregion Arrange
+
+            #region Act
+            TemplateTypeRepository.DbContext.BeginTransaction();
+            TemplateTypeRepository.EnsurePersistent(templateType);
+            TemplateTypeRepository.DbContext.CommitTransaction();
+            #endregion Act
+
+            #region Assert
+            Assert.IsFalse(templateType.IsTransient());
+            Assert.IsTrue(templateType.IsValid());
+            #endregion Assert
+        }
+
+        /// <summary>
+        /// Tests the Code with empty string saves.
+        /// </summary>
+        [TestMethod]
+        public void TestCodeWithEmptyStringSaves()
+        {
+            #region Arrange
+            var templateType = GetValid(9);
+            templateType.Code = string.Empty;
+            #endregion Arrange
+
+            #region Act
+            TemplateTypeRepository.DbContext.BeginTransaction();
+            TemplateTypeRepository.EnsurePersistent(templateType);
+            TemplateTypeRepository.DbContext.CommitTransaction();
+            #endregion Act
+
+            #region Assert
+            Assert.IsFalse(templateType.IsTransient());
+            Assert.IsTrue(templateType.IsValid());
+            #endregion Assert
+        }
+
+        /// <summary>
+        /// Tests the Code with one space saves.
+        /// </summary>
+        [TestMethod]
+        public void TestCodeWithOneSpaceSaves()
+        {
+            #region Arrange
+            var templateType = GetValid(9);
+            templateType.Code = " ";
+            #endregion Arrange
+
+            #region Act
+            TemplateTypeRepository.DbContext.BeginTransaction();
+            TemplateTypeRepository.EnsurePersistent(templateType);
+            TemplateTypeRepository.DbContext.CommitTransaction();
+            #endregion Act
+
+            #region Assert
+            Assert.IsFalse(templateType.IsTransient());
+            Assert.IsTrue(templateType.IsValid());
+            #endregion Assert
+        }
+
+        /// <summary>
+        /// Tests the Code with one character saves.
+        /// </summary>
+        [TestMethod]
+        public void TestCodeWithOneCharacterSaves()
+        {
+            #region Arrange
+            var templateType = GetValid(9);
+            templateType.Code = "x";
+            #endregion Arrange
+
+            #region Act
+            TemplateTypeRepository.DbContext.BeginTransaction();
+            TemplateTypeRepository.EnsurePersistent(templateType);
+            TemplateTypeRepository.DbContext.CommitTransaction();
+            #endregion Act
+
+            #region Assert
+            Assert.IsFalse(templateType.IsTransient());
+            Assert.IsTrue(templateType.IsValid());
+            #endregion Assert
+        }
+
+        /// <summary>
+        /// Tests the Code with long value saves.
+        /// </summary>
+        [TestMethod]
+        public void TestCodeWithLongValueSaves()
+        {
+            #region Arrange
+            var templateType = GetValid(9);
+            templateType.Code = "x".RepeatTimes(999);
+            #endregion Arrange
+
+            #region Act
+            TemplateTypeRepository.DbContext.BeginTransaction();
+            TemplateTypeRepository.EnsurePersistent(templateType);
+            TemplateTypeRepository.DbContext.CommitTransaction();
+            #endregion Act
+
+            #region Assert
+            Assert.AreEqual(999, templateType.Code.Length);
+            Assert.IsFalse(templateType.IsTransient());
+            Assert.IsTrue(templateType.IsValid());
+            #endregion Assert
+        }
+
+        #endregion Valid Tests
+        #endregion Code Tests

         #region Reflection of Database.

@@ -423,6 +565,7 @@
         {
             #region Arrange
             var expectedFields = new List<NameAndType>();
+            expectedFields.Add(new NameAndType("Code", "System.String", new List<string>()));
             expectedFields.Add(new NameAndType("Description", "System.String", new List<string>()));
             expectedFields.Add(new NameAndType("Id", "System.Int32", new List<string>
             {


Bugfixes #FIX: Fixed a bug that would cause VectorPropertyEditors to throw an exception when used without being bound to a class member.

--- DualityEditor/Controls/PropertyEditors/VectorPropertyEditor.cs
+++ DualityEditor/Controls/PropertyEditors/VectorPropertyEditor.cs
@@ -301,18 +301,21 @@
 				this.ApplyDefaultSubEditorConfig(t);
 			}

-			var places = this.EditedMember.GetEditorHint<EditorHintDecimalPlacesAttribute>(hintOverride);
-			var increment = this.EditedMember.GetEditorHint<EditorHintIncrementAttribute>(hintOverride);
-			var range = this.EditedMember.GetEditorHint<EditorHintRangeAttribute>(hintOverride);
+			if (this.EditedMember != null)
+			{
+				var places = this.EditedMember.GetEditorHint<EditorHintDecimalPlacesAttribute>(hintOverride);
+				var increment = this.EditedMember.GetEditorHint<EditorHintIncrementAttribute>(hintOverride);
+				var range = this.EditedMember.GetEditorHint<EditorHintRangeAttribute>(hintOverride);

-			foreach (NumericEditorTemplate t in this.editor)
-			{
-				if (places != null) t.DecimalPlaces = places.Places;
-				if (increment != null) t.Increment = increment.Increment;
-				if (range != null)
-				{
-					t.Minimum = range.Min;
-					t.Maximum = range.Max;
+				foreach (NumericEditorTemplate t in this.editor)
+				{
+					if (places != null) t.DecimalPlaces = places.Places;
+					if (increment != null) t.Increment = increment.Increment;
+					if (range != null)
+					{
+						t.Minimum = range.Min;
+						t.Maximum = range.Max;
+					}
 				}
 			}
 		}


allow dbitem to exist without logical item

--- EAAddinFramework/Databases/Compare/EADatabaseItemComparison.cs
+++ EAAddinFramework/Databases/Compare/EADatabaseItemComparison.cs
@@ -58,7 +58,14 @@
 			{
 				if (existingDatabaseItem != null)
 				{
-					comparisonStatus = DatabaseComparisonStatusEnum.deletedItem;
+					if (existingDatabaseItem.isOverridden)
+					{
+						comparisonStatus = DatabaseComparisonStatusEnum.dboverride;
+					}
+					else
+					{
+						comparisonStatus = DatabaseComparisonStatusEnum.deletedItem;
+					}
 				}
 				else
 				{


Made SauceNotFoundException able to accept inner exceptions

--- src/Shinoa/Modules/SauceModule.cs
+++ src/Shinoa/Modules/SauceModule.cs
@@ -47,9 +47,9 @@
                     artistName: document.DocumentNode.SelectNodes(@"//div[@class='resultcontentcolumn']/a")[1].InnerHtml,
                     thumbmnailImageUrl: document.DocumentNode.SelectNodes(@"//div[@class='resultimage']/a/img")[0].Attributes["src"].Value);
             }
-            catch (Exception)
+            catch (Exception e)
             {
-                throw new SauceNotFoundException();
+                throw new SauceNotFoundException(string.Empty, e);
             }
         }

@@ -137,6 +137,15 @@

         public class SauceNotFoundException : Exception
         {
+            public SauceNotFoundException()
+                : base()
+            {
+            }
+
+            public SauceNotFoundException(string message, Exception innerException)
+                : base(message, innerException)
+            {
+            }
         }

         public class SauceResult


ProcessEventクラスのディレイ時間の処理を変更

ProcessEventクラスのディレイ時間の処理を変更

--- src/Sitrine/Event/ProcessEvent.cs
+++ src/Sitrine/Event/ProcessEvent.cs
@@ -52,7 +52,7 @@
             if (seconds < 0)
                 throw new ArgumentOutOfRangeException("seconds");

-            this.PopDelaySpan().SetDelayAction(this.Storyboard);
+            this.SetDelayToStory();
             this.Storyboard.AddAction(() => this.Storyboard.SetWait(this.Storyboard.GetFrameCount(seconds)));

             return this;
@@ -69,7 +69,7 @@
             if (frame < 0)
                 throw new ArgumentOutOfRangeException("frame");

-            this.PopDelaySpan().SetDelayAction(this.Storyboard);
+            this.SetDelayToStory();
             this.Storyboard.AddAction(() => this.Storyboard.SetWait(frame));

             return this;
@@ -82,7 +82,7 @@
         /// <returns>このイベントのオブジェクトを返します。</returns>
         public ProcessEvent Break()
         {
-            this.PopDelaySpan().SetDelayAction(this.Storyboard);
+            this.SetDelayToStory();
             this.Storyboard.AddAction(this.Storyboard.Break);

             return this;
@@ -95,7 +95,7 @@
         /// <returns>このイベントのオブジェクトを返します。</returns>
         public ProcessEvent Invoke(Action action)
         {
-            this.PopDelaySpan().SetDelayAction(this.Storyboard);
+            this.SetDelayToStory();
             this.Storyboard.AddAction(action);

             return this;
@@ -109,7 +109,7 @@
         /// <returns>このイベントのオブジェクトを返します。</returns>
         public ProcessEvent Fork(Storyboard newStoryboard)
         {
-            this.PopDelaySpan().SetDelayAction(this.Storyboard);
+            this.SetDelayToStory();
             this.Storyboard.AddAction(() => this.Window.AddStoryboard(newStoryboard));

             return this;
@@ -124,7 +124,7 @@
         /// <returns>このイベントのオブジェクトを返します。</returns>
         public ProcessEvent ForkIf(Func<bool> condition, Storyboard newStoryboard)
         {
-            this.PopDelaySpan().SetDelayAction(this.Storyboard);
+            this.SetDelayToStory();
             this.Storyboard.AddAction(() =>
             {
                 if (condition())
@@ -144,7 +144,7 @@
         /// <returns>このイベントのオブジェクトを返します。</returns>
         public ProcessEvent ForkIf(Func<bool> condition, Storyboard storyOnTrue, Storyboard storyOnFalse)
         {
-            this.PopDelaySpan().SetDelayAction(this.Storyboard);
+            this.SetDelayToStory();
             this.Storyboard.AddAction(() => this.Window.AddStoryboard(condition() ? storyOnTrue : storyOnFalse));

             return this;
@@ -159,7 +159,7 @@
         /// <returns>このイベントのオブジェクトを返します。</returns>
         public ProcessEvent ForkElseIf(Func<bool> condition, Storyboard newStoryboard)
         {
-            this.PopDelaySpan().SetDelayAction(this.Storyboard);
+            this.SetDelayToStory();
             this.Storyboard.AddAction(() =>
             {
                 if (!condition())
@@ -177,7 +177,7 @@
         /// <returns>このイベントのオブジェクトを返します。</returns>
         public ProcessEvent Yield(Storyboard newStoryboard)
         {
-            this.PopDelaySpan().SetDelayAction(this.Storyboard);
+            this.SetDelayToStory();
             this.Storyboard.AddAction(() =>
             {
                 this.Window.AddStoryboard(newStoryboard);
@@ -196,7 +196,7 @@
         /// <returns>このイベントのオブジェクトを返します。</returns>
         public ProcessEvent YieldIf(Func<bool> condition, Storyboard newStoryboard)
         {
-            this.PopDelaySpan().SetDelayAction(this.Storyboard);
+            this.SetDelayToStory();
             this.Storyboard.AddAction(() =>
             {
                 if (condition())
@@ -219,7 +219,7 @@
         /// <returns>このイベントのオブジェクトを返します。</returns>
         public ProcessEvent YieldIf(Func<bool> condition, Storyboard storyOnTrue, Storyboard storyOnFalse)
         {
-            this.PopDelaySpan().SetDelayAction(this.Storyboard);
+            this.SetDelayToStory();
             this.Storyboard.AddAction(() =>
             {
                 this.Window.AddStoryboard(condition() ? storyOnTrue : storyOnFalse);
@@ -238,7 +238,7 @@
         /// <returns>このイベントのオブジェクトを返します。</returns>
         public ProcessEvent YieldElseIf(Func<bool> condition, Storyboard newStoryboard)
         {
-            this.PopDelaySpan().SetDelayAction(this.Storyboard);
+            this.SetDelayToStory();
             this.Storyboard.AddAction(() =>
             {
                 if (!condition())
@@ -259,7 +259,7 @@
         /// <returns>このイベントのオブジェクトを返します。</returns>
         public ProcessEvent Loop(Action<Storyboard> storyevents, int loopCount = -1)
         {
-            this.PopDelaySpan().SetDelayAction(this.Storyboard);
+            this.SetDelayToStory();
             this.Storyboard.AddAction(() => this.Window.AddStoryboard(LoopStoryboard.Create(this.Window, storyevents, loopCount)));

             return this;


Fix complex object enum field name schema.

--- src/SoapCore/MetaWCFBodyWriter.cs
+++ src/SoapCore/MetaWCFBodyWriter.cs
@@ -821,7 +821,7 @@
 			if (typeInfo.IsEnum)
 			{
 				WriteComplexElementType(writer, type.Name, _schemaNamespace, objectNamespace, type);
-				writer.WriteAttributeString("name", type.Name);
+				writer.WriteAttributeString("name", name);
 			}
 			else if (typeInfo.IsValueType)
 			{


Change PushbackInputStream to use only a single stack

--- src/TextFx/PushbackInputStream.cs
+++ src/TextFx/PushbackInputStream.cs
@@ -11,17 +11,11 @@
     ///
     public class PushbackInputStream : Stream
     {
-        /// Any previous pushback buffers.
-        private readonly Stack<PushbackContext> pushbackStack;
-
         /// The input stream that is being wrapped.
         private readonly Stream stream;

         /// The current pushback buffer.
-        private byte[] pushbackBuffer;
-
-        /// The current position within the pushback buffer.
-        private int pushbackOffset;
+        private readonly Stack<byte> pushback;

         ///
         /// Initializes a new instance of the <see cref="PushbackInputStream"/> class that wraps a given <see cref="Stream"/> object.
@@ -42,7 +36,7 @@
             }

             this.stream = stream;
-            this.pushbackStack = new Stack<PushbackContext>();
+            this.pushback = new Stack<byte>();
         }

         /// Gets a value indicating whether the current stream supports reading.
@@ -121,7 +115,7 @@
         public override void Flush()
         {
             this.stream.Flush();
-            this.pushbackStack.TrimExcess();
+            this.pushback.TrimExcess();
         }

         /// Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
@@ -204,68 +198,31 @@
 }}", count));
             }

-            // Push the current pushback buffer (if any) onto the stack
-            var currentBuffer = this.pushbackBuffer;
-            if (currentBuffer != null)
-            {
-                var position = this.pushbackOffset;
-                if (position < currentBuffer.Length)
-                {
-                    this.pushbackStack.Push(new PushbackContext { Buffer = currentBuffer, Offset = position });
-                }
-            }
-
-            // Replace the current pushback buffer
-            var tmp = new byte[count];
-            Buffer.BlockCopy(buffer, offset, tmp, 0, count);
-            this.pushbackBuffer = tmp;
-            this.pushbackOffset = 0;
+            for (int i = buffer.Length - 1; i >= offset && count != 0; i--, count--)
+            {
+                this.pushback.Push(buffer[i]);
+            }
         }

         private bool ReadFromBuffer(byte[] buffer, int offset, int count, out int result)
         {
-            if (this.pushbackBuffer == null)
+            if (this.pushback.Count == 0)
             {
                 result = default(int);
                 return false;
             }

-            if (this.pushbackOffset == this.pushbackBuffer.Length)
-            {
-                if (this.pushbackStack.Count == 0)
+            for (result = 0; result < count; result++, offset++)
+            {
+                if (this.pushback.Count == 0)
                 {
-                    result = default(int);
-                    return false;
+                    break;
                 }

-                var ctx = this.pushbackStack.Pop();
-                this.pushbackBuffer = ctx.Buffer;
-                this.pushbackOffset = ctx.Offset;
-            }
-
-            var currentPushbackBuffer = this.pushbackBuffer;
-            var currentPushbackOffset = this.pushbackOffset;
-            var available = currentPushbackBuffer.Length - currentPushbackOffset;
-            if (count > available)
-            {
-                Buffer.BlockCopy(currentPushbackBuffer, currentPushbackOffset, buffer, offset, available);
-                result = available;
-            }
-            else
-            {
-                Buffer.BlockCopy(currentPushbackBuffer, currentPushbackOffset, buffer, offset, count);
-                result = count;
-            }
-
-            this.pushbackOffset += result;
+                buffer[offset] = this.pushback.Pop();
+            }
+
             return true;
-        }
-
-        private class PushbackContext
-        {
-            public byte[] Buffer { get; set; }
-
-            public int Offset { get; set; }
         }
     }
 }


UncasImageHandler: Moved resize module to Uncas.Drawing and referenced that instead.

git-svn-id: 93f8dae8c9705d66954625438e5916a833f6d1c5@377 90d2b0b2-0e11-ba47-89f1-85e69862abc4

--- src/UncasImageHandler/FormMain.cs
+++ src/UncasImageHandler/FormMain.cs
@@ -1,11 +1,8 @@
 using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.ComponentModel;
 using System.Diagnostics;
 using System.IO;
 using System.Windows.Forms;
-using Uncas.Drawing;
+using Uncas.Drawing.ImageResizing;

 namespace UncasImageHandler
 {
@@ -23,7 +20,7 @@

         #region Private fields and properties

-        private ImageHandler ih = new ImageHandler();
+        private ResizeImages ri = new ResizeImages();
         private const string ResizeText = "Gem";
         private const string CancelText = "Afbryd";

@@ -52,14 +49,6 @@
                 += new EventHandler(btnClear_Click);
             btnSaveResizedImages.Click
                 += new EventHandler(btnSaveResizedImages_Click);
-            resizeWorker.DoWork
-                += new DoWorkEventHandler(resizeWorker_DoWork);
-            resizeWorker.ProgressChanged
-                += new ProgressChangedEventHandler
-                    (resizeWorker_ProgressChanged);
-            resizeWorker.RunWorkerCompleted
-                += new RunWorkerCompletedEventHandler
-                    (resizeWorker_RunWorkerCompleted);
             #endregion

             #region Sets folders on file and folder dialogs
@@ -104,6 +93,52 @@
             ChangeSourceMode();

             SetMaxImageSize();
+
+            ri.ResizeProgressChanged
+                += new EventHandler<ResizeProgressEventArgs>
+                    (ri_ProgressChanged);
+
+            ri.ResizeCompleted
+                += new EventHandler<ResizeCompletedEventArgs>
+                    (ri_ResizeCompleted);
+
+            ri.ResizeFailed
+                += new EventHandler<ResizeFailedEventArgs>
+                    (ri_ResizeFailed);
+        }
+
+        void ri_ResizeFailed
+            (object sender
+            , ResizeFailedEventArgs e)
+        {
+            MessageBox.Show(e.Exception.ToString());
+        }
+
+        void ri_ResizeCompleted
+            (object sender
+            , ResizeCompletedEventArgs e)
+        {
+            if (e.Cancelled)
+            {
+                MessageBox.Show("Arbejdet blev afbrudt");
+            }
+            else
+            {
+                lblNumberCompleted.Text = e.ProcessedImages.ToString();
+                progressBar1.Value = 100;
+                MessageBox.Show("Billederne blev gemt");
+            }
+            gbSourceMode.Enabled = true;
+            gbOutputFolder.Enabled = true;
+            gbMaxSize.Enabled = true;
+            btnSaveResizedImages.Text = ResizeText;
+            Process.Start(lblOutputFolder.Text);
+        }
+
+        void ri_ProgressChanged(object sender, ResizeProgressEventArgs e)
+        {
+            lblNumberCompleted.Text = e.ProcessedImages.ToString();
+            progressBar1.Value = e.ProcessedImages.Percentage;
         }

         #region Handling user choices
@@ -217,7 +252,7 @@
             gbOutputFolder.Enabled = false;
             gbMaxSize.Enabled = false;
             #endregion
-            DoResizeWorkAsync
+            ri.DoResizeWorkAsync
                 (lblOutputFolder.Text
                 , rbChooseFiles.Checked
                 , rbChooseFolder.Checked
@@ -256,293 +291,6 @@

         #endregion

-        #region Resizing the chosen images
-
-        #region Running in background thread
-
-        private class ImageToResize
-        {
-            public string OriginalImagePath { get; set; }
-            public string ResizedImagePath { get; set; }
-        }
-
-        private class SelectedImagesInfo
-        {
-            public int MaxImageSize { get; set; }
-            public List<ImageToResize> ImagesToResize { get; set; }
-        }
-
-        private class ProcessedImagesInfo
-        {
-            public int TotalNumberOfImages { get; set; }
-            public int ResizedNumberOfImages { get; set; }
-
-            public override string ToString()
-            {
-                return string.Format("{0}/{1}"
-                    , this.ResizedNumberOfImages
-                    , this.TotalNumberOfImages);
-            }
-        }
-
-        private void DoResizeWorkAsync
-            (string baseOutputFolder
-            , bool chooseFiles
-            , bool chooseFolder
-            , string baseInputFolder
-            , bool includeSubFolders
-            , IEnumerable filePaths
-            , int maxImageSize
-            )
-        {
-            #region Getting the list of images
-            List<ImageToResize> imagesToResize
-                = new List<ImageToResize>();
-            if (chooseFiles)
-            {
-                imagesToResize
-                    = GetSelectedImages
-                    (baseOutputFolder
-                    , filePaths);
-            }
-            else if (chooseFolder)
-            {
-                DirectoryInfo diBase
-                    = new DirectoryInfo(baseInputFolder);
-                try
-                {
-                    GetImagesInSelectedFolder
-                        (ref imagesToResize
-                        , diBase.Name
-                        , baseOutputFolder
-                        , diBase
-                        , includeSubFolders);
-                }
-                catch (Exception ex)
-                {
-                    HandleException(ex);
-                }
-            }
-            #endregion
-            #region Resizing the images
-            SelectedImagesInfo sfi = new SelectedImagesInfo
-            {
-                ImagesToResize = imagesToResize,
-                MaxImageSize = maxImageSize
-            };
-            resizeWorker.RunWorkerAsync(sfi);
-            #endregion
-        }
-
-        void resizeWorker_DoWork(object sender, DoWorkEventArgs e)
-        {
-            SelectedImagesInfo sfi = (SelectedImagesInfo)e.Argument;
-            int filesCompleted = 0;
-            ProcessedImagesInfo pif = new ProcessedImagesInfo
-            {
-                TotalNumberOfImages = sfi.ImagesToResize.Count,
-                ResizedNumberOfImages = filesCompleted
-            };
-            foreach (ImageToResize itr in sfi.ImagesToResize)
-            {
-                pif.ResizedNumberOfImages = filesCompleted;
-                int percentage = (int)((100d * filesCompleted)
-                    / (1d * sfi.ImagesToResize.Count));
-                resizeWorker.ReportProgress(percentage, pif);
-                if (resizeWorker.CancellationPending)
-                {
-                    e.Cancel = true;
-                    break;
-                }
-                ResizeImage(itr.OriginalImagePath
-                    , itr.ResizedImagePath
-                    , sfi.MaxImageSize);
-                filesCompleted++;
-            }
-            pif.ResizedNumberOfImages = filesCompleted;
-            e.Result = pif;
-        }
-
-        // TODO: Create event in the new class to pass this on:
-        void resizeWorker_ProgressChanged
-            (object sender
-            , ProgressChangedEventArgs e)
-        {
-            ProcessedImagesInfo pif
-                = (ProcessedImagesInfo)e.UserState;
-            lblNumberCompleted.Text = pif.ToString();
-            progressBar1.Value = e.ProgressPercentage;
-        }
-
-        // TODO: Create event in the new class to pass this on:
-        void resizeWorker_RunWorkerCompleted
-            (object sender
-            , RunWorkerCompletedEventArgs e)
-        {
-            if (e.Cancelled)
-            {
-                MessageBox.Show("Arbejdet blev afbrudt");
-            }
-            else
-            {
-                ProcessedImagesInfo pif
-                    = (ProcessedImagesInfo)e.Result;
-                lblNumberCompleted.Text = pif.ToString();
-                progressBar1.Value = 100;
-                MessageBox.Show("Billederne blev gemt");
-            }
-            gbSourceMode.Enabled = true;
-            gbOutputFolder.Enabled = true;
-            gbMaxSize.Enabled = true;
-            btnSaveResizedImages.Text = ResizeText;
-            Process.Start(lblOutputFolder.Text);
-        }
-
-        #endregion
-
-        #region The actual resizing methods
-
-        private List<ImageToResize> GetSelectedImages
-            (string baseOutputFolder
-            , IEnumerable filePaths)
-        {
-            List<ImageToResize> imagesToResize
-                = new List<ImageToResize>();
-            foreach (string filePath in filePaths)
-            {
-                FileInfo fi = new FileInfo(filePath);
-                string smallerFilePath =
-                    Path.Combine(baseOutputFolder, fi.Name);
-                imagesToResize.Add(new ImageToResize
-                {
-                    OriginalImagePath = filePath,
-                    ResizedImagePath = smallerFilePath
-                });
-            }
-            return imagesToResize;
-        }
-
-        private void GetImagesInSelectedFolder
-            (ref List<ImageToResize> imagesToResize
-            , string relativeInputFolderPath
-            , string baseOutputFolder
-            , DirectoryInfo di
-            , bool includeSubFolders)
-        {
-            string inputFolderPath = di.FullName;
-            string outputFolderPath
-                = Path.Combine(baseOutputFolder
-                , relativeInputFolderPath);
-            DirectoryInfo diOutput
-                = new DirectoryInfo(outputFolderPath);
-            // Getting images in this folder
-            GetFilesByExtension
-                (imagesToResize
-                , di
-                , outputFolderPath
-                , diOutput
-                , "*.jpg");
-            GetFilesByExtension
-                (imagesToResize
-                , di
-                , outputFolderPath
-                , diOutput
-                , "*.jpeg");
-            GetFilesByExtension
-                (imagesToResize
-                , di
-                , outputFolderPath
-                , diOutput
-                , "*.bmp");
-            GetFilesByExtension
-                (imagesToResize
-                , di
-                , outputFolderPath
-                , diOutput
-                , "*.png");
-            GetFilesByExtension
-                (imagesToResize
-                , di
-                , outputFolderPath
-                , diOutput
-                , "*.gif");
-            if (includeSubFolders)
-            {
-                // Resizing images in subfolders
-                foreach (DirectoryInfo diChild in di.GetDirectories())
-                {
-                    string childRelativePath
-                        = Path.Combine
-                        (relativeInputFolderPath
-                        , diChild.Name);
-                    GetImagesInSelectedFolder
-                        (ref imagesToResize
-                        , childRelativePath
-                        , baseOutputFolder
-                        , diChild
-                        , includeSubFolders);
-                }
-            }
-        }
-
-        private void GetFilesByExtension
-            (List<ImageToResize> imagesToResize
-            , DirectoryInfo di
-            , string outputFolderPath
-            , DirectoryInfo diOutput
-            , string extension)
-        {
-            foreach (FileInfo fi in di.GetFiles(extension))
-            {
-                if (!diOutput.Exists)
-                    diOutput.Create();
-                string originalImagePath = fi.FullName;
-                string resizedImagePath
-                    = Path.Combine(outputFolderPath, fi.Name);
-                imagesToResize.Add(new ImageToResize
-                {
-                    OriginalImagePath = originalImagePath,
-                    ResizedImagePath = resizedImagePath
-                });
-            }
-        }
-
-        private void ResizeImage
-            (string originalImagePath
-            , string resizedImagePath
-            , int maxImageSize)
-        {
-            try
-            {
-                if (File.Exists(originalImagePath)
-                    && !File.Exists(resizedImagePath))
-                {
-                    byte[] originalBytes
-                        = File.ReadAllBytes(originalImagePath);
-                    byte[] resizedBytes
-                        = ih.GetThumbnail(originalBytes, maxImageSize);
-                    originalBytes = null;
-                    File.WriteAllBytes(resizedImagePath, resizedBytes);
-                    resizedBytes = null;
-                    GC.WaitForPendingFinalizers();
-                }
-            }
-            catch (Exception ex)
-            {
-                HandleException(ex);
-            }
-        }
-
-        #endregion
-
-        #endregion
-
-        // TODO: Create event in the new class to pass this on:
-        private void HandleException(Exception ex)
-        {
-            MessageBox.Show(ex.ToString());
-        }
-
         #endregion
     }
 }


:bug: Fix evaluation of max values for random int and long

Use Math.Pow instead of logical XOR to evaluate max values

--- src/Utils/RandomValueGenerator.cs
+++ src/Utils/RandomValueGenerator.cs
@@ -1,8 +1,4 @@
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;

 namespace StrangerData.Utils
 {
@@ -17,12 +13,12 @@
                     return Any.String(columnInfo.MaxLength);
                 case ColumnType.Int:
                     // generates a random integer
-                    long maxValue = 10 ^ columnInfo.Precision - 1;
+                    long maxValue = (int)Math.Pow(10, columnInfo.Precision - 1);
                     if (maxValue > int.MaxValue)
                     {
-                        return Any.Long(1, columnInfo.Precision - 1);
+                        return Any.Long(1, maxValue);
                     }
-                    return Any.Int(1, 10 ^ columnInfo.Precision - 1);
+                    return Any.Int(1, (int)maxValue);
                 case ColumnType.Decimal:
                     // generates a random decimal
                     return Any.Double(columnInfo.Precision, columnInfo.Scale);
@@ -31,7 +27,7 @@
                     return Any.Double(columnInfo.Precision, columnInfo.Scale);
                 case ColumnType.Long:
                     // generates a random long
-                    return Any.Long(1, 10 ^ columnInfo.Precision - 1);
+                    return Any.Long(1, (int)Math.Pow(10, columnInfo.Precision - 1));
                 case ColumnType.Boolean:
                     // generates a random boolean
                     return Any.Boolean();


[BUG FIX] Corrigido erro que "limpava" a|~a, gerando uma proposição não equivalente.


Removed unneeded struct

Removed unneeded struct


Fix receipts for Lightning Address invoices

`AdditionalData` needs to be null-checked, because it isn't set for invoices generated via Lightning Address.

Fixes #4169.


Revert "WinForms - DefaultFocusHandler now allows browser to take focus on initial load"

This reverts commit f725ab3907487e1cac34b2b407d2c4535a8edba7.

Issue #2776


[Fix]:publicが抜けていたので追加

[Fix]:publicが抜けていたので追加

--- block-program/Detection/DebugOutput.cs
+++ block-program/Detection/DebugOutput.cs
@@ -3,7 +3,7 @@

 namespace Myxini.Recognition.Image
 {
-	class DebugOutput
+	public class DebugOutput
 	{
 		[Conditional("DEBUG")]
 		public static void SaveImage(string[] file_name, IImage image)


bugfix fix wrong commit

bugfix fix wrong commit

--- WpfDesign.Designer/Project/DesignPanel.cs
+++ WpfDesign.Designer/Project/DesignPanel.cs
@@ -473,8 +473,6 @@
 				}

 				foreach (PlacementInformation info in placementOp.PlacedItems) {
-
-
 					var transform = info.Item.Parent.View.TransformToVisual(this.DesignSurface.DesignContext.RootItem.View);
 					if (transform is MatrixTransform mt) {
 						var angle = Math.Atan2(mt.Matrix.M21, mt.Matrix.M11) * 180 / Math.PI;
@@ -486,12 +484,10 @@
 							var bak = dx;
 							dx = dy;
 							dy = bak * -1;
-						} else if (angle > 135.0 && angle < -135.0) {
+						} else if (angle > 135.0 || angle < -135.0) {
 							dx = dx * -1;
 							dy = dy * -1;
 						}
-
-
 					}

 					var bounds = info.OriginalBounds;


improved animations for vertical line series

--- WpfView/Points/VerticalBezierPointView.cs
+++ WpfView/Points/VerticalBezierPointView.cs
@@ -62,20 +62,36 @@
                 }
                 else
                 {
-                    Segment.Point1 = new Point(0, Data.Point1.Y);
-                    Segment.Point2 = new Point(0, Data.Point2.Y);
-                    Segment.Point3 = new Point(0, Data.Point3.Y);
+                    if (current.SeriesView.IsFirstDraw)
+                    {
+                        Segment.Point1 = new Point(0, Data.Point1.Y);
+                        Segment.Point2 = new Point(0, Data.Point2.Y);
+                        Segment.Point3 = new Point(0, Data.Point3.Y);
+
+                        if (Shape != null)
+                        {
+                            Canvas.SetTop(Shape, current.ChartLocation.Y - Shape.Height * .5);
+                            Canvas.SetLeft(Shape, 0);
+                        }
+                    }
+                    else
+                    {
+                        var startPoint = ((LineSeries) current.SeriesView).Splitters[0].Left.Point;
+                        Segment.Point1 = startPoint;
+                        Segment.Point2 = startPoint;
+                        Segment.Point3 = startPoint;
+
+                        if (Shape != null)
+                        {
+                            Canvas.SetTop(Shape, startPoint.Y - Shape.Height * .5);
+                            Canvas.SetLeft(Shape,  startPoint.X);
+                        }
+                    }

                     if (DataLabel != null)
                     {
                         Canvas.SetTop(DataLabel, current.ChartLocation.Y - DataLabel.ActualHeight*.5);
                         Canvas.SetLeft(DataLabel, 0);
-                    }
-
-                    if (Shape != null)
-                    {
-                        Canvas.SetTop(Shape, current.ChartLocation.Y - Shape.Height*.5);
-                        Canvas.SetLeft(Shape, 0);
                     }
                 }
             }


Fix for not getting chatroom name correctly

--- KraxbotOSS/Form1.cs
+++ KraxbotOSS/Form1.cs
@@ -455,7 +455,7 @@
                 // Check if we have a Cleverbot session
                 if (!CB.Exists(x => x.SteamID == chatRoomID))
                 {
-                    Log(string.Format("\nNo Cleverbot session for {0}", friends.GetClanName(chatRoomID)));
+                    Log(string.Format("\nNo Cleverbot session for {0}", chatRoom.ChatName));
                     string[] apikey = config.API_CleverbotIO.Split(';');
                     CB.Add(new CleverbotUser()
                     {


Don't return error, log it

Don't return error, log it

--- KraxbotOSS/Form1.cs
+++ KraxbotOSS/Form1.cs
@@ -707,7 +707,8 @@
                 try {
                     return client.DownloadString(url);
                 } catch (System.Net.WebException e) {
-                    return e.Message;
+                    Console.WriteLine(e.Message);
+                    return null;
                 }
             }
         }


Remove debug log

Remove debug log

--- KraxbotOSS/Form1.cs
+++ KraxbotOSS/Form1.cs
@@ -245,7 +245,6 @@
                 friends.SetPersonaState(config.LoginAs);

                 // Join chatrooms
-                Console.WriteLine(config.Chatrooms);
                 foreach (SteamID groupID in GetGroups())
                     if (config.Chatrooms.ToString().IndexOf(groupID.AccountID.ToString()) > -1)
                         friends.JoinChat(groupID);


Fix auto login crash

Fix auto login crash

--- KraxbotOSS/Form1.cs
+++ KraxbotOSS/Form1.cs
@@ -231,7 +231,10 @@
             Log("Ok");
             if (File.Exists(Path.Combine(configPath, "user")))
             {
-                lNetwork.Text = "Network: Connected";
+                Invoke((MethodInvoker)delegate
+                {
+                    lNetwork.Text = "Network: Connected";
+                });
                 string[] user = File.ReadAllLines(Path.Combine(configPath, "user"));
                 FormLogin.Username = user[0];
                 Login(user[0]);


Font change also updates generation.

Font change also updates generation.

--- LayoutParameters.cs
+++ LayoutParameters.cs
@@ -12,12 +12,23 @@
     {
         public LayoutParameters(Font font, Color defaultForeground, Color selectionColor)
         {
-            Font = font;
+            this.font = font;
             this.defaultForeground = defaultForeground;
             this.selectionColor = selectionColor;
         }

-        public Font Font { get; set; }
+        public Font Font
+        {
+            get
+            {
+                return font;
+            }
+            set
+            {
+                font = value;
+                UpdateGeneration();
+            }
+        }

         public double Width
         {
@@ -83,6 +94,7 @@
             generation++;
         }

+        private Font font;
         private int generation;
         private Color defaultForeground;
         private Color selectionColor;


Update per pr review.

Update per pr review.

--- EPPlus/Table/PivotTable/DataCalculation/TotalFunctionHelper.cs
+++ EPPlus/Table/PivotTable/DataCalculation/TotalFunctionHelper.cs
@@ -166,7 +166,6 @@
 			if (string.IsNullOrEmpty(formula))
 				return null;
 			// Create a named range that calculates each field referenced by the formula.
-			var stringValues = new List<string>();
 			foreach (var nameToValues in namesToValues)
 			{
 				var excelName = nameToValues.Key;
@@ -174,7 +173,7 @@
 					excelName = this.FieldNamesToSanitizedFieldNames[excelName];

 				// Convert DateTime values to OADates in order for calculations to proceed correctly.
-				stringValues.Clear();
+				var stringValues = new List<string>();
 				foreach (var value in nameToValues.Value)
 				{
 					if (value is DateTime dateValue)


修改一处Download的异常

修改一处Download的异常

--- GameFramework/Download/DownloadAgentHelperCompleteEventArgs.cs
+++ GameFramework/Download/DownloadAgentHelperCompleteEventArgs.cs
@@ -18,7 +18,7 @@
         /// <param name="length">下载的数据大小。</param>
         public DownloadAgentHelperCompleteEventArgs(int length)
         {
-            if (length <= 0)
+            if (length < 0)
             {
                 throw new GameFrameworkException("Length is invalid.");
             }


Fix a typo

Fix a typo

--- Google.Ads.GoogleAds/examples/CampaignManagement/ValidateAd.cs
+++ Google.Ads.GoogleAds/examples/CampaignManagement/ValidateAd.cs
@@ -70,7 +70,7 @@
         /// Returns a description about the code example.
         /// </summary>
         public override string Description =>
-            "This code example shows how to use the validateOnly header to validate a resopnsive " +
+            "This code example shows how to use the validateOnly header to validate a responsive " +
             "search ad. No objects will be created, but exceptions will still be thrown.";

         /// <summary>


Added buffer to the size of the map when resizing.

--- HackManchester2014/HackManchester2014/Views/Shared/_Map.cshtml
+++ HackManchester2014/HackManchester2014/Views/Shared/_Map.cshtml
@@ -5,7 +5,6 @@
 {
     <text>
         loadMaxLatLng(@Html.Raw(donation.NominationsGeoJson))
-        map.setView([@Model.Donation.Location.Latitude, @Model.Donation.Location.Longitude]);
         animatePath(map, @Html.Raw(donation.DonationGeoJson), @Html.Raw(donation.NominationsGeoJson))
         setTimeout(function() {
             @for (int i = 0; i < donation.Nominations.Count; i++)
@@ -83,29 +82,32 @@
             }
         }
         function loadMaxLatLng(data) {
-            var oldmaxLat = maxLat;
-            var oldmaxLng = maxLng;
-            var oldminLat = minLat;
-            var oldminLng = minLng;
+            var buffer = 0.1;
+            var updated = false;
             for (var i = 0; i < data.features.length; i++) {
                 var latLng = data.features[i].geometry.coordinates;
                 var lat = latLng[0];
                 var lng = latLng[1];
                 if (lat < minLat) {
-                    minLat = lat;
+                    updated = true;
+                    minLat = lat - buffer;
                 }
                 if (lat > maxLat) {
-                    maxLat = lat;
+                    updated = true;
+                    maxLat = lat + buffer;
                 }
                 if (lng < minLng) {
-                    minLng = lng;
+                    updated = true;
+                    minLng = lng - buffer;
                 }
                 if (lng > maxLng) {
-                    maxLng = lng;
+                    updated = true;
+                    maxLng = lng + buffer;
                 }
             }
-            if (oldmaxLat != maxLat || oldmaxLng != maxLng || oldminLat != minLat || oldminLng == minLng) {
+            if (updated === true) {
                 map.fitBounds([[minLat, minLng],[maxLat, maxLng]], [10,10]);
+                map.setView([@Model.Donation.Location.Latitude, @Model.Donation.Location.Longitude]);
             }
         }
         function drawPoints(map, data) {


Creating batches of 50 and adding more information to the logs

--- LogGenerator/TwitterStream.cs
+++ LogGenerator/TwitterStream.cs
@@ -83,7 +83,7 @@
                     Message = GetLogText(tweetInfo),
                     Timestamp = DateTime.Now
                 });
-                if(++counter % 10 == 0) {
+                if(++counter % 50 == 0) {
                     sequenceToken = DispatchLogEvents(logEventsBatch, sequenceToken);
                     logEventsBatch = new List<InputLogEvent>();
                 }
@@ -119,11 +119,14 @@
             var retweetedStatus = tweetInfo["retweeted_status"];
             var entities = tweetInfo["entities"];
             var hashTags = entities["hashtags"];
+            var tweetDate = tweetInfo["created_at"].ToString();
+            var userDate = user["created_at"].ToString();
             var text = new List<string> {
                 $"[USER]: The user name is ({user["name"]}), they have ({user["favourites_count"]}) favorite tweets and " +
                     $"have tweeted ({user["statuses_count"]}) times. " +
-                    $"They have ({user["friends_count"]}) friends and follow ({user["followers_count"]}) people!!",
-                $"[MESSAGE]: The tweet message is: ({tweetInfo["text"]})"
+                    $"They have ({user["friends_count"]}) friends and follow ({user["followers_count"]}) people!!" +
+                    $"This user was created on ({DateTime.Parse(userDate):yyyy-MM-dd HH:mm:ss})",
+                $"[MESSAGE]: The tweet by ({user["name"]}) is: ({tweetInfo["text"]}) and it was tweeted at ({DateTime.Parse(tweetDate):yyyy-MM-dd HH:mm:ss})"
             };
             if(!retweetedStatus.IsNullOrEmpty()) {
                 var retweetCount = retweetedStatus["retweet_count"];


#13596 Re-configure all samples to work with projekt-stoettesystemerne.dk - .Net STS samples -- customize validateConfirmationdata method to let it accept all data

--- Kombit.Samples.Service/Code/CustomSaml2SecurityTokenHandler.cs
+++ Kombit.Samples.Service/Code/CustomSaml2SecurityTokenHandler.cs
@@ -49,15 +49,16 @@
         /// <param name="confirmationData"></param>
         protected override void ValidateConfirmationData(Saml2SubjectConfirmationData confirmationData)
         {
-            try
-            {
-                base.ValidateConfirmationData(confirmationData);
-            }
-            catch (Exception ex)
-            {
-                if (!ex.Message.ToLower(CultureInfo.InvariantCulture).Contains("4157"))
-                    throw;
-            }
+            return;
+            //try
+            //{
+            //    base.ValidateConfirmationData(confirmationData);
+            //}
+            //catch (Exception ex)
+            //{
+            //    if (!ex.Message.ToLower(CultureInfo.InvariantCulture).Contains("4157"))
+            //        throw;
+            //}
         }

         /// <summary>


Logout requires user to set IssuerAddress (for now)

--- Microsoft.IdentityModel.Extensions/src/OpenIdConnectMessage.cs
+++ Microsoft.IdentityModel.Extensions/src/OpenIdConnectMessage.cs
@@ -81,7 +81,6 @@
         public string CreateLogoutQueryString()
         {
             OpenIdConnectMessage openIdConnectMessage = new OpenIdConnectMessage(this);
-            openIdConnectMessage.IssuerAddress = openIdConnectMessage.LogoutEndpoint;
             return openIdConnectMessage.BuildRedirectUri();
         }

@@ -273,11 +272,6 @@
         }

         /// <summary>
-        /// Gets or sets the value for the LogoutEndpoint
-        /// </summary>
-        public string LogoutEndpoint { get; set; }
-
-        /// <summary>
         /// Gets or sets 'max_age'.
         /// </summary>
         public string Max_Age


Remove some extra string allocations on getting a display type name display string

--- Mono.Debugging/Mono.Debugging.Evaluation/ObjectValueAdaptor.cs
+++ Mono.Debugging/Mono.Debugging.Evaluation/ObjectValueAdaptor.cs
@@ -193,7 +193,7 @@
 					next = genericEndIndex;

 				// Append the next generic type component
-				builder.Append (typeName.Substring (i, next - i));
+				builder.Append (typeName, i, next - i);

 				i = next + 1;
 			}
@@ -1266,7 +1266,7 @@
 			int last = 0;

 			while (i != -1 && i < expr.Length) {
-				display.Append (expr.Substring (last, i - last));
+				display.Append (expr, last, i - last);
 				i++;

 				int j = expr.IndexOf ('}', i);
@@ -1308,7 +1308,7 @@
 					if (str == null)
 						display.Append ("null");
 					else if (noquotes && IsQuoted (str))
-						display.Append (str.Substring (1, str.Length - 2));
+						display.Append (str, 1, str.Length - 2);
 					else
 						display.Append (str);
 				} else {


Fix nullability of second field of schedule

--- NCrontab/CrontabSchedule.cs
+++ NCrontab/CrontabSchedule.cs
@@ -38,7 +38,7 @@

     public sealed partial class CrontabSchedule
     {
-        readonly CrontabField _seconds;
+        readonly CrontabField? _seconds;
         readonly CrontabField _minutes;
         readonly CrontabField _hours;
         readonly CrontabField _days;
@@ -145,7 +145,7 @@
         }

         CrontabSchedule(
-            CrontabField seconds,
+            CrontabField? seconds,
             CrontabField minutes, CrontabField hours,
             CrontabField days, CrontabField months,
             CrontabField daysOfWeek)


Correction in test message.

Correction in test message.

--- NextLevelSeven.Test/MessageGeneration/MessageGeneratorTests.cs
+++ NextLevelSeven.Test/MessageGeneration/MessageGeneratorTests.cs
@@ -17,7 +17,7 @@
             Assert.AreEqual("^~\\&", message[1][2].Value, @"MSH-2 is not the standard set of encoding characters.");
             Assert.IsNotNull(message.ProcessingId, @"Processing ID is null.");
             Assert.AreEqual(message.Type, "ADT", @"Message type is not correct.");
-            Assert.AreEqual(message.TriggerEvent, "A01", @"Message type is not correct.");
+            Assert.AreEqual(message.TriggerEvent, "A01", @"Message trigger event is not correct.");
             Assert.IsNotNull(message.Version, @"Version number is null.");
         }
     }


Fix for Dialogs crash when app style is set via ThemeManager #1358

--- MahApps.Metro/ThemeManager.cs
+++ MahApps.Metro/ThemeManager.cs
@@ -197,8 +197,63 @@
         {
             if (resources == null) throw new ArgumentNullException("resources");

-            return Accents.FirstOrDefault(x => x.Resources.Source == resources.Source);
-        }
+            var builtInAccent = Accents.FirstOrDefault(x => x.Resources.Source == resources.Source);
+            if (builtInAccent != null)
+            {
+                return builtInAccent;
+            }
+
+            // support dynamically created runtime resource dictionaries
+            if (IsAccentDictionary(resources))
+            {
+                return new Accent
+                {
+                    Name = "Runtime accent",
+                    Resources = resources
+                };
+            }
+
+            return null;
+        }
+
+        /// <summary>
+        /// Determines whether the specified resource dictionary represents an <see cref="Accent"/>.
+        /// <para />
+        /// This might include runtime accents which do not have a resource uri.
+        /// </summary>
+        /// <param name="resources">The resources.</param>
+        /// <returns><c>true</c> if the resource dictionary is an <see cref="Accent"/>; otherwise, <c>false</c>.</returns>
+        /// <exception cref="System.ArgumentNullException">resources</exception>
+        public static bool IsAccentDictionary(ResourceDictionary resources)
+        {
+            if (resources == null) throw new ArgumentNullException("resources");
+
+            // Note: add more checks if these keys aren't sufficient
+            var styleKeys = new List<string>(new []
+            {
+                "HighlightColor",
+                "AccentColor",
+                "AccentColor2",
+                "AccentColor3",
+                "AccentColor4",
+                "HighlightBrush",
+                "AccentColorBrush",
+                "AccentColorBrush2",
+                "AccentColorBrush3",
+                "AccentColorBrush4",
+            });
+
+            foreach (var styleKey in styleKeys)
+            {
+                if (!resources.Contains(styleKey))
+                {
+                    return false;
+                }
+            }
+
+            return true;
+        }
+
         /// <summary>
         /// Gets a resource from the detected AppStyle.
         /// </summary>


Removed static properties and detection of a theme from app resources.

--- MahApps.Metro/ThemeManager.cs
+++ MahApps.Metro/ThemeManager.cs
@@ -38,14 +38,10 @@

         public static void ChangeTheme(ResourceDictionary r, Accent accent, Theme theme)
         {
-            ThemeIsDark = (theme == Theme.Dark);
-            ThemeAccent = accent;
             var themeResource = (theme == Theme.Light) ? LightResource : DarkResource;
             ApplyResourceDictionary(themeResource, r);
             ApplyResourceDictionary(accent.Resources, r);
         }
-
-        public static bool ThemeIsDark { get; private set; }

         private static void ApplyResourceDictionary(ResourceDictionary newRd, ResourceDictionary oldRd)
         {
@@ -58,38 +54,12 @@
             }
         }

-        public static Accent ThemeAccent { get; private set; }
-
-        /// <summary>
-        /// Scans the Application resources and updates the ThemeIsDark and ThemeAccent properties.
-        /// </summary>
-        /// <param name="window">The optional window to check. This can be null.</param>
-        /// <returns></returns>
-        public static void DetectTheme()
-        {
-            Theme currentTheme = Theme.Light;
-            ResourceDictionary themeDictionary = null;
-            Tuple<Theme, Accent> detectedAccentTheme = null;
-
-
-            if (DetectThemeFromAppResources(out currentTheme, out themeDictionary))
-            {
-                detectedAccentTheme = GetThemeFromResources(currentTheme, Application.Current.Resources);
-            }
-
-
-            if (detectedAccentTheme != null)
-            {
-                ThemeAccent = detectedAccentTheme.Item2;
-                ThemeIsDark = detectedAccentTheme.Item1 == Theme.Dark;
-            }
-        }
         /// <summary>
         /// Scans a Window's resources and returns it's accent and theme.
         /// </summary>
         /// <param name="window">The Window to check.</param>
         /// <returns></returns>
-        public static Tuple<Theme, Accent> DetectThemeForWindow(MahApps.Metro.Controls.MetroWindow window)
+        public static Tuple<Theme, Accent> DetectTheme(MahApps.Metro.Controls.MetroWindow window)
         {
             if (window == null) throw new ArgumentNullException("window");


Clamp heightmap lookups in BasicPhysics to the size of the region

--- OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs
+++ OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs
@@ -129,11 +129,14 @@
                     actorPosition.X = ((int)Constants.RegionSize - 0.1f);
                 }

-                float height = _heightMap[(int)actor.Position.Y * Constants.RegionSize + (int)actor.Position.X] + actor.Size.Z;
+                int posX = Utils.Clamp((int)actor.Position.X, 0, (int)Constants.RegionSize - 1);
+                int posY = Utils.Clamp((int)actor.Position.Y, 0, (int)Constants.RegionSize - 1);
+
+                float height = _heightMap[posY * Constants.RegionSize + posX] + actor.Size.Z;
                 if (actor.Flying)
                 {
                     if (actor.Position.Z + (actor.Velocity.Z*timeStep) <
-                        _heightMap[(int)actor.Position.Y * Constants.RegionSize + (int)actor.Position.X] + 2)
+                        _heightMap[posY * Constants.RegionSize + posX] + 2)
                     {
                         actorPosition.Z = height;
                         actorVelocity.Z = 0;


Add test for transient session

Add test for transient session

--- OutlookMatters.Test/Mattermost/Session/TransientSessionTest.cs
+++ OutlookMatters.Test/Mattermost/Session/TransientSessionTest.cs
@@ -123,6 +123,25 @@
             session.Verify(x => x.GetPostById(PostId));
         }

+        [Test]
+        public void FetchChannelList_ReturnsChannelListFromCurrentSession()
+        {
+            var settingsLoadService = new Mock<ISettingsLoadService>();
+            var settings = new OutlookMatters.Settings.Settings("myUrl", "testTeamId", "Donald Duck", "channels");
+            settingsLoadService.Setup(x => x.Load()).Returns(settings);
+            var mattermost = new Mock<IMattermost>();
+            var session = new Mock<ISession>();
+            mattermost.Setup(
+                x => x.LoginByUsername(settings.MattermostUrl, settings.TeamId, settings.Username, It.IsAny<string>()))
+                .Returns(session.Object);
+            var classUnderTest = new TransientSession(mattermost.Object, settingsLoadService.Object,
+                Mock.Of<IPasswordProvider>());
+
+            classUnderTest.FetchChannelList();
+
+            session.Verify(x => x.FetchChannelList());
+        }
+
         private static ISettingsLoadService DefaultSettingsLoadService
         {
             get


Refactored GetIssues method

Refactored GetIssues method

--- NuCheck/SolutionAnalyzer.cs
+++ NuCheck/SolutionAnalyzer.cs
@@ -16,18 +16,15 @@
         {
             IDictionary<Package, IEnumerable<Project>> packagesAggregation = packagesAggregator.Aggregate(solutionFile);

-            var packageGroup = from package in packagesAggregation.Keys
-                               group package by package.Id
-                               into g
-                               select new { Id = g.Key, Versions = g.ToList() };
+            var packagesWithIssues = from package in packagesAggregation.Keys
+                                     group package by package.Id
+                                     into g
+                                     where g.Count() > 1
+                                     select new { Id = g.Key, Versions = g.ToList() };

-            var packageWithIssues = from package in packageGroup
-                                    where package.Versions.Count() > 1
-                                    select package.Versions;
-
-            return packageWithIssues.SelectMany(package => package)
-                                    .Select(package => new Issue(package, packagesAggregation[package]))
-                                    .ToList();
+            return packagesWithIssues.SelectMany(package => package.Versions)
+                                     .Select(package => new Issue(package, packagesAggregation[package]))
+                                     .ToList();
         }
     }
 }


More stuff.

More stuff.

--- RubeGoldbergProgram/RubeGoldbergProgram/RubeGoldbergProgram.cs
+++ RubeGoldbergProgram/RubeGoldbergProgram/RubeGoldbergProgram.cs
@@ -12,8 +12,11 @@
 		{
 			Console.WriteLine("This program does something simple in the most complicated way possible.");

-			int randomNumber = GetRandomNumber();
-			Console.WriteLine("Let's start with the random number. [{0}]", randomNumber);
+			int randomNumberOne = GetRandomNumber();
+			int randomNumberTwo = GetRandomNumber();
+			Console.WriteLine("Let's start with the random number. [{0}]", randomNumberOne);
+
+			Console.WriteLine("And let's use the random number. [{0}]", randomNumberTwo);

 			Console.WriteLine("Press any key to continue.");
 			Console.ReadLine();


Added VARTYPE.GetCorrespondingType extension method to convert to a .NET or Vanara type.

--- PInvoke/Ole/Ole32/WTypes.cs
+++ PInvoke/Ole/Ole32/WTypes.cs
@@ -1,6 +1,10 @@
 using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection.Emit;
 using System.Runtime.InteropServices;
 using System.Runtime.InteropServices.ComTypes;
+using Vanara.Extensions;
 using Vanara.InteropServices;

 namespace Vanara.PInvoke
@@ -407,6 +411,35 @@
 			VT_BYREF = 0x4000,
 		}

+		/// Gets the .NET runtime type which corresponds to the <see cref="VARTYPE"/>.
+		/// <param name="vt">The <see cref="VARTYPE"/> enumeration value to evaluate.</param>
+		/// <returns>
+		/// <para>The corresponding .NET runtime type.</para>
+		/// <para>
+		/// If <paramref name="vt"/> specifies <see cref="VARTYPE.VT_VECTOR"/> or <see cref="VARTYPE.VT_ARRAY"/>, the return type is an
+		/// array of the element type.
+		/// </para>
+		/// <para>
+		/// If <paramref name="vt"/> specifies <see cref="VARTYPE.VT_BYREF"/> and the element type is a value type, the return type is a
+		/// pointer to the element type.
+		/// </para>
+		/// </returns>
+		public static Type GetCorrespondingType(this VARTYPE vt)
+		{
+			var elemVT = vt & ~(VARTYPE)0xF000;
+			var specVT = vt & (VARTYPE)0xF000;
+			var type = CorrespondingTypeAttribute.GetCorrespondingTypes(elemVT).FirstOrDefault();
+			if (type is null || elemVT == 0)
+				return null;
+			// Change type if by reference
+			if (specVT.IsFlagSet(VARTYPE.VT_BYREF) && type.IsValueType)
+				type = type.MakePointerType();
+			// Change type if vector
+			if (specVT.IsFlagSet(VARTYPE.VT_VECTOR) || specVT.IsFlagSet(VARTYPE.VT_ARRAY))
+				type = type.MakeArrayType();
+			return type;
+		}
+
 		/// Contains an operating system platform and processor architecture.
 		// https://docs.microsoft.com/en-us/windows/win32/api/wtypes/ns-wtypes-csplatform typedef struct tagCSPLATFORM { DWORD dwPlatformId;
 		// DWORD dwVersionHi; DWORD dwVersionLo; DWORD dwProcessorArch; } CSPLATFORM;


Support for compressed logs with Windows Phone 8. For some reason can't yet open resulting file with 7zip/Window, but ZipArchive object manages to open archive file.

--- MetroLog.WP8/Wp8FileTarget.cs
+++ MetroLog.WP8/Wp8FileTarget.cs
@@ -6,6 +6,10 @@
 using MetroLog.Layouts;
 using Windows.Storage;
 using Windows.Storage.Search;
+
+using Windows.Storage.Streams;
+using System.IO.Compression;
+using System.Runtime.InteropServices.WindowsRuntime;

 namespace MetroLog.Targets
 {
@@ -30,9 +34,72 @@
             return _logFolder;
         }

-        protected override Task<Stream> GetCompressedLogsInternal()
+        private async static Task<byte[]> ReadStorageFileToByteBuffer(IStorageFile storageFile)
         {
-           throw new NotSupportedException("Compression not supported on WP8 yet");
+            IRandomAccessStream accessStream = await storageFile.OpenReadAsync();
+            byte[] content = null;
+
+            using (Stream stream = accessStream.AsStreamForRead((int)accessStream.Size))
+            {
+                content = new byte[stream.Length];
+                await stream.ReadAsync(content, 0, (int)stream.Length);
+            }
+
+            return content;
+        }
+
+        private string GetCompressedFileName(string baseDirPath, StorageFile file)
+        {
+            return file.Path.Remove(0, baseDirPath.Length);
+        }
+
+        private async Task ZipFolderContents(StorageFolder sourceFolder, ZipArchive archive, string baseDirPath)
+        {
+            IReadOnlyList<StorageFile> files = await sourceFolder.GetFilesAsync();
+            Regex pattern = FileNamingParameters.GetRegex();
+
+            foreach (StorageFile file in files)
+            {
+                if (pattern.Match(file.Name).Success)
+                {
+                    ZipArchiveEntry readmeEntry = archive.CreateEntry(GetCompressedFileName(baseDirPath, file));
+
+                    byte[] buffer = await ReadStorageFileToByteBuffer(file);
+
+                    Stream entryStream = readmeEntry.Open();
+                    await entryStream.WriteAsync(buffer, 0, buffer.Length);
+                    await entryStream.FlushAsync();
+                    entryStream.Dispose();
+                    //using (Stream entryStream = readmeEntry.Open())
+                    //{
+                    //    await entryStream.WriteAsync(buffer, 0, buffer.Length);
+                    //}
+                }
+            }
+
+        }
+
+        protected async override Task<Stream> GetCompressedLogsInternal()
+        {
+            String logFileName = "Logs-Dump.zip";
+
+            // create log file and output stream
+            StorageFile zippedStorageFile = await _logFolder.CreateFileAsync(logFileName, CreationCollisionOption.ReplaceExisting);
+            Stream logoutputStream = await zippedStorageFile.OpenStreamForWriteAsync();
+
+            // archive
+            ZipArchive zipArchive = new ZipArchive(logoutputStream, ZipArchiveMode.Create, false);
+            await ZipFolderContents(_logFolder, zipArchive, logFileName);
+
+            // release outfile stream
+            await logoutputStream.FlushAsync();
+            zipArchive.Dispose();
+            logoutputStream.Dispose();
+
+            // get inputstream for reading
+            Stream loginputStream = await _logFolder.OpenStreamForReadAsync(logFileName);
+
+            return loginputStream;
         }

         protected override Task EnsureInitialized()


Fixed IGridConfig page

Fixed IGridConfig page

--- Source/Applications/openMIC/openMIC/wwwroot/IGridConfig.cshtml
+++ Source/Applications/openMIC/openMIC/wwwroot/IGridConfig.cshtml
@@ -1,25 +1,25 @@
 @*******************************************************************************************************
-    //  IGridConfig.cshtml - Gbtc
-    //
-    //  Copyright © 2017, Grid Protection Alliance.  All Rights Reserved.
-    //
-    //  Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
-    //  the NOTICE file distributed with this work for additional information regarding copyright ownership.
-    //  The GPA licenses this file to you under the MIT License (MIT), the "License"; you may not use this
-    //  file except in compliance with the License. You may obtain a copy of the License at:
-    //
-    //      http://opensource.org/licenses/MIT
-    //
-    //  Unless agreed to in writing, the subject software distributed under the License is distributed on an
-    //  "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
-    //  License for the specific language governing permissions and limitations.
-    //
-    //  Code Modification History:
-    //  ----------------------------------------------------------------------------------------------------
-    //  04/11/2017 - Ritchie Carroll
-    //       Generated original version of source code.
-    //
-    //*****************************************************************************************************@
+//  IGridConfig.cshtml - Gbtc
+//
+//  Copyright © 2017, Grid Protection Alliance.  All Rights Reserved.
+//
+//  Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
+//  the NOTICE file distributed with this work for additional information regarding copyright ownership.
+//  The GPA licenses this file to you under the MIT License (MIT), the "License"; you may not use this
+//  file except in compliance with the License. You may obtain a copy of the License at:
+//
+//      http://opensource.org/licenses/MIT
+//
+//  Unless agreed to in writing, the subject software distributed under the License is distributed on an
+//  "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
+//  License for the specific language governing permissions and limitations.
+//
+//  Code Modification History:
+//  ----------------------------------------------------------------------------------------------------
+//  04/11/2017 - Ritchie Carroll
+//       Generated original version of source code.
+//
+//*****************************************************************************************************@
 @using System.Net.Http
 @using System.Threading
 @using GSF.Identity
@@ -551,7 +551,7 @@
             });

             // Initialize primary view model
-            ko.applyBindings(viewModel);
+            ko.applyBindings(viewModel, document.getElementsByTagName("body")[0]);

             // Monitor for view model changes
             ko.watch(viewModel.devices, { depth: -1 }, function(parents, child, item) {


Fix render sorting for items not on the same hierarchy level

--- Source/Engine/AGS.Engine/Graphics/Logic/RenderOrderSelector.cs
+++ Source/Engine/AGS.Engine/Graphics/Logic/RenderOrderSelector.cs
@@ -56,7 +56,7 @@
 				float z1 = getZ(parent1, s1, out newParent1);
 				float z2 = getZ(parent2, s2, out newParent2);
 				if (z1 != z2) return z2 - z1;
-				if (newParent1 == null || newParent2 == null || newParent1 == s1 || newParent2 == s2)
+                if (newParent1 == null || newParent2 == null || (newParent1 == s1 && newParent2 == s2))
 				{
 					z1 = newParent1 == null ? parent1 == null ? 0 : getZ(parent1) : getZ(newParent1);
 					z2 = newParent2 == null ? parent2 == null ? 0 : getZ(parent2) : getZ(newParent2);


[Toolkit.Compiler] Fixed bind transforms for meshes that have additional tranformations in bind pose

--- Source/Toolkit/SharpDX.Toolkit.Compiler/Model/ModelCompiler.cs
+++ Source/Toolkit/SharpDX.Toolkit.Compiler/Model/ModelCompiler.cs
@@ -757,25 +757,30 @@
             Matrix meshBindTransform = Matrix.Identity;
             if (assimpMesh.HasBones)
             {
-                meshBindTransform = GetAbsoluteTransform(parentNode);
-
                 for (int i = 0; i < assimpMesh.Bones.Length; i++)
                 {
                     var bone = assimpMesh.Bones[i];
                     var boneNode = scene.RootNode.FindNode(bone.Name);

-                    // Get or create this skinned bone's global index
+                    // If a bone is used by multiple meshes, their offset matrices may still be different, as the meshes could have additional
+                    // transformations in bind pose. However, this transformation is equal for all offset matrices of the same mesh.
                     int boneIndex;
                     if (!skinnedBones.TryGetValue(boneNode, out boneIndex))
                     {
+                        // Register each bone only once
                         boneIndex = model.SkinnedBones.Count;
                         skinnedBones[boneNode] = boneIndex;

                         model.SkinnedBones.Add(new ModelData.SkinnedBone
                         {
                             BoneIndex = skeletonNodes[boneNode],
-                            InverseBindTransform = Matrix.Invert(GetAbsoluteTransform(parentNode)) * ConvertMatrix(bone.OffsetMatrix),
+                            InverseBindTransform = ConvertMatrix(bone.OffsetMatrix)
                         });
+                    }
+                    else
+                    {
+                        // If another mesh is using the bone, the difference in offset matrices is baked into the mesh.
+                        meshBindTransform = ConvertMatrix(bone.OffsetMatrix) * Matrix.Invert(model.SkinnedBones[boneIndex].InverseBindTransform);
                     }

                     // Add the bone index to the mesh part's local bone list


minor fixes updating BIM element properties from cloud database

--- RoomEditorApp/DbUpdater.cs
+++ RoomEditorApp/DbUpdater.cs
@@ -171,6 +171,8 @@
         "expected equal dictionary length" );

       string key_db; // JavaScript lowercases first char
+      string val_db; // remove prepended "r " or "w "
+      string val_el;

       foreach( string key in eldict.Keys )
       {
@@ -185,22 +187,23 @@
           Debug.Assert( dbdict.ContainsKey( key_db ),
             "expected same keys in Revit model and cloud database" );

+          val_db = dbdict[key_db].Substring( 2 );
+
           if( StorageType.String == pa.StorageType )
           {
-            if( !pa.AsString().Equals( dbdict[key_db] ) )
-            {
-              modifiedPropertyKeys.Add( key );
-            }
+            val_el = pa.AsString() ?? string.Empty;
           }
           else
           {
             Debug.Assert( StorageType.Integer == pa.StorageType,
               "expected only string and integer parameters" );

-            if( !pa.AsInteger().ToString().Equals( dbdict[key_db] ) )
-            {
-              modifiedPropertyKeys.Add( key );
-            }
+            val_el = pa.AsInteger().ToString();
+          }
+
+          if( !val_el.Equals( val_db ) )
+          {
+            modifiedPropertyKeys.Add( key );
           }
         }
       }
@@ -231,16 +234,17 @@
             Parameter pa = e.LookupParameter( key );

             key_db = Util.Uncapitalise( key );
+            val_db = dbdict[key_db].Substring( 2 );

             if( StorageType.String == pa.StorageType )
             {
-              pa.Set( dbdict[key_db] );
+              pa.Set( val_db );
             }
             else
             {
               try
               {
-                int i = int.Parse( dbdict[key_db] );
+                int i = int.Parse( val_db );
                 pa.Set( i );
               }
               catch( System.FormatException )


fixed merge issue

fixed merge issue

--- Source/Xamarin/Prism.Forms/Navigation/PageNavigationService.cs
+++ Source/Xamarin/Prism.Forms/Navigation/PageNavigationService.cs
@@ -54,11 +54,8 @@

                 bool useModalForDoPop = UseModalNavigation(page, useModalNavigation);
                 Page previousPage = PageUtilities.GetOnNavigatedToTarget(page, _applicationProvider.MainPage, useModalForDoPop);
-<<<<<<< HEAD

                 PageUtilities.OnNavigatingTo(previousPage, segmentParameters);
-=======
->>>>>>> refs/remotes/origin/master

                 var poppedPage = await DoPop(page.Navigation, useModalForDoPop, animated);
                 if (poppedPage != null)


color overlay

color overlay

--- Models/MainWindowViewModel.cs
+++ Models/MainWindowViewModel.cs
@@ -89,8 +89,11 @@
 		DateTime RunTimer;
 		double FrameProcessDuration;

-		int[] FilterWeights;
-		int[] FilterOffsets;
+		int[] EdgeFilterWeights;
+		int[] EdgeFilterOffsets;
+
+		int[] DespeckleFilterWeights;
+		int[] DespeckleFilterOffsets;

 		int SourceStride;
 		int SourceWidth;
@@ -106,9 +109,8 @@
 		byte[] ByteArray1;
 		byte[] ByteArray2;

-		int PixelValueCount;
 		int PixelValueMax;
-		int PixelValueThreshold;
+		int PixelEdgeThreshold;

 		public MainWindowViewModel() {
 			FrameTimer = DateTime.Now.AddMilliseconds(_FPSCalcDelay);
@@ -160,8 +162,8 @@

 			await Task.Run(() => {
 				IntArray1 = CompressToMonochrome(ByteArray1);
-				IntArray2 = FilterEdges(IntArray1);
-				ByteArray2 = ExpandFromMonochrome(IntArray2);
+				IntArray1 = FilterEdges(IntArray1);
+				ByteArray2 = ExpandFromMonochrome(IntArray1, ByteArray1);

 				parentThread.Invoke(() => {
 					FilteredImage.WritePixels(
@@ -178,23 +180,22 @@
 			});
 		}

-		byte[] ExpandFromMonochrome(int[] inputValues) {
+		byte[] ExpandFromMonochrome(int[] inputValues, byte[] inputBytes) {
 			var outputValues = new byte[ByteCount];

 			var pixelOffset = 0;

 			for (var byteOffset = 0; byteOffset < ByteCount; byteOffset += 4) {
-				byte byteValue;
-
-				if (inputValues[pixelOffset] > PixelValueThreshold)
-					byteValue = 255;
-				else
-					byteValue = 0;
-
-				outputValues[byteOffset] = byteValue;
-				outputValues[byteOffset + 1] = byteValue;
-				outputValues[byteOffset + 2] = byteValue;
-				outputValues[byteOffset + 3] = 255;
+				if (inputValues[pixelOffset] > PixelEdgeThreshold) {
+					outputValues[byteOffset] = 0;
+					outputValues[byteOffset + 1] = 0;
+					outputValues[byteOffset + 2] = 0;
+				}
+				else {
+					outputValues[byteOffset] = inputBytes[byteOffset];
+					outputValues[byteOffset + 1] = inputBytes[byteOffset + 1];
+					outputValues[byteOffset + 2] = inputBytes[byteOffset + 2];
+				}

 				pixelOffset++;
 			}
@@ -220,19 +221,45 @@

 		int[] FilterEdges(int[] monochromePixelValues) {
 			var filteredPixelValues = new int[PixelCount];
-			var filterLength = FilterWeights.Length;
+			var filterLength = EdgeFilterWeights.Length;

 			for (var pixel = 0; pixel < PixelCount; pixel++) {
 				var aggregate = 0;

 				for (var filterOffset = 0; filterOffset < filterLength; filterOffset++) {
-					var offset = FilterOffsets[filterOffset] + pixel;
+					var offset = EdgeFilterOffsets[filterOffset] + pixel;

 					if (offset > 0 && offset < PixelCount)
-						aggregate += monochromePixelValues[offset] * FilterWeights[filterOffset];
-				}
-
-				filteredPixelValues[pixel] = aggregate;
+						aggregate += monochromePixelValues[offset] * EdgeFilterWeights[filterOffset];
+				}
+
+				if (aggregate >= PixelEdgeThreshold)
+					filteredPixelValues[pixel] = PixelValueMax;
+				else
+					filteredPixelValues[pixel] = 0;
+			}
+
+			return filteredPixelValues;
+		}
+
+		int[] Despeckle(int[] inputPixelValues) {
+			var filteredPixelValues = new int[PixelCount];
+			var filterLength = DespeckleFilterWeights.Length;
+
+			for (var pixel = 0; pixel < PixelCount; pixel++) {
+				var aggregate = 0;
+
+				for (var filterOffset = 0; filterOffset < filterLength; filterOffset++) {
+					var offset = DespeckleFilterOffsets[filterOffset] + pixel;
+
+					if (offset > 0 && offset < PixelCount)
+						aggregate += inputPixelValues[offset] * DespeckleFilterWeights[filterOffset];
+				}
+
+				if (aggregate >= 255 * 255 * 9)
+					filteredPixelValues[pixel] = PixelValueMax;
+				else
+					filteredPixelValues[pixel] = 0;
 			}

 			return filteredPixelValues;
@@ -245,13 +272,13 @@
 		}

 		void BuildFilters() {
-			//var filter = new int[,] {
-			//	{ -1, -1, -1 },
-			//	{ -1,  8, -1 },
-			//	{ -1, -1, -1 },
-			//};
-
-			var filter = new int[,] {
+			var despeckleFilter = new int[,] {
+				{ -1, -1, -1 },
+				{ -1,  8, -1 },
+				{ -1, -1, -1 },
+			};
+
+			var edgeFilter = new int[,] {
 				{  0, -1,  0, -1,  0 },
 				{ -1, -1,  0, -1, -1 },
 				{  0,  0, 12,  0,  0 },
@@ -259,28 +286,42 @@
 				{  0, -1,  0, -1,  0 }
 			};

-			var filterLength = filter.GetLength(0);
+			PixelValueMax = 3 * 255 * 255;
+			PixelEdgeThreshold = PixelValueMax / 4;
+
+			var filterLength = edgeFilter.GetLength(0);
 			var filterOffset = Convert.ToInt32(Math.Floor((double)filterLength / 2));
 			var filterEnd = filterLength - filterOffset;

-			FilterWeights = new int[filterLength * filterLength];
-			FilterOffsets = new int[filterLength * filterLength];
+			EdgeFilterWeights = new int[filterLength * filterLength];
+			EdgeFilterOffsets = new int[filterLength * filterLength];

 			var filterOffsetCount = 0;

 			for (int filterY = -filterOffset; filterY < filterEnd; filterY++) {
 				for (int filterX = -filterOffset; filterX < filterEnd; filterX++) {
-					FilterWeights[filterOffsetCount] = filter[filterY + filterOffset, filterX + filterOffset];
-					FilterOffsets[filterOffsetCount] = (SourceWidth * filterY) + filterX;
+					EdgeFilterWeights[filterOffsetCount] = edgeFilter[filterY + filterOffset, filterX + filterOffset];
+					EdgeFilterOffsets[filterOffsetCount] = (SourceWidth * filterY) + filterX;
 					filterOffsetCount++;
 				}
 			}

-			// RG, RB, GB
-
-			PixelValueCount = 3;
-			PixelValueMax = PixelValueCount * 255;
-			PixelValueThreshold = (PixelValueMax * 255) / 4;
+			filterLength = despeckleFilter.GetLength(0);
+			filterOffset = Convert.ToInt32(Math.Floor((double)filterLength / 2));
+			filterEnd = filterLength - filterOffset;
+
+			DespeckleFilterWeights = new int[filterLength * filterLength];
+			DespeckleFilterOffsets = new int[filterLength * filterLength];
+
+			filterOffsetCount = 0;
+
+			for (int filterY = -filterOffset; filterY < filterEnd; filterY++) {
+				for (int filterX = -filterOffset; filterX < filterEnd; filterX++) {
+					DespeckleFilterWeights[filterOffsetCount] = despeckleFilter[filterY + filterOffset, filterX + filterOffset];
+					DespeckleFilterOffsets[filterOffsetCount] = (SourceWidth * filterY) + filterX;
+					filterOffsetCount++;
+				}
+			}
 		}

 		[NotifyPropertyChangedAction]


Removed limitation

Removed limitation

--- Modix/Modules/RandomModule.cs
+++ Modix/Modules/RandomModule.cs
@@ -48,12 +48,6 @@
                 return;
             }

-            if (inputs.Length > 100) // Arbitrary limit
-            {
-                await ReplyAsync("Woah, that's a lot to choose from, I can't decide :S");
-                return;
-            }
-
             var random = Random.Next(0, inputs.Length);

             var choice = inputs[random];


Removed constructor and added provider initialisation into the AddRoute()
method.

Note that the Initialise() method is only called once.

--- Navigation/Mvc/RouteConfig.cs
+++ Navigation/Mvc/RouteConfig.cs
@@ -6,11 +6,8 @@
 {
 	internal static class RouteConfig
 	{
-		static RouteConfig()
-		{
-			ValueProviderFactories.Factories.Insert(3, new NavigationDataMvcValueProviderFactory());
-			GlobalFilters.Filters.Add(new RefreshAjaxAttribute());
-		}
+
+		private static bool _Initialised = false;

 		internal static void AddRoute(State state)
 		{
@@ -18,6 +15,11 @@
 			string action = state.Attributes["action"] != null ? state.Attributes["action"].Trim() : string.Empty;
 			if (controller.Length != 0 && action.Length != 0)
 			{
+				if (!_Initialised)
+				{
+					Initialise();
+					_Initialised = true;
+				}
 				string area = state.Attributes["area"] != null ? state.Attributes["area"].Trim() : string.Empty;
 				state.StateHandler = new MvcStateHandler();
 				Route route = RouteTable.Routes.MapRoute("Mvc" + state.Id, state.Route);
@@ -30,6 +32,12 @@
 				route.RouteHandler = new MvcStateRouteHandler(state);
 			}
 		}
+
+		private static void Initialise()
+		{
+			ValueProviderFactories.Factories.Insert(3, new NavigationDataMvcValueProviderFactory());
+			GlobalFilters.Filters.Add(new RefreshAjaxAttribute());
+		}
 	}
 }
 #endif


Fix for previous commit addressing LIBOMV-413

git-svn-id: e915c4f8b2ea2a6e63cbe989b51c0994a698cc26@2326 52acb1d6-8a22-11de-b505-999d5b087335

--- OpenMetaverse/GroupManager.cs
+++ OpenMetaverse/GroupManager.cs
@@ -767,9 +767,7 @@
         public UUID RequestGroupRoleMembers(UUID group)
         {
             UUID requestID = UUID.Random();
-
-            lock (GroupRolesMembersCaches)
-                GroupRolesMembersCaches[group] = new List<KeyValuePair<UUID, UUID>>();
+            lock (GroupRolesRequests) GroupRolesMembersRequests.Add(requestID);

             GroupRoleMembersRequestPacket request = new GroupRoleMembersRequestPacket();
             request.AgentData.AgentID = Client.Self.AgentID;


Fix to includes determination.

Fix to includes determination.

--- Optimizer/RJSConfigBuilder.cs
+++ Optimizer/RJSConfigBuilder.cs
@@ -1,5 +1,4 @@
 namespace Optimizer {
-    using System;
     using System.Collections.Generic;
     using System.IO;
     using System.Linq;
@@ -20,8 +19,8 @@
                 BaseUrl = DetermineApplicationPath()
             };

-            info.Includes = FixupPaths(info.BaseUrl, GetIncludes(info.BaseUrl));
             info.Excludes = FixupPaths(info.BaseUrl, GetExcludes(info.BaseUrl));
+            info.Includes = FixupPaths(info.BaseUrl, GetIncludes(info.BaseUrl)).Except(info.Excludes);

             info.OutputDirectory = Path.Combine(new DirectoryInfo(info.BaseUrl).Parent.FullName, "app-built");
             info.BuildFilePath = Path.Combine(options.ApplicationSource, "app.build.js");