try to get a KeyValuePair enumerator

try to get a KeyValuePair enumerator

--- src/AutoMapper/Mappers/DictionaryMapper.cs
+++ src/AutoMapper/Mappers/DictionaryMapper.cs
@@ -21,29 +21,24 @@

         public object Map(ResolutionContext context, IMappingEngineRunner mapper)
         {
-            if (context.IsSourceValueNull && mapper.ShouldMapSourceCollectionAsNull(context))
-                return null;
-
-            var sourceEnumerableValue = (IEnumerable) context.SourceValue ?? new object[0];
-            IEnumerable<object> keyValuePairs = sourceEnumerableValue.Cast<object>();
-
+            if(context.IsSourceValueNull && mapper.ShouldMapSourceCollectionAsNull(context))
+            {
+                return null;
+            }
             Type genericSourceDictType = context.SourceType.GetDictionaryType();
             Type sourceKeyType = genericSourceDictType.GetGenericArguments()[0];
             Type sourceValueType = genericSourceDictType.GetGenericArguments()[1];
             Type sourceKvpType = KvpType.MakeGenericType(sourceKeyType, sourceValueType);
             Type genericDestDictType = context.DestinationType.GetDictionaryType();
             Type destKeyType = genericDestDictType.GetGenericArguments()[0];
-            Type destValueType = genericDestDictType.GetGenericArguments()[1];
-
-            var dictionaryEntries = keyValuePairs.OfType<DictionaryEntry>();
-            if (dictionaryEntries.Any())
-                keyValuePairs = dictionaryEntries.Select(e => Activator.CreateInstance(sourceKvpType, e.Key, e.Value));
-
-            object destDictionary = ObjectCreator.CreateDictionary(context.DestinationType, destKeyType, destValueType);
+            Type destValueType = genericDestDictType.GetGenericArguments()[1];
+
+            var kvpEnumerator = GetKeyValuePairEnumerator(context, sourceKvpType);
+            var destDictionary = ObjectCreator.CreateDictionary(context.DestinationType, destKeyType, destValueType);
             int count = 0;
-
-            foreach (object keyValuePair in keyValuePairs)
+            while(kvpEnumerator.MoveNext())
             {
+                var keyValuePair = kvpEnumerator.Current;
                 object sourceKey = sourceKvpType.GetProperty("Key").GetValue(keyValuePair, new object[0]);
                 object sourceValue = sourceKvpType.GetProperty("Value").GetValue(keyValuePair, new object[0]);

@@ -60,12 +55,32 @@
                 object destKey = mapper.Map(keyContext);
                 object destValue = mapper.Map(valueContext);

-                genericDestDictType.GetMethod("Add").Invoke(destDictionary, new[] {destKey, destValue});
+                genericDestDictType.GetMethod("Add").Invoke(destDictionary, new[] { destKey, destValue });

                 count++;
             }

             return destDictionary;
-        }
+        }
+
+        private static IEnumerator GetKeyValuePairEnumerator(ResolutionContext context, Type sourceKvpType)
+        {
+            if(context.SourceValue == null)
+            {
+                return Enumerable.Empty<object>().GetEnumerator();
+            }
+            var sourceEnumerableValue = (IEnumerable) context.SourceValue;
+            var dictionaryEntries = sourceEnumerableValue.Cast<object>().OfType<DictionaryEntry>().Select(e => Activator.CreateInstance(sourceKvpType, e.Key, e.Value));
+            if(dictionaryEntries.Any())
+            {
+                return dictionaryEntries.GetEnumerator();
+            }
+            var enumerableKvpType = typeof(IEnumerable<>).MakeGenericType(sourceKvpType);
+            if(enumerableKvpType.IsAssignableFrom(sourceEnumerableValue.GetType()))
+            {
+                return (IEnumerator)enumerableKvpType.GetMethod("GetEnumerator").Invoke(sourceEnumerableValue, null);
+            }
+            throw new AutoMapperMappingException(context, "Cannot map dictionary type " + context.SourceType);
+        }
     }
 }


modify fields to properties

modify fields to properties

--- src/Abp.Zero/Authorization/Roles/AbpRoleManager.cs
+++ src/Abp.Zero/Authorization/Roles/AbpRoleManager.cs
@@ -49,9 +49,11 @@

         protected AbpRoleStore<TRole, TUser> AbpStore { get; private set; }

-        protected readonly IPermissionManager _permissionManager;
-        protected readonly ICacheManager _cacheManager;
-        protected readonly IUnitOfWorkManager _unitOfWorkManager;
+        protected IPermissionManager PermissionManager { get; }
+
+        protected ICacheManager CacheManager { get; }
+
+        protected IUnitOfWorkManager UnitOfWorkManager { get; }

         /// <summary>
         /// Constructor.
