add more tests for normalization

add more tests for normalization

--- nuget-extensions/nuget-feed-tests/src/QueryNormalizationTest.cs
+++ nuget-extensions/nuget-feed-tests/src/QueryNormalizationTest.cs
@@ -44,6 +44,16 @@
       //  !( !a and !b) => a or b
       var expr = not(and(not(eq("A", 1)), not(eq("A", 2))));
       DoNormalizeTest(expr, "A", "( $.A == 1 ) or ( $.A == 2 )");
+    }
+
+    [Test]
+    public void test_not_and_not_or()
+    {
+      //  d or c or !( !a and !b) or e
+      //
+      var expr = or(or(eq("A", 3), eq("A", 2)), not(and(not(eq("A", 1)), not(eq("A", 2)))));
+      DoNormalizeTest(expr, "A", "( ( $.A == 3 ) or ( $.A == 2 ) ) or ( ( $.A == 1 ) or ( $.A == 2 ) )");
+
     }

     [Test]


Alterações solicitadas pelo banco SICOOB

--- src/Boleto.Net/Banco/Banco_Sicoob.cs
+++ src/Boleto.Net/Banco/Banco_Sicoob.cs
@@ -439,7 +439,7 @@
                 _header.Append(Utils.FitStringLength(cedente.Nome, 30, 30, ' ', 0, true, true, false)); //Posição 047 a 076
                 _header.Append(Utils.FitStringLength("756BANCOOBCED", 18, 18, ' ', 0, true, true, false)); //Posição 077 a 094
                 _header.Append(DateTime.Now.ToString("ddMMyy")); //Posição 095 a 100
-                _header.Append(Utils.FitStringLength(Convert.ToString(cedente.NumeroSequencial), 7, 7, '0', 0, true, true, true)); //Posição 101 a 107
+                _header.Append(Utils.FitStringLength(Convert.ToString(numeroArquivoRemessa), 7, 7, '0', 0, true, true, true)); //Posição 101 a 107
                 _header.Append(new string(' ', 287)); //Posição 108 a 394
                 _header.Append("000001"); //Posição 395 a 400

@@ -553,7 +553,15 @@
                 _detalhe.Append("00000"); //Posição 090 a 094
                 _detalhe.Append("0"); //Posição 095
                 _detalhe.Append(Utils.FitStringLength(boleto.Cedente.NumeroBordero.ToString(), 6, 6, '0', 0, true, true, true)); //Posição 096 a 101
-                _detalhe.Append(new string(' ', 5)); //Posição 102 a 106
+                _detalhe.Append(new string(' ', 4)); //Posição 102 a 105
+
+                // Tipo de emissão"Tipo de Emissão: 1 - Cooperativa 2 - Cliente"
+                var tipoDeEmissao = "1";
+                if (boleto.ApenasRegistrar)
+                    tipoDeEmissao = "2";
+
+                _detalhe.Append(Utils.FitStringLength(tipoDeEmissao, 1, 1, '0', 0, true, true, true)); // Posição 106 a 106
+
                 _detalhe.Append(Utils.FitStringLength(boleto.TipoModalidade, 2, 2, '0', 0, true, true, true));  //Posição 107 a 108
                 _detalhe.Append(Utils.FitStringLength(boleto.Remessa.CodigoOcorrencia, 2, 2, '0', 0, true, true, true)); //Posição 109 a 110 - (1)REGISTRO DE TITULOS (2)Solicitação de Baixa
                 _detalhe.Append(Utils.FitStringLength(boleto.NumeroDocumento, 10, 10, '0', 0, true, true, true)); //Posição 111 a 120


Added generic manager tests

Added generic manager tests

--- Tests/OpenIIoT.Core.Tests/Package/PackageManager.cs
+++ Tests/OpenIIoT.Core.Tests/Package/PackageManager.cs
@@ -59,6 +59,8 @@
 using Utility.OperationResult;
 using Xunit;
 using System.Threading.Tasks;
+using OpenIIoT.SDK.Common;
+using System.Reflection;

 namespace OpenIIoT.Core.Tests.Package
 {
@@ -295,6 +297,21 @@
         }

         /// <summary>
+        ///     Tests the <see cref="Core.Package.PackageManager.Instantiate(IApplicationManager, IPlatformManager)"/> method.
+        /// </summary>
+        [Fact]
+        public void Instantiate()
+        {
+            Mock<IApplicationManager> managerMock = new Mock<IApplicationManager>();
+            Mock<IPlatformManager> platformManagerMock = new Mock<IPlatformManager>();
+
+            managerMock.Setup(a => a.State).Returns(State.Running);
+            managerMock.Setup(a => a.IsInState(State.Starting, State.Running)).Returns(true);
+
+            IPackageManager test = Core.Package.PackageManager.Instantiate(managerMock.Object, platformManagerMock.Object);
+        }
+
+        /// <summary>
         ///     Tests the <see cref="Core.Package.PackageManager.ScanPackages()"/> method with a bad directory.
         /// </summary>
         [Fact]
@@ -444,6 +461,79 @@
             Assert.NotEqual(0, list.ReturnValue[0].FQN.Length);
         }

+        /// <summary>
+        ///     Tests the <see cref="Core.Package.PackageManager.Setup"/> method using reflection.
+        /// </summary>
+        [Fact]
+        public void Setup()
+        {
+            Mock<IApplicationManager> managerMock = new Mock<IApplicationManager>();
+            Mock<IPlatformManager> platformManagerMock = new Mock<IPlatformManager>();
+
+            managerMock.Setup(a => a.State).Returns(State.Running);
+            managerMock.Setup(a => a.IsInState(State.Starting, State.Running)).Returns(true);
+
+            IPackageManager test = Core.Package.PackageManager.Instantiate(managerMock.Object, platformManagerMock.Object);
+
+            MethodInfo setup = typeof(Core.Package.PackageManager).GetMethod("Setup", BindingFlags.NonPublic | BindingFlags.Instance);
+            setup.Invoke(test, new object[] { });
+        }
+
+        /// <summary>
+        ///     Tests the <see cref="Core.Package.PackageManager.Startup()"/> method via <see cref="Core.Common.Manager.Start()"/> .
+        /// </summary>
+        [Fact]
+        public void Start()
+        {
+            Mock<IApplicationManager> managerMock = new Mock<IApplicationManager>();
+            Mock<IPlatformManager> platformManagerMock = new Mock<IPlatformManager>();
+
+            managerMock.Setup(a => a.State).Returns(State.Running);
+            managerMock.Setup(a => a.IsInState(State.Starting, State.Running)).Returns(true);
+
+            IPackageManager test = Core.Package.PackageManager.Instantiate(managerMock.Object, platformManagerMock.Object);
+
+            IResult result = test.Start();
+
+            Assert.NotEqual(ResultCode.Failure, result.ResultCode);
+            Assert.Equal(State.Running, test.State);
+        }
+
+        /// <summary>
+        ///     Tests the <see cref="Core.Package.PackageManager.Shutdown(StopType)"/> method via
+        ///     <see cref="Core.Common.Manager.Stop(StopType)"/> .
+        /// </summary>
+        [Fact]
+        public void Stop()
+        {
+            Mock<IApplicationManager> managerMock = new Mock<IApplicationManager>();
+            Mock<IPlatformManager> platformManagerMock = new Mock<IPlatformManager>();
+
+            managerMock.Setup(a => a.State).Returns(State.Running);
+            managerMock.Setup(a => a.IsInState(State.Starting, State.Running)).Returns(true);
+
+            IPackageManager test = Core.Package.PackageManager.Instantiate(managerMock.Object, platformManagerMock.Object);
+
+            IResult result = test.Start();
+
+            Assert.NotEqual(ResultCode.Failure, result.ResultCode);
+            Assert.Equal(State.Running, test.State);
+
+            result = test.Stop();
+
+            Assert.Equal(ResultCode.Success, result.ResultCode);
+            Assert.Equal(State.Stopped, test.State);
+        }
+
+        /// <summary>
+        ///     Tests the <see cref="Core.Package.PackageManager.Terminate()"/> method.
+        /// </summary>
+        [Fact]
+        public void Terminate()
+        {
+            Core.Package.PackageManager.Terminate();
+        }
+
         #endregion Public Methods

         #region Protected Methods


- API для получения списка виджетов с данными;

--- ThinkingHome.Plugins.UniUI/UniUiPlugin.Dashboard.cs
+++ ThinkingHome.Plugins.UniUI/UniUiPlugin.Dashboard.cs
@@ -1,4 +1,13 @@
-using ThinkingHome.Plugins.Listener.Attributes;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using NHibernate;
+using NHibernate.Linq;
+using ThinkingHome.Core.Plugins.Utils;
+using ThinkingHome.Plugins.Listener.Api;
+using ThinkingHome.Plugins.Listener.Attributes;
+using ThinkingHome.Plugins.UniUI.Model;
+using ThinkingHome.Plugins.UniUI.Widgets;
 using ThinkingHome.Plugins.WebUI.Attributes;

 namespace ThinkingHome.Plugins.UniUI
@@ -10,6 +19,75 @@

 	public partial class UniUiPlugin
 	{
+		[HttpCommand("/api/uniui/dashboard/details")]
+		public object GetDdashboardDetails(HttpRequestParams request)
+		{
+			Guid dashboardId = request.GetRequiredGuid("id");

+			using (var session = Context.OpenSession())
+			{
+				var allWidgets = session.Query<Widget>()
+						.Where(w => w.Dashboard.Id == dashboardId)
+						.ToArray();
+
+				var allParameters = session.Query<WidgetParameter>()
+						.Where(w => w.Widget.Dashboard.Id == dashboardId)
+						.ToArray();
+
+				var list = GetWidgetListModel(allWidgets, allParameters, session);
+
+				return list;
+			}
+		}
+
+		private object[] GetWidgetListModel(Widget[] allWidgets, WidgetParameter[] allParameters, ISession session)
+		{
+			var list = new List<object>();
+
+			foreach (var widget in allWidgets)
+			{
+				var def = defs.GetValueOrDefault(widget.TypeAlias);
+
+				if (def != null)
+				{
+					var parameters = allParameters.Where(p => p.Widget.Id == widget.Id).ToArray();
+
+					var model = GetWidgetModel(def, widget, parameters, session);
+
+					if (model != null)
+					{
+						list.Add(model);
+					}
+				}
+			}
+			return list.ToArray(); ;
+		}
+
+		private object GetWidgetModel(IWidgetDefinition def, Widget widget, WidgetParameter[] parameters, ISession session)
+		{
+			try
+			{
+				var data = def.GetWidgetData(widget, parameters, session, Logger);
+
+				var model = new
+				{
+					id = widget.Id,
+					type = widget.TypeAlias,
+					displayName = widget.DisplayName,
+					sortOrder = widget.SortOrder,
+					data
+				};
+
+				return model;
+			}
+			catch (Exception ex)
+			{
+				var message = string.Format(
+					"UI widget error (id: {0}, type:{1})", widget.Id, widget.TypeAlias);
+				Logger.ErrorException(message, ex);
+
+				return null;
+			}
+		}
 	}
 }


Fix warning

Fix warning

--- TomsToolbox.Composition.Tests/MetadataReaderTest.cs
+++ TomsToolbox.Composition.Tests/MetadataReaderTest.cs
@@ -1,7 +1,6 @@
 namespace TomsToolbox.Composition.Tests
 {
     using System.Collections.Generic;
-    using System.Runtime.CompilerServices;
     using System.Text.RegularExpressions;

     using ApprovalTests;


Changed the media (IMediaFile and IImage) content extensions from internal to public.

--- src/Buzz.Hybrid/ContentExtensions.cs
+++ src/Buzz.Hybrid/ContentExtensions.cs
@@ -751,7 +751,7 @@
         /// <returns>
         /// The collection of <see cref="IImage"/>.
         /// </returns>
-        internal static IEnumerable<IImage> ToImages(this IEnumerable<IPublishedContent> contents)
+        public static IEnumerable<IImage> ToImages(this IEnumerable<IPublishedContent> contents)
         {
             return contents.ToList().Select(x => x.ToImage());
         }
@@ -765,7 +765,7 @@
         /// <returns>
         /// The <see cref="IImage"/>.
         /// </returns>
-        internal static IImage ToImage(this IPublishedContent content)
+        public static IImage ToImage(this IPublishedContent content)
         {
             return new Image()
             {
@@ -787,7 +787,7 @@
         /// <returns>
         /// The collection of <see cref="IMediaFile"/>.
         /// </returns>
-        internal static IEnumerable<IMediaFile> ToMediaFiles(this IEnumerable<IPublishedContent> contents)
+        public static IEnumerable<IMediaFile> ToMediaFiles(this IEnumerable<IPublishedContent> contents)
         {
             return contents.ToList().Select(x => x.ToMediaFile());
         }
@@ -801,7 +801,7 @@
         /// <returns>
         /// The <see cref="IMediaFile"/>.
         /// </returns>
-        internal static IMediaFile ToMediaFile(this IPublishedContent content)
+        public static IMediaFile ToMediaFile(this IPublishedContent content)
         {
             return new MediaFile()
             {


Prevent duplicated broadcasters so we don't check them multiple times.

--- TwitchModel/Program.cs
+++ TwitchModel/Program.cs
@@ -146,11 +146,10 @@
         /// </param>
         private static void OnNewThing(object sender, WarehouseEvents.ThingEventArgs args)
         {
-            if(args.Thing.Type.Is(TypeBroadcaster))
-            {
-                Logger.Debug("New Broadcaster: " + args.Thing.String("broadcaster"));
-                Broadcasters.Add(args.Thing.String("broadcaster"));
-            }
+            if (!args.Thing.Type.Is(TypeBroadcaster) || Broadcasters.Contains(args.Thing.String("broadcaster"))) return;
+
+            Logger.Debug("New Broadcaster: " + args.Thing.String("broadcaster"));
+            Broadcasters.Add(args.Thing.String("broadcaster"));
         }

         /// <summary>
@@ -164,10 +163,7 @@
         /// </param>
         private static void OnUpdatedThing(object sender, WarehouseEvents.ThingEventArgs args)
         {
-            if(args.Thing.Type.Is(TypeStream))
-            {
-                Logger.Debug(args.Thing.ID + " - " + (args.Thing.Boolean("live") ? "Online" : "Offline"));
-            }
+            if (args.Thing.Type.Is(TypeStream)) Logger.Debug(args.Thing.ID + " - " + (args.Thing.Boolean("live") ? "Online" : "Offline"));
         }

         /// <summary>
@@ -181,11 +177,10 @@
         /// </param>
         private static void OnDeletedThing(object sender, WarehouseEvents.ThingEventArgs args)
         {
-            if(args.Thing.Type.Is(TypeBroadcaster))
-            {
-                Logger.Debug("Broadcaster deleted: " + args.Thing.String("broadcaster"));
-                Broadcasters.Remove(args.Thing.String("broadcaster"));
-            }
+            if (!args.Thing.Type.Is(TypeBroadcaster) || !Broadcasters.Contains(args.Thing.String("broadcaster"))) return;
+
+            Logger.Debug("Broadcaster deleted: " + args.Thing.String("broadcaster"));
+            Broadcasters.Remove(args.Thing.String("broadcaster"));
         }

         /// <summary>


Add failing test coverage for not copying online properties

--- osu.Game.Tests/Visual/Editing/TestSceneEditorBeatmapCreation.cs
+++ osu.Game.Tests/Visual/Editing/TestSceneEditorBeatmapCreation.cs
@@ -201,6 +201,11 @@
                     new Colour4(0, 0, 255, 255)
                 });
             });
+            AddStep("set status & online ID", () =>
+            {
+                EditorBeatmap.BeatmapInfo.OnlineID = 123456;
+                EditorBeatmap.BeatmapInfo.Status = BeatmapOnlineStatus.WIP;
+            });

             AddStep("save beatmap", () => Editor.Save());
             AddAssert("new beatmap persisted", () =>
@@ -235,6 +240,9 @@
             AddAssert("approach rate correctly copied", () => EditorBeatmap.Difficulty.ApproachRate == 4);
             AddAssert("combo colours correctly copied", () => EditorBeatmap.BeatmapSkin.AsNonNull().ComboColours.Count == 2);

+            AddAssert("status not copied", () => EditorBeatmap.BeatmapInfo.Status == BeatmapOnlineStatus.None);
+            AddAssert("online ID not copied", () => EditorBeatmap.BeatmapInfo.OnlineID == -1);
+
             AddStep("set unique difficulty name", () => EditorBeatmap.BeatmapInfo.DifficultyName = secondDifficultyName);
             AddStep("save beatmap", () => Editor.Save());


make plugins config files be optional

make plugins config files be optional

--- neo/Plugins/Helper.cs
+++ neo/Plugins/Helper.cs
@@ -9,7 +9,7 @@
         public static IConfigurationSection GetConfiguration(this Assembly assembly)
         {
             string path = Path.Combine("Plugins", assembly.GetName().Name, "config.json");
-            return new ConfigurationBuilder().AddJsonFile(path).Build().GetSection("PluginConfiguration");
+            return new ConfigurationBuilder().AddJsonFile(path, optional: true).Build().GetSection("PluginConfiguration");
         }
     }
 }


Redirect to workgroup controller if create conditional approval is administrative.

--- Purchasing.Web/Controllers/ConditionalApprovalController.cs
+++ Purchasing.Web/Controllers/ConditionalApprovalController.cs
@@ -49,6 +49,7 @@

         /// <summary>
         /// Conditional approvals by org
+        /// Test 1A
         /// </summary>
         /// <param name="id"></param>
         /// <returns></returns>
@@ -63,6 +64,7 @@

         /// <summary>
         /// Conditional approvals by workgroup
+        /// Test 1B
         /// </summary>
         /// <param name="id"></param>
         /// <returns></returns>
@@ -248,6 +250,8 @@
         //public ActionResult Create(string approvalType)
         public ActionResult Create(int? workgroupId, string orgId)
         {
+            Check.Require(workgroupId.HasValue || !string.IsNullOrWhiteSpace(orgId), "Missing Parameters");
+
             var approvalType = string.Empty;

             if (workgroupId.HasValue)
@@ -259,7 +263,7 @@
                 if(workgroup.Administrative)
                 {
                     ErrorMessage = "Conditional Approval may not be added to an administrative workgroup.";
-                    return this.RedirectToAction<WizardController>(a => a.Details(workgroup.Id));
+                    return this.RedirectToAction<WorkgroupController>(a => a.Details(workgroup.Id));
                 }
             }
             else if (!string.IsNullOrWhiteSpace(orgId))
@@ -267,6 +271,8 @@
                 approvalType = OrganizationType;
                 ViewBag.OrganizationId = orgId;
             }
+
+

             var model = CreateModifyModel(approvalType);


Prevent null language tag when CollationRulesType is OtherLanguage

--- SIL.Windows.Forms.WritingSystems/WritingSystemSetupModel.cs
+++ SIL.Windows.Forms.WritingSystems/WritingSystemSetupModel.cs
@@ -897,7 +897,7 @@
 						var simpleCollation = (SimpleRulesCollationDefinition) CurrentDefinition.DefaultCollation;
 						return simpleCollation.SimpleRules == string.Empty ? DefaultCustomSimpleSortRules : simpleCollation.SimpleRules;
 					case CollationRulesType.OtherLanguage:
-						return ((SystemCollationDefinition) CurrentDefinition.DefaultCollation).LanguageTag;
+						return ((SystemCollationDefinition) CurrentDefinition.DefaultCollation).LanguageTag ?? string.Empty;
 				}
 				return string.Empty;
 			}


CrrentDirectoryの問題でテストがたまにこけるのを修正。

CrrentDirectoryの問題でテストがたまにこけるのを修正。