@@ -64,9 +66,9 @@
             IUnitOfWorkManager unitOfWorkManager)
             : base(store)
         {
-            _permissionManager = permissionManager;
-            _cacheManager = cacheManager;
-            _unitOfWorkManager = unitOfWorkManager;
+            PermissionManager = permissionManager;
+            CacheManager = cacheManager;
+            UnitOfWorkManager = unitOfWorkManager;

             RoleManagementConfig = roleManagementConfig;
             AbpStore = store;
@@ -82,7 +84,7 @@
         /// <returns>True, if the role has the permission</returns>
         public virtual async Task<bool> IsGrantedAsync(string roleName, string permissionName)
         {
-            return await IsGrantedAsync((await GetRoleByNameAsync(roleName)).Id, _permissionManager.GetPermission(permissionName));
+            return await IsGrantedAsync((await GetRoleByNameAsync(roleName)).Id, PermissionManager.GetPermission(permissionName));
         }

         /// <summary>
@@ -93,7 +95,7 @@
         /// <returns>True, if the role has the permission</returns>
         public virtual async Task<bool> IsGrantedAsync(int roleId, string permissionName)
         {
-            return await IsGrantedAsync(roleId, _permissionManager.GetPermission(permissionName));
+            return await IsGrantedAsync(roleId, PermissionManager.GetPermission(permissionName));
         }

         /// <summary>
@@ -151,7 +153,7 @@
         {
             var permissionList = new List<Permission>();

-            foreach (var permission in _permissionManager.GetAllPermissions())
+            foreach (var permission in PermissionManager.GetAllPermissions())
             {
                 if (await IsGrantedAsync(role.Id, permission))
                 {
@@ -231,7 +233,7 @@
         /// <param name="role">Role</param>
         public async Task ProhibitAllPermissionsAsync(TRole role)
         {
-            foreach (var permission in _permissionManager.GetAllPermissions())
+            foreach (var permission in PermissionManager.GetAllPermissions())
             {
                 await ProhibitPermissionAsync(role, permission);
             }
@@ -334,7 +336,7 @@
         {
             FeatureDependencyContext.TenantId = role.TenantId;

-            var permissions = _permissionManager.GetAllPermissions(role.GetMultiTenancySide())
+            var permissions = PermissionManager.GetAllPermissions(role.GetMultiTenancySide())
                                                 .Where(permission =>
                                                     permission.FeatureDependency == null ||
                                                     permission.FeatureDependency.IsSatisfied(FeatureDependencyContext)
@@ -348,7 +350,7 @@
         {
             var staticRoleDefinitions = RoleManagementConfig.StaticRoles.Where(sr => sr.Side == MultiTenancySides.Tenant);

-            using (_unitOfWorkManager.Current.SetTenantId(tenantId))
+            using (UnitOfWorkManager.Current.SetTenantId(tenantId))
             {
                 foreach (var staticRoleDefinition in staticRoleDefinitions)
                 {
@@ -396,7 +398,7 @@
         private async Task<RolePermissionCacheItem> GetRolePermissionCacheItemAsync(int roleId)
         {
             var cacheKey = roleId + "@" + (GetCurrentTenantId() ?? 0);
-            return await _cacheManager.GetRolePermissionCache().GetAsync(cacheKey, async () =>
+            return await CacheManager.GetRolePermissionCache().GetAsync(cacheKey, async () =>
             {
                 var newCacheItem = new RolePermissionCacheItem(roleId);

@@ -419,9 +421,9 @@

         private int? GetCurrentTenantId()
         {
-            if (_unitOfWorkManager.Current != null)
-            {
-                return _unitOfWorkManager.Current.GetTenantId();
+            if (UnitOfWorkManager.Current != null)
+            {
+                return UnitOfWorkManager.Current.GetTenantId();
             }

             return AbpSession.TenantId;


Remove formatting lock from books when downloading from BL.org (BL-9996)

--- src/BloomExe/WebLibraryIntegration/BookTransfer.cs
+++ src/BloomExe/WebLibraryIntegration/BookTransfer.cs
@@ -549,11 +549,22 @@
 				return destinationPath; //argh! we can't lock it.
 			var xmlDomFromHtmlFile = XmlHtmlConverter.GetXmlDomFromHtmlFile(htmlFile, false);
 			var dom = new HtmlDom(xmlDomFromHtmlFile);
+			bool needToSave = false;
+			// If the book is downloaded from Bloom Library, we don't want to treat it as though
+			// it were directly created from a Reader bloomPack.  So relax the formatting lock.
+			// See https://issues.bloomlibrary.org/youtrack/issue/BL-9996.
+			if (dom.HasMetaElement("lockFormatting"))
+			{
+				dom.RemoveMetaElement("lockFormatting");
+				needToSave = true;
+			}
 			if (!BookMetaData.FromString(MetaDataText(destinationPath)).IsSuitableForMakingShells)
 			{
 				dom.RecordAsLockedDown(true);
+				needToSave = true;
+			}
+			if (needToSave)
 				XmlHtmlConverter.SaveDOMAsHtml5(dom.RawDom, htmlFile);
-			}

 			return destinationPath;
 		}


shorter name

shorter name

--- Name.Of/Name.Of.cs
+++ Name.Of/Name.Of.cs
@@ -5,19 +5,19 @@
 public static class Name {
 	static Name() {
 		// If this assembly has been loaded at run-time, the weaving failed to replace the calls to the place-holder methods below and should throw as soon as possible (i.e. this static constructor).
-		throw GetNotImplementedException();
+		throw GetException();
 	}

-    private static NotImplementedException GetNotImplementedException() { return new NotImplementedException("This is just a stub to be removed at build when processed by Fody."); }
-    public static String Of<T>() { throw GetNotImplementedException(); }
-    public static String Of(Object @object) { throw GetNotImplementedException(); }
-    public static String Of<TResult>(Func<TResult> objectOrMethod) { throw GetNotImplementedException(); }
-    public static String Of<T, TResult>(Func<T, Func<TResult>> method) { throw GetNotImplementedException(); }
-    public static String Of<T>(Func<T, Object> fieldOrProperty) { throw GetNotImplementedException(); }
-    public static String Of(Action<EventHandler> @event) { throw GetNotImplementedException(); }
-    public static String Of<T>(Action<T, EventHandler> @event) { throw GetNotImplementedException(); }
-    public static String OfVoid(Action voidMethod) { throw GetNotImplementedException(); }
-	public static String OfVoid<T>(Func<T, Action> voidMethod) { throw GetNotImplementedException(); }
-	public static String OfStatic<T, TResult>(Func<T, TResult> staticMethod) { throw GetNotImplementedException(); }
-	public static String OfStaticVoid<T>(Action<T> staticVoidMethodWithArgument) { throw GetNotImplementedException(); }
+	private static NotSupportedException GetException() { return new NotSupportedException("This is just a stub to be removed at build when processed by Fody."); }
+    public static String Of<T>() { throw GetException(); }
+    public static String Of(Object @object) { throw GetException(); }
+    public static String Of<TResult>(Func<TResult> objectOrMethod) { throw GetException(); }
+    public static String Of<T, TResult>(Func<T, Func<TResult>> method) { throw GetException(); }
+    public static String Of<T>(Func<T, Object> fieldOrProperty) { throw GetException(); }
+    public static String Of(Action<EventHandler> @event) { throw GetException(); }
+    public static String Of<T>(Action<T, EventHandler> @event) { throw GetException(); }
+    public static String OfVoid(Action voidMethod) { throw GetException(); }
+	public static String OfVoid<T>(Func<T, Action> voidMethod) { throw GetException(); }
+	public static String OfStatic<T, TResult>(Func<T, TResult> staticMethod) { throw GetException(); }
+	public static String OfStaticVoid<T>(Action<T> staticVoidMethodWithArgument) { throw GetException(); }
 }


Fix: IndexOutOfRange if a object is used as a key.

git-svn-id: aa2a336599e7068ff5cd3016b1146e3121f70fb4@31964 2abf6ff4-378a-4344-b6f7-2bcd8b316ba9

--- NeoLua/LuaTable.cs
+++ NeoLua/LuaTable.cs
@@ -2242,7 +2242,7 @@

 				if (value == null) // remove value
 					RemoveValue(iIndex);
-				else if (iIndex == -1 && (lRawSet || !OnNewIndex(key, value))) // insert value
+				else if (iIndex < 0 && (lRawSet || !OnNewIndex(key, value))) // insert value
 					InsertValue(key, hashCode, value, false);
 				else // update value
 					entries[iIndex].value = value;
@@ -2302,7 +2302,7 @@
 			else
 			{
 				iIndex = FindKey(key, key.GetHashCode() & 0x7FFFFFFF, comparerObject);
-				if (iIndex == -1)
+				if (iIndex < 0)
 					return lRawGet ? null : OnIndex(key);
 				else
 					return entries[iIndex].value;


Throw if collection Id does not exist on the organization (#1259)

Otherwise, we're just saving strings for fun. This makes it clear the
user's specified collection won't do anything.

--- src/Core/Services/Implementations/CipherService.cs
+++ src/Core/Services/Implementations/CipherService.cs
@@ -122,6 +122,11 @@
             {
                 if (cipher.OrganizationId.HasValue && collectionIds != null)
                 {
+                    var existingCollectionIds = (await _collectionRepository.GetManyByOrganizationIdAsync(cipher.OrganizationId.Value)).Select(c => c.Id);
+                    if (collectionIds.Except(existingCollectionIds).Any())
+                    {
+                        throw new BadRequestException("Specified CollectionId does not exist on the specified Organization.");
+                    }
                     await _cipherRepository.CreateAsync(cipher, collectionIds);
                 }
                 else
@@ -198,7 +203,7 @@
                 Key = request.Key,
                 Size = request.FileSize,
                 Validated = false,
-           };
+            };

             var uploadUrl = await _attachmentStorageService.GetAttachmentUploadUrlAsync(cipher, data);

@@ -248,7 +253,8 @@
                 await _eventService.LogCipherEventAsync(cipher, Enums.EventType.Cipher_AttachmentCreated);
                 cipher.AddAttachment(attachmentId, data);

-                if (!await ValidateCipherAttachmentFile(cipher, data)) {
+                if (!await ValidateCipherAttachmentFile(cipher, data))
+                {
                     throw new Exception("Content-Length does not match uploaded file size");
                 }
             }
@@ -911,7 +917,7 @@
             {
                 return;
             }
-
+
             await _cipherRepository.DeleteAttachmentAsync(cipher.Id, attachmentData.AttachmentId);
             cipher.DeleteAttachment(attachmentData.AttachmentId);
             await _attachmentStorageService.DeleteAttachmentAsync(cipher.Id, attachmentData);


Disabled faulty solution-optimization

Disabled faulty solution-optimization

--- src/core/Bari.Core/cs/Build/SuiteReferenceBuilder.cs
+++ src/core/Bari.Core/cs/Build/SuiteReferenceBuilder.cs
@@ -26,6 +26,9 @@
     [AggressiveCacheRestore]
     public class SuiteReferenceBuilder : ReferenceBuilderBase<SuiteReferenceBuilder>, IEquatable<SuiteReferenceBuilder>
     {
+        private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof (SuiteReferenceBuilder));
+
+        private readonly Project project;
         private readonly Suite suite;
         private readonly Module module;
         private readonly IEnumerable<IProjectBuilderFactory> projectBuilders;
@@ -52,6 +55,7 @@
         /// <param name="projectBuilders">Project builders available</param>
         public SuiteReferenceBuilder(Project project, IEnumerable<IProjectBuilderFactory> projectBuilders)
         {
+            this.project = project;
             module = project.Module;
             suite = project.Module.Suite;
             this.projectBuilders = projectBuilders;
@@ -144,7 +148,11 @@
             if (!context.Contains(this))
             {
                 subtasks = new HashSet<IBuilder>();
-                context.AddBuilder(this, SubtaskGenerator(context));
+                GenerateSubtasks(context);
+
+                log.DebugFormat("Project {0}'s reference to {1} adds the following subtasks: {2}", project, referencedProject, String.Join(", ", subtasks));
+
+                context.AddBuilder(this, subtasks);
             }
             else
             {
@@ -152,19 +160,14 @@
             }
         }

-        private IEnumerable<IBuilder> SubtaskGenerator(IBuildContext context)
-        {
-            bool isTestProject = referencedProject is TestProject;
-            var targetModule = referencedProject.Module;
-            var allModuleProjects = isTestProject ? targetModule.Projects.Concat(module.TestProjects).ToList() : targetModule.Projects;
-
+        private void GenerateSubtasks(IBuildContext context)
+        {
             foreach (var projectBuilder in projectBuilders)
             {
-                var builder = projectBuilder.AddToContext(context, allModuleProjects);
+                var builder = projectBuilder.AddToContext(context, new[] { referencedProject });
                 if (builder != null)
                 {
                     subtasks.Add(builder);
-                    yield return builder;
                 }
             }
         }


Fixes for additional test correctness

Fixes for additional test correctness

--- src/Couchbase.Lite.Tests.Shared/ReplicationTest.cs
+++ src/Couchbase.Lite.Tests.Shared/ReplicationTest.cs
@@ -219,11 +219,7 @@
                 pull.Changed += (sender, e) =>
                 {
                     statusHistory.Add(e.Status);
-                    if (e.ChangesCount > 0 && e.CompletedChangesCount != e.ChangesCount) {
-                        Assert.AreEqual(ReplicationStatus.Active, e.Status);
-                    }
-
-                    if (e.Status == ReplicationStatus.Idle) {
+                    if (e.Status == ReplicationStatus.Idle && e.ChangesCount == e.CompletedChangesCount) {
                         doneEvent.Set();
                     }
                 };
@@ -236,7 +232,7 @@
                     if (i == statusHistory.Count - 1) {
                         Assert.AreEqual(ReplicationStatus.Idle, statusHistory[i]);
                     } else {
-                        Assert.AreEqual(ReplicationStatus.Active, statusHistory[i]);
+                        Assert.IsTrue(statusHistory[i] == ReplicationStatus.Active | statusHistory[i] == ReplicationStatus.Idle);
                     }
                 }

@@ -2519,6 +2515,7 @@
                     Assert.AreEqual(gotSequence, Int32.Parse(repl.LastSequence), "LastSequence was advanced");
                 });

+                Thread.Sleep(500);
                 fakeFactory.HttpHandler.ClearResponders();
                 var pull = database.CreatePullReplication(remoteDb.RemoteUri);
                 RunReplication(pull);


guildUsers instantiated to empty collection, removed added nullchecks

A null conditional operator was required at line 70 to avoid a nullref.

--- src/Discord.Net.Commands/Readers/UserTypeReader.cs
+++ src/Discord.Net.Commands/Readers/UserTypeReader.cs
@@ -14,7 +14,7 @@
         {
             var results = new Dictionary<ulong, TypeReaderValue>();
             IReadOnlyCollection<IUser> channelUsers = (await context.Channel.GetUsersAsync(CacheMode.CacheOnly).Flatten().ConfigureAwait(false)).ToArray(); //TODO: must be a better way?
-            IReadOnlyCollection<IGuildUser> guildUsers = null;
+            IReadOnlyCollection<IGuildUser> guildUsers = ImmutableArray.Create<IGuildUser>();
             ulong id;

             if (context.Guild != null)
@@ -61,15 +61,13 @@
                 foreach (var channelUser in channelUsers.Where(x => string.Equals(input, x.Username, StringComparison.OrdinalIgnoreCase)))
                     AddResult(results, channelUser as T, channelUser.Username == input ? 0.65f : 0.55f);

-                if (context.Guild != null)
                 foreach (var guildUser in guildUsers.Where(x => string.Equals(input, x.Username, StringComparison.OrdinalIgnoreCase)))
                     AddResult(results, guildUser as T, guildUser.Username == input ? 0.60f : 0.50f);
             }

             //By Nickname (0.5-0.6)
-            if (context.Guild != null)
             {
-                foreach (var channelUser in channelUsers.Where(x => string.Equals(input, (x as IGuildUser).Nickname, StringComparison.OrdinalIgnoreCase)))
+                foreach (var channelUser in channelUsers.Where(x => string.Equals(input, (x as IGuildUser)?.Nickname, StringComparison.OrdinalIgnoreCase)))
                     AddResult(results, channelUser as T, (channelUser as IGuildUser).Nickname == input ? 0.65f : 0.55f);

                 foreach (var guildUser in guildUsers.Where(x => string.Equals(input, (x as IGuildUser).Nickname, StringComparison.OrdinalIgnoreCase)))


make importer test more robust to not copy into source directory and reuse current infrastructure

git-svn-id: ee144a4ada4e65570a65b3ba2a4ac9d4eedc8fa4@1226045 13f79535-47bb-0310-9956-ffa450edef68

--- dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/csharp/ImporterTests/NPandayImporterTest.cs
+++ dotnet/assemblies/NPanday.ProjectImporter/Engine/src/test/csharp/ImporterTests/NPandayImporterTest.cs
@@ -31,50 +31,13 @@
     [TestFixture]
     public class NPandayImporterTest
     {
-        private String slnFile;
         private String warnMsg = String.Empty;
-        private DirectoryInfo withoutNUnitSource;
-        private DirectoryInfo withoutNUnitTarget;
-        private DirectoryInfo withNUnitSource;
-        private DirectoryInfo withNUnitTarget;
-
-        public NPandayImporterTest()
-        {
-            withoutNUnitSource = new DirectoryInfo(FileUtil.GetBaseDirectory() + "\\src\\test\\resource\\MavenTestProjectWithoutNUnit");
-            withoutNUnitTarget = new DirectoryInfo(FileUtil.GetBaseDirectory() + "\\src\\test\\resource\\MavenTestProjectWithoutNUnitCopy");
-
-            withNUnitSource = new DirectoryInfo(FileUtil.GetBaseDirectory() + "\\src\\test\\resource\\MavenTestProjectWithNUnit");
-            withNUnitTarget = new DirectoryInfo(FileUtil.GetBaseDirectory() + "\\src\\test\\resource\\MavenTestProjectWithNUnitCopy");
-        }
-
-        [TestFixtureSetUp]
-        public void TestSetUp()
-        {
-            //TODO Remove when TestTearDown is fixed
-            //Delete manually
-            if (withNUnitTarget.Exists)
-            {
-                withNUnitTarget.Delete(true);
-            }
-
-            FileUtil.CopyDirectory(withoutNUnitSource, withoutNUnitTarget);
-            FileUtil.CopyDirectory(withNUnitSource, withNUnitTarget);
-        }
-
-        [TestFixtureTearDown]
-        public void TestTearDown()
-        {
-            Directory.Delete(withoutNUnitTarget.FullName, true);
-
-            //TODO
-            //Doesn't work because some process is holding the .references folder
-            //Directory.Delete(withNUnitTarget.FullName, true);
-        }

         [Test]
         public void TestProjectImporterWithNunitAndUncheckedTestProject()
-        {
-            slnFile = withNUnitTarget.FullName + "\\MavenTestProjectWithNUnit.sln";
+        {
+            Assert.IsNotNull(ProjectImporterTestFixture.SampleProjectsPath, "ProjectImporterTestFixture.SampleProjectsPath must not be null");
+            string slnFile = Path.Combine(ProjectImporterTestFixture.SampleProjectsPath, @"MavenTestProjectWithNUnit\MavenTestProjectWithNUnit.sln");
             string[] generatedPoms = NPandayImporter.ImportProject(slnFile, "test", "test-plugin", "1.0", "", UncheckedProject, ref warnMsg);

             Assert.IsNotNull(generatedPoms);
@@ -85,7 +48,8 @@
         [Test]
         public void TestProjectImporterWithNunitAndCheckedTestProject()
         {
-            slnFile = withNUnitTarget.FullName + "\\MavenTestProjectWithNUnit.sln";
+            Assert.IsNotNull(ProjectImporterTestFixture.SampleProjectsPath, "ProjectImporterTestFixture.SampleProjectsPath must not be null");
+            string slnFile = Path.Combine(ProjectImporterTestFixture.SampleProjectsPath, @"MavenTestProjectWithNUnit\MavenTestProjectWithNUnit.sln");
             string[] generatedPoms = NPandayImporter.ImportProject(slnFile, "test", "test-plugin", "1.0", "", CheckedProject, ref warnMsg);

             Assert.IsNotNull(generatedPoms);
@@ -96,7 +60,8 @@
         [Test]
         public void TestProjectImporterWithOutNunitAndCheckedTestProject()
         {
-            slnFile = withoutNUnitTarget.FullName + "\\MavenTestProjectWithoutNUnit.sln";
+            Assert.IsNotNull(ProjectImporterTestFixture.SampleProjectsPath, "ProjectImporterTestFixture.SampleProjectsPath must not be null");
+            string slnFile = Path.Combine(ProjectImporterTestFixture.SampleProjectsPath, @"MavenTestProjectWithoutNUnit\MavenTestProjectWithoutNUnit.sln");
             string[] generatedPoms = NPandayImporter.ImportProject(slnFile, "test", "test-plugin", "1.0", "", CheckedProject, ref warnMsg);

             Assert.IsNotNull(generatedPoms);
@@ -107,7 +72,8 @@
         [Test]
         public void TestProjectImporterWithOutNunitAndUncheckedTestProject()
         {
-            slnFile = withoutNUnitTarget.FullName + "\\MavenTestProjectWithoutNUnit.sln";
+            Assert.IsNotNull(ProjectImporterTestFixture.SampleProjectsPath, "ProjectImporterTestFixture.SampleProjectsPath must not be null");
+            string slnFile = Path.Combine(ProjectImporterTestFixture.SampleProjectsPath, @"MavenTestProjectWithoutNUnit\MavenTestProjectWithoutNUnit.sln");
             string[] generatedPoms = NPandayImporter.ImportProject(slnFile, "test", "test-plugin", "1.0", "", UncheckedProject, ref warnMsg);

             Assert.IsNotNull(generatedPoms);


Adds timemark to logs

Adds timemark to logs

--- src/FlubuCore/Infrastructure/FlubuConsoleLogger.cs
+++ src/FlubuCore/Infrastructure/FlubuConsoleLogger.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Runtime.InteropServices;
 using System.Text;
 using FlubuCore.Context;
@@ -30,8 +31,11 @@
         [ThreadStatic]
         private static int _depth = 0;

-        // ConsoleColor does not have a value to specify the 'Default' color
+        private readonly Stopwatch _stopwatch = new Stopwatch();
+        //// ConsoleColor does not have a value to specify the 'Default' color
         private readonly ConsoleColor? _defaultConsoleColor = null;
+
+        private TimeSpan _lastTimeMark;

         private IConsole _console;

@@ -42,6 +46,8 @@
             Console = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && buildSystem.IsLocalBuild
                 ? (IConsole)new WindowsLogConsole()
                 : new AnsiLogConsole(new AnsiSystemConsole());
+
+            _stopwatch.Start();
         }

         public static bool DisableColloredLogging { get; set; }
@@ -122,9 +128,14 @@

             var logLevelColors = default(ConsoleColors);
             var logLevelString = string.Empty;
+            string timeMark = GetTimeMark();
             string indentation = Depth > 0 ? new string(' ', Depth * 3) : string.Empty;

-            message = $"{indentation}{message}";
+            if (!string.IsNullOrEmpty(timeMark))
+            {
+                indentation = indentation.Length > timeMark.Length ? indentation.Substring(timeMark.Length) : string.Empty;
+            }
+
             if (!string.IsNullOrEmpty(message))
             {
                 ////logLevelColors = GetLogLevelConsoleColors(logLevel);
@@ -142,17 +153,23 @@

                 lock (Lock)
                 {
+#if !NETSTANDARD1_6
+                    if (!DisableColloredLogging)
+                    {
+                        timeMark = timeMark.Pastel(Color.Magenta);
+                    }
+#endif
                     if (_useColor && !DisableColloredLogging)
                     {
                         #if !NETSTANDARD1_6
-                        Console.Write(logMessage.Pastel(Color), _defaultConsoleColor, _defaultConsoleColor);
+                        Console.Write($"{timeMark}{indentation}{logMessage.Pastel(Color)}", _defaultConsoleColor, _defaultConsoleColor);
                         #else
-                        Console.Write(logMessage, _defaultConsoleColor, _defaultConsoleColor);
+                        Console.Write($"{timeMark}{indentation}{logMessage}", _defaultConsoleColor, _defaultConsoleColor);
                         #endif
                     }
                     else
                     {
-                        Console.Write(logMessage, _defaultConsoleColor, _defaultConsoleColor);
+                        Console.Write($"{timeMark}{indentation}{logMessage}", _defaultConsoleColor, _defaultConsoleColor);
                     }

                     // In case of AnsiLogConsole, the messages are not yet written to the console,
@@ -179,6 +196,20 @@
         public IDisposable BeginScope<TState>(TState state)
         {
             throw new NotSupportedException();
+        }
+
+        private string GetTimeMark()
+        {
+            TimeSpan timeMark = _stopwatch.Elapsed;
+            TimeSpan diff = timeMark - _lastTimeMark;
+            string result = string.Empty;
+            if (diff.TotalSeconds >= 2)
+            {
+                result = string.Format("{0,1}: ", (int)diff.TotalSeconds);
+            }
+
+            _lastTimeMark = timeMark;
+            return result;
         }

         private ConsoleColors GetLogLevelConsoleColors(LogLevel logLevel)


Mark old References syntax as obsolete

Mark old References syntax as obsolete

--- src/FluentMigrator/Builders/IColumnOptionSyntax.cs
+++ src/FluentMigrator/Builders/IColumnOptionSyntax.cs
@@ -27,20 +27,26 @@
 		TNext WithDefaultValue(object value);
 		TNext Identity();
 		TNext Indexed();
+
 		TNext PrimaryKey();
 		TNext PrimaryKey(string primaryKeyName);
+
 		TNext Nullable();
 		TNext NotNullable();
 		TNext Unique();
-        TNext ForeignKey(string primaryTableName, string primaryColumnName);
-        TNext ForeignKey(string foreignKeyName, string primaryTableName, string primaryColumnName);
-        TNext ForeignKey(string foreignKeyName, string primaryTableSchema, string primaryTableName, string primaryColumnName);
-        TNext ReferencedBy(string foreignTableName, string foreignColumnName);
-        TNext ReferencedBy(string foreignKeyName, string foreignTableName, string foreignColumnName);
-        TNext ReferencedBy(string foreignKeyName, string foreignTableSchema, string foreignTableName, string foreignColumnName);
-
-        TNext ForeignKey();
-        TNext References(string foreignKeyName, string foreignTableName, IEnumerable<string> foreignColumnNames);
+
+	        TNext ForeignKey(string primaryTableName, string primaryColumnName);
+	        TNext ForeignKey(string foreignKeyName, string primaryTableName, string primaryColumnName);
+	        TNext ForeignKey(string foreignKeyName, string primaryTableSchema, string primaryTableName, string primaryColumnName);
+	        TNext ForeignKey();
+
+	        TNext ReferencedBy(string foreignTableName, string foreignColumnName);
+	        TNext ReferencedBy(string foreignKeyName, string foreignTableName, string foreignColumnName);
+	        TNext ReferencedBy(string foreignKeyName, string foreignTableSchema, string foreignTableName, string foreignColumnName);
+
+	        [Obsolete("Please use ReferencedBy syntax. This method will be removed in the next version")]
+	        TNext References(string foreignKeyName, string foreignTableName, IEnumerable<string> foreignColumnNames);
+	        [Obsolete("Please use ReferencedBy syntax. This method will be removed in the next version")]
 		TNext References(string foreignKeyName, string foreignTableSchema, string foreignTableName, IEnumerable<string> foreignColumnNames);
 	}
 }


Fixed processing of incomplete enums in CLI headers.

--- src/Generator/Generators/CLI/CLIHeadersTemplate.cs
+++ src/Generator/Generators/CLI/CLIHeadersTemplate.cs
@@ -84,7 +84,9 @@
             for (int i = 0; i < Module.Enums.Count; ++i)
             {
                 var @enum = Module.Enums[i];
-                if (@enum.Ignore) continue;
+
+                if (@enum.Ignore || @enum.IsIncomplete)
+                    continue;

                 GenerateEnum(@enum);
                 needsNewline = true;
@@ -344,7 +346,9 @@

         public void GenerateEnum(Enumeration @enum)
         {
-            if (@enum.Ignore) return;
+            if (@enum.Ignore || @enum.IsIncomplete)
+                return;
+
             GenerateDeclarationCommon(@enum);

             if (@enum.Modifiers.HasFlag(Enumeration.EnumModifiers.Flags))


Avoid creation of properties from constructors.

--- src/Generator/Passes/GetterSetterToPropertyPass.cs
+++ src/Generator/Passes/GetterSetterToPropertyPass.cs
@@ -84,6 +84,9 @@
             if (@class == null || @class.IsIncomplete)
                 return false;

+            if (method.IsConstructor)
+                return false;
+
             if (IsGetter(method))
             {
                 var name = method.Name.Substring("get".Length);


Fix nullRef when processing empty entities (imported from main endpoind to extended one)

--- Utils/Sorter.cs
+++ Utils/Sorter.cs
@@ -15,7 +15,7 @@

             foreach (XElement elt in Entities)
             {
-                elt.Element(Namespace + "Fields").SortFields();
+                elt.Element(Namespace + "Fields")?.SortFields();
                 elt.Element(Namespace + "Mappings")?.SortMapings();

                 elt.Remove();


make ThrottleCacheItem serializable so that I can persist it using a Ovicus.Caching Sql implementation of ObjectCache

--- src/BrakePedal/MemoryThrottleRepository.cs
+++ src/BrakePedal/MemoryThrottleRepository.cs
@@ -131,9 +131,10 @@
         {
             TimeSpan timeSpan = (CurrentDate() - new DateTime(1970, 1, 1, 0, 0, 0));
             return (long)timeSpan.TotalSeconds;
-        }
-
-        public class ThrottleCacheItem
+        }
+
+		[Serializable]
+		public class ThrottleCacheItem
         {
             public long Count { get; set; }


Fix property ref

Fix property ref

--- src/HolzShots.Windows/Forms/Controls/PluginItem.cs
+++ src/HolzShots.Windows/Forms/Controls/PluginItem.cs
@@ -33,7 +33,7 @@

         private void authorWebSite_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
         {
-            var website = _model?.Url;
+            var website = _model?.Website;
             if (website != null)
                 OpenUrl(website);
         }
@@ -62,7 +62,7 @@
             public string Name => "Cool plugin";
             public string Author => "Even cooler author";
             public SemVersion Version => new SemVersion(1);
-            public string Url => "https://holzshots.net";
+            public string Website => "https://holzshots.net";
             public string BugsUrl => "https://github.com/nikeee/holzshots/issues";
             public string Contact => "https://github.com/nikeee/holzshots/issues";
             public string Description => "A very cool plugin";


removed space

removed space

--- src/CAPNet/SpaceDelimitedElementsParser.cs
+++ src/CAPNet/SpaceDelimitedElementsParser.cs
@@ -11,7 +11,6 @@
     /// </summary>
     public static class SpaceDelimitedElementsParser
     {
-
         private const int betweenAddressesState = 0;
         private const int InSpaceContainingAddress = 1;
         private const int InAddressWithNoSpace = 2;


add equality semantics for Checksum

add equality semantics for Checksum

--- VaultMarshal.cs
+++ VaultMarshal.cs
@@ -11,7 +11,7 @@

 namespace EasyKeeper {
     public static class VaultMarshal {
-        private class Checksum {
+        private class Checksum : IEquatable<Checksum> {
             public const int HashSizeInBytes = 128 / 8;
             private readonly byte[] _data;

@@ -25,6 +25,49 @@
                 get {
                     return _data;
                 }
+            }
+
+            public bool Equals(Checksum other)
+            {
+                if (ReferenceEquals(null, other)) {
+                    return false;
+                }
+
+                if (ReferenceEquals(this, other)) {
+                    return true;
+                }
+
+                return _data.SequenceEqual(other._data);
+            }
+
+            public override bool Equals(object other)
+            {
+                if (ReferenceEquals(null, other)) {
+                    return false;
+                }
+
+                if (ReferenceEquals(this, other)) {
+                    return true;
+                }
+
+                var otherChecksum = other as Checksum;
+
+                return (otherChecksum != null) && Equals(otherChecksum);
+            }
+
+            public override int GetHashCode()
+            {
+                return (_data != null ? _data.GetHashCode() : 0);
+            }
+
+            public static bool operator==(Checksum lhs, Checksum rhs)
+            {
+                return Equals(lhs, rhs);
+            }
+
+            public static bool operator!=(Checksum lhs, Checksum rhs)
+            {
+                return !(lhs == rhs);
             }
         }


Add ssl.com CA config (RSA and ECDSA)

Add ssl.com CA config (RSA and ECDSA)

--- src/Certify.Models/CertificateAuthority.cs
+++ src/Certify.Models/CertificateAuthority.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;

 namespace Certify.Models
 {
@@ -24,6 +24,12 @@
         public static string ZEROSSL = "zerossl.com";
     }

+    public static class StandardKeyTypes
+    {
+        public static string ALL = "ALL";
+        public static string RSA = "RSA";
+        public static string ECDSA = "ECDSA";
+    }
     public class CertificateAuthority
     {
         public static List<CertificateAuthority> CoreCertificateAuthorities = new List<CertificateAuthority> {
@@ -85,6 +91,48 @@
                     CertAuthoritySupportedRequests.DOMAIN_WILDCARD.ToString()
                 },
                 EabInstructions="To use ZeroSSL, Create a free account on ZeroSSL.com then navigate to Developer > EAB Credentials for ACME Clients > Generate. Save your EAB KID and EAB HMAC Key. Enter these in the Advanced tab (Add/Edit Account)."
+            },
+                new CertificateAuthority{
+                Id="rsa.ssl.com",
+                Title ="SSL.com (RSA)",
+                Description="SSL.com offer free and paid certificate services. Free certificates are valid for 90 days and can contain a single domain plus www.",
+                APIType = CertAuthorityAPIType.ACME_V2.ToString(),
+                WebsiteUrl ="https://ssl.com/",
+                PrivacyPolicyUrl ="https://www.ssl.com/privacy-policy/",
+                ProductionAPIEndpoint = "https://acme.ssl.com/sslcom-dv-rsa",
+                SupportedKeyTypes = StandardKeyTypes.RSA,
+                StagingAPIEndpoint = null,
+                IsEnabled=true,
+                IsCustom = false,
+                SANLimit = 2,
+                RequiresEmailAddress = true,
+                RequiresExternalAccountBinding = true,
+                SupportedFeatures = new List<string>{
+                    CertAuthoritySupportedRequests.DOMAIN_SINGLE.ToString(),
+                    CertAuthoritySupportedRequests.DOMAIN_SINGLE_PLUS_WWW.ToString()
+                },
+                EabInstructions="To use SSL.com, Create a free account on SSL.com (https://secure.ssl.com/users/new) then navigate to Dashboard > Developers and Integrations > API and ACME Credentials > Add Credential. Save your Account/ACME Key and HMAC Key. Enter these in the Advanced tab (Add/Edit Account)."
+            },
+                 new CertificateAuthority{
+                Id="ecdsa.ssl.com",
+                Title ="SSL.com (ECDSA)",
+                Description="SSL.com offer free and paid certificate services. Free certificates are valid for 90 days and can contain a single domain plus www.",
+                APIType = CertAuthorityAPIType.ACME_V2.ToString(),
+                WebsiteUrl ="https://ssl.com/",
+                PrivacyPolicyUrl ="https://www.ssl.com/privacy-policy/",
+                ProductionAPIEndpoint = "https://acme.ssl.com/sslcom-dv-ecc",
+                SupportedKeyTypes = StandardKeyTypes.ECDSA,
+                StagingAPIEndpoint = null,
+                IsEnabled=true,
+                IsCustom = false,
+                SANLimit = 2,
+                RequiresEmailAddress = true,
+                RequiresExternalAccountBinding = true,
+                SupportedFeatures = new List<string>{
+                    CertAuthoritySupportedRequests.DOMAIN_SINGLE.ToString(),
+                    CertAuthoritySupportedRequests.DOMAIN_SINGLE_PLUS_WWW.ToString()
+                },
+                EabInstructions="To use SSL.com, Create a free account on SSL.com (https://secure.ssl.com/users/new) then navigate to Dashboard > Developers and Integrations > API and ACME Credentials > Add Credential. Save your Account/ACME Key and HMAC Key. Enter these in the Advanced tab (Add/Edit Account)."
             }
         };

@@ -98,6 +146,7 @@
         public string TermsAndConditionsUrl { get; set; }
         public string ProductionAPIEndpoint { get; set; }
         public string StagingAPIEndpoint { get; set; }
+
         public bool IsEnabled { get; set; }
         public bool IsCustom { get; set; } = true;
         public int SANLimit { get; set; }
@@ -106,6 +155,7 @@
         public bool AllowUntrustedTls { get; set; } = false;

         public string EabInstructions { get; set; }
+        public string SupportedKeyTypes { get; set; } = StandardKeyTypes.ALL;

     }
 }


Added a Parent property to the WMI exposed Hardware objects

--- WMI/Hardware.cs
+++ WMI/Hardware.cs
@@ -46,6 +46,7 @@
     public string HardwareType { get; private set; }
     public string Identifier { get; private set; }
     public string Name { get; private set; }
+    public string Parent { get; private set; }

     #endregion

@@ -53,6 +54,7 @@
       Name = hardware.Name;
       Identifier = hardware.Identifier.ToString();
       HardwareType = hardware.HardwareType.ToString();
+      Parent = hardware.Parent.Identifier.ToString();
     }

     public void Update() { }


BUG: Lucene.Net.QueryParser.Flexible.Core.Util.UnescapedCharSequence: (Fixes LUCENENET-592) Changed condition in ToStringEscaped() method so it will correctly escape the string.

--- src/Lucene.Net.QueryParser/Flexible/Core/Util/UnescapedCharSequence.cs
+++ src/Lucene.Net.QueryParser/Flexible/Core/Util/UnescapedCharSequence.cs
@@ -141,7 +141,7 @@
         {
             // non efficient implementation
             StringBuilder result = new StringBuilder();
-            for (int i = 0; i >= this.Length; i++)
+            for (int i = 0; i < this.Length; i++) // LUCENENET-592 - changed condition from >= to <
             {
                 if (this.chars[i] == '\\')
                 {


Update comment on HandleRemoteAuthenticateAsync

--- src/Microsoft.AspNetCore.Authentication/RemoteAuthenticationHandler.cs
+++ src/Microsoft.AspNetCore.Authentication/RemoteAuthenticationHandler.cs
@@ -112,9 +112,9 @@
         }

         /// <summary>
-        /// Authenticate the user identity with the identity provider.
+        /// Authenticate the user identity with the identity provider.
         ///
-        /// This could be done through a back channel communication with the identity provider.
+        /// The method process the request on the endpoint defined by CallbackPath.
         /// </summary>
         protected abstract Task<AuthenticateResult> HandleRemoteAuthenticateAsync();


Lower roles for account management

Lower roles for account management

--- src/Collectively.Api/Modules/UserModule.cs
+++ src/Collectively.Api/Modules/UserModule.cs
@@ -37,15 +37,15 @@
                 return Response.AsRedirect(string.Format(settings.AvatarUrl, query.Id));
             });

-            Put("{lockUserId}/lock", async args => await ForAdministrator<LockAccount>()
+            Put("{lockUserId}/lock", async args => await ForModerator<LockAccount>()
                 .OnSuccessAccepted()
                 .DispatchAsync());

-            Put("{unlockUserId}/unlock", async args => await ForAdministrator<UnlockAccount>()
+            Put("{unlockUserId}/unlock", async args => await ForModerator<UnlockAccount>()
                 .OnSuccessAccepted()
                 .DispatchAsync());

-            Post("", async (ctx, p) => await ForAdministrator<SignUp>()
+            Post("", async (ctx, p) => await ForModerator<SignUp>()
                 .OnSuccessAccepted()
                 .DispatchAsync());
         }


* Fixed an occurred exception if an interpolation rule had a wrong number of closing braces

--- src/Compilation/Rules/InterpolationRule.cs
+++ src/Compilation/Rules/InterpolationRule.cs
@@ -83,7 +83,7 @@
                             var expressionEnd = BraceCounter.MatchBraces(line.Text, expressionBegin, line.End);
                             if (expressionEnd == line.End)
                             {
-                                end = line.End;
+                                index = end = line.End;
                                 var errorPosition = new TextPosition(line.Position.Line, 1 + (line.End - line.Begin));
                                 messageHandler.Message(TraceLevel.Error, "Missing '}'.", line.Position.Name, errorPosition);
                                 break;


Brought back CommandPlugin.CommandChar

Brought back CommandPlugin.CommandChar

--- src/Discord.Net.Commands/CommandsPlugin.cs
+++ src/Discord.Net.Commands/CommandsPlugin.cs
@@ -18,7 +18,8 @@
 		internal CommandMap Map => _map;
 		private readonly CommandMap _map;

-		public IEnumerable<char> CommandChars { get { return _commandChars; } set { _commandChars = value.ToArray(); } }
+		public char ComamndChar { get { return _commandChars[0]; } set { _commandChars = new char[] { value }; } }
+        public IEnumerable<char> CommandChars { get { return _commandChars; } set { _commandChars = value.ToArray(); } }
         private char[] _commandChars;

 		public bool RequireCommandCharInPublic { get; set; }


Replace slow Thread.Sleep with semaphore to enforce concurrency in WorkItemDispatcher.

--- src/DurableTask.Core/WorkItemDispatcher.cs
+++ src/DurableTask.Core/WorkItemDispatcher.cs
@@ -33,17 +33,17 @@
         const int BackoffIntervalOnInvalidOperationSecs = 10;
         const int CountDownToZeroDelay = 5;
         static TimeSpan DefaultReceiveTimeout = TimeSpan.FromSeconds(30);
-        static TimeSpan WaitIntervalOnMaxSessions = TimeSpan.FromSeconds(5);
         readonly string id;
         readonly string name;
         readonly object thisLock = new object();
-        readonly SemaphoreSlim slimLock = new SemaphoreSlim(1, 1);
+        readonly SemaphoreSlim initializationLock = new SemaphoreSlim(1, 1);

         volatile int concurrentWorkItemCount;
         volatile int countDownToZeroDelay;
         volatile int delayOverrideSecs;
         volatile int activeFetchers = 0;
         bool isStarted = false;
+        SemaphoreSlim concurrencyLock;

         /// <summary>
         /// Gets or sets the maximum concurrent work items
@@ -109,13 +109,16 @@
         {
             if (!isStarted)
             {
-                await slimLock.WaitAsync();
+                await initializationLock.WaitAsync();
                 try
                 {
                     if (isStarted)
                     {
                         throw TraceHelper.TraceException(TraceEventType.Error, "WorkItemDispatcherStart-AlreadyStarted", new InvalidOperationException($"WorkItemDispatcher '{name}' has already started"));
                     }
+
+                    concurrencyLock?.Dispose();
+                    concurrencyLock = new SemaphoreSlim(MaxConcurrentWorkItems);

                     isStarted = true;

@@ -131,7 +134,7 @@
                 }
                 finally
                 {
-                    slimLock.Release();
+                    initializationLock.Release();
                 }
             }
         }
@@ -147,7 +150,7 @@
                 return;
             }

-            await slimLock.WaitAsync();
+            await initializationLock.WaitAsync();
             try
             {
                 if (!isStarted)
@@ -172,7 +175,7 @@
             }
             finally
             {
-                slimLock.Release();
+                initializationLock.Release();
             }
         }

@@ -182,13 +185,12 @@

             while (isStarted)
             {
-                if (concurrentWorkItemCount >= MaxConcurrentWorkItems)
+                if (!await concurrencyLock.WaitAsync(TimeSpan.FromSeconds(5)))
                 {
                     TraceHelper.Trace(
-                        TraceEventType.Information,
+                        TraceEventType.Warning,
                         "WorkItemDispatcherDispatch-MaxOperations",
-                        GetFormattedLog(dispatcherId, $"Max concurrent operations ({concurrentWorkItemCount}) are already in progress. Waiting for {WaitIntervalOnMaxSessions}s for next accept."));
-                    await Task.Delay(WaitIntervalOnMaxSessions);
+                        GetFormattedLog(dispatcherId, $"Max concurrent operations ({concurrentWorkItemCount}) are already in progress. Still waiting for next accept."));
                     continue;
                 }

@@ -245,6 +247,7 @@
                     Interlocked.Decrement(ref activeFetchers);
                 }

+                bool scheduledWorkItem = false;
                 if (!(Equals(workItem, default(T))))
                 {
                     if (!isStarted)
@@ -261,6 +264,8 @@
                         #pragma warning disable 4014
                         Task.Run(() => ProcessWorkItemAsync(context, workItem));
                         #pragma warning restore 4014
+
+                        scheduledWorkItem = true;
                     }
                 }

@@ -268,6 +273,11 @@
                 if (delaySecs > 0)
                 {
                     await Task.Delay(TimeSpan.FromSeconds(delaySecs));
+                }
+
+                if (!scheduledWorkItem)
+                {
+                    concurrencyLock.Release();
                 }
             }
         }
@@ -342,6 +352,7 @@
             finally
             {
                 Interlocked.Decrement(ref concurrentWorkItemCount);
+                this.concurrencyLock.Release();
             }

             if (abortWorkItem && AbortWorkItem != null)
@@ -416,7 +427,8 @@
         {
             if (disposing)
             {
-                ((IDisposable)slimLock).Dispose();
+                initializationLock.Dispose();
+                concurrencyLock.Dispose();
             }
         }
     }


Fix name of RunnerTests.

Fix name of RunnerTests.

--- src/Fixie.Tests/Conventions/RunnerTests.cs
+++ src/Fixie.Tests/Conventions/RunnerTests.cs
@@ -2,44 +2,42 @@

 namespace Fixie.Tests.Conventions
 {
-    public class ConventionRunnerTests
+    public class RunnerTests
     {
         public void ShouldExecuteAllCasesInAllDiscoveredTestClasses()
         {
             var listener = new StubListener();
-            var runner = new Runner(listener);
             var convention = SelfTestConvention.Build();

-            runner.RunTypes(GetType().Assembly, convention,
+            new Runner(listener).RunTypes(GetType().Assembly, convention,
                 typeof(SampleIrrelevantClass), typeof(PassTestClass), typeof(int),
                 typeof(PassFailTestClass), typeof(SkipTestClass));

-            listener.Entries.ShouldEqual("Fixie.Tests.Conventions.ConventionRunnerTests+PassTestClass.PassA passed.",
-                "Fixie.Tests.Conventions.ConventionRunnerTests+PassTestClass.PassB passed.",
-                "Fixie.Tests.Conventions.ConventionRunnerTests+PassFailTestClass.Fail failed: 'Fail' failed!",
-                "Fixie.Tests.Conventions.ConventionRunnerTests+PassFailTestClass.Pass passed.",
-                "Fixie.Tests.Conventions.ConventionRunnerTests+SkipTestClass.Skip skipped.");
+            listener.Entries.ShouldEqual("Fixie.Tests.Conventions.RunnerTests+PassTestClass.PassA passed.",
+                "Fixie.Tests.Conventions.RunnerTests+PassTestClass.PassB passed.",
+                "Fixie.Tests.Conventions.RunnerTests+PassFailTestClass.Fail failed: 'Fail' failed!",
+                "Fixie.Tests.Conventions.RunnerTests+PassFailTestClass.Pass passed.",
+                "Fixie.Tests.Conventions.RunnerTests+SkipTestClass.Skip skipped.");
         }

         public void ShouldAllowRandomShufflingOfCaseExecutionOrder()
         {
             var listener = new StubListener();
-            var runner = new Runner(listener);
             var convention = SelfTestConvention.Build();

             convention.ClassExecution
                 .CreateInstancePerClass()
                 .ShuffleCases(new Random(1));

-            runner.RunTypes(GetType().Assembly, convention,
+            new Runner(listener).RunTypes(GetType().Assembly, convention,
                 typeof(SampleIrrelevantClass), typeof(PassTestClass), typeof(int),
                 typeof(PassFailTestClass), typeof(SkipTestClass));

-            listener.Entries.ShouldEqual("Fixie.Tests.Conventions.ConventionRunnerTests+PassTestClass.PassB passed.",
-                "Fixie.Tests.Conventions.ConventionRunnerTests+PassTestClass.PassA passed.",
-                "Fixie.Tests.Conventions.ConventionRunnerTests+PassFailTestClass.Fail failed: 'Fail' failed!",
-                "Fixie.Tests.Conventions.ConventionRunnerTests+PassFailTestClass.Pass passed.",
-                "Fixie.Tests.Conventions.ConventionRunnerTests+SkipTestClass.Skip skipped.");
+            listener.Entries.ShouldEqual("Fixie.Tests.Conventions.RunnerTests+PassTestClass.PassB passed.",
+                "Fixie.Tests.Conventions.RunnerTests+PassTestClass.PassA passed.",
+                "Fixie.Tests.Conventions.RunnerTests+PassFailTestClass.Fail failed: 'Fail' failed!",
+                "Fixie.Tests.Conventions.RunnerTests+PassFailTestClass.Pass passed.",
+                "Fixie.Tests.Conventions.RunnerTests+SkipTestClass.Skip skipped.");
         }

         class SampleIrrelevantClass


Simplify example parameter generation.

Simplify example parameter generation.

--- src/Fixie.Tests/TestClassLifecycleTests.cs
+++ src/Fixie.Tests/TestClassLifecycleTests.cs
@@ -225,18 +225,13 @@

             static IEnumerable<object?[]> Cases(TestMethod test)
             {
-                if (test.HasParameters)
-                {
-                    foreach (var parameters in Utility.UsingInputAttributes(test.Method))
-                        yield return parameters;
-                }
-                else
-                {
-                    yield return EmptyParameters;
-                }
+                return test.HasParameters
+                    ? Utility.UsingInputAttributes(test.Method)
+                    : InvokeOnceWithZeroParameters;
             }

             static readonly object[] EmptyParameters = {};
+            static readonly object[][] InvokeOnceWithZeroParameters = { EmptyParameters };
         }

         public async Task ShouldRunAllTestsByDefault()


Added additional context

Added additional context

--- src/Shouldly.Tests/Strings/ShouldBeEmpty/ShouldBeEmptyBasicScenario.cs
+++ src/Shouldly.Tests/Strings/ShouldBeEmpty/ShouldBeEmptyBasicScenario.cs
@@ -8,16 +8,22 @@
         public void ShouldBeEmptyBasicScenarioShouldFail()
         {
             Verify.ShouldFail(() =>
-    "a".ShouldBeEmpty(),
+    "a".ShouldBeEmpty("Some additional context"),

     errorWithSource:
     @"""a""
     should be empty but was
-""a""",
+""a""
+
+Additional Info:
+    Some additional context",

     errorWithoutSource:
     @"""a""
-    should be empty but was not empty");
+    should be empty but was not empty
+
+Additional Info:
+    Some additional context");
         }

         [Fact]


Added Lockers on HLCache

Added Lockers on HLCache

--- src/Gmtl.HandyLib/Gmtl.HandyLib/HLCache.cs
+++ src/Gmtl.HandyLib/Gmtl.HandyLib/HLCache.cs
@@ -14,7 +14,9 @@
         private readonly Func<Dictionary<TKey, TData>> _initializerFunction;
         private static Dictionary<TKey, TData> data = new Dictionary<TKey, TData>();
         private static bool isInitialized = false;
-        private static object locker = new object();
+        private static object _initializeLock = new object();
+        private static object _deleteLock = new object();
+        private static object _insertLock = new object();

         public Cache() { }

@@ -68,7 +70,7 @@
         {
             if (isInitialized) return;

-            lock (locker)
+            lock (_initializeLock)
             {
                 if (isInitialized) return;

@@ -83,21 +85,33 @@

         public TData Get(TKey key)
         {
+            return data[key];
+        }
+
+        public TData GetOrDefault(TKey key)
+        {
             if (data.ContainsKey(key)) return data[key];

             return default(TData);
         }

-        public void Insert(TKey key, TData newItemData)
+        public void Delete(TKey key)
         {
-            if (!data.ContainsKey(key))
-                data[key] = newItemData;
+            lock (_deleteLock)
+            {
+                if (data.ContainsKey(key))
+                    data.Remove(key);
+            }
         }

-        public void Update(TKey key, TData newItemData)
+        public void InsertOrUpdate(TKey key, TData newItemData)
         {
+            lock (_insertLock) {
             if (data.ContainsKey(key))
                 data[key] = newItemData;
+            else
+                data.Add(key, newItemData);
+            }
         }
     }
 }


fix: #420 enable dragging ToggleButton controls

With changes for #342 the dragging of ToggleButton controls was gone. To re-enable this it's necessary to remove the test in GetHitTestResult and don't handle the mouse inputs for it (down and up). So after that it's possible to toggle the state or drag the control.

--- src/GongSolutions.WPF.DragDrop/DragDrop.cs
+++ src/GongSolutions.WPF.DragDrop/DragDrop.cs
@@ -426,7 +426,7 @@
             var dragInfo = infoBuilder?.CreateDragInfo(sender, e.OriginalSource, MouseButton.Left, item => e.GetTouchPoint(item).Position)
                            ?? new DragInfo(sender, e.OriginalSource, MouseButton.Left, item => e.GetTouchPoint(item).Position);

-            DragSourceDown(sender, dragInfo, e);
+            DragSourceDown(sender, dragInfo, e, elementPosition);
         }

         private static void DoMouseButtonDown(object sender, MouseButtonEventArgs e)
@@ -449,10 +449,10 @@
             var dragInfo = infoBuilder?.CreateDragInfo(sender, e.OriginalSource, e.ChangedButton, item => e.GetPosition(item))
                            ?? new DragInfo(sender, e.OriginalSource, e.ChangedButton, item => e.GetPosition(item));

-            DragSourceDown(sender, dragInfo, e);
-        }
-
-        private static void DragSourceDown(object sender, DragInfo dragInfo, InputEventArgs e)
+            DragSourceDown(sender, dragInfo, e, elementPosition);
+        }
+
+        private static void DragSourceDown(object sender, DragInfo dragInfo, InputEventArgs e, Point elementPosition)
         {
             if (dragInfo.VisualSource is ItemsControl control && control.CanSelectMultipleItems())
             {
@@ -482,8 +482,11 @@
                 var selectedItems = itemsControl.GetSelectedItems().OfType<object>().ToList();
                 if (selectedItems.Count > 1 && selectedItems.Contains(dragInfo.SourceItem))
                 {
-                    _clickSupressItem = dragInfo.SourceItem;
-                    e.Handled = true;
+                    if (!HitTestUtilities.HitTest4Type<ToggleButton>(sender, elementPosition))
+                    {
+                        _clickSupressItem = dragInfo.SourceItem;
+                        e.Handled = true;
+                    }
                 }
             }

@@ -492,21 +495,26 @@

         private static void DragSourceOnMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
         {
-            DragSourceUp(sender);
+            DragSourceUp(sender, e.GetPosition((IInputElement)sender));
         }

         private static void DragSourceOnMouseRightButtonUp(object sender, MouseButtonEventArgs e)
         {
-            DragSourceUp(sender);
+            DragSourceUp(sender, e.GetPosition((IInputElement)sender));
         }

         private static void DragSourceOnTouchUp(object sender, TouchEventArgs e)
         {
-            DragSourceUp(sender);
-        }
-
-        private static void DragSourceUp(object sender)
-        {
+            DragSourceUp(sender, e.GetTouchPoint((IInputElement)sender).Position);
+        }
+
+        private static void DragSourceUp(object sender, Point elementPosition)
+        {
+            if (HitTestUtilities.HitTest4Type<ToggleButton>(sender, elementPosition))
+            {
+                return;
+            }
+
             var dragInfo = _dragInfo;

             // If we prevented the control's default selection handling in DragSource_PreviewMouseLeftButtonDown
@@ -946,7 +954,6 @@
                    || HitTestUtilities.HitTest4Type<TextBoxBase>(sender, elementPosition)
                    || HitTestUtilities.HitTest4Type<PasswordBox>(sender, elementPosition)
                    || HitTestUtilities.HitTest4Type<ComboBox>(sender, elementPosition)
-                   || HitTestUtilities.HitTest4Type<ToggleButton>(sender, elementPosition)
                    || HitTestUtilities.HitTest4Type<MenuBase>(sender, elementPosition)
                    || HitTestUtilities.HitTest4GridViewColumnHeader(sender, elementPosition)
                    || HitTestUtilities.HitTest4DataGridTypes(sender, elementPosition);


Address PR feedback, disable test

Address PR feedback, disable test

--- src/System.Net.HttpListener/tests/HttpListenerPrefixCollectionTests.cs
+++ src/System.Net.HttpListener/tests/HttpListenerPrefixCollectionTests.cs
@@ -239,7 +239,11 @@

         public static IEnumerable<object[]> InvalidPrefix_TestData()
         {
-            yield return new object[] { $"http://{Guid.NewGuid().ToString("N")}/" };
+            // [ActiveIssue(19593, TestPlatforms.OSX)]
+            if (!PlatformDetection.IsOSX)
+            {
+                yield return new object[] { $"http://{Guid.NewGuid().ToString("N")}/" };
+            }
             yield return new object[] { "http://[]/" };
             yield return new object[] { "http://[::1%2]/" };
             yield return new object[] { "http://[::]/" };
@@ -271,7 +275,7 @@
             using (var factory = new HttpListenerFactory())
             {
                 HttpListener listener = factory.GetListener();
-                    Assert.Single(listener.Prefixes);
+                Assert.Single(listener.Prefixes);

                 Assert.Throws<HttpListenerException>(() => listener.Prefixes.Add(uriPrefix));
             }


[packages,Publisher] Issue #100. Xcode project build steps now copy a renamed directory correctly

--- packages/Publisher/bam/XcodeBuilder/XcodeCollatedObject.cs
+++ packages/Publisher/bam/XcodeBuilder/XcodeCollatedObject.cs
@@ -57,6 +57,10 @@
             var commandLine = new Bam.Core.StringArray();
             (sender.Settings as CommandLineProcessor.IConvertToCommandLine).Convert(commandLine);

+            var destinationPath = sender.Macros["CopyDir"].Parse();
+            var commands = new Bam.Core.StringArray();
+            commands.Add(System.String.Format("[[ ! -d {0} ]] && mkdir -p {0}", destinationPath));
+
             if (sender.SourceModule != null && sender.SourceModule.MetaData != null)
             {
                 if ((null != sender.Reference) &&
@@ -68,10 +72,6 @@
                     return;
                 }

-                var destinationPath = sender.Macros["CopyDir"].Parse();
-
-                var commands = new Bam.Core.StringArray();
-                commands.Add(System.String.Format("[[ ! -d {0} ]] && mkdir -p {0}", destinationPath));
                 commands.Add(System.String.Format("{0} {1} $CONFIGURATION_BUILD_DIR/$EXECUTABLE_NAME {2} {3}",
                     CommandLineProcessor.Processor.StringifyTool(sender.Tool as Bam.Core.ICommandLineTool),
                     commandLine.ToString(' '),
@@ -85,24 +85,11 @@
             else
             {
                 var isSymlink = (sender is CollatedSymbolicLink);
-                var commands = new Bam.Core.StringArray();

                 var destinationFolder = "$CONFIGURATION_BUILD_DIR";
                 if (sender.Reference != null)
                 {
                     destinationFolder = "$CONFIGURATION_BUILD_DIR/$EXECUTABLE_FOLDER_PATH";
-                    if (isSymlink)
-                    {
-                        commands.Add(System.String.Format("[[ ! -d {0} ]] && mkdir -p {0}",
-                            sender.CreateTokenizedString("@dir($CONFIGURATION_BUILD_DIR/$EXECUTABLE_FOLDER_PATH/$(0))",
-                                sender.CreateTokenizedString("$(0)/@filename($(1))", sender.SubDirectory, sender.SourcePath)).Parse()));
-                    }
-                    else
-                    {
-                        commands.Add(System.String.Format("[[ ! -d {0} ]] && mkdir -p {0}",
-                            sender.CreateTokenizedString("$CONFIGURATION_BUILD_DIR/$EXECUTABLE_FOLDER_PATH/$(0)",
-                                sender.SubDirectory).Parse()));
-                    }
                 }

                 if (isSymlink)
@@ -119,10 +106,16 @@
                 {
                     if (sender is CollatedDirectory)
                     {
+                        var copySource = sourcePath.Parse();
+                        if (sender.Macros["CopiedFilename"].IsAliased)
+                        {
+                            copySource = System.String.Format("{0}/*", copySource);
+                        }
+
                         commands.Add(System.String.Format("{0} {1} {2} {3}/{4}/ {5}",
                             CommandLineProcessor.Processor.StringifyTool(sender.Tool as Bam.Core.ICommandLineTool),
                             commandLine.ToString(' '),
-                            sourcePath.Parse(),
+                            copySource,
                             destinationFolder,
                             sender.CreateTokenizedString("$(0)/@ifnotempty($(CopiedFilename),@filename($(1)))", sender.SubDirectory, sourcePath).Parse(),
                             CommandLineProcessor.Processor.TerminatingArgs(sender.Tool as Bam.Core.ICommandLineTool)));


new default transport client.

new default transport client.

--- src/TWCore.Net.Rpc/Client/Transports/Default/DefaultTransportClient.cs
+++ src/TWCore.Net.Rpc/Client/Transports/Default/DefaultTransportClient.cs
@@ -113,6 +113,21 @@
         public DefaultTransportClient()
         {
             Serializer = SerializerManager.DefaultBinarySerializer.DeepClone();
+            if (Serializer != null)
+            {
+                if (!Serializer.KnownTypes.Contains(typeof(RPCEventMessage)))
+                    Serializer.KnownTypes.Add(typeof(RPCEventMessage));
+                if (!Serializer.KnownTypes.Contains(typeof(RPCPushMessage)))
+                    Serializer.KnownTypes.Add(typeof(RPCPushMessage));
+                if (!Serializer.KnownTypes.Contains(typeof(RPCRequestMessage)))
+                    Serializer.KnownTypes.Add(typeof(RPCRequestMessage));
+                if (!Serializer.KnownTypes.Contains(typeof(RPCResponseMessage)))
+                    Serializer.KnownTypes.Add(typeof(RPCResponseMessage));
+                if (!Serializer.KnownTypes.Contains(typeof(RPCSessionRequestMessage)))
+                    Serializer.KnownTypes.Add(typeof(RPCSessionRequestMessage));
+                if (!Serializer.KnownTypes.Contains(typeof(RPCSessionResponseMessage)))
+                    Serializer.KnownTypes.Add(typeof(RPCSessionResponseMessage));
+            }
             Core.Status.Attach(collection =>
             {
                 collection.Add("Messages Waiting Response Count", _messageResponsesHandlers.Count, true);
@@ -133,7 +148,21 @@
             Serializer = serializer ?? SerializerManager.DefaultBinarySerializer.DeepClone();
             if (socketsPerClient > 0)
                 _maxIndex = socketsPerClient - 1;
-
+            if (Serializer != null)
+            {
+                if (!Serializer.KnownTypes.Contains(typeof(RPCEventMessage)))
+                    Serializer.KnownTypes.Add(typeof(RPCEventMessage));
+                if (!Serializer.KnownTypes.Contains(typeof(RPCPushMessage)))
+                    Serializer.KnownTypes.Add(typeof(RPCPushMessage));
+                if (!Serializer.KnownTypes.Contains(typeof(RPCRequestMessage)))
+                    Serializer.KnownTypes.Add(typeof(RPCRequestMessage));
+                if (!Serializer.KnownTypes.Contains(typeof(RPCResponseMessage)))
+                    Serializer.KnownTypes.Add(typeof(RPCResponseMessage));
+                if (!Serializer.KnownTypes.Contains(typeof(RPCSessionRequestMessage)))
+                    Serializer.KnownTypes.Add(typeof(RPCSessionRequestMessage));
+                if (!Serializer.KnownTypes.Contains(typeof(RPCSessionResponseMessage)))
+                    Serializer.KnownTypes.Add(typeof(RPCSessionResponseMessage));
+            }
             Core.Status.Attach(collection =>
             {
                 collection.Add("Messages Waiting Response Count", _messageResponsesHandlers.Count, true);


Provided default values for PersistenceConfig properties

--- src/formulate.app/Configuration/PersistenceConfig.cs
+++ src/formulate.app/Configuration/PersistenceConfig.cs
@@ -1,5 +1,7 @@
 namespace formulate.app.Configuration
 {
+    using System.ComponentModel;
+
     /// <summary>
     /// The persistence config.
     /// </summary>
@@ -8,11 +10,13 @@
         /// <summary>
         /// Gets or sets the json base path.
         /// </summary>
+        [DefaultValue("~/App_Data/Formulate/Json/")]
         public string JsonBasePath { get; set; }

         /// <summary>
         /// Gets or sets the file storage base path.
         /// </summary>
+        [DefaultValue("~/App_Data/Formulate/FileStorage/Files/")]
         public string FileStorageBasePath { get; set; }
     }
 }


make async

make async

--- src/VisualStudio/Core/Impl/SolutionExplorer/AnalyzersCommandHandler.cs
+++ src/VisualStudio/Core/Impl/SolutionExplorer/AnalyzersCommandHandler.cs
@@ -451,7 +451,7 @@
                             if (pathToAnalyzerConfigDoc != null)
                             {
                                 using var scope1 = context.AddScope(allowCancellation: true, ServicesVSResources.Updating_severity);
-                                var newSolution = selectedDiagnostic.GetSolutionWithUpdatedAnalyzerConfigSeverityAsync(selectedAction.Value, project, context.UserCancellationToken).WaitAndGetResult(context.UserCancellationToken);
+                                var newSolution = await selectedDiagnostic.GetSolutionWithUpdatedAnalyzerConfigSeverityAsync(selectedAction.Value, project, context.UserCancellationToken).ConfigureAwait(false);
                                 var operations = ImmutableArray.Create<CodeActionOperation>(new ApplyChangesOperation(newSolution));
                                 await editHandlerService.ApplyAsync(
                                     _workspace,


Simplify

Simplify

--- src/Workspaces/Core/Portable/SymbolKey/SymbolKey.ErrorTypeSymbolKey.cs
+++ src/Workspaces/Core/Portable/SymbolKey/SymbolKey.ErrorTypeSymbolKey.cs
@@ -1,6 +1,7 @@
 // Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

 using System.Collections.Immutable;
+using System.Diagnostics;

 namespace Microsoft.CodeAnalysis
 {
@@ -31,13 +32,12 @@
                 var arity = reader.ReadInteger();

                 using var typeArguments = reader.ReadSymbolArray<ITypeSymbol>();
-                using var errorTypes = ResolveErrorTypes(reader, containingSymbolResolution, name, arity);
-
                 if (typeArguments.Count != arity)
                 {
                     return default;
                 }

+                using var errorTypes = CreateErrorTypes(reader, containingSymbolResolution, name, arity);
                 if (arity == 0)
                 {
                     return CreateSymbolInfo(errorTypes);
@@ -53,25 +53,24 @@
                 return CreateSymbolInfo(result);
             }

-            private static PooledArrayBuilder<INamedTypeSymbol> ResolveErrorTypes(
+            private static PooledArrayBuilder<INamedTypeSymbol> CreateErrorTypes(
                 SymbolKeyReader reader,
                 SymbolKeyResolution containingSymbolResolution, string name, int arity)
             {
                 var errorTypes = PooledArrayBuilder<INamedTypeSymbol>.GetInstance();

-                if (containingSymbolResolution.GetAnySymbol() == null)
+                foreach (var container in containingSymbolResolution)
+                {
+                    if (container is INamespaceOrTypeSymbol containerTypeOrNS)
+                    {
+                        errorTypes.AddIfNotNull(reader.Compilation.CreateErrorTypeSymbol(containerTypeOrNS, name, arity));
+                    }
+                }
+
+                // Always ensure at least one error type was created.
+                if (errorTypes.Count == 0)
                 {
                     errorTypes.AddIfNotNull(reader.Compilation.CreateErrorTypeSymbol(null, name, arity));
-                }
-                else
-                {
-                    foreach (var container in containingSymbolResolution)
-                    {
-                        if (container is INamespaceOrTypeSymbol containerTypeOrNS)
-                        {
-                            errorTypes.AddIfNotNull(reader.Compilation.CreateErrorTypeSymbol(containerTypeOrNS, name, arity));
-                        }
-                    }
                 }

                 return errorTypes;


ObservableListBase undo/redo now captures.

--- src/IX.Observable/ObservableListBase{T}.cs
+++ src/IX.Observable/ObservableListBase{T}.cs
@@ -468,6 +468,16 @@
                         this.InternalListContainer.RemoveAt(index);

                         T item = aul.AddedItem;
+
+                        if (this.ItemsAreUndoable &&
+                            this.AutomaticallyCaptureSubItems &&
+                            item is IUndoableItem ul &&
+                            ul.IsCapturedIntoUndoContext &&
+                            ul.ParentUndoContext == this)
+                        {
+                            ul.ReleaseFromUndoContext();
+                        }
+
                         toInvokeOutsideLock = () =>
                         {
                             this.RaiseCollectionChangedRemove(item, index);
@@ -488,6 +498,16 @@
                         }

                         IEnumerable<T> items = amul.AddedItems;
+
+                        if (this.ItemsAreUndoable &&
+                            this.AutomaticallyCaptureSubItems)
+                        {
+                            foreach (IUndoableItem ul in items.Cast<IUndoableItem>().Where(p => p.IsCapturedIntoUndoContext && p.ParentUndoContext == this))
+                            {
+                                ul.ReleaseFromUndoContext();
+                            }
+                        }
+
                         toInvokeOutsideLock = () =>
                         {
                             this.RaiseCollectionChangedRemoveMultiple(items, index);
@@ -505,6 +525,14 @@

                         this.InternalListContainer.Insert(index, item);

+                        if (this.ItemsAreUndoable &&
+                            this.AutomaticallyCaptureSubItems &&
+                            item is IUndoableItem ul &&
+                            !ul.IsCapturedIntoUndoContext)
+                        {
+                            ul.CaptureIntoUndoContext(this);
+                        }
+
                         toInvokeOutsideLock = () =>
                         {
                             this.RaiseCollectionChangedAdd(item, index);
@@ -520,6 +548,15 @@
                         foreach (T t in cul.OriginalItems)
                         {
                             this.InternalListContainer.Add(t);
+                        }
+
+                        if (this.ItemsAreUndoable &&
+                            this.AutomaticallyCaptureSubItems)
+                        {
+                            foreach (IUndoableItem ul in cul.OriginalItems.Cast<IUndoableItem>().Where(p => !p.IsCapturedIntoUndoContext))
+                            {
+                                ul.CaptureIntoUndoContext(this);
+                            }
                         }

                         toInvokeOutsideLock = () =>
@@ -539,6 +576,23 @@
                         var index = caul.Index;

                         this.InternalListContainer[index] = newItem;
+
+                        if (this.ItemsAreUndoable &&
+                            this.AutomaticallyCaptureSubItems)
+                        {
+                            if (newItem is IUndoableItem ul &&
+                                !ul.IsCapturedIntoUndoContext)
+                            {
+                                ul.CaptureIntoUndoContext(this);
+                            }
+
+                            if (oldItem is IUndoableItem ol &&
+                                ol.IsCapturedIntoUndoContext &&
+                                ol.ParentUndoContext == this)
+                            {
+                                ol.ReleaseFromUndoContext();
+                            }
+                        }

                         toInvokeOutsideLock = () =>
                         {
@@ -583,6 +637,14 @@

                         this.InternalListContainer.Insert(index, item);

+                        if (this.ItemsAreUndoable &&
+                            this.AutomaticallyCaptureSubItems &&
+                            item is IUndoableItem ul &&
+                            !ul.IsCapturedIntoUndoContext)
+                        {
+                            ul.CaptureIntoUndoContext(this);
+                        }
+
                         toInvokeOutsideLock = () =>
                         {
                             this.RaiseCollectionChangedAdd(item, index);
@@ -600,6 +662,15 @@

                         items.Reverse().ForEach(p => this.InternalListContainer.Insert(index, p));

+                        if (this.ItemsAreUndoable &&
+                            this.AutomaticallyCaptureSubItems)
+                        {
+                            foreach (IUndoableItem ul in amul.AddedItems.Cast<IUndoableItem>().Where(p => !p.IsCapturedIntoUndoContext))
+                            {
+                                ul.CaptureIntoUndoContext(this);
+                            }
+                        }
+
                         toInvokeOutsideLock = () =>
                         {
                             this.RaiseCollectionChangedAddMultiple(items, index);
@@ -617,6 +688,15 @@

                         this.InternalListContainer.RemoveAt(index);

+                        if (this.ItemsAreUndoable &&
+                            this.AutomaticallyCaptureSubItems &&
+                            item is IUndoableItem ul &&
+                            ul.IsCapturedIntoUndoContext &&
+                            ul.ParentUndoContext == this)
+                        {
+                            ul.ReleaseFromUndoContext();
+                        }
+
                         toInvokeOutsideLock = () =>
                         {
                             this.RaiseCollectionChangedRemove(item, index);
@@ -630,6 +710,15 @@
                 case ClearUndoLevel<T> cul:
                     {
                         this.InternalContainer.Clear();
+
+                        if (this.ItemsAreUndoable &&
+                            this.AutomaticallyCaptureSubItems)
+                        {
+                            foreach (IUndoableItem ul in cul.OriginalItems.Cast<IUndoableItem>().Where(p => p.IsCapturedIntoUndoContext && p.ParentUndoContext == this))
+                            {
+                                ul.ReleaseFromUndoContext();
+                            }
+                        }

                         toInvokeOutsideLock = () =>
                         {
@@ -649,6 +738,23 @@

                         this.InternalListContainer[index] = newItem;

+                        if (this.ItemsAreUndoable &&
+                            this.AutomaticallyCaptureSubItems)
+                        {
+                            if (newItem is IUndoableItem ul &&
+                                !ul.IsCapturedIntoUndoContext)
+                            {
+                                ul.CaptureIntoUndoContext(this);
+                            }
+
+                            if (oldItem is IUndoableItem ol &&
+                                ol.IsCapturedIntoUndoContext &&
+                                ol.ParentUndoContext == this)
+                            {
+                                ol.ReleaseFromUndoContext();
+                            }
+                        }
+
                         toInvokeOutsideLock = () =>
                         {
                             this.RaiseCollectionChangedChanged(oldItem, newItem, index);


Fix problem in tests due to changed implementation of Description Attribute

--HG--
branch : nunitlite
extra : convert_revision : charlie%40nunit.com-20090828221351-n2gbsht823naxeo0

--- src/tests/Constraints/TypeConstraintTests.cs
+++ src/tests/Constraints/TypeConstraintTests.cs
@@ -153,7 +153,7 @@
         {
             Assert.That(
                 System.Reflection.MethodInfo.GetCurrentMethod(),
-                Has.Attribute(typeof(DescriptionAttribute)).Property("Description").EqualTo("my description"));
+                Has.Attribute(typeof(DescriptionAttribute)).Property("Properties").Property("Keys").Contains("Description"));
         }
     }
 }


Core.Store.CompoundFileDirectory: Fixed issue where magic byte was not correctly represented as negative (secondByte is always negative and represents the Lucene version).

--- src/Lucene.Net.Core/Store/CompoundFileDirectory.cs
+++ src/Lucene.Net.Core/Store/CompoundFileDirectory.cs
@@ -130,10 +130,11 @@
             }
         }

-        private static readonly byte CODEC_MAGIC_BYTE1 = (byte)Number.URShift(CodecUtil.CODEC_MAGIC, 24);
-        private static readonly byte CODEC_MAGIC_BYTE2 = (byte)Number.URShift(CodecUtil.CODEC_MAGIC, 16);
-        private static readonly byte CODEC_MAGIC_BYTE3 = (byte)Number.URShift(CodecUtil.CODEC_MAGIC, 8);
-        private static readonly byte CODEC_MAGIC_BYTE4 = unchecked((byte)CodecUtil.CODEC_MAGIC);
+        // LUCENENET NOTE: These MUST be sbyte because they can be negative
+        private static readonly sbyte CODEC_MAGIC_BYTE1 = (sbyte)Number.URShift(CodecUtil.CODEC_MAGIC, 24);
+        private static readonly sbyte CODEC_MAGIC_BYTE2 = (sbyte)Number.URShift(CodecUtil.CODEC_MAGIC, 16);
+        private static readonly sbyte CODEC_MAGIC_BYTE3 = (sbyte)Number.URShift(CodecUtil.CODEC_MAGIC, 8);
+        private static readonly sbyte CODEC_MAGIC_BYTE4 = unchecked((sbyte)CodecUtil.CODEC_MAGIC);

         /// <summary>
         /// Helper method that reads CFS entries from an input stream </summary>
@@ -153,9 +154,9 @@
                 // and separate norms/etc are outside of cfs.
                 if (firstInt == CODEC_MAGIC_BYTE1)
                 {
-                    byte secondByte = stream.ReadByte();
-                    byte thirdByte = stream.ReadByte();
-                    byte fourthByte = stream.ReadByte();
+                    sbyte secondByte = (sbyte)stream.ReadByte();
+                    sbyte thirdByte = (sbyte)stream.ReadByte();
+                    sbyte fourthByte = (sbyte)stream.ReadByte();
                     if (secondByte != CODEC_MAGIC_BYTE2 || thirdByte != CODEC_MAGIC_BYTE3 || fourthByte != CODEC_MAGIC_BYTE4)
                     {
                         throw new CorruptIndexException("Illegal/impossible header for CFS file: " + secondByte + "," + thirdByte + "," + fourthByte);


Fixed incorrect sensor type

Fixed incorrect sensor type

--- src/MindstormR.Server.Nancy/Modules/RobotModule.cs
+++ src/MindstormR.Server.Nancy/Modules/RobotModule.cs
@@ -100,7 +100,7 @@

             // Parse sensor values from query string params.
             dynamic q = Request.Query;
-            _sensors[id]["color"] = q["color"];
+            _sensors[id]["touch"] = q["touch"];
             _sensors[id]["gyro"] = q["gyro"];
             _sensors[id]["color"] = q["color"];
             _sensors[id]["ir"] = q["ir"];


[FastCGI] Remove unused Hash from ConfigurationManager

--- src/Mono.WebServer.FastCgi/ConfigurationManager.cs
+++ src/Mono.WebServer.FastCgi/ConfigurationManager.cs
@@ -39,8 +39,6 @@
 {
 	public class ConfigurationManager
 	{
-		int hash;
-
 		XmlNodeList settings;

 		readonly NameValueCollection cmd_args =
@@ -378,10 +376,6 @@
 				throw new ArgumentNullException ("args");

 			for (int i = 0; i < args.Length; i ++) {
-				// Randomize the hash a bit.
-				int idx = (i + 1 < args.Length) ? i + 1 : i;
-				hash ^= args [idx].GetHashCode () + i;
-
 				string arg = args [i];
 				int len = PrefixLength (arg);

@@ -464,10 +458,6 @@
 			return 0;
 		}

-		public int Hash {
-			get {return hash < 0 ? -hash : hash;}
-		}
-
 		static NameValueCollection AppSettings {
 			get { return System.Configuration.ConfigurationManager.AppSettings; }
 		}


Added page and pageSize to the set query parameter

--- src/MtgApiManager.Lib/Service/SetQueryParameter.cs
+++ src/MtgApiManager.Lib/Service/SetQueryParameter.cs
@@ -18,5 +18,17 @@
         /// </summary>
         [JsonPropertyName("name")]
         public string Name { get; set; }
+
+        /// <summary>
+        /// Gets or sets the page number.
+        /// </summary>
+        [JsonPropertyName("page")]
+        public int Page { get; set; }
+
+        /// <summary>
+        /// Gets or sets the page size.
+        /// </summary>
+        [JsonPropertyName("pageSize")]
+        public int PageSize { get; set; }
     }
 }


Restore char navigation in edit (#1355)

Restore char navigation in edit (#1355)

--- src/JoinRpg.Portal/Views/Claim/Edit.cshtml
+++ src/JoinRpg.Portal/Views/Claim/Edit.cshtml
@@ -22,7 +22,7 @@
   @Html.ValidationSummary(true, "", new { @class = "text-danger" })

-      @*   @await Html.PartialAsync("CharacterNavigation", Model.Navigation) *@
+       @await Html.PartialAsync("CharacterNavigation", Model.Navigation)

       @if (Model.HasMasterAccess && Model.Problems.Any())


Fixed tests

Fixed tests

--- tests/Avalonia.Controls.UnitTests/MenuItemTests.cs
+++ tests/Avalonia.Controls.UnitTests/MenuItemTests.cs
@@ -181,10 +181,10 @@
             {
             }

-            public TestCommand(Func<object, bool> canExecute, Action<object> execute)
+            public TestCommand(Func<object, bool> canExecute, Action<object> execute = null)
             {
                 _canExecute = canExecute;
-                _execute = execute;
+                _execute = execute ?? (_ => { });
             }

             public int SubscriptionCount { get; private set; }


(GH-64) Fix spelling error in upgrade message

Previously, due to concatenation of "ed" to the end of the command name
string, it caused a spelling error in the message for successful
upgrade: "packagename has been upgradeed successfully".

Without this change the spelling will continue to be incorrect and look
unprofessional.

--- src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs
+++ src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs
@@ -206,7 +206,7 @@

             if (!packageResult.Success)
             {
-                this.Log().Error(ChocolateyLoggers.Important, "{0} {1} not successful.".format_with(packageResult.Name, commandName.to_string()));
+                this.Log().Error(ChocolateyLoggers.Important, "The {0} of {1} was NOT successful.".format_with(commandName.to_string(), packageResult.Name));
                 handle_unsuccessful_operation(config, packageResult, movePackageToFailureLocation: true, attemptRollback: true);

                 return;
@@ -214,7 +214,7 @@

             remove_rollback_if_exists(packageResult);

-            this.Log().Info(ChocolateyLoggers.Important, " {0} has been {1}ed successfully.".format_with(packageResult.Name, commandName.to_string()));
+            this.Log().Info(ChocolateyLoggers.Important, " The {0} of {1} was successful.".format_with( commandName.to_string(), packageResult.Name));
         }

         public ConcurrentDictionary<string, PackageResult> install_run(ChocolateyConfiguration config)


further logic refinement

further logic refinement

--- src/OmniSharp.Host/MSBuild/Discovery/Extensions.cs
+++ src/OmniSharp.Host/MSBuild/Discovery/Extensions.cs
@@ -16,7 +16,7 @@
                 if (invalidVSFound && bestInstanceFound.DiscoveryType == DiscoveryType.StandAlone)
                 {
                     logger.LogWarning(
-                        @"It looks like you have Visual Studio 2019 RTM installed.
+                        @"It looks like you have Visual Studio 2019 lower than 16.3 installed.
  Try updating Visual Studio 2019 to the most recent release to enable better MSBuild support."
                     );
                 }
@@ -24,7 +24,7 @@
                 if (vsWithoutSdkResolver && bestInstanceFound.DiscoveryType == DiscoveryType.StandAlone)
                 {
                     logger.LogWarning(
-                        @"It looks like you have Visual Studio 2019 RTM installed without .NET Core SDK support which is required by OmniSharp.
+                        @"It looks like you have Visual Studio 2019 installed without .NET Core SDK support which is required by OmniSharp.
  Try updating Visual Studio 2019 installation with .NET Core SDK to enable better MSBuild support."
                     );
                 }
@@ -55,8 +55,8 @@
         /// Checks if it is MSBuild from Visual Studio 2017 RTM that cannot be used.
         /// </summary>
         public static bool IsInvalidVisualStudio(this MSBuildInstance instance)
-            => instance.Version.Major == 15
-                && instance.Version.Minor == 0
+            => (instance.Version.Major < 16 ||
+                (instance.Version.Major == 16 && instance.Version.Minor < 3))
                 && (instance.DiscoveryType == DiscoveryType.DeveloperConsole
                     || instance.DiscoveryType == DiscoveryType.VisualStudioSetup);

@@ -73,8 +73,8 @@

                 logger.LogDebug($"MSBuild instance {instance.Name} {instance.Version} scored at {score}");

-                vsWithoutSdkResolver = vsWithoutSdkResolver || instance.HasDotNetSdksResolvers();
                 invalidVSFound = invalidVSFound || instance.IsInvalidVisualStudio();
+                vsWithoutSdkResolver = vsWithoutSdkResolver || (!instance.IsInvalidVisualStudio() && !instance.HasDotNetSdksResolvers());

                 if (bestMatchInstance == null ||
                     score > bestMatchScore ||
@@ -110,12 +110,6 @@
             if (i.DiscoveryType == DiscoveryType.StandAlone)
                 score--;

-            // VS 2019 should be preferred
-            if (i.Version.Major >= 16 && i.Version.Minor >= 3)
-                score++;
-            else
-                score--;
-
             return score;
         }
     }


HASHROUTE should be a target module

HASHROUTE should be a target module


Introduction of a wait condition to be sure that msmdsrv is started


Add Landscape module to build dependencies.


Fix Typemapper bug (DbType.Boolean)

Fix Typemapper bug (DbType.Boolean)

--- src/Provider40/Storage/Internal/SqlCeTypeMapper.cs
+++ src/Provider40/Storage/Internal/SqlCeTypeMapper.cs
@@ -15,7 +15,7 @@
         private readonly RelationalSizedTypeMapping _rowversion = new RelationalSizedTypeMapping("rowversion", typeof(byte[]), DbType.Binary, 8);
         private readonly RelationalTypeMapping _int = new RelationalTypeMapping("int", typeof(int), DbType.Int32);
         private readonly RelationalTypeMapping _bigint = new RelationalTypeMapping("bigint", typeof(long), DbType.Int64);
-        private readonly RelationalTypeMapping _bit = new RelationalTypeMapping("bit", typeof(bool));
+        private readonly RelationalTypeMapping _bit = new RelationalTypeMapping("bit", typeof(bool), DbType.Boolean);
         private readonly RelationalTypeMapping _smallint = new RelationalTypeMapping("smallint", typeof(short), DbType.Int16);
         private readonly RelationalTypeMapping _tinyint = new RelationalTypeMapping("tinyint", typeof(byte), DbType.Byte);
         private readonly SqlCeMaxLengthMapping _nchar = new SqlCeMaxLengthMapping("nchar", typeof(string), DbType.StringFixedLength);
@@ -87,10 +87,10 @@

         protected override string GetColumnType(IProperty property) => property.SqlCe().ColumnType;

-        protected override IReadOnlyDictionary<Type, RelationalTypeMapping> SimpleMappings
-            => _simpleMappings;
+        protected override IReadOnlyDictionary<Type, RelationalTypeMapping> GetSimpleMappings()
+             => _simpleMappings;

-        protected override IReadOnlyDictionary<string, RelationalTypeMapping> SimpleNameMappings
+        protected override IReadOnlyDictionary<string, RelationalTypeMapping> GetSimpleNameMappings()
             => _simpleNameMappings;

         public override RelationalTypeMapping FindMapping(Type clrType)


remove bogus [] from the exec commands

remove bogus [] from the exec commands

--- src/MIDebugEngine/Engine.Impl/Variables.cs
+++ src/MIDebugEngine/Engine.Impl/Variables.cs
@@ -424,18 +424,13 @@
                     else
                         message = e.Message;

-                    SetAsError(string.Format("Error: {0}\r\n", message));
+                    SetAsError(string.Format("Error: {0}", message));
                 }

                 if (consoleResults.Length > 0)
                 {
-                    // Make sure that we are printing whole lines
-                    if (!consoleResults.EndsWith("\n") && !consoleResults.EndsWith("\r\n"))
-                    {
-                        consoleResults = consoleResults + "\n";
-                    }
-
                     Value = consoleResults;
+                    this.TypeName = null;
                 }
             }
             else


Using case-insensitive regexes when comparing signal parameters to conditions

--- src/Metamorphic.Server/Rules/RuleLoader.cs
+++ src/Metamorphic.Server/Rules/RuleLoader.cs
@@ -294,14 +294,14 @@
                     {
                         var text = o as string;
                         var pattern = comparisonValue as string;
-                        return (text != null) && (pattern != null) && Regex.IsMatch(text, pattern);
+                        return (text != null) && (pattern != null) && Regex.IsMatch(text, pattern, RegexOptions.IgnoreCase);
                     };
                 case "notmatchregex":
                     return o =>
                     {
                         var text = o as string;
                         var pattern = comparisonValue as string;
-                        return (text != null) && (pattern != null) && !Regex.IsMatch(text, pattern);
+                        return (text != null) && (pattern != null) && !Regex.IsMatch(text, pattern, RegexOptions.IgnoreCase);
                     };
                 case "startswith":
                     return o =>


Added logging for error messages from the API.

--- src/ContinuousSeo/W3cValidation/ContinuousSeo.W3cValidation.Runner/Processors/HtmlValidatorWrapper.cs
+++ src/ContinuousSeo/W3cValidation/ContinuousSeo.W3cValidation.Runner/Processors/HtmlValidatorWrapper.cs
@@ -110,6 +110,7 @@
             result.DomainName = domainName;
             result.ErrorMessage = errorMessage;
             result.IsValid = false;
+            mContext.Announcer.Error(errorMessage);
             return result;
         }