--- UnitTest/BaseDbTest.cs
+++ UnitTest/BaseDbTest.cs
@@ -212,8 +212,9 @@

     private static void ExecuteSqlFile(DbConnection con, string dataFilePath)
     {
+      var fullPath = System.AppDomain.CurrentDomain.BaseDirectory + Path.DirectorySeparatorChar + dataFilePath;
       //setup.sqlを流し込みます。
-      using (StreamReader stream = new StreamReader(dataFilePath, Encoding.GetEncoding("UTF-8")))
+      using (StreamReader stream = new StreamReader(fullPath, Encoding.GetEncoding("UTF-8")))
       {
         String setupSql = stream.ReadToEnd();
         DbTransaction sqlTran = con.BeginTransaction();


Mac: Fix Scrollable.Scroll event

Mac: Fix Scrollable.Scroll event

--- Source/Eto.Platform.Mac/Forms/Controls/ScrollableHandler.cs
+++ Source/Eto.Platform.Mac/Forms/Controls/ScrollableHandler.cs
@@ -68,7 +68,7 @@
 			{
 				case Scrollable.ScrollEvent:
 					Control.ContentView.PostsBoundsChangedNotifications = true;
-					this.AddControlObserver(NSView.BoundsChangedNotification, e => {
+					this.AddObserver(NSView.BoundsChangedNotification, e => {
 						var w = (Scrollable)e.Widget;
 						w.OnScroll(new ScrollEventArgs(w.ScrollPosition));
 					}, Control.ContentView);
@@ -134,7 +134,7 @@

 		public override Size GetPreferredSize(Size availableSize)
 		{
-			return Size.Min(availableSize, base.GetPreferredSize(availableSize));
+				return Size.Min(availableSize, base.GetPreferredSize(availableSize));
 		}

 		protected override Size GetNaturalSize(Size availableSize)


More failing tests.

More failing tests.

--- src/test/Test.FAKECore/Globbing/Directories/GlobbingOfDirectoriesSpecs.cs
+++ src/test/Test.FAKECore/Globbing/Directories/GlobbingOfDirectoriesSpecs.cs
@@ -28,7 +28,7 @@
     {
         private Because of = () => Files = Globbing("temptest/SampleApp/bin/**/*.*", "");

-        It should_match_3_files = () => Files.Length.ShouldEqual(3);
+        It should_match_3_files = () => Files.Length.ShouldEqual(2);
         It should_find_ilmerge = () => Files[0].ShouldEndWith("ilmerge.exclude");
         It should_find_sample_app = () => Files[1].ShouldEndWith("SampleApp.dll");
     }


Simplify access token implementation.

Simplify access token implementation.

--- Source/Lib/TraktApiSharp/Authentication/TraktAccessToken.cs
+++ Source/Lib/TraktApiSharp/Authentication/TraktAccessToken.cs
@@ -24,26 +24,12 @@
         [JsonProperty(PropertyName = "expires_in")]
         public int ExpiresInSeconds { get; set; }

-        private long? _createdAt;
-
-        [JsonIgnore]
-        public long? CreatedAt
-        {
-            get { return _createdAt; }
-
-            set
-            {
-                _createdAt = value;
-                Created = DateTime.FromFileTimeUtc(value.GetValueOrDefault());
-            }
-        }
-
         [JsonProperty(PropertyName = "token_type")]
         [JsonConverter(typeof(TraktAccessTokenTypeConverter))]
         public TraktAccessTokenType TokenType { get; set; }

         [JsonIgnore]
-        public bool IsValid => !string.IsNullOrEmpty(AccessToken) && DateTime.UtcNow.AddSeconds(ExpiresInSeconds) >= DateTime.UtcNow;
+        public bool IsValid => !string.IsNullOrEmpty(AccessToken) && DateTime.UtcNow.AddSeconds(ExpiresInSeconds) > DateTime.UtcNow;

         [JsonIgnore]
         public DateTime Created { get; private set; }


GH-106: Parse new response headers

GH-106: Parse new response headers

--- Source/Lib/TraktApiSharp/Requests/Handler/RequestHandler.cs
+++ Source/Lib/TraktApiSharp/Requests/Handler/RequestHandler.cs
@@ -37,6 +37,8 @@
         private const string HEADER_STARTDATE_KEY = "X-Start-Date";
         private const string HEADER_ENDDATE_KEY = "X-End-Date";
         private const string HEADER_PRIVATE_USER_KEY = "X-Private-User";
+        private const string HEADER_X_ITEM_ID = "X-Item-ID";
+        private const string HEADER_X_ITEM_TYPE = "X-Item-Type";
         private const string MEDIA_TYPE = "application/json";
         private const string AUTHENTICATION_SCHEME = "Bearer";

@@ -521,6 +523,17 @@
                 if (DateTime.TryParse(strEndDate, out DateTime endDate))
                     headerResults.EndDate = endDate.ToUniversalTime();
             }
+
+            if (responseHeaders.TryGetValues(HEADER_X_ITEM_ID, out values))
+            {
+                string strXItemId = values.First();
+
+                if (int.TryParse(strXItemId, out int id))
+                    headerResults.XItemId = id;
+            }
+
+            if (responseHeaders.TryGetValues(HEADER_X_ITEM_TYPE, out values))
+                headerResults.XItemType = values.First();
         }

         private void ParsePagedResponseHeaderValues(ITraktPagedResponseHeaders headerResults, HttpResponseHeaders responseHeaders)


Clean up aggregate parameters.

Clean up aggregate parameters.

--- src/SilDev/Reorganize.cs
+++ src/SilDev/Reorganize.cs
@@ -225,7 +225,7 @@
         {
             try
             {
-                var s = strs.Aggregate(str, (current, x) => Regex.Replace(current, x, x.ToLower(), RegexOptions.IgnoreCase));
+                var s = strs.Aggregate(str, (c, x) => Regex.Replace(c, x, x.ToLower(), RegexOptions.IgnoreCase));
                 return s;
             }
             catch (Exception ex)
@@ -248,7 +248,7 @@
         {
             try
             {
-                var s = strs.Aggregate(str, (current, x) => Regex.Replace(current, x, x.ToUpper(), RegexOptions.IgnoreCase));
+                var s = strs.Aggregate(str, (c, x) => Regex.Replace(c, x, x.ToUpper(), RegexOptions.IgnoreCase));
                 return s;
             }
             catch (Exception ex)
@@ -294,7 +294,7 @@
         {
             try
             {
-                var s = strs.Aggregate(str, (current, x) => current.Replace(x, string.Empty));
+                var s = strs.Aggregate(str, (c, x) => c.Replace(x, string.Empty));
                 return s;
             }
             catch (Exception ex)


removed HH ph1 handling

removed HH ph1 handling

--- TCC.Core/ViewModels/WindowManagers/BossGageWindowManager.cs
+++ TCC.Core/ViewModels/WindowManagers/BossGageWindowManager.cs
@@ -17,7 +17,7 @@
             {
                 if (SessionManager.HarrowholdMode)
                 {
-                    return null;
+                    return _bosses;//null
                 }
                 else
                 {


Integration tests

Integration tests

--- TableDependency.IntegrationTest/TriggerTypeTestSqlServer.cs
+++ TableDependency.IntegrationTest/TriggerTypeTestSqlServer.cs
@@ -462,9 +462,9 @@

         private static void ModifyTableContent()
         {
-            CheckValues.Add(ChangeType.Insert.ToString(), new Tuple<Item, Item>(new Item { Name = "Christian", Description = "Del Bianco" }, new Item()));
-            CheckValues.Add(ChangeType.Update.ToString(), new Tuple<Item, Item>(new Item { Name = "Velia" }, new Item()));
-            CheckValues.Add(ChangeType.Delete.ToString(), new Tuple<Item, Item>(new Item { Name = "Velia", Description = "Del Bianco" }, new Item()));
+            CheckValues.Add(ChangeType.Insert.ToString(), new Tuple<Item, Item>(new Item { Id = 23, Name = "Pizza Mergherita", Description = "Pizza Mergherita" }, new Item()));
+            CheckValues.Add(ChangeType.Update.ToString(), new Tuple<Item, Item>(new Item { Id = 23, Name = "Pizza Funghi", Description = "Pizza Mergherita" }, new Item()));
+            CheckValues.Add(ChangeType.Delete.ToString(), new Tuple<Item, Item>(new Item { Id = 23, Name = "Pizza Funghi", Description = "Pizza Funghi" }, new Item()));

             using (var sqlConnection = new SqlConnection(ConnectionString))
             {


Quickfix for exceptions with playing sounds. Origin of error unknown, only happens on some machines sometimes.

--- VirusX/AudioManager.cs
+++ VirusX/AudioManager.cs
@@ -48,8 +48,12 @@
         {
             System.Diagnostics.Debug.Assert(soundEffects.ContainsKey(sound));

-            if (Settings.Instance.Sound)
-                soundEffects[sound].Play();
+            try
+            {
+                if (Settings.Instance.Sound)
+                    soundEffects[sound].Play();
+            }
+            catch { }
         }

         /// <summary>
@@ -58,15 +62,10 @@
         /// <param name="sound">click, capture, switch, explosion, danger, wipeout, collect</param>
         public void PlaySoundeffect(string sound, float volume)
         {
-            System.Diagnostics.Debug.Assert(soundEffects.ContainsKey(sound));
-
-            if (Settings.Instance.Sound)
-            {
-                float currentVolume = MediaPlayer.Volume;
-                MediaPlayer.Volume = volume;
-                soundEffects[sound].Play();
-                MediaPlayer.Volume = currentVolume;
-            }
+            float currentVolume = MediaPlayer.Volume;
+            MediaPlayer.Volume = volume;
+            PlaySoundeffect(sound);
+            MediaPlayer.Volume = currentVolume;
         }

         /// <summary>


Always initialize MenuItem fields.

Always initialize MenuItem fields.

--- osu.Framework/Graphics/UserInterface/MenuItem.cs
+++ osu.Framework/Graphics/UserInterface/MenuItem.cs
@@ -11,12 +11,12 @@
         /// <summary>
         /// The text which this <see cref="MenuItem"/> displays.
         /// </summary>
-        public readonly Bindable<string> Text;
+        public readonly Bindable<string> Text = new Bindable<string>();

         /// <summary>
         /// The <see cref="Action"/> that is performed when this <see cref="MenuItem"/> is clicked.
         /// </summary>
-        public readonly Bindable<Action> Action;
+        public readonly Bindable<Action> Action = new Bindable<Action>();

         /// <summary>
         /// Creates a new <see cref="MenuItem"/>.
@@ -24,8 +24,7 @@
         /// <param name="text">The text to display.</param>
         public MenuItem(string text)
         {
-            Text = new Bindable<string>(text);
-            Action = new Bindable<Action>();
+            Text.Value = text;
         }

         /// <summary>
@@ -34,9 +33,9 @@
         /// <param name="text">The text to display.</param>
         /// <param name="action">The <see cref="Action"/> to perform when clicked.</param>
         public MenuItem(string text, Action action)
+            : this(text)
         {
-            Text = new Bindable<string>(text);
-            Action = new Bindable<Action>(action);
+            Action.Value = action;
         }
     }
 }


[VsIntegration] Fixes TECH-L5AJG9518S

[VsIntegration] Fixes TECH-L5AJG9518S

--- VisualStudio/ProjectPackage/XSharpIDEBuildLogger.cs
+++ VisualStudio/ProjectPackage/XSharpIDEBuildLogger.cs
@@ -1,6 +1,6 @@
 //
-// Copyright (c) XSharp B.V.  All Rights Reserved.
-// Licensed under the Apache License, Version 2.0.
+// Copyright (c) XSharp B.V.  All Rights Reserved.
+// Licensed under the Apache License, Version 2.0.
 // See License.txt in the project root for license information.
 //
 using Microsoft.VisualStudio.Project;
@@ -167,6 +167,7 @@
         {
             try
             {
+                didCompile = true;
                 errorlistManager.AddBuildError(args.File, args.LineNumber, args.ColumnNumber, args.Code, args.Message, MessageSeverity.Error);
             }
             catch (Exception e)
@@ -178,6 +179,7 @@
         {
             try
             {
+                didCompile = true;
                 errorlistManager.AddBuildError(args.File, args.LineNumber, args.ColumnNumber, args.Code, args.Message, MessageSeverity.Warning);
             }
             catch (Exception e)
@@ -186,4 +188,4 @@
             }
         }
     }
-}+}


Add missing LocalisableString

Add missing LocalisableString

--- osu.Game/Graphics/UserInterface/OsuTabControl.cs
+++ osu.Game/Graphics/UserInterface/OsuTabControl.cs
@@ -14,6 +14,7 @@
 using osu.Framework.Graphics.Sprites;
 using osu.Framework.Graphics.UserInterface;
 using osu.Framework.Input.Events;
+using osu.Framework.Localisation;
 using osu.Framework.Utils;
 using osu.Game.Graphics.Sprites;

@@ -160,7 +161,12 @@
                         Margin = new MarginPadding { Top = 5, Bottom = 5 },
                         Origin = Anchor.BottomLeft,
                         Anchor = Anchor.BottomLeft,
-                        Text = (value as IHasDescription)?.Description ?? (value as Enum)?.GetLocalisableDescription() ?? value.ToString(),
+                        Text = value switch{
+                            IHasDescription desc => desc?.Description,
+                            Enum e => e.GetLocalisableDescription(),
+                            LocalisableString l => l,
+                            var other => other.ToString()
+                        },
                         Font = OsuFont.GetFont(size: 14)
                     },
                     Bar = new Box


New sky and stuff working

New sky and stuff working

http://puu.sh/lf6Yd.png

--- Voxalia/ClientGame/ClientMainSystem/ClientRender.cs
+++ Voxalia/ClientGame/ClientMainSystem/ClientRender.cs
@@ -409,8 +409,9 @@
                 GL.BindFramebuffer(FramebufferTarget.Framebuffer, fbo_godray_main);
                 s_finalgodray.Bind();
                 GL.DrawBuffers(2, new DrawBuffersEnum[] { DrawBuffersEnum.ColorAttachment0, DrawBuffersEnum.ColorAttachment1 });
-                GL.ClearBuffer(ClearBuffer.Color, 0, new float[] { 1f, 1f, 1f, 0f });
+                GL.ClearBuffer(ClearBuffer.Color, 0, new float[] { 0f, 0f, 0f, 0f });
                 GL.ClearBuffer(ClearBuffer.Color, 1, new float[] { 1f, 1f, 1f, 0f });
+                GL.BlendFuncSeparate(1, BlendingFactorSrc.SrcColor, BlendingFactorDest.Zero, BlendingFactorSrc.SrcAlpha, BlendingFactorDest.Zero);
                 GL.Uniform1(19, DesaturationAmount);
                 GL.Uniform3(5, ClientUtilities.Convert(ambient));
                 GL.Uniform3(8, ClientUtilities.Convert(CameraFinalTarget));
@@ -452,6 +453,7 @@
                 GL.ActiveTexture(TextureUnit.Texture0);
                 GL.BindTexture(TextureTarget.Texture2D, 0);
                 GL.Enable(EnableCap.DepthTest);
+                GL.BlendFunc(1, BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
                 GL.DrawBuffer(DrawBufferMode.Back);
                 GL.BindFramebuffer(FramebufferTarget.Framebuffer, 0);
                 GL.BindFramebuffer(FramebufferTarget.ReadFramebuffer, RS4P.fbo);


Use single

Use single

--- osu.Game/Online/Multiplayer/MultiplayerClient.cs
+++ osu.Game/Online/Multiplayer/MultiplayerClient.cs
@@ -658,7 +658,7 @@

                 Debug.Assert(APIRoom != null);

-                Room.Playlist[Room.Playlist.IndexOf(Room.Playlist.First(existing => existing.ID == item.ID))] = item;
+                Room.Playlist[Room.Playlist.IndexOf(Room.Playlist.Single(existing => existing.ID == item.ID))] = item;

                 int existingIndex = APIRoom.Playlist.IndexOf(APIRoom.Playlist.Single(existing => existing.ID == item.ID));
                 APIRoom.Playlist.RemoveAt(existingIndex);


Fixed SendMessage not returning message objects

--- src/Discord.Net/DiscordClient.API.cs
+++ src/Discord.Net/DiscordClient.API.cs
@@ -258,9 +258,9 @@
 			{
 				int index = i * DiscordAPIClient.MaxMessageSize;
 				string blockText = text.Substring(index, Math.Min(2000, text.Length - index));
-				var nonce = GenerateNonce();
 				if (_config.UseMessageQueue)
 				{
+					var nonce = GenerateNonce();
 					var msg = _messages.GetOrAdd("nonce_" + nonce, channel.Id, _currentUserId);
 					var currentMember = _members[msg.UserId, channel.ServerId];
                     msg.Update(new Net.API.Message
@@ -282,7 +282,8 @@
 					var msg = _messages.GetOrAdd(model.Id, channel.Id, model.Author.Id);
 					msg.Update(model);
 					RaiseMessageSent(msg);
-                }
+					result[i] = msg;
+				}
 				await Task.Delay(1000).ConfigureAwait(false);
 			}
 			return result;


Introduced a variable for the buffer size in VndbUtils.GetDumpAsync

--- VndbSharp/VndbUtils.cs
+++ VndbSharp/VndbUtils.cs
@@ -16,6 +16,8 @@
 		internal static Version Version = new Version(0, 1);

 		private static DateTime? _lastTime = null;
+
+		public static Int32 BufferSize { get; set; } = 4096;

         public static async Task<IEnumerable<Tag>> GetTagDumpAsync()
             => await VndbUtils.GetDumpAsync<IEnumerable<Tag>>(Constants.TagsDump).ConfigureAwait(false);
@@ -50,7 +52,7 @@
                     return null;

                 //				var headers = response.Headers; // Not used
-                var buffer = new Byte[4096]; // Use the receive buffer size here maybe?
+                var buffer = new Byte[VndbUtils.BufferSize];
                 var encoding = String.IsNullOrWhiteSpace(response.CharacterSet)
                     ? Encoding.UTF8
                     : Encoding.GetEncoding(response.CharacterSet);
@@ -60,10 +62,10 @@
                 while ((bytesRead = await responseStream.ReadAsync(buffer, 0, buffer.Length).ConfigureAwait(false)) > 0)
                     await responseContent.WriteAsync(buffer, 0, bytesRead).ConfigureAwait(false);

-                // Reset out position;
+                // Reset our position;
                 responseContent.Position = 0;
                 // Reset the buffer as well
-                buffer = new Byte[4096];
+                buffer = new Byte[VndbUtils.BufferSize];
                 using (var gzipStream = new GZipStream(responseContent, CompressionMode.Decompress))
                 using (var finalStream = new MemoryStream())
                 {


added one more method Split for Silverlight version

--- WebSocket4Net.Silverlight/Extensions.Silverlight.cs
+++ WebSocket4Net.Silverlight/Extensions.Silverlight.cs
@@ -2,6 +2,7 @@
 using System.Net;
 using System.Security.Cryptography;
 using System.Text;
+using System.Linq;

 namespace WebSocket4Net
 {
@@ -32,6 +33,19 @@

             return uri.OriginalString.Substring(0, pos);
         }
+
+        public static string[] Split(this string source, char[] spliter, int count, StringSplitOptions options)
+        {
+            var parts = source.Split(spliter, options);
+
+            if (parts.Length <= count)
+                return parts.ToArray();
+
+            var partList = parts.Take(count - 1).ToList();
+            partList.Add(string.Join(spliter[0].ToString(), parts, count - 1, parts.Length - count + 1));
+            parts = partList.ToArray();
+            return parts;
+        }
     }

     public static class MD5


fix konec

fix konec

--- WPF/MainWindow.xaml.cs
+++ WPF/MainWindow.xaml.cs
@@ -23,8 +23,14 @@
 				RoundCount.Items.Add(round);
 			}

+			//plotter.AddLineGraph(ds, Colors.Green, 2, "Volts"); // to use this method you need "using Microsoft.Research.DynamicDataDisplay;"
+		}
+
+		private void GenerateButtonClick(object sender, RoutedEventArgs e)
+		{
 			var points1 = new List<Tuple<double, double>>();
 			var points2 = new List<Tuple<double, double>>();
+			var points3 = new List<Tuple<double, double>>();
 			for (int i = 0; i < 1000; i++)
 			{
 				points1.Add(new Tuple<double, double>(i * Math.PI / 50, Math.Cos(i * Math.PI / 50)));
@@ -41,12 +47,6 @@

 			plotter.AddLineGraph(ds1, null, new CirclePointMarker { Size = 5, Fill = Brushes.Red }, null);
 			plotter.AddLineGraph(ds2, null, new CirclePointMarker { Size = 5, Fill = Brushes.Green }, null);
-			//plotter.AddLineGraph(ds, Colors.Green, 2, "Volts"); // to use this method you need "using Microsoft.Research.DynamicDataDisplay;"
-		}
-
-		private void GenerateButtonClick(object sender, RoutedEventArgs e)
-		{
-
 		}
 	}
 }


add summary comment.

add summary comment.

--- src/DotNetCore.CAP/MessageContext.cs
+++ src/DotNetCore.CAP/MessageContext.cs
@@ -1,11 +1,23 @@
 namespace DotNetCore.CAP
 {
+    /// <summary>
+    /// Message context
+    /// </summary>
     public class MessageContext
     {
+        /// <summary>
+        /// Gets or sets the message group.
+        /// </summary>
         public string Group { get; set; }

+        /// <summary>
+        /// Message name.
+        /// </summary>
         public string Name { get; set; }

+        /// <summary>
+        /// Message content
+        /// </summary>
         public string Content { get; set; }

         public override string ToString()


Update SmtpClientTests.cs

Update SmtpClientTests.cs

--- UnitTests/Net/Smtp/SmtpClientTests.cs
+++ UnitTests/Net/Smtp/SmtpClientTests.cs
@@ -1758,8 +1758,8 @@
 			commands.Add (new SmtpReplayCommand ("", "comcast-greeting.txt"));
 			commands.Add (new SmtpReplayCommand ("EHLO [127.0.0.1]\r\n", "comcast-ehlo+smtputf8.txt"));
 			commands.Add (new SmtpReplayCommand ("AUTH PLAIN AHVzZXJuYW1lAHBhc3N3b3Jk\r\n", "comcast-auth-plain.txt"));
-			commands.Add (new SmtpReplayCommand ("MAIL FROM:<úßerñame@example.com> SMTPUTF8 BODY=8BITMIME\r\n", "comcast-mail-from.txt"));
-			commands.Add (new SmtpReplayCommand ("RCPT TO:<úßerñame@example.com>\r\n", "comcast-rcpt-to.txt"));
+			commands.Add (new SmtpReplayCommand ($"MAIL FROM:<{mailbox.Address}> SMTPUTF8 BODY=8BITMIME\r\n", "comcast-mail-from.txt"));
+			commands.Add (new SmtpReplayCommand ($"RCPT TO:<{mailbox.Address}>\r\n", "comcast-rcpt-to.txt"));
 			commands.Add (new SmtpReplayCommand ("DATA\r\n", "comcast-data.txt"));
 			commands.Add (new SmtpReplayCommand (".\r\n", "comcast-data-done.txt"));
 			commands.Add (new SmtpReplayCommand ($"MAIL FROM:<{addrspec}> BODY=8BITMIME\r\n", "comcast-mail-from.txt"));
@@ -1831,8 +1831,8 @@
 			commands.Add (new SmtpReplayCommand ("", "comcast-greeting.txt"));
 			commands.Add (new SmtpReplayCommand ("EHLO [127.0.0.1]\r\n", "comcast-ehlo+smtputf8.txt"));
 			commands.Add (new SmtpReplayCommand ("AUTH PLAIN AHVzZXJuYW1lAHBhc3N3b3Jk\r\n", "comcast-auth-plain.txt"));
-			commands.Add (new SmtpReplayCommand ("MAIL FROM:<úßerñame@example.com> SMTPUTF8 BODY=8BITMIME\r\n", "comcast-mail-from.txt"));
-			commands.Add (new SmtpReplayCommand ("RCPT TO:<úßerñame@example.com>\r\n", "comcast-rcpt-to.txt"));
+			commands.Add (new SmtpReplayCommand ($"MAIL FROM:<{mailbox.Address}> SMTPUTF8 BODY=8BITMIME\r\n", "comcast-mail-from.txt"));
+			commands.Add (new SmtpReplayCommand ($"RCPT TO:<{mailbox.Address}>\r\n", "comcast-rcpt-to.txt"));
 			commands.Add (new SmtpReplayCommand ("DATA\r\n", "comcast-data.txt"));
 			commands.Add (new SmtpReplayCommand (".\r\n", "comcast-data-done.txt"));
 			commands.Add (new SmtpReplayCommand ($"MAIL FROM:<{addrspec}> BODY=8BITMIME\r\n", "comcast-mail-from.txt"));


VHD: Avoid re-reading the header each time we update the footer when extending the file.

--- src/Vhd/DynamicStream.cs
+++ src/Vhd/DynamicStream.cs
@@ -42,6 +42,7 @@
         private long _nextBlockStart;
         private bool _newBlocksAllocated;
         private bool _autoCommitFooter = true;
+        private byte[] _footerCache;

         public DynamicStream(Stream fileStream, DynamicHeader dynamicHeader, long length, SparseStream parentStream, Ownership ownsParentStream)
         {
@@ -603,10 +604,13 @@
             if (_newBlocksAllocated)
             {
                 // Update the footer at the end of the file (if we allocated new blocks).
-                _fileStream.Position = 0;
-                byte[] footerData = Utilities.ReadFully(_fileStream, Utilities.SectorSize);
+                if (_footerCache == null)
+                {
+                    _fileStream.Position = 0;
+                    _footerCache = Utilities.ReadFully(_fileStream, Utilities.SectorSize);
+                }
                 _fileStream.Position = _nextBlockStart;
-                _fileStream.Write(footerData, 0, footerData.Length);
+                _fileStream.Write(_footerCache, 0, _footerCache.Length);
             }
         }


try fixing build error in ci

try fixing build error in ci

--- test/Microsoft.DocAsCode.MarkdownRewriters.Tests/MarkdownRewritersTest.cs
+++ test/Microsoft.DocAsCode.MarkdownRewriters.Tests/MarkdownRewritersTest.cs
@@ -3,10 +3,6 @@

 namespace Microsoft.DocAsCode.MarkdownRewriters.Tests
 {
-    using System;
-    using System.Collections.Immutable;
-
-    using Microsoft.DocAsCode.EntityModel;
     using Microsoft.DocAsCode.MarkdownLite;

     using Xunit;


fix typo in summary of down keys (#7946)

--- dotnet/src/webdriver/Keys.cs
+++ dotnet/src/webdriver/Keys.cs
@@ -163,12 +163,12 @@
         public static readonly string ArrowRight = Convert.ToString(Convert.ToChar(0xE014, CultureInfo.InvariantCulture), CultureInfo.InvariantCulture); // alias

         /// <summary>
-        /// Represents the Left arrow key.
+        /// Represents the down arrow key.
         /// </summary>
         public static readonly string Down = Convert.ToString(Convert.ToChar(0xE015, CultureInfo.InvariantCulture), CultureInfo.InvariantCulture);

         /// <summary>
-        /// Represents the Left arrow key.
+        /// Represents the down arrow key.
         /// </summary>
         public static readonly string ArrowDown = Convert.ToString(Convert.ToChar(0xE015, CultureInfo.InvariantCulture), CultureInfo.InvariantCulture); // alias


mark as background thread

mark as background thread

--- Emitter/Net/Fx.cs
+++ Emitter/Net/Fx.cs
@@ -26,7 +26,12 @@
     {
         public static void StartThread(ThreadStart threadStart)
         {
-            new Thread(threadStart).Start();
+            var thread = new Thread(threadStart);
+            #if !(MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3 || MF_FRAMEWORK_VERSION_V4_4)
+            thread.IsBackground = true;
+            #endif
+
+            thread.Start();
         }

         public static void SleepThread(int millisecondsTimeout)


Other minor renamings related to 'count' vs 'number'

--- src/FireworksNet/Explode/Exploder.cs
+++ src/FireworksNet/Explode/Exploder.cs
@@ -67,15 +67,11 @@
                 throw new ArgumentOutOfRangeException("currentStepNumber");
             }

-            // TODO: Need further decomposition:
-            //       - SparksCountCalculator
-            //       - AmplitudeCalculator
-
             double amplitude = this.CalculateAmplitude(epicenter, currentFireworkQualities);
             IDictionary<FireworkType, int> sparkCounts = new Dictionary<FireworkType, int>()
             {
-                { FireworkType.ExplosionSpark, this.CalculateExplosionSparksNumber(epicenter, currentFireworkQualities) },
-                { FireworkType.SpecificSpark, this.CalculateSpecificSparksNumber(epicenter, currentFireworkQualities) }
+                { FireworkType.ExplosionSpark, this.CountExplosionSparks(epicenter, currentFireworkQualities) },
+                { FireworkType.SpecificSpark, this.CountSpecificSparks(epicenter, currentFireworkQualities) }
             };

             return new FireworkExplosion(epicenter, currentStepNumber, amplitude, sparkCounts);
@@ -88,10 +84,9 @@
             return this.settings.ExplosionSparksMaximumAmplitude * (epicenter.Quality - minFireworkQuality + double.Epsilon) / (currentFireworkQualities.Sum(fq => fq - minFireworkQuality) + double.Epsilon);
         }

-        protected virtual int CalculateExplosionSparksNumber(Firework epicenter, IEnumerable<double> currentFireworkQualities)
+        protected virtual int CountExplosionSparks(Firework epicenter, IEnumerable<double> currentFireworkQualities)
         {
-            double explosionSparksNumberExact = this.CalculateExplosionSparksNumberExact(epicenter, currentFireworkQualities);
-
+            double explosionSparksNumberExact = this.CountExplosionSparksExact(epicenter, currentFireworkQualities);
             if (explosionSparksNumberExact.IsLess(this.minAllowedExplosionSparksNumberExact))
             {
                 return this.minAllowedExplosionSparksNumber;
@@ -106,12 +101,12 @@
             }
         }

-        protected virtual int CalculateSpecificSparksNumber(Firework epicenter, IEnumerable<double> currentFireworkQualities)
+        protected virtual int CountSpecificSparks(Firework epicenter, IEnumerable<double> currentFireworkQualities)
         {
             return this.settings.SpecificSparksPerExplosionNumber;
         }

-        private double CalculateExplosionSparksNumberExact(Firework epicenter, IEnumerable<double> currentFireworkQualities)
+        private double CountExplosionSparksExact(Firework epicenter, IEnumerable<double> currentFireworkQualities)
         {
             // Using Aggregate() here because Max() won't use my double extensions
             double maxFireworkQuality = currentFireworkQualities.Aggregate((agg, next) => next.IsGreater(agg) ? next : agg);


Added a new block policy to only generate a block if the following is not empty.

--- src/Generator/Generators/Template.cs
+++ src/Generator/Generators/Template.cs
@@ -10,7 +10,8 @@
     {
         Never,
         Always,
-        BeforeNextBlock
+        BeforeNextBlock,
+        IfNotEmpty
     }

     public class BlockKind
@@ -87,9 +88,26 @@
             uint totalIndent = 0;
             Block previousBlock = null;

+            var blockIndex = 0;
             foreach (var childBlock in Blocks)
             {
                 var childText = childBlock.Generate(options);
+
+                var nextBlock = (++blockIndex < Blocks.Count)
+                    ? Blocks[blockIndex]
+                    : null;
+
+                var skipBlock = false;
+                if (nextBlock != null)
+                {
+                    var nextText = nextBlock.Generate(options);
+                    if (string.IsNullOrEmpty(nextText) &&
+                        childBlock.NewLineKind == NewLineKind.IfNotEmpty)
+                        skipBlock = true;
+                }
+
+                if (skipBlock)
+                    continue;

                 if (string.IsNullOrEmpty(childText))
                     continue;


Fixing spacing

Fixing spacing

--- src/Hyde/Table/Memory/MemoryTable.cs
+++ src/Hyde/Table/Memory/MemoryTable.cs
@@ -22,7 +22,7 @@

       public void Add( string partitionKey, string rowKey, Guid callerInstanceId, GenericTableEntity entity )
       {
-         IDictionary<string, EntityProperty> properties = entity.WriteEntity(null);
+         IDictionary<string, EntityProperty> properties = entity.WriteEntity( null );

          var tableServiceEntity = new TableServiceEntity( partitionKey, rowKey );

@@ -75,7 +75,7 @@

          var actualEntity = TableEntries.Single( e => EntryKeysMatch( partitionKey, rowKey, e ) );

-         IDictionary<string, EntityProperty> serializedData = entity.WriteEntity( null ) ;
+         IDictionary<string, EntityProperty> serializedData = entity.WriteEntity( null );
          actualEntity.Value.Modify( callerInstanceId, serializedData );
       }
    }


fixed a NPE in science log when placing a new vessel onto the launch pad

--- src/Kerbalism/Database/ScienceLog.cs
+++ src/Kerbalism/Database/ScienceLog.cs
@@ -25,7 +25,8 @@
 		internal void Save(ConfigNode node)
 		{
 			node.AddValue("SumTotal", SumTotal);
-			node.AddValue("LastSubjectTitle", LastSubjectTitle);
+			if(!string.IsNullOrEmpty(LastSubjectTitle))
+				node.AddValue("LastSubjectTitle", LastSubjectTitle);
 			node.AddValue("LastTransmissionTime", LastTransmissionTime);
 		}
 	}


DefaultMappers: code comments

DefaultMappers: code comments

--- src/Kirkin/Mapping/DefaultMappers.cs
+++ src/Kirkin/Mapping/DefaultMappers.cs
@@ -6,6 +6,7 @@
     /// </summary>
     internal static class StrictMapper<TSource, TTarget>
     {
+        // Lazy initialized to avoid a TypeInitializationException in case of a bad mapping,
         private static Mapper<TSource, TTarget> _default;

         /// <summary>
@@ -16,7 +17,6 @@
         {
             get
             {
-                // Lazy initialized to avoid a TypeInitializationException in case of a bad mapping,
                 if (_default == null) {
                     _default = CreateMapper();
                 }
@@ -44,6 +44,7 @@
     /// </summary>
     internal static class RelaxedMapper<TSource, TTarget>
     {
+        // Lazy initialized to avoid a TypeInitializationException in case of a bad mapping,
         private static Mapper<TSource, TTarget> _default;

         /// <summary>
@@ -54,7 +55,6 @@
         {
             get
             {
-                // Lazy initialized to avoid a TypeInitializationException in case of a bad mapping,
                 if (_default == null) {
                     _default = CreateMapper();
                 }
@@ -82,6 +82,7 @@
     /// </summary>
     internal static class AllSourceMembersMapper<TSource, TTarget>
     {
+        // Lazy initialized to avoid a TypeInitializationException in case of a bad mapping,
         private static Mapper<TSource, TTarget> _default;

         /// <summary>
@@ -92,7 +93,6 @@
         {
             get
             {
-                // Lazy initialized to avoid a TypeInitializationException in case of a bad mapping,
                 if (_default == null) {
                     _default = CreateMapper();
                 }
@@ -120,6 +120,7 @@
     /// </summary>
     internal static class AllTargetMembersMapper<TSource, TTarget>
     {
+        // Lazy initialized to avoid a TypeInitializationException in case of a bad mapping,
         private static Mapper<TSource, TTarget> _default;

         /// <summary>
@@ -130,7 +131,6 @@
         {
             get
             {
-                // Lazy initialized to avoid a TypeInitializationException in case of a bad mapping,
                 if (_default == null) {
                     _default = CreateMapper();
                 }


Use new syntax

Use new syntax

--- src/LazyStorage/Xml/XmlRepository.cs
+++ src/LazyStorage/Xml/XmlRepository.cs
@@ -57,10 +57,8 @@

         public void Save()
         {
-            using (var writer = new FileStream(_uri, FileMode.Create))
-            {
-                GetXmlOuput(_repository).Save(writer);
-            }
+            using var writer = new FileStream(_uri, FileMode.Create);
+            GetXmlOuput(_repository).Save(writer);
         }

         private XDocument GetXmlOuput(List<T> objects)


Add methods intto User Api

Add methods intto User Api

--- WTM.Api/Controllers/UserController.cs
+++ WTM.Api/Controllers/UserController.cs
@@ -1,4 +1,6 @@
-using System.Web.Http;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web.Http;
 using WTM.Core.Services;
 using WTM.Crawler;
 using WTM.Crawler.Services;
@@ -29,5 +31,19 @@
         {
             return userService.Login(username, password);
         }
+
+        [Route("api/User/{username}")]
+        [HttpGet]
+        public User Get(string username)
+        {
+            return userService.GetByUsername(username);
+        }
+
+        //[Route("api/User/Search")]
+        [HttpGet]
+        public List<UserSummary> Search(string search, [FromUri]int? page = null)
+        {
+            return userService.Search(search, page).ToList();
+        }
     }
 }


typo (adding missing dot to abbreviation)

--- Website/Views/Pages/Home.generated.cs
+++ Website/Views/Pages/Home.generated.cs
@@ -1,4 +1,4 @@
-#pragma warning disable 1591
+#pragma warning disable 1591
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
@@ -77,7 +77,7 @@

About

When you use NuGet to install a package, it copies the library files to your solution and automatically updates your project
-    (add references, change config files, etc). If you remove a package, NuGet reverses whatever changes it made so that no clutter is left.

+    (add references, change config files, etc.). If you remove a package, NuGet reverses whatever changes it made so that no clutter is left.

Important Notice

You can develop your own package and share it via the NuGet Gallery. Read the documentation for more details on


close #137

close #137

--- Wox.Plugin.SystemPlugins/UrlPlugin.cs
+++ Wox.Plugin.SystemPlugins/UrlPlugin.cs
@@ -16,7 +16,7 @@
         protected override List<Result> QueryInternal(Query query)
         {
             var raw = query.RawQuery;
-            if (reg.IsMatch(raw))
+            if (reg.Match(raw).Value == raw)
             {
                 return new List<Result>
                 {


CA-339273: Mention destination Host/Pool in VM import action

Also moved initial description update from base constructor call to body of subclass constructor.

Signed-off-by: Danilo Del Busso <766dc0f994b57f2d2e98930ecfa5ee8fb1091a62@citrix.com>

--- XenModel/Actions/VM/ImportVmAction.cs
+++ XenModel/Actions/VM/ImportVmAction.cs
@@ -72,9 +72,10 @@

         public ImportVmAction(IXenConnection connection, Host affinity, string filename, SR sr,
             Action<VM, bool> warningDelegate, Action<VMStartAbstractAction, Failure> failureDiagnosisDelegate)
-			: base(connection, string.Format(Messages.IMPORTVM_TITLE, filename, Helpers.GetName(connection)), Messages.IMPORTVM_PREP)
-		{
-			Pool = Helpers.GetPoolOfOne(connection);
+			: base(connection, GetTitle(filename, connection, affinity))
+        {
+            Description = Messages.IMPORTVM_PREP;
+            Pool = Helpers.GetPoolOfOne(connection);
 			m_affinity = affinity;
 			Host = affinity ?? connection.Resolve(Pool.master);
 			SR = sr;
@@ -95,6 +96,12 @@

 			#endregion
 		}
+
+        private static string GetTitle(string filename, IXenConnection connection, Host affinity)
+        {
+            var toHost = affinity ?? connection.Resolve(Helpers.GetPoolOfOne(connection).master);
+            return string.Format(Messages.IMPORTVM_TITLE, filename, toHost.NameWithLocation());
+        }

         protected override void Run()
         {


Cleanup

Cleanup

--- src/MvvmNano.Forms/FormsPresenter.cs
+++ src/MvvmNano.Forms/FormsPresenter.cs
@@ -11,27 +11,58 @@
     {
         private readonly Application _application;

+        private readonly Type[] _availableViewTypes;
+
         public FormsPresenter(Application application)
         {
             _application = application;
+
+            _availableViewTypes = _application
+                .GetType()
+                .GetTypeInfo()
+                .Assembly
+                .DefinedTypes
+                .Select(t => t.AsType())
+                .ToArray();
         }

         public async Task ShowViewModelAsync<TViewModel>(object parameter) where TViewModel : IViewModel
         {
             Type viewModelType = typeof(TViewModel);
-            string pageName = viewModelType.Name.Replace("ViewModel", "Page");

-            Type pageType = _application.GetType().GetTypeInfo().Assembly.DefinedTypes
-                .Select(t => t.AsType())
-                .FirstOrDefault(t => t.Name == pageName);
-
-            var viewModel = Activator.CreateInstance(viewModelType) as IViewModel;
+            IViewModel viewModel = CreateViewModel(viewModelType);
             viewModel.Initialize(parameter);

-            var page = Activator.CreateInstance(pageType) as Page;
-            ((IView)page).SetViewModel(viewModel);
+            IView view = CreateView(viewModelType);
+            view.SetViewModel(viewModel);

-            await _application.MainPage.Navigation.PushAsync(page, true);
+            await OpenPageAsync(view as Page);
+        }
+
+        private static IViewModel CreateViewModel(Type viewModelType)
+        {
+            return Activator.CreateInstance(viewModelType) as IViewModel;
+        }
+
+        private IView CreateView(Type viewModelType)
+        {
+            string viewName = viewModelType.Name.Replace("ViewModel", "Page");
+            Type pageType = _availableViewTypes
+                .FirstOrDefault(t => t.Name == viewName);
+
+            var view = Activator.CreateInstance(pageType) as IView;
+            if (view == null)
+                throw new InvalidOperationException(viewName + " could not be found.");
+
+            return view;
+        }
+
+        private Task OpenPageAsync(Page page)
+        {
+            if (page == null)
+                throw new ArgumentNullException("page");
+
+            return _application.MainPage.Navigation.PushAsync(page, true);
         }
     }
 }


Logging the error when get a bad requst

Logging the error when get a bad requst

--- src/Orchard/Mvc/Routes/ShellRoute.cs
+++ src/Orchard/Mvc/Routes/ShellRoute.cs
@@ -6,6 +6,7 @@
 using System.Web.SessionState;
 using Orchard.Environment;
 using Orchard.Environment.Configuration;
+using Orchard.Logging;
 using Orchard.Mvc.Extensions;

 namespace Orchard.Mvc.Routes {
@@ -119,6 +120,8 @@
                 get { return false; }
             }

+            public ILogger Logger { get; set; }
+
             public void ProcessRequest(HttpContext context) {
                 using (_workContextAccessor.CreateWorkContextScope(new HttpContextWrapper(context))) {
                     _httpHandler.ProcessRequest(context);
@@ -147,8 +150,9 @@
                 try {
                     return _httpAsyncHandler.BeginProcessRequest(context, cb, extraData);
                 }
-                catch {
+                catch(Exception ex) {
                     _scope.Dispose();
+                    Logger.Error(ex,ex.Message);
                     HttpContext.Current.Response.Redirect("/StartPage");
                    // throw;
                     return null;


cleanup

cleanup

--- src/Peachpie.Runtime/std/Iterator.cs
+++ src/Peachpie.Runtime/std/Iterator.cs
@@ -47,7 +47,7 @@
 /// This interface contains only arg-less stubs as signatures should not be restricted.
 /// </remarks>
 [EditorBrowsable(EditorBrowsableState.Advanced)]
-[PhpType(PhpTypeAttribute.InheritName), PhpExtension("Core")]
+[PhpType(PhpTypeAttribute.InheritName), PhpExtension(PhpExtensionAttribute.KnownExtensionNames.Core)]
 public interface IteratorAggregate : Traversable
 {
     /// <summary>


Forced certificate/config file directory creation on load

--- src/Procon.Service.Shared/Defines.cs
+++ src/Procon.Service.Shared/Defines.cs
@@ -222,6 +222,8 @@
         /// Ensure the entire directory structure has been created.
         /// </summary>
         static Defines() {
+            Defines.CertificatesDirectory.Create();
+            Defines.ConfigsDirectory.Create();
             Defines.PackagesDirectory.Create();
             Defines.LogsDirectory.Create();
             Defines.ErrorsLogsDirectory.Create();


Fixed error in documentation.

Fixed error in documentation.

--- src/Cake.Core/IO/DirectoryPath.cs
+++ src/Cake.Core/IO/DirectoryPath.cs
@@ -34,7 +34,7 @@

         /// <summary>
         /// Combines the current path with a <see cref="FilePath"/>.
-        /// The provided <see cref="FilePath"/> must be absolute.
+        /// The provided <see cref="FilePath"/> must be relative.
         /// </summary>
         /// <param name="path">The path.</param>
         /// <returns>A combination of the current path and the provided <see cref="FilePath"/>.</returns>
@@ -54,7 +54,7 @@

         /// <summary>
         /// Combines the current path with another <see cref="DirectoryPath"/>.
-        /// The provided <see cref="DirectoryPath"/> must be absolute.
+        /// The provided <see cref="DirectoryPath"/> must be relative.
         /// </summary>
         /// <param name="path">The path.</param>
         /// <returns>A combination of the current path and the provided <see cref="DirectoryPath"/>.</returns>


Made the program not crash when the enumerable properties were not present in the pack.json file.

--- src/Umbraco.Tools.Package/Program.cs
+++ src/Umbraco.Tools.Package/Program.cs
@@ -11,9 +11,22 @@
 {
     public class ApplicationSettings
     {
-        public string[] Dlls { get; set; }
+        private string[] _includeFolders;
+        private string[] _dlls;
+
+        public string[] Dlls
+        {
+            get { return _dlls ?? (_dlls = new string[0]); }
+            set { _dlls = value; }
+        }
+
         public string PackageXmlTemplate { get; set; }
-        public string[] IncludeFolders { get; set; }
+
+        public string[] IncludeFolders
+        {
+            get { return _includeFolders ?? (_includeFolders = new string[0]); }
+            set { _includeFolders = value; }
+        }
     }

     public class Program


VMDK: Make extent calculation lazy evaluated.

--- src/Vmdk/CommonSparseExtentStream.cs
+++ src/Vmdk/CommonSparseExtentStream.cs
@@ -284,23 +284,22 @@
             {
                 CheckDisposed();

-                // Note: For now we only go down to grain table granularity (large chunks), we don't inspect the
-                // grain tables themselves to indicate which sectors are present.
-                List<StreamExtent> extents = new List<StreamExtent>();
-
-                long length = Length;
-                long start = FindNextPresentGrain(0);
-                while (start < length)
-                {
-                    long end = FindNextAbsentGrain(start);
-                    extents.Add(new StreamExtent(start, end - start));
-
-                    start = FindNextPresentGrain(end);
-                }
-
                 var parentExtents = StreamExtent.Intersect(_parentDiskStream.Extents, new StreamExtent[] { new StreamExtent(_diskOffset, Length) });
                 parentExtents = StreamExtent.Offset(parentExtents, -_diskOffset);
-                return StreamExtent.Union(extents, parentExtents);
+                return StreamExtent.Union(LayerExtents(), parentExtents);
+            }
+        }
+
+        private IEnumerable<StreamExtent> LayerExtents()
+        {
+            long length = Length;
+            long start = FindNextPresentGrain(0);
+            while (start < length)
+            {
+                long end = FindNextAbsentGrain(start);
+                yield return new StreamExtent(start, end - start);
+
+                start = FindNextPresentGrain(end);
             }
         }


Fixed #23

Fixed #23

--- src/Compose/ServiceApplication.cs
+++ src/Compose/ServiceApplication.cs
@@ -2,5 +2,5 @@

 namespace Compose
 {
-	public class ServiceApplication : Executable<CancellationToken> { }
+	public class ServiceApplication : Executable<CancellationTokenSource> { }
 }


Decompiler.Decompile method now simply dispatches and calls individual methods to decompile each section

--- src/ContentCompiler/Decompiler.cs
+++ src/ContentCompiler/Decompiler.cs
@@ -14,15 +14,26 @@
     {
         public void Decompile(ContentManager content)
         {
+            DecompileSchedules(content);
+            DecompilePortraits(content);
+        }
+        void DecompileSchedules(ContentManager content)
+        {
             foreach (var asset in GetGameAssetsIn<Dictionary<string, string>>(content, "characters\\schedules"))
             {
                 var schedule = Schedule.Decompile(asset);

                 File.WriteAllText(Path.Combine(content.RootDirectory, "characters\\schedules", asset.Filename) + ".json", JsonConvert.SerializeObject(schedule, Formatting.Indented));
             }
-            DecompilePortraits(content);
         }
-        static IEnumerable<GameAsset<T>> GetGameAssetsIn<T>(ContentManager content, string relativePath)
+        void DecompilePortraits(ContentManager content)
+        {
+            foreach (var asset in GetGameAssetsIn<Texture2D>(content, "portraits"))
+                using (var stream = File.Create(content.RootDirectory + "\\Portraits\\" + asset.Filename + ".png"))
+                    asset.Content.SaveAsPng(stream, asset.Content.Width, asset.Content.Height);
+        }
+
+        IEnumerable<GameAsset<T>> GetGameAssetsIn<T>(ContentManager content, string relativePath)
         {
             var items = Directory.EnumerateFiles(Path.Combine(content.RootDirectory, relativePath)).Where(c => Path.GetExtension(c) == ".xnb").Select(c => Path.GetFileNameWithoutExtension(c));
             foreach (var item in items)
@@ -30,12 +41,5 @@
                 yield return GameAsset.Create(item, content.Load<T>(Path.Combine(relativePath, item)));
             }
         }
-
-        static void DecompilePortraits(ContentManager content)
-        {
-            foreach (var asset in GetGameAssetsIn<Texture2D>(content, "portraits"))
-                using (var stream = File.Create(content.RootDirectory + "\\Portraits\\" + asset.Filename + ".png"))
-                    asset.Content.SaveAsPng(stream, asset.Content.Width, asset.Content.Height);
-        }
     }
 }


renamed params in StepExecutor from primitive to step

--- src/Xbehave/Internal/StepExecutor.cs
+++ src/Xbehave/Internal/StepExecutor.cs
@@ -8,47 +8,47 @@

     internal static class StepExecutor
     {
-        public static void Execute(Step<Action> primitive)
+        public static void Execute(Step<Action> step)
         {
-            if (primitive.MillisecondsTimeout > 0)
+            if (step.MillisecondsTimeout > 0)
             {
-                var result = primitive.Action.BeginInvoke(null, null);
+                var result = step.Action.BeginInvoke(null, null);

                 // NOTE: we do not call the WaitOne(int) overload because it wasn't introduced until .NET 3.5 SP1 and we want to support pre-SP1
-                if (!result.AsyncWaitHandle.WaitOne(primitive.MillisecondsTimeout, false))
+                if (!result.AsyncWaitHandle.WaitOne(step.MillisecondsTimeout, false))
                 {
-                    throw new Xunit.Sdk.TimeoutException(primitive.MillisecondsTimeout);
+                    throw new Xunit.Sdk.TimeoutException(step.MillisecondsTimeout);
                 }
                 else
                 {
-                    primitive.Action.EndInvoke(result);
+                    step.Action.EndInvoke(result);
                 }
             }
             else
             {
-                primitive.Action();
+                step.Action();
             }
         }

-        public static IDisposable Execute(Step<ContextDelegate> primitive)
+        public static IDisposable Execute(Step<ContextDelegate> step)
         {
-            if (primitive.MillisecondsTimeout > 0)
+            if (step.MillisecondsTimeout > 0)
             {
-                var result = primitive.Action.BeginInvoke(null, null);
+                var result = step.Action.BeginInvoke(null, null);

                 // NOTE: we do not call the WaitOne(int) overload because it wasn't introduced until .NET 3.5 SP1 and we want to support pre-SP1
-                if (!result.AsyncWaitHandle.WaitOne(primitive.MillisecondsTimeout, false))
+                if (!result.AsyncWaitHandle.WaitOne(step.MillisecondsTimeout, false))
                 {
-                    throw new Xunit.Sdk.TimeoutException(primitive.MillisecondsTimeout);
+                    throw new Xunit.Sdk.TimeoutException(step.MillisecondsTimeout);
                 }
                 else
                 {
-                    return primitive.Action.EndInvoke(result);
+                    return step.Action.EndInvoke(result);
                 }
             }
             else
             {
-                return primitive.Action();
+                return step.Action();
             }
         }
     }


implement .ctor(IEnumerable<TEntity>).

implement .ctor(IEnumerable<TEntity>).

git-svn-id: 1800f71f313d917366f95485fa960eed04b40598@933 33146b6e-df29-0410-a1ca-39be37fb9416

--- src/DbLinq/Data/Linq/EntityRef.cs
+++ src/DbLinq/Data/Linq/EntityRef.cs
@@ -42,9 +42,11 @@
     {
         private TEntity entity;
         private bool hasLoadedOrAssignedValue;
+        private IEnumerable<TEntity> source;

         public EntityRef(TEntity entity)
         {
+            this.source = null;
             this.entity = entity;
             hasLoadedOrAssignedValue = true;
         }
@@ -52,11 +54,14 @@
         [DbLinqToDo]
         public EntityRef(IEnumerable<TEntity> source)
         {
-            throw new NotImplementedException();
+            this.source = source;
+            hasLoadedOrAssignedValue = false;
+            entity = null;
         }

         public EntityRef(EntityRef<TEntity> entityRef)
         {
+            this.source = null;
             this.entity = entityRef.Entity;
             hasLoadedOrAssignedValue = true;
         }
@@ -65,6 +70,14 @@
         {
             get
             {
+                if (source != null) {
+                    foreach (var s in source) {
+                        if (entity != null)
+                            throw new InvalidOperationException ("Sequence contains more than one element");
+                        entity = s;
+                    }
+                    source = null;
+                }
                 return entity;
             }
             set


remove check ArgumentNullException

remove check ArgumentNullException

--- src/Fan/Helpers/RegexUtilities.cs
+++ src/Fan/Helpers/RegexUtilities.cs
@@ -25,10 +25,9 @@
                 if(string.IsNullOrEmpty(strIn))
                     return false;
             }
-            catch (Exception ex)
+            catch (RegexMatchTimeoutException)
             {
-                if(ex is RegexMatchTimeoutException || ex is ArgumentNullException)
-                    return false;
+                return false;
             }
             // Return true if strIn is in valid email format.
             try


'object' is the default base type now

'object' is the default base type now

--- src/Flame.Ecs/GlobalConverters.cs
+++ src/Flame.Ecs/GlobalConverters.cs
@@ -76,6 +76,9 @@
 					descTy.AddAttribute(PrimitiveAttributes.Instance.VirtualAttribute);
 				}

+                // A boolean that tells us if all of this type's base types
+                // are interfaces.
+                bool allInterfaces = true;
 				foreach (var item in Node.Args[1].Args)
 				{
 					// Convert the base types.
@@ -95,6 +98,13 @@
 						descTy.AddBaseType(innerTy);
 					}
 				}
+
+                if (allInterfaces && !descTy.GetIsInterface())
+                {
+                    var rootType = Scope.Binder.Environment.RootType;
+                    if (rootType != null)
+                        descTy.AddBaseType(rootType);
+                }

 				foreach (var item in Node.Args[2].Args)
 				{


commit for moving single comment, too good

--- FFTools_Mining.cs
+++ FFTools_Mining.cs
@@ -9,10 +9,10 @@
 namespace FFTools {
     public class Mining {
         public static void Main() {
-            // Ready singleton MemoryManager.
             String MineType= "Mature Tree"; //set to desired farming type ex: Mineral Deposit, Mature Tree
             byte[] MineTypeByteArray = Encoding.ASCII.GetBytes(MineType);

+            // Ready singleton MemoryManager.
             MemoryManager theMemory = new MemoryManager();
             if (theMemory.initialize() > 0) Environment.Exit(1);
             // Get a first read of Player.


Expose XElement when accessing Cell

Expose XElement when accessing Cell

--- FastExcel/Cell.cs
+++ FastExcel/Cell.cs
@@ -26,7 +26,12 @@
         /// Defined name or the column letter(s) for column this cell is in
         /// </summary>
         public string ColumnName { get; }
-
+
+        /// <summary>
+        /// Raw underlying XElement of cell
+        /// </summary>
+        public XElement XElement { get; }
+
         /// <summary>
         /// List of defined names assigned to this cell
         /// *Does not include names of ranges this cell is within*
@@ -91,6 +96,8 @@

             ColumnNumber = GetExcelColumnNumber(columnName);

+            XElement = cellElement;
+
             if (isTextRow)
             {
                 Value = worksheet.FastExcel.SharedStrings.GetString(cellElement.Value);


few comments

few comments

--- dix-nez-lande/dix-nez-lande/Implem/MapImpl.cs
+++ dix-nez-lande/dix-nez-lande/Implem/MapImpl.cs
@@ -77,6 +77,8 @@
             {
                 while (!positionValide(pos, r))
                 {
+                    //On cherche une valeur aléatoire dans
+                    //la moitié haute de la carte
                     pos = rand.Next(0, (size* size)/2);
                 }
             }
@@ -85,6 +87,8 @@
                 pos =(size*size)/2;
                 while (!positionValide(pos, r))
                 {
+                    //On cherche une valeur aléatoire dans
+                    //la moitié basse de la carte
                     pos = rand.Next((size*size)/2, size*size);
                 }
             }


Added method to append custom json converters

--- src/Nest/ElasticClient-Statics.cs
+++ src/Nest/ElasticClient-Statics.cs
@@ -1,49 +1,62 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Nest.Thrift;
-using Newtonsoft.Json.Linq;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Serialization;
-using Fasterflect;
-using Newtonsoft.Json.Converters;
-using Nest.DSL;
-using System.Diagnostics;
-using System.Text.RegularExpressions;
-using System.Reflection;
-using Nest.Domain;
-using Nest.Resolvers.Converters;
-
-namespace Nest
-{
-	public partial class ElasticClient
-	{
-		internal static readonly JsonSerializerSettings SerializationSettings;
-		internal static readonly PropertyNameResolver PropertyNameResolver;
-
-		static ElasticClient()
-		{
-			SerializationSettings = new JsonSerializerSettings()
-				{
-					ContractResolver = new ElasticResolver(),
-					NullValueHandling = NullValueHandling.Ignore,
-					DefaultValueHandling = DefaultValueHandling.Ignore,
-					Converters = new List<JsonConverter>
-				{
-					new IsoDateTimeConverter(),
-					new TermConverter(),
-					new FacetConverter(),
-					new IndexSettingsConverter(),
-					new ShardsSegmentConverter(),
-					new RawOrQueryDescriptorConverter()
-				}
-				};
-			PropertyNameResolver = new PropertyNameResolver(SerializationSettings);
-		}
-		public static string Serialize<T>(T @object)
-		{
-			return JsonConvert.SerializeObject(@object, Formatting.Indented, SerializationSettings);
-		}
-	}
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Nest.Thrift;
+using Newtonsoft.Json.Linq;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Serialization;
+using Fasterflect;
+using Newtonsoft.Json.Converters;
+using Nest.DSL;
+using System.Diagnostics;
+using System.Text.RegularExpressions;
+using System.Reflection;
+using Nest.Domain;
+using Nest.Resolvers.Converters;
+
+namespace Nest
+{
+	public partial class ElasticClient
+	{
+		internal static readonly JsonSerializerSettings SerializationSettings;
+		internal static readonly PropertyNameResolver PropertyNameResolver;
+
+    private static JsonSerializerSettings CreateSettings()
+    {
+      return new JsonSerializerSettings()
+      {
+        ContractResolver = new ElasticResolver(),
+        NullValueHandling = NullValueHandling.Ignore,
+        DefaultValueHandling = DefaultValueHandling.Ignore,
+        Converters = new List<JsonConverter>
+				{
+					new IsoDateTimeConverter(),
+					new TermConverter(),
+					new FacetConverter(),
+					new IndexSettingsConverter(),
+					new ShardsSegmentConverter(),
+					new RawOrQueryDescriptorConverter()
+				}
+      };
+    }
+
+    public static void AddConverter(JsonConverter converter)
+    {
+      ElasticClient.SerializationSettings.Converters.Add(converter);
+    }
+
+
+
+		static ElasticClient()
+		{
+      SerializationSettings = ElasticClient.CreateSettings();
+			PropertyNameResolver = new PropertyNameResolver(SerializationSettings);
+
+		}
+		public static string Serialize<T>(T @object)
+		{
+			return JsonConvert.SerializeObject(@object, Formatting.Indented, SerializationSettings);
+		}
+	}
+}


IsValidName helper

IsValidName helper

--- src/Peachpie.Runtime/Variables.cs
+++ src/Peachpie.Runtime/Variables.cs
@@ -261,6 +261,30 @@
             }
         }

+        /// <summary>
+		/// Checks whether a string is "valid" PHP variable identifier.
+		/// </summary>
+		/// <param name="name">The variable name.</param>
+		/// <returns>
+		/// Whether <paramref name="name"/> is "valid" name of variable, i.e. [_[:alpha:]][_0-9[:alpha:]]*.
+		/// This doesn't say anything about whether a variable of such name can be used in PHP, e.g. <c>${0}</c> is ok.
+		/// </returns>
+		public static bool IsValidName(string name)
+        {
+            if (string.IsNullOrEmpty(name)) return false;
+
+            // first char:
+            if (!char.IsLetter(name[0]) && name[0] != '_') return false;
+
+            // next chars:
+            for (int i = 1; i < name.Length; i++)
+            {
+                if (!char.IsLetterOrDigit(name[i]) && name[i] != '_') return false;
+            }
+
+            return true;
+        }
+
         public static bool IsValidCallback(IPhpCallable callable)
         {
             PhpCallback tmp;


Remove unused imports.

Remove unused imports.

--- src/Renci.SshNet/Session.NET40.cs
+++ src/Renci.SshNet/Session.NET40.cs
@@ -1,6 +1,4 @@
-using System.Threading.Tasks;
-using System.Linq;
-using Renci.SshNet.Messages;
+using Renci.SshNet.Messages;

 namespace Renci.SshNet
 {


return to normal error page and remove appInsights

--- Forum3/Startup.cs
+++ Forum3/Startup.cs
@@ -23,7 +23,7 @@

 		// This method gets called by the runtime. Use this method to add services to the container.
 		public void ConfigureServices(IServiceCollection services) {
-			services.AddApplicationInsightsTelemetry(Configuration);
+			// services.AddApplicationInsightsTelemetry(Configuration);

 			// Loads from the environment
 			var dbConnectionString = Configuration["DefaultConnection"];
@@ -70,20 +70,13 @@
 		}

 		public void Configure(IApplicationBuilder app, IHostingEnvironment env) {
-			// Keep for future reference on rewriting.
-			//app.UseRewriter(new RewriteOptions().AddRedirect("forum(.*)", "Boards/Index"));
-
 			if (env.IsDevelopment()) {
-				//app.UseDeveloperExceptionPage();
+				app.UseDeveloperExceptionPage();
 				app.UseBrowserLink();
 				app.UseDatabaseErrorPage();
 			}
-			else {
-				// Temporarily make everyone see this page until bugs are worked out.
-				app.UseDeveloperExceptionPage();
-
-				//app.UseExceptionHandler("/Boards/Error");
-			}
+			else
+				app.UseExceptionHandler("/Boards/Error");

 			app.UseStaticFiles();


tidied up

tidied up

--- src/Runners/MbUnit.Icarus/Main.cs
+++ src/Runners/MbUnit.Icarus/Main.cs
@@ -152,7 +152,7 @@
             aboutForm.ShowDialog();

             //if (aboutForm != null)
-                aboutForm.Dispose();
+            aboutForm.Dispose();
         }

         private void tlbStart_Click(object sender, EventArgs e)
@@ -200,7 +200,7 @@
             //trayIcon.ShowBalloonTip(5, "MbUnit Test Notice", "Recent changes have caused 5 of your unit tests to fail.",
             //                        ToolTipIcon.Error);
             List<TaskButton> taskButtons = new List<TaskButton>();
-
+
             TaskButton button1 = new TaskButton();
             button1.Text = "Button 1";
             button1.Icon = Resources.tick;
@@ -210,7 +210,8 @@
             TaskButton button2 = new TaskButton();
             button2.Text = "Button 2";
             button2.Icon = Resources.help_browser;
-            button2.Description = "This is the second button, much the same as the first button but this one demonstrates that the text will wrap onto the next line.";
+            button2.Description =
+                "This is the second button, much the same as the first button but this one demonstrates that the text will wrap onto the next line.";
             taskButtons.Add(button2);

             TaskButton button3 = new TaskButton();
@@ -218,18 +219,14 @@
             button3.Icon = Resources.cross;
             button3.Description = "Saves all changes and exits the application.";
             taskButtons.Add(button3);
-
-            //Shower taskDialogShower = new Shower();
+
             TaskButton res = TaskDialog.Show("Title Text",
-                            "Description about the problem and what you need to do to resolve it. Each button can have its own description too.",
-                            taskButtons);
-            //TaskButton res = taskDialogShower.CreateTaskDialog("Title Text", "Description about the problem and what you need to do to resolve it. Each button can have its own description too.", taskButtons);
-
+                                             "Description about the problem and what you need to do to resolve it. Each button can have its own description too.",
+                                             taskButtons);
             if (res == button2)
                 MessageBox.Show("Button 2 was clicked.");
             else if (res == button1)
                 MessageBox.Show("Button 1 was clicked.");
-
         }

         private void openProjectToolStripMenuItem_Click(object sender, EventArgs e)


100% coverage

100% coverage

--- Frost/HSVColor.cs
+++ Frost/HSVColor.cs
@@ -24,10 +24,20 @@
 			Trace.Assert(Check.IsPercentage(value));
 			Trace.Assert(Check.IsPercentage(alpha));

+			hue = Convert.ToSingle(Math.Round(hue, 4));
+			value = Convert.ToSingle(Math.Round(value, 4));
+			alpha = Convert.ToSingle(Math.Round(alpha, 4));
+			saturation = Convert.ToSingle(Math.Round(saturation, 4));
+
 			this._H = hue;
 			this._S = saturation;
 			this._V = value;
 			this._A = alpha;
+
+			Contract.Assert(H.Equals(hue));
+			Contract.Assert(S.Equals(saturation));
+			Contract.Assert(V.Equals(value));
+			Contract.Assert(A.Equals(alpha));
 		}

 		public float V
@@ -35,6 +45,7 @@
 			get
 			{
 				Contract.Ensures(Check.IsPercentage(Contract.Result<float>()));
+				Contract.Ensures(Contract.Result<float>().Equals(this._V));

 				return this._V;
 			}
@@ -45,6 +56,7 @@
 			get
 			{
 				Contract.Ensures(Check.IsPercentage(Contract.Result<float>()));
+				Contract.Ensures(Contract.Result<float>().Equals(this._S));

 				return this._S;
 			}
@@ -55,6 +67,7 @@
 			get
 			{
 				Contract.Ensures(Check.IsDegrees(Contract.Result<float>()));
+				Contract.Ensures(Contract.Result<float>().Equals(this._H));

 				return this._H;
 			}
@@ -65,6 +78,7 @@
 			get
 			{
 				Contract.Ensures(Check.IsPercentage(Contract.Result<float>()));
+				Contract.Ensures(Contract.Result<float>().Equals(this._A));

 				return this._A;
 			}
@@ -106,9 +120,9 @@

 		internal Color ToColor()
 		{
-			float r = 0.0f;
-			float g = 0.0f;
-			float b = 0.0f;
+			float r;
+			float g;
+			float b;

 			float h = this._H;
 			float s = this._S / 100.0f;
@@ -196,42 +210,39 @@

 			float delta = max - min;

-			if(max.Equals(0.0f) || delta.Equals(0.0f))
-			{
-				// undefined behavior, just use zero to prevent problems
+			if(delta.Equals(0.0f))
+			{
+				h = 0.0f;
 				s = 0.0f;
+			}
+			else
+			{
+				s = delta / max;
+
+				float delR = (((max - r) / 6.0f) + (delta * 0.5f)) / delta;
+				float delG = (((max - g) / 6.0f) + (delta * 0.5f)) / delta;
+				float delB = (((max - b) / 6.0f) + (delta * 0.5f)) / delta;
+
 				h = 0.0f;
-			}
-			else
-			{
-				s = delta / max;

 				if(r.Equals(max))
 				{
-					// between yellow and magenta
-					h = (g - b) / delta;
+					h = delB - delG;
 				}
 				else if(g.Equals(max))
 				{
-					// between cyan and yellow
-					h = 2.0f + (b - r) / delta;
-				}
-				else // b.Equals(max)
-				{
-					// between magenta and cyan
-					h = 4.0f + (r - g) / delta;
-				}
-			}
-
-			// scale to 0 ... 360
-			h *= 60.0f;
-
-			if(h < 0.0f)
-			{
-				h += 360.0f;
-			}
-
-			return new HSVColor(h, s * 100.0f, v * 100.0f, a * 100.0f);
+					h = (1.0f / 3.0f) + delR - delB;
+				}
+				else if(b.Equals(max))
+				{
+					h = (2.0f / 3.0f) + delG - delR;
+				}
+
+				h += h < 0.0f ? 1.0f : 0.0f;
+				h -= h > 1.0f ? 1.0f : 0.0f;
+			}
+
+			return new HSVColor(h * 360.0f, s * 100.0f, v * 100.0f, a * 100.0f);
 		}

 		public static bool operator ==(HSVColor left, HSVColor right)
@@ -247,12 +258,23 @@
 #if(UNIT_TESTING)
 		[Fact] internal static void Test0()
 		{
-			Assert.Equal(0, 1);
-		}
-
-		[Fact] internal static void Test1()
-		{
-			Assert.True(true);
+			Assert.Equal<HSVColor>(new HSVColor(000, 100, 100), new Color(1, 0, 0));
+			Assert.Equal<HSVColor>(new HSVColor(060, 100, 100), new Color(1, 1, 0));
+			Assert.Equal<HSVColor>(new HSVColor(120, 100, 100), new Color(0, 1, 0));
+			Assert.Equal<HSVColor>(new HSVColor(180, 100, 100), new Color(0, 1, 1));
+			Assert.Equal<HSVColor>(new HSVColor(240, 100, 100), new Color(0, 0, 1));
+			Assert.Equal<HSVColor>(new HSVColor(300, 100, 100), new Color(1, 0, 1));
+			Assert.Equal<HSVColor>(new HSVColor(000, 000, 100), new Color(1, 1, 1));
+
+			Assert.Equal<Color>(new Color(1, 0, 0), new HSVColor(000, 100, 100));
+			Assert.Equal<Color>(new Color(1, 1, 0), new HSVColor(060, 100, 100));
+			Assert.Equal<Color>(new Color(0, 1, 0), new HSVColor(120, 100, 100));
+			Assert.Equal<Color>(new Color(0, 1, 1), new HSVColor(180, 100, 100));
+			Assert.Equal<Color>(new Color(0, 0, 1), new HSVColor(240, 100, 100));
+			Assert.Equal<Color>(new Color(1, 0, 1), new HSVColor(360, 100, 100));
+			Assert.Equal<Color>(new Color(1, 1, 1), new HSVColor(180, 000, 100));
+
+			Assert.TestObject<HSVColor>(Color.Red, Color.Blue);
 		}
 #endif
 	}


fix exception message

fix exception message


Fix up formatting in RuntimePolicy documentation

--- source/Glimpse.Core/RuntimePolicy.cs
+++ source/Glimpse.Core/RuntimePolicy.cs
@@ -19,6 +19,7 @@
         /// Will not modify any part of the request
         /// </remarks>
         Off = 1,
+
         /// <summary>
         /// The execute resource only
         /// </summary>
@@ -26,6 +27,7 @@
         /// Will only resource endpoints to execute
         /// </remarks>
         ExecuteResourceOnly = 2 | Off,
+
         /// <summary>
         /// The persist results
         /// </summary>
@@ -33,6 +35,7 @@
         /// Will allow results to be persisted to the data store
         /// </remarks>
         PersistResults = 4,
+
         /// <summary>
         /// The modify response headers
         /// </summary>
@@ -40,6 +43,7 @@
         /// Allows the modification of response headers
         /// </remarks>
         ModifyResponseHeaders = 8 | PersistResults,
+
         /// <summary>
         /// The modify response body
         /// </summary>
@@ -47,6 +51,7 @@
         /// Allows the modification of response body
         /// </remarks>
         ModifyResponseBody = 16 | ModifyResponseHeaders,
+
         /// <summary>
         /// The display glimpse client
         /// </summary>
@@ -54,6 +59,7 @@
         /// Whether the client should show in the client browser
         /// </remarks>
         DisplayGlimpseClient = 32 | ModifyResponseBody,
+
         /// <summary>
         /// The on
         /// </summary>


Reduce rate of taking all Monitor locks in string interning (#4240)

Reduce rate of taking numProcessors or even more Monitor locks in string interning by increasing initial size

Increases from 31 to 2048.NextPrime() initial capacity. In medium-sized codebases (3K proj files) we see 200K of these; for 500 projects, 48K.
Intended to also reduce the rate of these we see parsing large repos in QuickBuild:

System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
   at System.Threading.Monitor.Enter(Object obj)
   at System.Collections.Concurrent.ConcurrentDictionary`2.AcquireLocks(Int32 fromInclusive, Int32 toExclusive, Int32& locksAcquired)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GrowTable(Tables tables, IEqualityComparer`1 newComparer, Boolean regenerateHashKeys, Int32 rehashCount)
   at System.Collections.Concurrent.ConcurrentDictionary`2.TryAddInternal(TKey key, TValue value, Boolean updateIfExists, Boolean acquireLock, TValue& resultingValue)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, TValue value)
   at Microsoft.Build.OpportunisticIntern.BucketedPrioritizedStringList.TryIntern(IInternable candidate, String& interned)
   at Microsoft.Build.OpportunisticIntern.BucketedPrioritizedStringList.InterningToString(IInternable candidate)
   at Microsoft.Build.Evaluation.Expander`2.PropertyExpander`1.ExpandPropertiesLeaveTypedAndEscaped(String expression, IPropertyProvider`1 properties, ExpanderOptions options, IElementLocation elementLocation, UsedUninitializedProperties usedUninitializedProperties)
...

--- src/Shared/OpportunisticIntern.cs
+++ src/Shared/OpportunisticIntern.cs
@@ -520,7 +520,12 @@
             private readonly bool _useSimpleConcurrency;

 #if !CLR2COMPATIBILITY
-            private readonly ConcurrentDictionary<string, string> _internedStrings = new ConcurrentDictionary<string, string>(StringComparer.Ordinal);
+            // ConcurrentDictionary starts with capacity 31 but we're usually adding far more than that. Make a better first capacity guess to reduce
+            // ConcurrentDictionary having to take all internal locks to upgrade its bucket list. Note that the number should be prime per the
+            // comments on the code at https://referencesource.microsoft.com/#mscorlib/system/Collections/Concurrent/ConcurrentDictionary.cs,122
+            // Also note default lock count is Environment.ProcessorCount from the same code.
+            private const int InitialCapacity = 2053;
+            private readonly ConcurrentDictionary<string, string> _internedStrings = new ConcurrentDictionary<string, string>(Environment.ProcessorCount, InitialCapacity, StringComparer.Ordinal);
 #endif

             #region Statistics


misc: update version

misc: update version

--- source/RedArmory/AssemblyProperty.cs
+++ source/RedArmory/AssemblyProperty.cs
@@ -26,12 +26,12 @@
         /// <summary>
         /// アセンブリ マニフェストに含める、ファイル バージョンを定義します。
         /// </summary>
-        public const string FileVersion = "1.9.0.1";
+        public const string FileVersion = "1.9.1.0";

         /// <summary>
         /// アセンブリ マニフェストに含める、アセンブリ バージョンを定義します。
         /// </summary>
-        public const string Version = "1.9.0.1";
+        public const string Version = "1.9.1.0";

     }


Adding transformation

Adding transformation

--- src/Sharp48.ConsoleApp/Program.cs
+++ src/Sharp48.ConsoleApp/Program.cs
@@ -16,9 +16,9 @@
                 new IntelligentSolver(
                     new ExpectimaxEvaluator(new CachingEvaluator(new SumEvaluator(new List<IEvaluator>
                     {
-                        new EmptyTileEvaluator(),
-                        //new MergeEvaluator(),
-                        //new MergesAwayEvaluator(),
+                        new TransformEvaluator(new EmptyTileEvaluator(), (score) => 2048*score),
+                        new MergeEvaluator(),
+                        new MergesAwayEvaluator(),
                         new Reaching2048IsAWinEvaluator(),
                     }))));
             var ui = new GoogleChromeUI(Path.Combine(Environment.CurrentDirectory));


TextureEvent.Positionメソッドのオーバーロードを追加

TextureEvent.Positionメソッドのオーバーロードを追加

--- src/Sitrine/Event/TextureEvent.cs
+++ src/Sitrine/Event/TextureEvent.cs
@@ -594,6 +594,30 @@
         }

         /// <summary>
+        /// テクスチャの表示位置を設定します。
+        /// このメソッドは遅延実行されます。
+        /// </summary>
+        /// <param name="x">表示位置の X 座標値。</param>
+        /// <param name="y">表示位置の Y 座標値。</param>
+        /// <returns>このイベントのオブジェクトを返します。</returns>
+        public TextureEvent Position(float x, float y)
+        {
+            return this.Position(new PointF(x, y));
+        }
+
+        /// <summary>
+        /// テクスチャの表示位置を設定します。
+        /// このメソッドは遅延実行されます。
+        /// </summary>
+        /// <param name="x">表示位置の X 座標値。</param>
+        /// <param name="y">表示位置の Y 座標値。</param>
+        /// <returns>このイベントのオブジェクトを返します。</returns>
+        public TextureEvent Position(double x, double y)
+        {
+            return this.Position(new PointF((float)x, (float)y));
+        }
+
+        /// <summary>
         /// 指定された位置へ移動するアニメーションを開始します。
         /// このメソッドは遅延実行されます。
         /// </summary>


TextureEventクラスにIDメソッドを追加

TextureEventクラスにIDメソッドを追加

--- src/Sitrine/Event/TextureEvent.cs
+++ src/Sitrine/Event/TextureEvent.cs
@@ -42,6 +42,7 @@
     {
         #region -- Private Fields --
         private readonly Dictionary<int, int> asignment;
+        private int? id = null;
         #endregion

         #region -- Constructors --
@@ -54,6 +55,18 @@

         #region -- Public Methods --
         /// <summary>
+        /// 操作対象のテクスチャ ID を指定します。
+        /// </summary>
+        /// <param name="id"></param>
+        /// <returns></returns>
+        public TextureEvent ID(int id)
+        {
+            this.id = id;
+
+            return this;
+        }
+
+        /// <summary>
         /// 指定された ID とビットマップから新しいテクスチャを作成します。
         /// このメソッドは遅延実行されます。
         /// </summary>
@@ -66,6 +79,7 @@
                 throw new ArgumentNullException("bitmap");

             BitmapLoader loader = new BitmapLoader(bitmap);
+            this.id = id;

             this.Storyboard.AddAction(() => this.AsignmentTexture(id, new BitmapTexture(loader)));
             this.Storyboard.AddResource(loader);
@@ -86,6 +100,7 @@
                 throw new ArgumentNullException("stream");

             BitmapLoader loader = new BitmapLoader(stream);
+            this.id = id;

             this.Storyboard.AddAction(() => this.AsignmentTexture(id, new BitmapTexture(loader)));
             this.Storyboard.AddResource(loader);
@@ -106,6 +121,7 @@
                 throw new ArgumentNullException("filename");

             BitmapLoader loader = new BitmapLoader(filename);
+            this.id = id;

             this.Storyboard.AddAction(() => this.AsignmentTexture(id, new BitmapTexture(loader)));
             this.Storyboard.AddResource(loader);
@@ -419,6 +435,7 @@
                 throw new ArgumentNullException("bitmap");

             BitmapLoader loader = new BitmapLoader(bitmap);
+            this.id = id;

             this.Storyboard.AddAction(() => this.AsignmentTexture(id, new SpriteAnimation(loader, countX, countY)));
             this.Storyboard.AddResource(loader);
@@ -441,6 +458,7 @@
                 throw new ArgumentNullException("stream");

             BitmapLoader loader = new BitmapLoader(stream);
+            this.id = id;

             this.Storyboard.AddAction(() => this.AsignmentTexture(id, new SpriteAnimation(loader, countX, countY)));
             this.Storyboard.AddResource(loader);
@@ -463,6 +481,7 @@
                 throw new ArgumentNullException("filename");

             BitmapLoader loader = new BitmapLoader(filename);
+            this.id = id;

             this.Storyboard.AddAction(() => this.AsignmentTexture(id, new SpriteAnimation(loader, countX, countY)));
             this.Storyboard.AddResource(loader);


Reduced client code to minimum.

Reduced client code to minimum.


This might fix our IHost problem. we'll see

--- SoraBot/SoraBot.WebApi/Program.cs
+++ SoraBot/SoraBot.WebApi/Program.cs
@@ -125,6 +125,7 @@
                     webBuilder.UseStartup<Startup>();
                     webBuilder.UseUrls($"http://*:{p.ToString()}");
                 })
-                .UseSerilog();
+                .UseSerilog()
+                .UseConsoleLifetime();
     }
 }


インナークラスを外に出した

インナークラスを外に出した

--- Talk2you/Models/ProjectManager.cs
+++ Talk2you/Models/ProjectManager.cs
@@ -20,34 +20,34 @@
     }

     /// <summary>
+    /// プロジェクトの情報を保存するクラス
+    /// </summary>
+    class ProjectInformation
+    {
+        public string ProjectName { set; get; }
+        public string CharaName { set; get; }
+        public string WorkName { set; get; }
+    }
+
+    /// <summary>
+    /// １つのセリフ情報を保存するクラス
+    /// </summary>
+    class WordsInformation
+    {
+        public string Identifier { set; get; }
+        public string Text { set; get; }
+        public VoiceCategory Category { set; get; }
+        public int Volume { set; get; }
+        public double Start { set; get; }
+        public double End { set; get; }
+        public string File { set; get; }
+    }
+
+    /// <summary>
     /// プロジェクト(キャラクター等全体のデータ)を管理するクラス
     /// </summary>
     public class ProjectManager : NotificationObject
     {
-
-        /// <summary>
-        /// プロジェクトの情報を保存するクラス
-        /// </summary>
-        class ProjectInformation
-        {
-            string ProjectName { set; get; }
-            string CharaName { set; get; }
-            string WorkName { set; get; }
-        }
-
-        /// <summary>
-        /// １つのセリフ情報を保存するクラス
-        /// </summary>
-        class WordsInformation
-        {
-            string Identifier { set; get; }
-            string Text { set; get; }
-            VoiceCategory Category { set; get; }
-            int Volume { set; get; }
-            double Start { set; get; }
-            double End { set; get; }
-            string File { set; get; }
-        }

         /// <summary>
         /// 動作中のアプリケーションのファイルパスを返す。


Only report read/written and not seeked bytes in ProgressStream

--- src/Common/Streams/ProgressStream.cs
+++ src/Common/Streams/ProgressStream.cs
@@ -104,7 +104,7 @@
         private int Report(int count)
         {
             _cancellationToken.ThrowIfCancellationRequested();
-            _progress?.Report(CanSeek ? Position : Interlocked.Add(ref _counter, count));
+            _progress?.Report(Interlocked.Add(ref _counter, count));
             return count;
         }
     }