#18189: Applying default Location when no placement is provided

Work Item: 18189

--HG--
branch : 1.x

--- src/Orchard/ContentManagement/DefaultContentDisplay.cs
+++ src/Orchard/ContentManagement/DefaultContentDisplay.cs
@@ -123,6 +123,9 @@
                         Path = VirtualPathUtility.AppendTrailingSlash(_virtualPathProvider.ToAppRelative(request.Path)) // get the current app-relative path, i.e. ~/my-blog/foo
                     };

+                    // define which location should be used if none placement is hit
+                    descriptor.DefaultPlacement = defaultLocation;
+
                     var placement = descriptor.Placement(placementContext);
                     if (placement != null) {
                         placement.Source = placementContext.Source;


change to MachineName

change to MachineName

--- src/PowerShellEditorServices/Session/SessionDetails.cs
+++ src/PowerShellEditorServices/Session/SessionDetails.cs
@@ -56,7 +56,7 @@
         {
             PSCommand infoCommand = new PSCommand();
             infoCommand.AddScript(
-                "@{ 'computerName' = if ($ExecutionContext.Host.Runspace.ConnectionInfo) {$ExecutionContext.Host.Runspace.ConnectionInfo.ComputerName}  else {'localhost'}; 'processId' = $PID; 'instanceId' = $host.InstanceId }");
+                "@{ 'computerName' = if ([Environment]::MachineName) {[Environment]::MachineName}  else {'localhost'}; 'processId' = $PID; 'instanceId' = $host.InstanceId }");

             return infoCommand;
         }


fix multi-targeting error

fix multi-targeting error

--- src/Prism.Plugin.Popups/PopupRegistrationExtensions.cs
+++ src/Prism.Plugin.Popups/PopupRegistrationExtensions.cs
@@ -27,7 +27,11 @@
         {
             var regType = containerRegistry.GetType();
             var propInfo = regType.GetRuntimeProperty("Instance");
-            return propInfo?.PropertyType.FullName.Equals("DryIoc.IContainer", StringComparison.InvariantCultureIgnoreCase) ?? false;
+#if NETSTANDARD1_0
+            return propInfo?.PropertyType.FullName.Equals("DryIoc.IContainer", StringComparison.OrdinalIgnoreCase) ?? false;
+#else
+			return propInfo?.PropertyType.FullName.Equals("DryIoc.IContainer", StringComparison.InvariantCultureIgnoreCase) ?? false;
+#endif
         }
     }
 }


Fix typo

Fix typo

--- src/QuartzNET-DynamoDB/DataModel/DynamoTriggerGroup.cs
+++ src/QuartzNET-DynamoDB/DataModel/DynamoTriggerGroup.cs
@@ -4,7 +4,7 @@
 using Quartz.DynamoDB.DataModel.Storage;

 namespace Quartz.DynamoDB.DataModel
-
+{
     /// <summary>
     /// A wrapper class for a Quartz Trigger Group instance that can be serialized and stored in Amazon DynamoDB.
     /// </summary>


bug fix

bug fix

--- src/SFA.DAS.EmployerFinance/Services/PaymentService.cs
+++ src/SFA.DAS.EmployerFinance/Services/PaymentService.cs
@@ -19,6 +19,7 @@
 {
     public class ApprenticeshipCache
     {
+        public long Id { get; set; }
         public string FirstName { get; set; }
         public string LastName { get; set; }
         public string NINumber { get; set; }
@@ -125,9 +126,9 @@
             return resultProviders;
         }

-        private async Task<Dictionary<long, Apprenticeship>> GetApprenticeshipDetailsDict(long employerAccountId, IEnumerable<long> apprenticeshipIdList)
-        {
-            var resultApprenticeships = new Dictionary<long, Apprenticeship>();
+        private async Task<Dictionary<long, ApprenticeshipCache>> GetApprenticeshipDetailsDict(long employerAccountId, IEnumerable<long> apprenticeshipIdList)
+        {
+            var resultApprenticeships = new Dictionary<long, ApprenticeshipCache>();

             var taskList = apprenticeshipIdList.Select(id =>
             {
@@ -239,6 +240,7 @@
                     var apprenticeship = await _commitmentsApiClient.GetEmployerApprenticeship(employerAccountId, apprenticeshipId);
                     _apprenticeships.Add(new ApprenticeshipCache
                     {
+                        Id = apprenticeship.Id,
                         FirstName = apprenticeship.FirstName,
                         LastName = apprenticeship.LastName,
                         NINumber = apprenticeship.NINumber,


Update SpellDatabase.cs

Update SpellDatabase.cs

--- AdEvade/AdEvade/Data/Spells/SpellDatabase.cs
+++ AdEvade/AdEvade/Data/Spells/SpellDatabase.cs
@@ -2795,41 +2795,29 @@

             #endregion Ryze

-            #region Sejuani
-            Spells.Add(
-            new SpellData
-            {
-                CharName = "Sejuani",
-                Dangerlevel = SpellDangerLevel.High,
-                Name = "Arctic Assault",
-                ProjectileSpeed = 1250,
-                Radius = 70,
-                Range = 850,
+
+
+
+            #region Shen
+
+            Spells.Add(
+            new SpellData
+            {
+                CharName = "Shen",
+                Dangerlevel = SpellDangerLevel.High,
+                MissileName = "ShenE",
+                Name = "ShadowDash",
+                ProjectileSpeed = 1450,
+                Radius = 50,
+                Range = 600,
                 SpellDelay = 0,
-                SpellKey = SpellSlot.Q,
-                SpellName = "SejuaniArcticAssault",
-                SpellType = SpellType.Line,
-
-            });
-
-            Spells.Add(
-            new SpellData
-            {
-                CharName = "Sejuani",
-                Dangerlevel = SpellDangerLevel.Extreme,
-                MissileName = "SejuaniGlacialPrison",
-                Name = "SejuaniR",
-                ProjectileSpeed = 1600,
-                Radius = 110,
-                Range = 1200,
-                SpellDelay = 250,
-                SpellKey = SpellSlot.R,
-                SpellName = "SejuaniGlacialPrisonCast",
-                ExtraSpellNames = new [] { "SejuaniGlacialPrison" },
-                SpellType = SpellType.Line,
-
-            });
-            #endregion Sejuani
+                SpellKey = SpellSlot.E,
+                SpellName = "ShenE",
+                SpellType = SpellType.Line,
+
+            });
+
+            #endregion Shen

             #region Shyvana


Add webjobs app insight package

Add webjobs app insight package

--- src/SFA.DAS.EmployerFinance/Services/PaymentService.cs
+++ src/SFA.DAS.EmployerFinance/Services/PaymentService.cs
@@ -36,7 +36,7 @@
             _apprenticeshipInfoService = apprenticeshipInfoService;
             _mapper = mapper;
             _logger = logger;
-            _inProcessCache = inProcessCache;
+            _inProcessCache = inProcessCache;
             _providerService = providerService;
         }

@@ -56,17 +56,43 @@

                 var paymentDetails = payments.Items.Select(x => _mapper.Map<PaymentDetails>(x)).ToArray();

-                int paymentDetailsCount = 0;
+                //int paymentDetailsCount = 0;
+
+                _logger.Info($"Fetching provider and apprenticeship for AccountId = {employerAccountId}, periodEnd={periodEnd}, correlationId = {correlationId}");
+
+                var ukprnList = paymentDetails.Select(pd => pd.Ukprn).Distinct();
+                var apprenticeshipIdList = paymentDetails.Select(pd => pd.ApprenticeshipId).Distinct();
+
+                var getProviderDetailsTask = GetProviderDetailsDict(ukprnList);
+                var getApprenticeDetailsTask = GetApprenticeshipDetailsDict(employerAccountId, apprenticeshipIdList);
+
+                await Task.WhenAll(getProviderDetailsTask, getApprenticeDetailsTask);
+
+                var apprenticeshipDetails = getApprenticeDetailsTask.Result;
+                var providerDetails = getProviderDetailsTask.Result;
+
+                _logger.Info($"Fetching {providerDetails.Count} providers and {apprenticeshipDetails.Count} apprenticeship details  for AccountId = {employerAccountId}, periodEnd={periodEnd}, correlationId = {correlationId}");
+
                 foreach (var details in paymentDetails)
                 {
                     details.PeriodEnd = periodEnd;
-
-                    var getProviderDetailsTask = GetProviderDetails(details);
-                    var getApprenticeshipDetailsTask = GetApprenticeshipDetails(employerAccountId, details);
                     var getCourseDetailsTask = GetCourseDetails(details);

-                    await Task.WhenAll(getProviderDetailsTask, getApprenticeshipDetailsTask, getCourseDetailsTask);
-                    _logger.Info($"Metadata retrieved for payment {details.Id}, count: {++paymentDetailsCount}, correlationId = {correlationId}");
+                    var provider = providerDetails[details.Ukprn];
+                    details.ProviderName = provider?.Name;
+                    details.IsHistoricProviderName = provider?.IsHistoricProviderName ?? false;
+
+                    var apprenticeship = apprenticeshipDetails[details.ApprenticeshipId];
+
+                    if (apprenticeship != null)
+                    {
+                        details.ApprenticeName = $"{apprenticeship.FirstName} {apprenticeship.LastName}";
+                        details.ApprenticeNINumber = apprenticeship.NINumber;
+                        details.CourseStartDate = apprenticeship.StartDate;
+                    }
+
+                    await getCourseDetailsTask;
+                    //_logger.Info($"Metadata retrieved for payment {details.Id}, count: {++paymentDetailsCount}, correlationId = {correlationId}");
                 }

                 populatedPayments.AddRange(paymentDetails);
@@ -75,6 +101,34 @@
             }

             return populatedPayments;
+        }
+
+        private async Task<Dictionary<long, Models.ApprenticeshipProvider.Provider>> GetProviderDetailsDict(IEnumerable<long> ukprnList)
+        {
+            var resultProviders = new Dictionary<long, Models.ApprenticeshipProvider.Provider>();
+
+            foreach (var ukprn in ukprnList)
+            {
+                if (resultProviders.ContainsKey(ukprn)) continue;
+                var provider = await _providerService.Get(ukprn);
+                resultProviders.Add(ukprn, provider);
+            }
+
+            return resultProviders;
+        }
+
+        private async Task<Dictionary<long, Apprenticeship>> GetApprenticeshipDetailsDict(long employerAccountId, IEnumerable<long> apprenticeshipIdList)
+        {
+            var resultApprenticeships = new Dictionary<long, Apprenticeship>();
+
+            foreach (var apprenticeshipId in apprenticeshipIdList)
+            {
+                if (resultApprenticeships.ContainsKey(apprenticeshipId)) continue;
+                var apprenticeship = await GetApprenticeship(employerAccountId, apprenticeshipId);
+                resultApprenticeships.Add(apprenticeshipId, apprenticeship);
+            }
+
+            return resultApprenticeships;
         }

         public async Task<IEnumerable<AccountTransfer>> GetAccountTransfers(string periodEnd, long receiverAccountId, Guid correlationId)
@@ -112,7 +166,7 @@
                 payment.CourseName = standard?.CourseName;
                 payment.CourseLevel = standard?.Level;
             }
-            else if(payment.FrameworkCode.HasValue && payment.FrameworkCode > 0)
+            else if (payment.FrameworkCode.HasValue && payment.FrameworkCode > 0)
             {
                 await GetFrameworkCourseDetails(payment);
             }
@@ -183,7 +237,7 @@
             }

             return null;
-        }
+        }

         private async Task<Standard> GetStandard(long standardCode)
         {


Update SpellDatabase.cs

Update SpellDatabase.cs

--- AdEvade/AdEvade/Data/Spells/SpellDatabase.cs
+++ AdEvade/AdEvade/Data/Spells/SpellDatabase.cs
@@ -2562,356 +2562,6 @@
             });
             #endregion Pantheon

-            #region Poppy
-
-            Spells.Add(
-            new SpellData
-            {
-                CharName = "Poppy",
-                Dangerlevel = SpellDangerLevel.Normal,
-                MissileName = "PoppyQ",
-                Name = "Hammer Shock",
-                Radius = 100,
-                Range = 450,
-                SpellDelay = 500,
-                SpellKey = SpellSlot.Q,
-                SpellName = "PoppyQ",
-                SpellType = SpellType.Line,
-            });
-
-            Spells.Add(
-            new SpellData
-            {
-                CharName = "Poppy",
-                Dangerlevel = SpellDangerLevel.High,
-                Name = "Keeper's Verdict",
-                Radius = 200,
-                Range = 450,
-                SpellDelay = 250,
-                SpellKey = SpellSlot.R,
-                SpellName = "PoppyRSpellInstant",
-                SpellType = SpellType.Line,
-            });
-
-            Spells.Add(
-            new SpellData
-            {
-                CharName = "Poppy",
-                Dangerlevel = SpellDangerLevel.High,
-                Name = "Keeper's Verdict",
-                Radius = 100,
-                Range = 1150,
-                ProjectileSpeed = 1750,
-                SpellDelay = 300,
-                SpellKey = SpellSlot.R,
-                SpellName = "PoppyRSpell",
-                MissileName = "PoppyRMissile",
-                SpellType = SpellType.Line,
-                FixedRange = true,
-            });
-            #endregion
-
-            #region Quinn
-
-            Spells.Add(
-            new SpellData
-            {
-                CharName = "Quinn",
-                Dangerlevel = SpellDangerLevel.Normal,
-                MissileName = "QuinnQ",
-                Name = "QuinnQ",
-                ProjectileSpeed = 1550,
-                Radius = 80,
-                Range = 1050,
-                SpellDelay = 250,
-                SpellKey = SpellSlot.Q,
-                SpellName = "QuinnQ",
-                SpellType = SpellType.Line,
-                CollisionObjects = new[] { CollisionObjectType.EnemyChampions, CollisionObjectType.EnemyMinions },
-                FixedRange = true,
-            });
-            #endregion Quinn
-
-            #region RekSai
-
-            Spells.Add(
-            new SpellData
-            {
-                CharName = "RekSai",
-                Dangerlevel = SpellDangerLevel.Normal,
-                MissileName = "RekSaiQBurrowedMis",
-                Name = "RekSaiQ",
-                ProjectileSpeed = 1950,
-                Radius = 65,
-                Range = 1500,
-                SpellDelay = 125,
-                SpellKey = SpellSlot.Q,
-                SpellName = "ReksaiQBurrowed",
-                SpellType = SpellType.Line,
-                CollisionObjects = new[] { CollisionObjectType.EnemyChampions, CollisionObjectType.EnemyMinions },
-
-            });
-            #endregion RekSai
-
-            #region Rengar
-
-
-            Spells.Add(
-            new SpellData
-            {
-                CharName = "Rengar",
-                Dangerlevel = SpellDangerLevel.High,
-                Name = "Savagery [Beta]",
-                Radius = 150,
-                Range = 500,
-                SpellDelay = 250,
-                SpellKey = SpellSlot.Q,
-                SpellName = "RengarQ2",
-                ExtraSpellNames = new[] { "RengarQ2Emp" },
-                SpellType = SpellType.Line,
-            });
-
-            Spells.Add(
-            new SpellData
-            {
-                CharName = "Rengar",
-                Dangerlevel = SpellDangerLevel.Normal,
-                MissileName = "RengarEFinal",
-                Name = "Bola Strike",
-                ProjectileSpeed = 1500,
-                Radius = 70,
-                Range = 1000,
-                SpellDelay = 250,
-                SpellKey = SpellSlot.E,
-                SpellName = "RengarE",
-                SpellType = SpellType.Line,
-                ExtraSpellNames = new []{ "RengarEEmp" },
-                ExtraMissileNames = new []{ "RengarEFinalMAX","RengerEEmpMis", "RengarEMis" },
-                CollisionObjects = new[] { CollisionObjectType.EnemyChampions, CollisionObjectType.EnemyMinions },
-
-            });
-
-            #endregion Rengar
-
-            #region Riven
-
-            Spells.Add(
-            new SpellData
-            {
-                Angle = 15,
-                CharName = "Riven",
-                Dangerlevel = SpellDangerLevel.Normal,
-                IsThreeWay = true,
-                Name = "WindSlash",
-                ProjectileSpeed = 1600,
-                Radius = 100,
-                Range = 1100,
-                SpellDelay = 250,
-                SpellKey = SpellSlot.R,
-                SpellName = "RivenIzunaBlade",
-                SpellType = SpellType.Line,
-                IsSpecial = true,
-                FixedRange = true,
-            });
-
-            Spells.Add(
-            new SpellData
-            {
-                CharName = "Riven",
-                Dangerlevel = SpellDangerLevel.Normal,
-                DefaultOff = true,
-                MissileName = "RivenMartyr",
-                Name = "RivenW",
-                ProjectileSpeed = 1500,
-                Radius = 280,
-                Range = 650,
-                SpellDelay = 0,
-                SpellKey = SpellSlot.W,
-                SpellName = "RivenMartyr",
-                SpellType = SpellType.Circular,
-
-            });
-            #endregion Riven
-
-            #region Rumble
-
-            Spells.Add(
-            new SpellData
-            {
-                CharName = "Rumble",
-                Dangerlevel = SpellDangerLevel.Low,
-                MissileName = "RumbleGrenadeMissile",
-                Name = "RumbleGrenade",
-                ProjectileSpeed = 2000,
-                Radius = 60,
-                Range = 950,
-                SpellDelay = 250,
-                SpellKey = SpellSlot.E,
-                SpellName = "RumbleGrenade",
-                SpellType = SpellType.Line,
-                CollisionObjects = new[] { CollisionObjectType.EnemyChampions, CollisionObjectType.EnemyMinions },
-                FixedRange = true,
-            });
-
-
-            Spells.Add(
-            new SpellData
-            {
-                charName = "Rumble",
-                Dangerlevel = SpellDangerLevel.Extreme,
-                MissileName = "RumbleCarpetBombMissile",
-                Name = "Carpet Bomb",
-                ProjectileSpeed = 1600,
-                Radius = 200,
-                Range = 1200,
-                SpellDelay = 0,
-                SpellKey = SpellSlot.R,
-                SpellName = "RumbleCarpetBomb",
-                SpellType = SpellType.Line,
-                UsePackets = true,
-                FixedRange = true,
-            });
-
-            #endregion Rumble
-
-            #region Ryze
-
-            Spells.Add(
-            new SpellData
-            {
-                CharName = "Ryze",
-                Dangerlevel = SpellDangerLevel.Normal,
-                MissileName = "RyzeQ",
-                Name = "RyzeQ",
-                ProjectileSpeed = 1700,
-                Radius = 60,
-                Range = 900,
-                SpellDelay = 250,
-                SpellKey = SpellSlot.Q,
-                SpellName = "RyzeQ",
-                SpellType = SpellType.Line,
-                CollisionObjects = new[] { CollisionObjectType.EnemyChampions, CollisionObjectType.EnemyMinions },
-                FixedRange = true,
-            });
-
-            #endregion Ryze
-
-            #region Sejuani
-            Spells.Add(
-            new SpellData
-            {
-                CharName = "Sejuani",
-                Dangerlevel = SpellDangerLevel.High,
-                Name = "Arctic Assault",
-                ProjectileSpeed = 1250,
-                Radius = 70,
-                Range = 850,
-                SpellDelay = 0,
-                SpellKey = SpellSlot.Q,
-                SpellName = "SejuaniArcticAssault",
-                SpellType = SpellType.Line,
-
-            });
-
-            Spells.Add(
-            new SpellData
-            {
-                CharName = "Sejuani",
-                Dangerlevel = SpellDangerLevel.Extreme,
-                MissileName = "SejuaniGlacialPrison",
-                Name = "SejuaniR",
-                ProjectileSpeed = 1600,
-                Radius = 110,
-                Range = 1200,
-                SpellDelay = 250,
-                SpellKey = SpellSlot.R,
-                SpellName = "SejuaniGlacialPrisonCast",
-                ExtraSpellNames = new [] { "SejuaniGlacialPrison" },
-                SpellType = SpellType.Line,
-
-            });
-            #endregion Sejuani
-
-            #region Shen
-
-            Spells.Add(
-            new SpellData
-            {
-                CharName = "Shen",
-                Dangerlevel = SpellDangerLevel.High,
-                MissileName = "ShenE",
-                Name = "ShadowDash",
-                ProjectileSpeed = 1450,
-                Radius = 50,
-                Range = 600,
-                SpellDelay = 0,
-                SpellKey = SpellSlot.E,
-                SpellName = "ShenE",
-                SpellType = SpellType.Line,
-
-            });
-
-            #endregion Shen
-
-            #region Shyvana
-
-            Spells.Add(
-            new SpellData
-            {
-                CharName = "Shyvana",
-                Dangerlevel = SpellDangerLevel.Low,
-                MissileName = "ShyvanaFireballMissile",
-                Name = "ShyvanaFireball",
-                ProjectileSpeed = 1700,
-                Radius = 60,
-                Range = 950,
-                SpellDelay = 250,
-                SpellKey = SpellSlot.E,
-                SpellName = "ShyvanaFireball",
-                SpellType = SpellType.Line,
-                FixedRange = true,
-
-            });
-
-            Spells.Add(
-            new SpellData
-            {
-                CharName = "Shyvana",
-                Dangerlevel = SpellDangerLevel.High,
-                IsThreeWay = true,
-                MissileName = "ShyvanaFireballDragonFxMissile",
-                Name = "Flame Breath Dragon",
-                ProjectileSpeed = 2000,
-                Radius = 70,
-                Range = 850,
-                SpellDelay = 250,
-                ExtraEndTime = 200,
-                SpellKey = SpellSlot.R,
-                SpellName = "shyvanafireballdragon2",
-                SpellType = SpellType.Line,
-
-            });
-
-            Spells.Add(
-            new SpellData
-            {
-                CharName = "Shyvana",
-                Dangerlevel = SpellDangerLevel.High,
-                MissileName = "ShyvanaTransformCast",
-                Name = "Dragon's Descent",
-                ProjectileSpeed = 1250,
-                Radius = 160,
-                Range = 1000,
-                SpellDelay = 250,
-                SpellKey = SpellSlot.R,
-                SpellName = "ShyvanaTransformCast",
-                SpellType = SpellType.Line,
-
-            });
-
-
-            #endregion Shyvana
-


Include URL in .players response when unable to retrieve player count


fixed issue with update alias-parameterized (broken tests:Can_execute_updateParam_using_aliased_columns)

--- src/ServiceStack.OrmLite/OrmLiteDialectProviderBase.cs
+++ src/ServiceStack.OrmLite/OrmLiteDialectProviderBase.cs
@@ -684,7 +684,7 @@
                     {
                         if (sqlFilter.Length > 0) sqlFilter.Append(" AND ");

-                        sqlFilter.AppendFormat("{0} = {1}", GetQuotedColumnName(fieldDef.FieldName), String.Concat(ParamString, fieldDef.Name));
+                        sqlFilter.AppendFormat("{0} = {1}", GetQuotedColumnName(fieldDef.FieldName), String.Concat(ParamString, fieldDef.FieldName));
                         AddParameterForFieldToCommand(command, fieldDef, objWithProperties);

                         continue;
@@ -692,7 +692,7 @@

                     if (updateFields.Count > 0 && !updateFields.Contains(fieldDef.Name)) continue;
                     if (sql.Length > 0) sql.Append(",");
-                    sql.AppendFormat("{0} = {1}", GetQuotedColumnName(fieldDef.FieldName), String.Concat(ParamString, fieldDef.Name));
+                    sql.AppendFormat("{0} = {1}", GetQuotedColumnName(fieldDef.FieldName), String.Concat(ParamString, fieldDef.FieldName));

                     AddParameterForFieldToCommand(command, fieldDef, objWithProperties);
                 }


Attempt to diagnose #AG351 by logging connection strings

--- Agiil.Data/Sqlite/ConnectionStringAdapter.cs
+++ Agiil.Data/Sqlite/ConnectionStringAdapter.cs
@@ -3,43 +3,36 @@

 namespace Agiil.Data.Sqlite
 {
-  public class ConnectionStringAdapter
-  {
-    const string DataFilePattern = @"Data Source=([^;]+)";
-    static readonly Regex DataFileMatcher = new Regex(DataFilePattern,
-                                                      RegexOptions.CultureInvariant
-                                                      | RegexOptions.IgnoreCase
-                                                      | RegexOptions.Compiled);
+    public class ConnectionStringAdapter
+    {
+        const string DataFilePattern = @"Data Source=([^;]+)";
+        static readonly Regex DataFileMatcher = new Regex(DataFilePattern,
+                                                          RegexOptions.CultureInvariant
+                                                          | RegexOptions.IgnoreCase
+                                                          | RegexOptions.Compiled);

-    readonly string connectionString;
+        public string ConnectionString { get; }

-    public string ConnectionString => connectionString;
+        public string GetDataFile()
+        {
+            var match = DataFileMatcher.Match(ConnectionString);
+            Console.WriteLine(ConnectionString);

-    public string GetDataFile()
-    {
-      var match = DataFileMatcher.Match(ConnectionString);
+            return match.Success ? match.Groups[1].Value : null;
+        }

-      if(!match.Success)
-        return null;
+        public ConnectionStringAdapter(string connectionString)
+        {
+            ConnectionString = connectionString ?? throw new ArgumentNullException(nameof(connectionString));
+        }

-      return match.Groups[1].Value;
+        public static ConnectionStringAdapter Create(IConnectionStringProvider connectionStringProvider)
+        {
+            if(connectionStringProvider == null)
+                throw new ArgumentNullException(nameof(connectionStringProvider));
+
+            var connString = connectionStringProvider.GetConnectionString();
+            return new ConnectionStringAdapter(connString);
+        }
     }
-
-    public ConnectionStringAdapter(string connectionString)
-    {
-      if(connectionString == null)
-        throw new ArgumentNullException(nameof(connectionString));
-
-      this.connectionString = connectionString;
-    }
-
-    public static ConnectionStringAdapter Create(IConnectionStringProvider connectionStringProvider)
-    {
-      if(connectionStringProvider == null)
-        throw new ArgumentNullException(nameof(connectionStringProvider));
-
-      var connString = connectionStringProvider.GetConnectionString();
-      return new ConnectionStringAdapter(connString);
-    }
-  }
 }


Removed no longer applicable comment

Removed no longer applicable comment


Add test for constructor

Add test for constructor

--- AngleSharp.Io.Tests/Network/ResponseTests.cs
+++ AngleSharp.Io.Tests/Network/ResponseTests.cs
@@ -1,7 +1,9 @@
 namespace AngleSharp.Io.Tests.Network
 {
     using System;
+    using System.Collections.Generic;
     using System.IO;
+    using System.Net;
     using AngleSharp.Io.Network;
     using FluentAssertions;
     using NUnit.Framework;
@@ -10,17 +12,40 @@
     public class ResponseTests
     {
         [Test]
-        public void DisposesContent()
+        public void Initialize()
+        {
+            // ARRANGE, ACT
+            var response = new Response();
+
+            // ASSERT
+            response.Content.Should().BeNull();
+            response.StatusCode.Should().Be(HttpStatusCode.Accepted);
+            response.Headers.Should().NotBeNull();
+            response.Headers.Should().BeEmpty();
+            response.Address.Should().BeNull();
+        }
+
+        [Test]
+        public void DisposesContentAndHeaders()
         {
             // ARRANGE
             var stream = new DisposableStream();
-            var response = new Response {Content = stream};
+            var response = new Response
+            {
+                Content = stream,
+                Headers = new Dictionary<String, String>
+                {
+                    {"Server", "Fake"},
+                    {"X-Foo", "Bar"}
+                }
+            };

             // ACT
             response.Dispose();

             // ASSERT
             stream.Disposed.Should().BeTrue();
+            response.Headers.Should().BeEmpty();
         }

         [Test]
@@ -35,6 +60,7 @@
             // ASSERT
             action.ShouldNotThrow();
         }
+
         class DisposableStream : Stream
         {
             public override Boolean CanRead


Integrated (statically) into overview page

--- AngleSharp.TestSite/Views/Tests/Index.cshtml
+++ AngleSharp.TestSite/Views/Tests/Index.cshtml
@@ -2,13 +2,17 @@
 @using System.Reflection
 @{
     ViewBag.Title = "Index";
+    var Methods = typeof(TestsController).
+        GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly).
+        Where(m => m.GetCustomAttribute<HttpGetAttribute>() != null);
 }

Available test pages

-    @foreach (var method in typeof(TestsController).GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly).Where(m => m.GetCustomAttribute<HttpGetAttribute>() != null))
-    {
-
@method.Name

-    }
+@foreach (var method in Methods)
+{
+
@method.Name

+}
+
@Html.ActionLink("ResourceTestPage", "Index", "Page")


Cosmetics

Cosmetics

--- src/Tests/Kephas.Core.Tests/Dynamic/ExpandoBaseTest.cs
+++ src/Tests/Kephas.Core.Tests/Dynamic/ExpandoBaseTest.cs
@@ -12,7 +12,7 @@
 {
     using System;
     using System.Collections.Generic;
-    using System.Linq;
+    using System.Linq;

     using Kephas.Dynamic;
     using NUnit.Framework;


Post-review

Post-review

--- ApiExamples/CSharp/ApiExamples/ExDocument.cs
+++ ApiExamples/CSharp/ApiExamples/ExDocument.cs
@@ -2246,8 +2246,8 @@
             doc.StartTrackRevisions("John Doe", DateTime.Now);
             builder.Write("This is revision #1. ");

-            // This flag corresponds to the "Track Changes" option being turned on in Microsoft Word,
-            // not the programmatic tracking we are doing here
+            // This flag corresponds to the "Track Changes" option being turned on in Microsoft Word, to track the editing manually
+            // done there and not the programmatic changes we are about to do here
             Assert.IsFalse(doc.TrackRevisions);

             // As well as nodes in the document, revisions get referenced in this collection
@@ -2267,19 +2267,26 @@
             Assert.AreEqual(RevisionType.Deletion, doc.Revisions[0].RevisionType);
             Assert.AreEqual(2, doc.Revisions.Count);

-            // INSP: I think we need to check that elements in the document also changed or not, not only 'revisions count'
+            // Insert revisions are treated as document text by the GetText() method before they are accepted,
+            // since they are still nodes with text and are in the body
+            Assert.AreEqual("This does not count as a revision. This is revision #1.", doc.GetText().Trim());
+
             // Accepting the deletion revision will assimilate it into the paragraph text and remove it from the collection
             doc.Revisions[0].Accept();
             Assert.AreEqual(1, doc.Revisions.Count);

-            // The second insertion revision is now at index 0, which we can reject to ignore it
+            // Once the delete revision is accepted, the nodes that it concerns are removed and their text will not show up here
+            Assert.AreEqual("This is revision #1.", doc.GetText().Trim());
+
+            // The second insertion revision is now at index 0, which we can reject to ignore and discard it
             doc.Revisions[0].Reject();
             Assert.AreEqual(0, doc.Revisions.Count);
+            Assert.AreEqual("", doc.GetText().Trim());

             // This takes us back to not counting changes as revisions
             doc.StopTrackRevisions();

-            builder.Writeln("This also does not count as a revision. ");
+            builder.Writeln("This also does not count as a revision.");
             Assert.AreEqual(0, doc.Revisions.Count);

             doc.Save(ArtifactsDir + "Document.Revisions.docx");


Adds some logic if we get 0 results back and the search expression contains no spaces (we retry with a message like filter) Moves some of the logic into methods - as we end up reusing it

--- src/Umbraco.Core/Logging/Viewer/LogViewerSourceBase.cs
+++ src/Umbraco.Core/Logging/Viewer/LogViewerSourceBase.cs
@@ -54,30 +54,43 @@
             string[] logLevels = null)
         {
             //Get all logs into memory (Not sure this good or not)
-            var logs = GetAllLogs(startDate, endDate);
+            var allLogs = GetAllLogs(startDate, endDate);
+            var logs = allLogs;

             //If we have a filter expression, apply it
             if (string.IsNullOrEmpty(filterExpression) == false)
             {
                 Func<LogEvent, bool> filter = null;
-
+
                 // If the expression evaluates then make it into a filter
                 if (FilterLanguage.TryCreateFilter(filterExpression, out Func<LogEvent, object> eval, out string error))
                 {
                     filter = evt => true.Equals(eval(evt));
                 }
-                else // assume the expression was a search string and make a Like filter from that
+                else
                 {
-                    var filterSearch = $"@Message like '%{FilterLanguage.EscapeLikeExpressionContent(filterExpression)}%'";
-                    if (FilterLanguage.TryCreateFilter(filterSearch, out eval, out error))
-                    {
-                        filter = evt => true.Equals(eval(evt));
-                    }
+                    //Assume the expression was a search string and make a Like filter from that
+                    filter = PerformMessageLikeFilter(filterExpression);
                 }
-
-                if (filter != null)
+
+                //Go and filter the logs
+                //May be with a valid expression (could be single word & return no results)
+                //Failed expression so we try @Message like
+                logs = FilterLogs(logs, filter);
+
+                //If logs now has a count of 0 AND filterExpression contains no spaces
+                //We can assume a single word search (Which would PASS creating a filter above)
+                if (logs.Count() == 0 && filterExpression.Contains(" ") == false)
                 {
-                    logs = logs.Where(filter);
+                    //Reset logs & filter
+                    logs = allLogs;
+                    filter = null;
+
+                    //Do an expression using message like
+                    filter = PerformMessageLikeFilter(filterExpression);
+
+                    //Filter the logs again with the single word
+                    logs = FilterLogs(logs, filter);
                 }
             }

@@ -116,5 +129,26 @@
                 Items = logMessages
             };
         }
+
+        private Func<LogEvent, bool> PerformMessageLikeFilter(string filterExpression)
+        {
+            var filterSearch = $"@Message like '%{FilterLanguage.EscapeLikeExpressionContent(filterExpression)}%'";
+            if (FilterLanguage.TryCreateFilter(filterSearch, out var eval, out var error))
+            {
+                return evt => true.Equals(eval(evt));
+            }
+
+            return null;
+        }
+
+        private IEnumerable<LogEvent> FilterLogs(IEnumerable<LogEvent> logs, Func<LogEvent, bool> filter)
+        {
+            if (filter != null)
+            {
+                logs = logs.Where(filter);
+            }
+
+            return logs;
+        }
     }
 }


Fixed NullReferenceException with nameText in SayDialog #517

--- Assets/Fungus/Narrative/Scripts/SayDialog.cs
+++ Assets/Fungus/Narrative/Scripts/SayDialog.cs
@@ -136,7 +136,7 @@
             // Start method of another component, so check that no image has been set yet.
             // Same for nameText.

-            if (nameText.text == "")
+            if (nameText != null && nameText.text == "")
             {
                 SetCharacterName("", Color.white);
             }


Refactor

Refactor

--- Assets/Scripts/UI/RangeSelectionPresenter.cs
+++ Assets/Scripts/UI/RangeSelectionPresenter.cs
@@ -24,7 +24,7 @@
                 .Where(_ => model.IsMouseOverNotesRegion.Value)
                 .Select(_ => model.ScreenToCanvasPosition(Input.mousePosition))
                 .Select(currentPos => new Rect(startPos, currentPos - startPos)))
-            .Do(rect => SelectNotesWithinRect(rect))
+            .Do(rect => SelectNotesWithin(rect))
             .Subscribe(rect => GLLineRenderer.RenderLines("selectionRect", ToLines(rect, Color.magenta)));

@@ -45,23 +45,17 @@
                 .OnNext(selectedNote.notePosition));
     }

-    void SelectNotesWithinRect(Rect rect)
+    void SelectNotesWithin(Rect rect)
     {
-        Deselect();
-        var notesWithinRect = model.NoteObjects.Values
-            .Where(noteObject => rect.Contains(noteObject.rectTransform.localPosition, true));
-
-        foreach (var note in notesWithinRect)
+        foreach (var note in model.NoteObjects.Values)
         {
-            note.isSelected.Value = true;
+            note.isSelected.Value = rect.Contains(note.rectTransform.localPosition, true);
         }
     }

     void Deselect()
     {
-        var selectedNotes = model.NoteObjects.Values.Where(noteObject => noteObject.isSelected.Value);
-
-        foreach (var note in selectedNotes)
+        foreach (var note in model.NoteObjects.Values)
         {
             note.isSelected.Value = false;
         }


Fix dispose method

Fix dispose method

Disposing threw an exception if class construction failed, e.g. if the FFmpeg proxy dependency wasn't in its place and could not be found.

--- AudioAlign/AudioAlign.FFmpeg/FFmpegReader.cs
+++ AudioAlign/AudioAlign.FFmpeg/FFmpegReader.cs
@@ -57,8 +57,10 @@

                 // There are no unmanaged resources to release, but
                 // if we add them, they need to be released here.
-                interop.stream_close(instance);
-                instance = IntPtr.Zero;
+                if (instance != IntPtr.Zero) {
+                    interop.stream_close(instance);
+                    instance = IntPtr.Zero;
+                }
             }
             disposed = true;


Added PostAvatarText Property.

Added PostAvatarText Property.

--- AwfulNET.Core/Metadata/ThreadPostMetadata.cs
+++ AwfulNET.Core/Metadata/ThreadPostMetadata.cs
@@ -14,6 +14,8 @@

         [DataMember]
         public DateTime PostDate { get; set; }
+        [DataMember]
+        public string PostAvatarText { get; set; }
         [DataMember]
         public Uri PostIconUri { get; set; }
         [DataMember]


Show pretty wallet string in Update Store

--- BTCPayServer/Controllers/StoresController.cs
+++ BTCPayServer/Controllers/StoresController.cs
@@ -478,7 +478,7 @@
                 vm.DerivationSchemes.Add(new StoreViewModel.DerivationScheme()
                 {
                     Crypto = network.CryptoCode,
-                    Value = strategy?.AccountDerivation?.ToString() ?? string.Empty,
+                    Value = strategy?.ToPrettyString() ?? string.Empty,
                     WalletId = new WalletId(store.Id, network.CryptoCode),
                     Enabled = !excludeFilters.Match(new Payments.PaymentMethodId(network.CryptoCode, Payments.PaymentTypes.BTCLike))
                 });


Toxy now implements bootstrap_from_address

(still needs a list of nodes)

--- Toxy/Forms/frmMain.cs
+++ Toxy/Forms/frmMain.cs
@@ -31,6 +31,9 @@
                 }
             }

+            if (!tox.BootstrapFromAddress("192.184.81.118", 33445, "5CD7EB176C19A2FD840406CD56177BB8E75587BB366F7BB3004B19E3EDC04143", false))
+                MessageBox.Show("Could not \"bootstrap from address\", tell Imperative to update Toxy with a list of nodes to iterate through");
+
             tox.Start();

             ID = tox.GetAddress();


Properly insert Comparison Generators

Properly insert Comparison Generators

SRL comparisons cause us to have to insert at the front of the list

--- LiveSplit/LiveSplit.View/View/TimerForm.cs
+++ LiveSplit/LiveSplit.View/View/TimerForm.cs
@@ -2461,12 +2461,12 @@
         private void SwitchComparisonGenerators()
         {
             var allGenerators = new StandardComparisonGeneratorsFactory().GetAllGenerators(CurrentState.Run);
-            foreach (var generator in Settings.ComparisonGeneratorStates)
+            foreach (var generator in Settings.ComparisonGeneratorStates.Reverse())
             {
                 if (CurrentState.Run.ComparisonGenerators.Any(x => x.Name == generator.Key))
                     CurrentState.Run.ComparisonGenerators.Remove(CurrentState.Run.ComparisonGenerators.First(x => x.Name == generator.Key));
                 if (generator.Value == true)
-                    CurrentState.Run.ComparisonGenerators.Add(allGenerators.First(x => x.Name == generator.Key));
+                    CurrentState.Run.ComparisonGenerators.Insert(0, allGenerators.First(x => x.Name == generator.Key));
             }
             RegenerateComparisons();
         }


Calculate Overall Size after Rendering

Calculate Overall Size after Rendering

This ensures that the Title gets resized properly if the font size
changes.

--- LiveSplit/LiveSplit.View/View/TimerForm.cs
+++ LiveSplit/LiveSplit.View/View/TimerForm.cs
@@ -274,6 +274,7 @@
             }

             TopMost = Layout.Settings.AlwaysOnTop;
+            BackColor = Color.Black;

             Server = new CommandServer(CurrentState);
             Server.Start();
@@ -1214,9 +1215,8 @@
             else
                 transformedHeight /= scaleFactor;

-            BackColor = Color.Black;
-
             ComponentRenderer.Render(g, CurrentState, transformedWidth, transformedHeight, Layout.Mode, UpdateRegion);
+            ComponentRenderer.CalculateOverallSize(Layout.Mode);

             KeepLayoutSize();
         }


can now drink from the pool

can now drink from the pool

--- MIMWebClient/Core/World/Tutorial/Ambush.cs
+++ MIMWebClient/Core/World/Tutorial/Ambush.cs
@@ -723,7 +723,7 @@
                 Area = "Tutorial",
                 AreaId = 5
             };
-            room.mobs.Add(goblin);
+
             goblin.Gold = 10;

@@ -911,6 +911,26 @@

             };

+            var pool = new Item.Item()
+            {
+                name = "pool of water",
+                isHiddenInRoom = true,
+                waterContainer = true,
+                waterContainerAmount = 999,
+                waterContainerLiquid = "fresh water",
+                waterContainerMaxAmount = 999,
+                stuck = true,
+                type = Item.Item.ItemType.Drink,
+                location = Item.Item.ItemLocation.Room,
+                description = new Description()
+                {
+                    look = "The cool water gently ripples as you look into the pool. What do you see?
",
+                    exam = "The cool water gently ripples as you look into the pool. What do you see?
"
+                }
+            };
+
+            room.items.Add(pool);
+

             var north = new Exit


removed unnecessary commented code

removed unnecessary commented code

--- src/Abp.Dapper/Dapper/AbpDapperModule.cs
+++ src/Abp.Dapper/Dapper/AbpDapperModule.cs
@@ -35,16 +35,6 @@
         {
             IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());

-            //IocManager.Register<IDapperQueryFilter, MayHaveTenantDapperQueryFilter>(DependencyLifeStyle.Transient);
-            //IocManager.Register<IDapperQueryFilter, MustHaveTenantDapperQueryFilter>(DependencyLifeStyle.Transient);
-            //IocManager.Register<IDapperQueryFilter, SoftDeleteDapperQueryFilter>(DependencyLifeStyle.Transient);
-            //IocManager.Register<IDapperQueryFilterExecuter, DapperQueryFilterExecuter>(DependencyLifeStyle.Transient);
-
-            //IocManager.Register<IDapperActionFilter, CreationAuditDapperActionFilter>(DependencyLifeStyle.Transient);
-            //IocManager.Register<IDapperActionFilter, ModificationAuditDapperActionFilter>(DependencyLifeStyle.Transient);
-            //IocManager.Register<IDapperActionFilter, DeletionAuditDapperActionFilter>(DependencyLifeStyle.Transient);
-            //IocManager.Register<IDapperActionFilterExecuter, DapperActionFilterExecuter>(DependencyLifeStyle.Transient);
-
             RegisterDapperGenericRepositories();
         }


Border the table at least

Border the table at least


Check returned value is null when no worksheet was found.

--- ClosedXML/ClosedXML/ClosedXML/Excel/XLWorkbook_Load.cs
+++ ClosedXML/ClosedXML/ClosedXML/Excel/XLWorkbook_Load.cs
@@ -704,8 +704,11 @@
                         if (area.Contains("["))
                         {
                             String tableName = area.Substring(0, area.IndexOf("["));
-                            var ws = Worksheets.First(w => (w as XLWorksheet).SheetId == definedName.LocalSheetId + 1);
-                            ws.PageSetup.PrintAreas.Add(area);
+                            var ws = Worksheets.FirstOrDefault(w => (w as XLWorksheet).SheetId == definedName.LocalSheetId + 1);
+                            if (ws != null)
+                            {
+                                ws.PageSetup.PrintAreas.Add(area);
+                            }
                         }
                         else
                         {


Update sync info

Update sync info

--- 3DSRNGTool/Gen6/PKM6.cs
+++ 3DSRNGTool/Gen6/PKM6.cs
@@ -9,7 +9,7 @@

         public bool Bank; // Bank = PokemonLink or Transporter
         public byte NumOfPkm = 1;
-        public bool InstantSync => Delay == 0; // To-do
+        public bool InstantSync;
         private bool _ShinyLocked;

         public readonly static PokemonList Default = new PokemonList
@@ -32,12 +32,12 @@
                     new PKM6 { Species = 380, Level = 30, Version = GameVersion.AS, Ability = 1, Gift = true, }, // Latias
                     new PKM6 { Species = 381, Level = 30, Version = GameVersion.OR, Ability = 1, Gift = true, }, // Latios

-                    new PKM6 { Species = 381, Level = 30, Version = GameVersion.AS, }, // Latios
-                    new PKM6 { Species = 380, Level = 30, Version = GameVersion.OR, }, // Latias
+                    new PKM6 { Species = 381, Level = 30, Version = GameVersion.AS, InstantSync = true, }, // Latios
+                    new PKM6 { Species = 380, Level = 30, Version = GameVersion.OR, InstantSync = true, }, // Latias

                     new PKM6 { Species = 382, Level = 45, ShinyLocked = true, Version = GameVersion.AS, Delay = 3300, Unstable= true, }, // Kyogre
                     new PKM6 { Species = 383, Level = 45, ShinyLocked = true, Version = GameVersion.OR, Delay = 3300, Unstable= true, }, // Groudon
-                    new PKM6 { Species = 384, Level = 70, ShinyLocked = true, }, // Rayquaza
+                    new PKM6 { Species = 384, Level = 70, ShinyLocked = true, InstantSync = true, }, // Rayquaza
                     new PKM6 { Species = 386, Level = 80, ShinyLocked = true, Delay = 300, }, // Deoxys

                     new PKM6 { Species = 377, Level = 40, Delay = 158, }, // Regirock
@@ -123,11 +123,11 @@
                 Text = "Normal Stationary",
                 List = new[]
                 {
-                    new PKM6 { Species = 352, Level = 30, }, // Kecleon @ Route 120
-                    new PKM6 { Species = 352, Level = 40, Gender = 2,}, // Kecleon @ Lavaridge
-                    new PKM6 { Species = 352, Level = 45, Ability = 4, }, // Kecleon @ Mossdeeps
-                    new PKM6 { Species = 101, Level = 40, Delay = 122, }, // Electrode @ Magma Hideout, Aqua Hideout
-                    new PKM6 { Species = 100, Level = 20, Delay = 120, }, // Voltorb @ Route 119
+                    new PKM6 { Species = 352, Level = 30, InstantSync = true, }, // Kecleon @ Route 120
+                    new PKM6 { Species = 352, Level = 40, Gender = 2, InstantSync = true,}, // Kecleon @ Lavaridge
+                    new PKM6 { Species = 352, Level = 45, Ability = 4, InstantSync = true, }, // Kecleon @ Mossdeeps
+                    new PKM6 { Species = 101, Level = 40, Delay = 122, InstantSync = true, }, // Electrode @ Magma Hideout, Aqua Hideout
+                    new PKM6 { Species = 100, Level = 20, Delay = 120, InstantSync = true, }, // Voltorb @ Route 119
                     new PKM6 { Species = 442, Level = 50, }, // Spiritomb @ Route 120
                     new PKM6 { Species = 265, Level = 03, Delay = 14, ShinyLocked = true, }, // Wurmple
                     new PKM6 { Species = 261, Level = 05, Delay = 8, }, // Poochyena (DexNav)


fixes smartequalizer get entity

fixes smartequalizer get entity

--- Signum.Engine/Linq/ExpressionVisitor/SmartEqualizer.cs
+++ Signum.Engine/Linq/ExpressionVisitor/SmartEqualizer.cs
@@ -610,19 +610,22 @@

             return null;
         }
-
-        private static Expression GetEntity(Expression exp)
-        {
-            exp = ConstantToLite(exp) ?? exp;
-
-            if (exp.IsNull())
-                return Expression.Constant(null, exp.Type.CleanType());
-
-            var liteExp = exp as LiteReferenceExpression;
-            if (liteExp == null)
-                throw new InvalidCastException("Impossible to convert expression to Lite: {0}".FormatWith(exp.ToString()));
-
-            return liteExp.Reference;
+
+        private static Expression GetEntity(Expression liteExp)
+        {
+            liteExp = ConstantToLite(liteExp) ?? liteExp;
+
+            if (liteExp.IsNull())
+                return Expression.Constant(null, liteExp.Type.CleanType());
+
+            if (liteExp is UnaryExpression ue && (ue.NodeType == ExpressionType.Convert || ue.NodeType == ExpressionType.ConvertChecked))
+                liteExp = ue.Operand;
+
+            var liteReference = liteExp as LiteReferenceExpression;
+            if (liteReference == null)
+                throw new InvalidCastException("Impossible to convert expression to Lite: {0}".FormatWith(liteExp.ToString()));
+
+            return liteReference.Reference;
         }

         public static Expression EntityEquals(Expression e1, Expression e2)


Fixed an issue when changing the center frequency too far

git-svn-id: 6b7e1e5d0861e268462ba7828ef63c1bcab52a9b@318 d3cde5d6-82b8-4669-8b62-43054d6781d8

--- SDRSharp/MainForm.cs
+++ SDRSharp/MainForm.cs
@@ -660,9 +660,11 @@
             waterfall.CenterFrequency = newCenterFreq;
             spectrumAnalyzer.CenterFrequency = newCenterFreq;

+            frequencyNumericUpDown.Maximum = decimal.MaxValue;
+            frequencyNumericUpDown.Minimum = decimal.MinValue;
+            frequencyNumericUpDown.Value = newCenterFreq + _vfo.Frequency;
             frequencyNumericUpDown.Maximum = newCenterFreq + (int) (_vfo.SampleRate / 2);
             frequencyNumericUpDown.Minimum = newCenterFreq - (int) (_vfo.SampleRate / 2);
-            frequencyNumericUpDown.Value = newCenterFreq + _vfo.Frequency;

             if (_frontendController != null && iqStreamRadioButton.Checked && !_extioChangingFrequency)
             {


Collect "Related Game Community" lists

Collect "Related Game Community" lists

--- MiiverseArchive/Context/MiiverseContext.cs
+++ MiiverseArchive/Context/MiiverseContext.cs
@@ -254,6 +254,84 @@
             }
         }

+        public async Task<RelatedCommunityListResponse> GetRelatedCommunityGameListAsync(string gameid)
+        {
+            AccessCheck();
+            var trueGameId = gameid.Replace("community-", "");
+            var baseUrl = $"https://miiverse.nintendo.net/titles/{trueGameId}";
+
+            var req = new HttpRequestMessage(HttpMethod.Get, baseUrl);
+            req.Headers.Add("X-Requested-With", "XMLHttpRequest");
+            using (var result = await Client.SendAsync(req))
+            using (var content = await result.Content.ReadAsStreamAsync())
+            {
+                var doc = new HtmlDocument();
+                doc.Load(content, System.Text.Encoding.UTF8);
+                var gameListNode =
+                    doc.DocumentNode.Descendants("ul")
+                        .FirstOrDefault(
+                            node =>
+                                node.GetAttributeValue("class", string.Empty).Contains("list community-list"));
+                if (gameListNode == null)
+                {
+                    return new RelatedCommunityListResponse(null);
+                }
+
+                var gamesList = gameListNode.Descendants("li");
+                var output = new List<CommunityItem>();
+                foreach (var game in gamesList)
+                {
+                    var id = game.GetAttributeValue("id", string.Empty);
+                    var titleUrl = game.GetAttributeValue("data-href", string.Empty);
+
+                    var communityIconImageNode = game.Descendants("img").FirstOrDefault(n => n.GetAttributeValue("class", string.Empty) == "community-list-cover");
+                    var communityListIcon = communityIconImageNode?.GetAttributeValue("src", string.Empty);
+
+                    var iconImg = game.Descendants("img").FirstOrDefault(n => n.GetAttributeValue("class", string.Empty) == "icon");
+                    var icon = iconImg?.GetAttributeValue("src", string.Empty);
+
+                    var body =
+                        game.Descendants("div")
+                            .FirstOrDefault(node => node.GetAttributeValue("class", string.Empty) == "body");
+
+                    var titleNode =
+                        body.Descendants("a")
+                            .FirstOrDefault(node => node.GetAttributeValue("class", string.Empty) == "title");
+                    var title = titleNode?.InnerText;
+
+                    var imageNode = body.Descendants("img").FirstOrDefault();
+                    var image = imageNode?.GetAttributeValue("src", string.Empty);
+                    var imageFilename = string.Empty;
+                    if (!string.IsNullOrEmpty(image))
+                    {
+                        var uri = new Uri(image);
+                        imageFilename = System.IO.Path.GetFileName(uri.LocalPath).Split('?').FirstOrDefault();
+                    }
+
+                    var communityBadgeNode = game.Descendants("span").FirstOrDefault(n => n.GetAttributeValue("class", string.Empty) == "news-community-badge");
+                    var communityBadge = "";
+                    if (communityBadgeNode != null)
+                        communityBadge = communityBadgeNode.InnerText;
+
+                    var gameTextSpan = body.Descendants("span").LastOrDefault();
+                    var gameText = gameTextSpan.InnerText;
+
+                    var fullGameId = $"community-{trueGameId}-{id.Replace("community-", "")}";
+
+                    if (string.IsNullOrEmpty(communityListIcon))
+                    {
+                        output.Add(new CommunityItem(fullGameId, trueGameId, communityBadge, title, titleUrl, new Uri(icon), imageFilename, gameText));
+                    }
+                    else
+                    {
+                        output.Add(new CommunityItem(fullGameId, trueGameId, communityBadge, title, titleUrl, new Uri(icon), new Uri(communityListIcon), imageFilename, gameText));
+                    }
+                }
+                return new RelatedCommunityListResponse(output);
+            }
+
+        }
+
         public async Task<CommunityListResponse> GetCommunityGameListAsync(GameSearchList searchOption, GamePlatformSearch platformSearch, int offset)
         {
             AccessCheck();
@@ -781,7 +859,6 @@

             if (isImagePost)
             {
-                Console.WriteLine("Image post");
                 return new Post(
                     id,
                     accept,


Don't make soft debugger breakpoint requests in the GUI thread

--- Mono.Debugging.Soft/SoftDebuggerSession.cs
+++ Mono.Debugging.Soft/SoftDebuggerSession.cs
@@ -918,15 +918,22 @@
 		void InsertBreakpoint (Breakpoint bp, BreakInfo bi)
 		{
 			EventRequest request;
-
-			request = vm.SetBreakpoint (bi.Location.Method, bi.Location.ILOffset);
-			request.Enabled = bp.Enabled;
+
+			request = vm.CreateBreakpointRequest (bi.Location.Method, bi.Location.ILOffset);
 			bi.Requests.Add (request);
-
 			breakpoints[request] = bi;
-
+
 			if (bi.Location.LineNumber != bp.Line || bi.Location.ColumnNumber != bp.Column)
 				bi.AdjustBreakpointLocation (bi.Location.LineNumber, bi.Location.ColumnNumber);
+
+			ThreadPool.QueueUserWorkItem (delegate {
+				try {
+					request.Enabled = bp.Enabled;
+				} catch (Exception ex) {
+					OnDebuggerOutput (true, string.Format ("Breakpoint request failed: {0}", ex.Message));
+					LoggingService.LogError ("Breakpoint request failed", ex);
+				}
+			});
 		}

 		void InsertCatchpoint (Catchpoint cp, BreakInfo bi, TypeMirror excType)


Wrong quotation marks.

Wrong quotation marks.

--- Mono.Debugging.Soft/SoftDebuggerSession.cs
+++ Mono.Debugging.Soft/SoftDebuggerSession.cs
@@ -1265,7 +1265,7 @@
 								ProcessType (t);
 						}
 						catch (CommandException exc) {
-							OnDebuggerOutput (false, string.Format (“Error while parsing type ‘{0}’.\n”, exceptionType);
+							OnDebuggerOutput (false, string.Format ("Error while parsing type ‘{0}’.\n", exceptionType));
 						}
 					}
 				}


Subscribe on BusyStateChanged

Subscribe on BusyStateChanged

(cherry picked from commit 1eadfcc)

--- Mono.Debugging.Win32/CorDebuggerSession.cs
+++ Mono.Debugging.Win32/CorDebuggerSession.cs
@@ -77,6 +77,7 @@
 		public CorDebuggerSession(char[] badPathChars)
 		{
 			this.badPathChars = badPathChars;
+			ObjectAdapter.BusyStateChanged += (sender, e) => SetBusyState (e);
 			var cancellationToken = helperOperationsCancellationTokenSource.Token;
 			new Thread (() => {
 				try {


Ldelema test

Ldelema test

--- UnitTests/CilTests.cs
+++ UnitTests/CilTests.cs
@@ -493,6 +493,21 @@
         }

         [TestMethod]
+        public void TestLdelema()
+        {
+            TestStruct[] a = new TestStruct[1];
+            TestStruct b = new TestStruct() { A = 1, B = 2 };
+
+            Silk.Cil.Load(a);
+            Silk.Cil.Load(0);
+            Silk.Cil.Ldelema<TestStruct>();
+            Silk.Cil.Load(b);
+            Silk.Cil.Stobj<TestStruct>();
+
+            Assert.AreEqual(a[0], b);
+        }
+
+        [TestMethod]
         public void TestStelem()
         {
             byte[] a = new byte[1];


updated messages

updated messages

--- SharpNose/Program.cs
+++ SharpNose/Program.cs
@@ -34,7 +34,9 @@
             		ShowHelp();
             		break;
             }
-
+
+            Console.WriteLine("Goto www.Typemock.com to learn more about unit testing and TDD");
+
             return result;
         }

@@ -46,7 +48,6 @@
             Console.WriteLine("To configure the path to NUnit use:");
             Console.WriteLine("SharpNose -config");
             Console.WriteLine();
-            Console.WriteLine("Goto www.Typemock.com to learn more about unit tests and TDD");
         }

         private static bool ConfigSystem()


Adjusted the default jitter buffer size

Adjusted the default jitter buffer size

--- SharpTox/Av/ToxAv.cs
+++ SharpTox/Av/ToxAv.cs
@@ -115,7 +115,7 @@
             audio_channels = 1,
             audio_VAD_tolerance = 600,

-            jbuf_capacity = 6
+            jbuf_capacity = 2
         };

         private IntPtr toxav;


Align test class name with file name

Align test class name with file name

--- A1.Tests/ColRowTests.cs
+++ A1.Tests/ColRowTests.cs
@@ -18,7 +18,7 @@
 {
     using Xunit;

-    public class ColRowTest
+    public class ColRowTests
     {
         [Fact]
         public void InitEmpty()


Added a comment.

Added a comment.

--- NoRM/Collections/MongoCollectionGeneric.cs
+++ NoRM/Collections/MongoCollectionGeneric.cs
@@ -446,8 +446,10 @@
             dm.Execute();
         }

-        /// <summary>TODO::Description.</summary>
-        public void Delete(T entity)
+        /// <summary>
+        /// Deletes the specified document based on it's Id property.
+        /// </summary>
+        public void Delete(T document)
         {
             var helper = TypeHelper.GetHelperForType(typeof(T));
             var idProperty = helper.FindIdProperty();
@@ -455,7 +457,7 @@
             {
                 throw new MongoException(string.Format("Cannot delete {0} since it has no id property", typeof(T).FullName));
             }
-            Delete(new { Id = idProperty.Getter(entity) });
+            Delete(new { Id = idProperty.Getter(document) });
         }

         /// <summary>


fix path to icons was incorrect

fix path to icons was incorrect

--- CSHARP/CodeCompletion/AsmCompletionSource.cs
+++ CSHARP/CodeCompletion/AsmCompletionSource.cs
@@ -121,28 +121,28 @@
             Uri uri = null;
             string installPath = AsmDudeToolsStatic.getInstallPath();
             try {
-                uri = new Uri(installPath + "images/icon-R-blue.png");
+                uri = new Uri(installPath + "Resources/images/icon-R-blue.png");
                 this._icons[AsmTokenTypes.Register] = AsmDudeToolsStatic.bitmapFromUri(uri);
             } catch (FileNotFoundException) {
-                MessageBox.Show("ERROR: AsmCompletionSource: could not find file \"" + uri.AbsolutePath + "\".");
-            }
-            try {
-                uri = new Uri(installPath + "images/icon-M.png");
+                //MessageBox.Show("ERROR: AsmCompletionSource: could not find file \"" + uri.AbsolutePath + "\".");
+            }
+            try {
+                uri = new Uri(installPath + "Resources/images/icon-M.png");
                 this._icons[AsmTokenTypes.Mnemonic] = AsmDudeToolsStatic.bitmapFromUri(uri);
             } catch (FileNotFoundException) {
-                MessageBox.Show("ERROR: AsmCompletionSource: could not find file \"" + uri.AbsolutePath + "\".");
-            }
-            try {
-                uri = new Uri(installPath + "images/icon-question.png");
+                //MessageBox.Show("ERROR: AsmCompletionSource: could not find file \"" + uri.AbsolutePath + "\".");
+            }
+            try {
+                uri = new Uri(installPath + "Resources/images/icon-question.png");
                 this._icons[AsmTokenTypes.Misc] = AsmDudeToolsStatic.bitmapFromUri(uri);
             } catch (FileNotFoundException) {
-                MessageBox.Show("ERROR: AsmCompletionSource: could not find file \"" + uri.AbsolutePath + "\".");
-            }
-            try {
-                uri = new Uri(installPath + "images/icon-L.png");
+                //MessageBox.Show("ERROR: AsmCompletionSource: could not find file \"" + uri.AbsolutePath + "\".");
+            }
+            try {
+                uri = new Uri(installPath + "Resources/images/icon-L.png");
                 this._icons[AsmTokenTypes.Label] = AsmDudeToolsStatic.bitmapFromUri(uri);
             } catch (FileNotFoundException) {
-                MessageBox.Show("ERROR: AsmCompletionSource: could not find file \"" + uri.AbsolutePath + "\".");
+                //MessageBox.Show("ERROR: AsmCompletionSource: could not find file \"" + uri.AbsolutePath + "\".");
             }
             #endregion
         }


cleaned up output of reminders

cleaned up output of reminders

--- CSSBot/Services/Reminders/ReminderService.cs
+++ CSSBot/Services/Reminders/ReminderService.cs
@@ -231,16 +231,15 @@

             string description;

-            //if (option == ReminderTimeOption.OnReminderExpire || option == ReminderTimeOption.ThreeHoursOverdue)
-            //{
-            //    description = string.Format("Reminder for {0:g}\n**Message**:\n{1}", r.ReminderTime, r.ReminderText, DateTime.Now.Subtract(r.ReminderTime));
-            //}
-            //else
-            //{
-            //    description = string.Format("Reminder for {0:g}\n{2} remains.\n**Message**:\n{1}", r.ReminderTime, r.ReminderText, DateTime.Now.Subtract(r.ReminderTime));
-            //}
-
-            description = string.Format("Reminder for {0:g} ({2} remains.)\n\n{1}", r.ReminderTime, r.ReminderText, r.ReminderTime - DateTime.Now);
+            // when reminder expire, don't include the timespan difference between now and remindertime
+            if (expired == TimeSpan.Zero)
+            {
+                description = string.Format("Reminder for {0:g}\n\n{1}", r.ReminderTime, r.ReminderText);
+            }
+            else
+            {
+                description = string.Format("Reminder for {0:g} ({2} remains.)\n\n{1}", r.ReminderTime, r.ReminderText, r.ReminderTime - DateTime.Now);
+            }

             if (r.ReminderTimeSpanTicks.Count > 1)
             {
@@ -250,17 +249,17 @@
                     description += ts.ToString() + "\n";
             }

+            description = description.TrimEnd();
+
             string mentionStr = "";

-            // include the person we were supposed to ping
+            // get the person that we are supposed to ping
             if (r.ReminderType == ReminderType.Author && user != null)
                 mentionStr = user.Mention;
             else if (r.ReminderType == ReminderType.Channel)
                 mentionStr = "@here";
             else if (r.ReminderType == ReminderType.Guild)
                 mentionStr = "@everyone";
-
-            description += "\n\n" + mentionStr;

             embed.WithColor(new Color(255, 204, 77));
             embed.WithDescription(description);


GetFontBitmap

GetFontBitmap

--- CSharpGL/NewFontResource/FontBitmapHelper.cs
+++ CSharpGL/NewFontResource/FontBitmapHelper.cs
@@ -20,24 +20,41 @@
         /// <returns></returns>
         public static FontBitmap GetFontBitmap(this Font font, string charSet)
         {
-            var result = new FontBitmap();
-            result.font = font;
+            InitStandardWidths();

-            GetGlyphInfo(result, font.Size, charSet);
-            result.glyphBitmap.Save("TestFontBitmap.bmp");
+            var fontBitmap = new FontBitmap();
+            fontBitmap.font = font;
+
+            // 以下三步，不能调换先后顺序。
+            // Don't change the order in which these 3 functions invoked.
+            GetGlyphSizes(fontBitmap, charSet);
+            GetGlyphPositions(fontBitmap, charSet);
+            GetGlyphBitmap(fontBitmap, charSet);
+
+            fontBitmap.glyphBitmap.Save("TestFontBitmap.bmp");
             //var fontResource = new FontResource();
             //fontResource.FontHeight = pixelSize + yInterval;
             //fontResource.CharInfoDict = dict;
             //fontResource.InitTexture(finalBitmap);
             //finalBitmap.Dispose();
             //return fontResource;
-            return result;
+            return fontBitmap;
         }

-        private static void GetGlyphInfo(FontBitmap fontBitmap, float pixelSize, string charSet)
+        private static void GetGlyphBitmap(FontBitmap fontBitmap, string charSet)
         {
-            InitStandardWidths();
-            int maxWidth = GetMaxWidth(pixelSize, charSet.Length);
+            throw new NotImplementedException();
+        }
+
+        private static void GetGlyphPositions(FontBitmap fontBitmap, string charSet)
+        {
+            throw new NotImplementedException();
+        }
+
+        private static void GetGlyphSizes(FontBitmap fontBitmap, string charSet)
+        {
+            float fontSize = fontBitmap.font.Size;
+            int maxWidth = GetMaxWidth(fontSize, charSet.Length);

             using (var bitmap = new Bitmap(maxWidth, maxWidth, PixelFormat.Format24bppRgb))
             {
@@ -46,11 +63,21 @@
                 {
                     foreach (char c in charSet)
                     {
-                        BlitCharacter(pixelSize, maxWidth, fontBitmap.glyphInfoDictionary, ref currentX, ref currentY, graphics, c, fontBitmap.font);
+                        SizeF size = graphics.MeasureString(c.ToString(), fontBitmap.font);
+                        if (currentX + xInterval + size.Width >= maxWidth)
+                        {
+                            currentX = 0;
+                            currentY += yInterval + fontSize;
+                            if (currentY + yInterval + fontSize >= maxWidth)
+                            { throw new Exception("Texture Size not big enough for required characters."); }
+                        }
+                        const int a = 5;
+                        const int b = 8;
+                        var info = new GlyphInfo(currentX, currentY, size.Width + xInterval, yInterval + fontSize - 1);
+                        fontBitmap.glyphInfoDictionary.Add(c, info);
+                        currentX += xInterval + size.Width;
                     }
                 }
-
-                fontBitmap.glyphBitmap = ShortenBitmap(bitmap, maxWidth, (int)Math.Ceiling(currentY + yInterval + pixelSize + (pixelSize / 10 > 1 ? pixelSize / 10 : 1)));
             }
         }
         static int[] standardWidths;
@@ -101,22 +128,6 @@
                 standardWidths = widths.ToArray();
             }
         }
-        private static void BlitCharacter(float pixelSize, int maxWidth, FullDictionary<char, GlyphInfo> dict, ref float currentX, ref float currentY, Graphics graphics, char c, Font font)
-        {
-            SizeF size = graphics.MeasureString(c.ToString(), font);
-            if (currentX + xInterval + size.Width >= maxWidth)
-            {
-                currentX = 0;
-                currentY += yInterval + pixelSize;
-                if (currentY + yInterval + pixelSize >= maxWidth)
-                { throw new Exception("Texture Size not big enough for required characters."); }
-            }
-            const int a = 5;
-            const int b = 8;
-            var info = new GlyphInfo(currentX, currentY, size.Width + xInterval, yInterval + pixelSize - 1);
-            dict.Add(c, info);
-            currentX += xInterval + size.Width;
-        }

         const int xInterval = 1;
         const int yInterval = 10;


Clean up TextBox a little

Clean up TextBox a little

--- src/DotVVM.Framework/Controls/TextBox.cs
+++ src/DotVVM.Framework/Controls/TextBox.cs
@@ -29,7 +29,6 @@
         public static readonly DotvvmProperty EnabledProperty =
             DotvvmPropertyWithFallback.Register<bool, TextBox>(nameof(Enabled), FormControls.EnabledProperty);

-
         /// <summary>
         /// Gets or sets a format of presentation of value to client.
         /// </summary>
@@ -122,16 +121,25 @@
         public static readonly DotvvmProperty ValueTypeProperty =
             DotvvmProperty.Register<FormatValueType, TextBox>(t => t.ValueType);

-        public static bool NeedsFormatting(IValueBinding binding) => binding != null && (binding.ResultType == typeof(DateTime) || binding.ResultType == typeof(DateTime?)
-            || binding.ResultType.IsNumericType() || Nullable.GetUnderlyingType(binding.ResultType).IsNumericType());
+        public static bool NeedsFormatting(IValueBinding binding)
+        {
+            if (binding == null)
+            {
+                return false;
+            }
+            return binding.ResultType == typeof(DateTime)
+                || binding.ResultType == typeof(DateTime?)
+                || binding.ResultType.IsNumericType()
+                || Nullable.GetUnderlyingType(binding.ResultType).IsNumericType();
+        }

         protected internal override void OnPreRender(IDotvvmRequestContext context)
         {
             var isTypeImplicitlyFormatted = Type.TryGetFormatString(out implicitFormatString);
             if (!string.IsNullOrEmpty(FormatString) && isTypeImplicitlyFormatted)
             {
-                throw new NotSupportedException($"Property FormatString cannot be used with Type set to '{ Type }'." +
-                    $" In this case browsers localize '{ Type }' themselves.");
+                throw new NotSupportedException($"Property FormatString cannot be used with Type " +
+                    $"set to '{ Type }'. In this case browsers localize '{ Type }' themselves.");
             }

             if (!isTypeImplicitlyFormatted || implicitFormatString != null)


fixing a big 1+N query issue!

fixing a big 1+N query issue!

--- src/FODT/Controllers/SearchController.cs
+++ src/FODT/Controllers/SearchController.cs
@@ -30,7 +30,8 @@

             if (searchType == "all" || searchType == "show")
             {
-                var query = DatabaseSession.Query<Show>();
+                var query = DatabaseSession.Query<Show>()
+                    .Fetch(x => x.Photo).AsQueryable();
                 foreach (var term in searchTerms)
                 {
                     query = query.Where(x => x.Title.Contains(term));
@@ -48,7 +49,8 @@

             if (searchType == "all" || searchType == "peep")
             {
-                var query = DatabaseSession.Query<Person>();
+                var query = DatabaseSession.Query<Person>()
+                    .Fetch(x => x.Photo).AsQueryable();
                 foreach (var term in searchTerms)
                 {
                     query = query.Where(x => x.LastName.Contains(term) ||


do not show parsing progress for logs with pirated content

--- CompatBot/EventHandlers/LogParsingHandler.cs
+++ CompatBot/EventHandlers/LogParsingHandler.cs
@@ -144,6 +144,7 @@
                                     if (result.Error == LogParseState.ErrorCode.PiracyDetected)
                                     {
                                         var yarr = client.GetEmoji(":piratethink:", "☠");
+                                        result.ReadBytes = 0;
                                         if (message.Author.IsWhitelisted(client, channel.Guild))
                                         {
                                             var piracyWarning = await result.AsEmbedAsync(client, message, source).ConfigureAwait(false);


Fix Key Up/Down

Fix Key Up/Down

--- src/FujiyNotepad.UI/FujiyTextBox.xaml.cs
+++ src/FujiyNotepad.UI/FujiyTextBox.xaml.cs
@@ -61,6 +61,7 @@

             GoToOffset(0);
             ContentScrollBar.Value = 0;
+            TxtContent.Focus();
         }

         public void GoToLineNumber(int lineNumber)
@@ -192,12 +193,19 @@
             switch (e.Key)
             {
                 case Key.Up:
-                    //TODO só deveria fazer o scroll caso esteja na primeira linha
+                    if (TxtContent.GetLineIndexFromCharacterIndex(TxtContent.CaretIndex) > 0)
+                    {
+                        return;
+                    }
                     linesToScroll = -1;
                     break;
                 case Key.Down:
-                    //TODO só deveria fazer o scroll caso esteja na ultima linha
+                    if ((TxtContent.GetLineIndexFromCharacterIndex(TxtContent.CaretIndex) + 1) < CountVisibleLines())
+                    {
+                        return;
+                    }
                     linesToScroll = 1;
+
                     break;
                 case Key.PageUp:
                     linesToScroll = -(CountVisibleLines() - 2);


Marshal OnStartSearch onto UI thread

Marshal OnStartSearch onto UI thread

OnStartSearch is called on a background thread. Marshal onto UI thread
when updating view model.

--- src/GitHub.VisualStudio/UI/GitHubPane.cs
+++ src/GitHub.VisualStudio/UI/GitHubPane.cs
@@ -82,7 +82,9 @@
             // Using JoinableTaskFactory from parent AsyncPackage. That way if VS shuts down before this
             // work is done, we won't risk crashing due to arbitrary work going on in background threads.
             var asyncPackage = (AsyncPackage)Package;
-            viewModelTask = asyncPackage.JoinableTaskFactory.RunAsync(() => InitializeAsync(asyncPackage));
+            JoinableTaskFactory = asyncPackage.JoinableTaskFactory;
+
+            viewModelTask = JoinableTaskFactory.RunAsync(() => InitializeAsync(asyncPackage));
         }

         public Task<IGitHubPaneViewModel> GetViewModelAsync() => viewModelTask.JoinAsync();
@@ -123,7 +125,7 @@

             if (pane != null)
             {
-                return new SearchTask(pane, dwCookie, pSearchQuery, pSearchCallback);
+                return new SearchTask(JoinableTaskFactory, pane, dwCookie, pSearchQuery, pSearchCallback);
             }

             return null;
@@ -189,23 +191,29 @@

         class SearchTask : VsSearchTask
         {
+            readonly JoinableTaskFactory joinableTaskFactory;
             readonly IGitHubPaneViewModel viewModel;

             public SearchTask(
+                JoinableTaskFactory joinableTaskFactory,
                 IGitHubPaneViewModel viewModel,
                 uint dwCookie,
                 IVsSearchQuery pSearchQuery,
                 IVsSearchCallback pSearchCallback)
                 : base(dwCookie, pSearchQuery, pSearchCallback)
             {
+                this.joinableTaskFactory = joinableTaskFactory;
                 this.viewModel = viewModel;
             }

             protected override void OnStartSearch()
             {
-                ThreadHelper.ThrowIfNotOnUIThread();
-
-                viewModel.SearchQuery = SearchQuery.SearchString;
+                joinableTaskFactory.RunAsync(async () =>
+                {
+                    await joinableTaskFactory.SwitchToMainThreadAsync();
+                    viewModel.SearchQuery = SearchQuery.SearchString;
+                });
+
                 base.OnStartSearch();
             }

@@ -224,5 +232,7 @@

             public uint GetTokens(uint dwMaxTokens, IVsSearchToken[] rgpSearchTokens) => 0;
         }
+
+        public JoinableTaskFactory JoinableTaskFactory { get; private set; }
     }
 }


Remove unused namespaces

Remove unused namespaces

--- src/Glimpse.Common/_SystemWeb/Glimpse.cs
+++ src/Glimpse.Common/_SystemWeb/Glimpse.cs
@@ -1,8 +1,4 @@
 #if SystemWeb
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
 using Microsoft.Extensions.DependencyInjection;

 namespace Glimpse


Exhaustive switch expressions (#238)

Exhaustive switch expressions (#238)

--- src/GraphQLParser/ParserContext.Parse.cs
+++ src/GraphQLParser/ParserContext.Parse.cs
@@ -859,7 +859,8 @@

     internal ASTNode ParseNamedDefinition(string[]? oneOf = null) // internal for tests
     {
-        return ExpectOneOf(oneOf ?? TopLevelKeywordOneOf, advance: false) switch
+        var keyword = ExpectOneOf(oneOf ?? TopLevelKeywordOneOf, advance: false);
+        return keyword switch
         {
             "query" => ParseOperationDefinition(),
             "mutation" => ParseOperationDefinition(),
@@ -875,7 +876,7 @@
             "extend" => ParseTypeExtension(),
             "directive" => ParseDirectiveDefinition(),

-            string keyword => throw new NotSupportedException($"Unexpected keyword '{keyword}' in {nameof(ParseNamedDefinition)}.")
+            _ => throw new NotSupportedException($"Unexpected keyword '{keyword}' in {nameof(ParseNamedDefinition)}.")
         };
     }

@@ -1098,20 +1099,22 @@
     // http://spec.graphql.org/October2021/#OperationType
     internal OperationType ParseOperationType(string[]? oneOf = null) // internal for tests
     {
-        return ExpectOneOf(oneOf ?? OperationTypeOneOf) switch
+        var keyword = ExpectOneOf(oneOf ?? OperationTypeOneOf);
+        return keyword switch
         {
             "query" => OperationType.Query,
             "mutation" => OperationType.Mutation,
             "subscription" => OperationType.Subscription,

-            string keyword => throw new NotSupportedException($"Unexpected keyword '{keyword}' in {nameof(ParseOperationType)}.")
+            _ => throw new NotSupportedException($"Unexpected keyword '{keyword}' in {nameof(ParseOperationType)}.")
         };
     }

     // http://spec.graphql.org/June2018/#DirectiveLocation
     internal DirectiveLocation ParseDirectiveLocation(string[]? oneOf = null) // internal for tests
     {
-        return ExpectOneOf(oneOf ?? DirectiveLocationOneOf) switch
+        var keyword = ExpectOneOf(oneOf ?? DirectiveLocationOneOf);
+        return keyword switch
         {
             // http://spec.graphql.org/June2018/#ExecutableDirectiveLocation
             "QUERY" => DirectiveLocation.Query,
@@ -1136,7 +1139,7 @@
             "INPUT_OBJECT" => DirectiveLocation.InputObject,
             "INPUT_FIELD_DEFINITION" => DirectiveLocation.InputFieldDefinition,

-            string keyword => throw new NotSupportedException($"Unexpected keyword '{keyword}' in {nameof(ParseDirectiveLocation)}.")
+            _ => throw new NotSupportedException($"Unexpected keyword '{keyword}' in {nameof(ParseDirectiveLocation)}.")
         };
     }

@@ -1350,7 +1353,8 @@

         ExpectKeyword("extend");

-        return ExpectOneOf(oneOf ?? TypeExtensionOneOf, advance: false) switch
+        var keyword = ExpectOneOf(oneOf ?? TypeExtensionOneOf, advance: false);
+        return keyword switch
         {
             "schema" => ParseSchemaExtension(start, comments),
             "scalar" => ParseScalarTypeExtension(start, comments),
@@ -1360,7 +1364,7 @@
             "enum" => ParseEnumTypeExtension(start, comments),
             "input" => ParseInputObjectTypeExtension(start, comments),

-            string keyword => throw new NotSupportedException($"Unexpected keyword '{keyword}' in {nameof(ParseTypeExtension)}.")
+            _ => throw new NotSupportedException($"Unexpected keyword '{keyword}' in {nameof(ParseTypeExtension)}.")
         };
     }


* Fixed an issue where it chose the smaller rather than larger of the two numbers for the update call.

--- OpenSim/Region/Environment/Scenes/Scene.cs
+++ OpenSim/Region/Environment/Scenes/Scene.cs
@@ -275,7 +275,7 @@

                 if (m_frame % m_update_physics == 0)
                     UpdatePhysics(
-                        Math.Min(SinceLastFrame.TotalSeconds, m_timespan)
+                        Math.Max(SinceLastFrame.TotalSeconds, m_timespan)
                         );

                 if (m_frame % m_update_entities == 0)


Remove the gratuitious prim deletes caused by linking. This makes linking a bit faster.

--- OpenSim/Region/Environment/Scenes/Scene.cs
+++ OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1880,7 +1880,9 @@
         {
             if (m_innerScene.DeleteSceneObject(uuid, resultOfLinkingObjects))
             {
-                m_storageManager.DataStore.RemoveObject(uuid, m_regInfo.RegionID);
+                if (!resultOfLinkingObjects)
+                    m_storageManager.DataStore.RemoveObject(uuid,
+                            m_regInfo.RegionID);
                 return true;
             }


SecurityAdapter fix.

SecurityAdapter fix.


before opening package chooser dialog for plugins manager, check network status.

--HG--
extra : rebase_source : a2b8f7acb6a50a4cf5f90bb19354835c091aabe9

--- PackageViewModel/PluginManagerViewModel.cs
+++ PackageViewModel/PluginManagerViewModel.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
+using System.Net.NetworkInformation;
 using NuGet;
 using NuGetPackageExplorer.Types;

@@ -100,6 +101,12 @@

         private void AddFeedPlugin()
         {
+            if (!NetworkInterface.GetIsNetworkAvailable())
+            {
+                _uiServices.Show(Resources.NoNetworkConnection, MessageLevel.Warning);
+                return;
+            }
+
             PackageInfo selectedPackageInfo = _packageChooser.SelectPluginPackage();
             if (selectedPackageInfo != null)
             {


Added doc comments :page_facing_up:

Added doc comments :page_facing_up:

--- DorTaxRateWeb/Formatters/GeoJsonFormatter.cs
+++ DorTaxRateWeb/Formatters/GeoJsonFormatter.cs
@@ -16,6 +16,9 @@
 	/// </summary>
 	public class GeoJsonFormatter : BufferedMediaTypeFormatter
 	{
+		/// <summary>
+		/// Creates a new instance of this object.
+		/// </summary>
 		public GeoJsonFormatter()
 		{
 			SupportedMediaTypes.Add(new MediaTypeHeaderValue("application/vnd.geo+json"));
@@ -23,11 +26,22 @@
 			SupportedMediaTypes.Add(new MediaTypeHeaderValue("text/json"));
 		}

+		/// <summary>
+		/// Determines if a type can be read.
+		/// </summary>
+		/// <param name="type"></param>
+		/// <returns><see langword="false"/>.</returns>
+		/// <remarks>This class cannot read any types</remarks>
 		public override bool CanReadType(Type type)
 		{
 			return false;
 		}

+		/// <summary>
+		/// Determines if a type can be written by this class.
+		/// </summary>
+		/// <param name="type">A type.</param>
+		/// <returns>Returns a <see cref="bool"/> indicating if the type is supported for writing.</returns>
 		public override bool CanWriteType(Type type)
 		{
 			if (type == typeof(FeatureCollection))
@@ -40,6 +54,13 @@
 			}
 		}

+		/// <summary>
+		/// Serializes the object to the stream as GeoJson.
+		/// </summary>
+		/// <param name="type"></param>
+		/// <param name="value"></param>
+		/// <param name="writeStream"></param>
+		/// <param name="content"></param>
 		public override void WriteToStream(Type type, object value, Stream writeStream, HttpContent content)
 		{
 			using (var writer = new StreamWriter(writeStream) { AutoFlush = true })


Use ordinal string comparison.

Use ordinal string comparison.

--- Duplicati/Library/Snapshots/HyperVUtility.cs
+++ Duplicati/Library/Snapshots/HyperVUtility.cs
@@ -122,7 +122,7 @@
             {
                 IsHyperVInstalled = new ManagementObjectSearcher(_wmiScope, new ObjectQuery(
                     "SELECT * FROM meta_class")).Get().OfType<ManagementObject>()
-                    .Any(o => ((ManagementClass)o).ClassPath.ClassName.StartsWith("Msvm_"));
+                    .Any(o => ((ManagementClass)o).ClassPath.ClassName.StartsWith("Msvm_", StringComparison.Ordinal));
             }
             catch { IsHyperVInstalled = false; }


Only show map transition if transitioning to a different map ID

--- EOLib/PacketHandlers/EndPlayerWarpHandler.cs
+++ EOLib/PacketHandlers/EndPlayerWarpHandler.cs
@@ -57,6 +57,8 @@
                 .WithMapID(warpAgreePacketData.MapID)
                 .WithRenderProperties(updatedRenderProperties);

+            var differentMapID = _currentMapStateRepository.CurrentMapID != warpAgreePacketData.MapID;
+
             _currentMapStateRepository.CurrentMapID = warpAgreePacketData.MapID;
             _currentMapStateRepository.Characters = warpAgreePacketData.Characters.ToList();
             _currentMapStateRepository.NPCs = warpAgreePacketData.NPCs.ToList();
@@ -66,7 +68,7 @@
                                                      _currentMapProvider.CurrentMap.Properties.MapAvailable;

             foreach (var notifier in _mapChangedNotifiers)
-                notifier.NotifyMapChanged(showMapTransition: true, //todo: only show transition if its a different map
+                notifier.NotifyMapChanged(showMapTransition: differentMapID,
                                           warpAnimation: warpAgreePacketData.WarpAnimation);

             return true;


Avoid a rare SEHException during Screen.AllScreens call

--- EarTrumpet/Interop/Helpers/WindowsTaskbar.cs
+++ EarTrumpet/Interop/Helpers/WindowsTaskbar.cs
@@ -1,6 +1,4 @@
 using System;
-using System.Drawing;
-using System.Linq;
 using System.Runtime.InteropServices;
 using System.Windows.Forms;

@@ -25,42 +23,37 @@
             Bottom = 3
         }

-        public static uint Dpi
-        {
-            get
-            {
-                var hWnd = User32.FindWindow("Shell_TrayWnd", null);
-                return User32.GetDpiForWindow(hWnd);
-            }
-        }
+        public static uint Dpi => User32.GetDpiForWindow(GetHwnd());

         public static State Current
         {
             get
             {
-                var hWnd = User32.FindWindow("Shell_TrayWnd", null);
-                var state = new State();
+                var hWnd = GetHwnd();
+                var state = new State
+                {
+                    ContainingScreen = Screen.FromHandle(hWnd),
+                };
                 var appBarData = new APPBARDATA
                 {
                     cbSize = (uint)Marshal.SizeOf(typeof(APPBARDATA)),
                     hWnd = hWnd
                 };
+
                 // SHAppBarMessage: Understands Taskbar auto-hide
                 // state (the window is positioned across screens).
                 if (Shell32.SHAppBarMessage(AppBarMessage.GetTaskbarPos, ref appBarData) != UIntPtr.Zero)
                 {
                     state.Size = appBarData.rect;
                     state.Location = (Position)appBarData.uEdge;
-                    state.ContainingScreen = GetScreenFromRect(state.Size);
                 }
                 else
                 {
                     User32.GetWindowRect(hWnd, out state.Size);
-                    var screen = GetScreenFromRect(state.Size);
-                    state.ContainingScreen = screen;

-                    if (screen != null)
+                    if (state.ContainingScreen != null)
                     {
+                        var screen = state.ContainingScreen;
                         if (state.Size.Bottom == screen.Bounds.Bottom && state.Size.Top == screen.Bounds.Top)
                         {
                             state.Location = (state.Size.Left == screen.Bounds.Left) ? Position.Left : Position.Right;
@@ -79,15 +72,6 @@
             }
         }

-        private static Screen GetScreenFromRect(RECT rect)
-        {
-            return Screen.AllScreens.FirstOrDefault(x => x.Bounds.Contains(
-                new Rectangle(
-                rect.Left,
-                rect.Top,
-                rect.Right - rect.Left,
-                rect.Bottom - rect.Top)
-            ));
-        }
+        private static IntPtr GetHwnd() => User32.FindWindow("Shell_TrayWnd", null);
     }
 }


fix error.

fix error.

--- ElectronicObserver/Window/FormBrowserHost.cs
+++ ElectronicObserver/Window/FormBrowserHost.cs
@@ -317,13 +317,7 @@
 		private string BuildDownstreamProxy() {
 			var config = Utility.Configuration.Config.Connection;

-			if ( !string.IsNullOrEmpty( config.DownstreamProxy ) ) {
-				return config.DownstreamProxy;
-
-			} else if ( config.UseSystemProxy ) {
-				return APIObserver.Instance.ProxyPort.ToString();
-
-			} else if ( config.UseUpstreamProxy ) {
+			if ( config.UseUpstreamProxy ) {
 				return string.Format(
 					"http=127.0.0.1:{0};https={1}:{2}",
 					APIObserver.Instance.ProxyPort,


Some typos in exception messages

Some typos in exception messages

- Saw them while looking at pull request #19 (adding an error stream to this class).
- Unified the apostrophe character

--- FileHelpers/Engines/FileHelperAsyncEngine.cs
+++ FileHelpers/Engines/FileHelperAsyncEngine.cs
@@ -125,7 +125,7 @@
             {
                 if (mAsyncWriter == null) {
                     throw new BadUsageException(
-                        "You must be writting something to set a record value. Try calling BeginWriteFile first.");
+                        "You must be writing something to set a record value. Try calling BeginWriteFile first.");
                 }

                 if (mLastRecordValues == null)
@@ -133,7 +133,7 @@

                 if (value == null) {
                     if (RecordInfo.Fields[fieldIndex].FieldType.IsValueType)
-                        throw new BadUsageException("You can't assing null to a value type.");
+                        throw new BadUsageException("You can't assign null to a value type.");

                     mLastRecordValues[fieldIndex] = null;
                 }
@@ -180,7 +180,7 @@
         public IDisposable BeginReadStream(TextReader reader)
         {
             if (reader == null)
-                throw new ArgumentNullException("reader", "The TextReader cant be null.");
+                throw new ArgumentNullException("reader", "The TextReader can't be null.");

             if (mAsyncWriter != null)
                 throw new BadUsageException("You can't start to read while you are writing.");
@@ -448,7 +448,7 @@
         public IDisposable BeginWriteStream(TextWriter writer)
         {
             if (writer == null)
-                throw new ArgumentException("writer", "The TextWriter cant be null.");
+                throw new ArgumentException("writer", "The TextWriter can't be null.");

             if (mAsyncReader != null)
                 throw new BadUsageException("You can't start to write while you are reading.");
@@ -541,7 +541,7 @@
                 throw new BadUsageException("Before call WriteNext you must call BeginWriteFile or BeginWriteStream.");

             if (record == null)
-                throw new BadUsageException("The record to write cant be null.");
+                throw new BadUsageException("The record to write can't be null.");

             if (RecordType.IsAssignableFrom(record.GetType()) == false)
                 throw new BadUsageException("The record must be of type: " + RecordType.Name);
@@ -600,7 +600,7 @@
                 throw new BadUsageException("Before call WriteNext you must call BeginWriteFile or BeginWriteStream.");

             if (records == null)
-                throw new ArgumentNullException("records", "The record to write cant be null.");
+                throw new ArgumentNullException("records", "The record to write can't be null.");

             bool first = true;

@@ -781,4 +781,4 @@

         #endregion
     }
-}+}


Added working receipt card

Added working receipt card

--- src/LUISBankingBot/Dialogs/LuisDialog.cs
+++ src/LUISBankingBot/Dialogs/LuisDialog.cs
@@ -87,19 +87,35 @@
                 string smilingFace = "\U0001F642";

                 await context.PostAsync("I'm sorry, I didn't get that " + worriedFace + '.');
-                await context.PostAsync("Here are some things I know how to talk about!" + smilingFace);
+                await context.PostAsync("Here are some things I know how to talk about! " + smilingFace);

-                // new CardView().ReceiptCard;
-                HeroCard plCard = new HeroCard()
+                var message = context.MakeMessage();
+
+                var receiptCard = new ReceiptCard
                 {
-                    Title = "I'm a hero card",
-                    Subtitle = "Pig Latin Wikipedia Page"
+                    Title = "John Doe",
+                    Facts = new List<Fact> { new Fact("Order Number", "1234"), new Fact("Payment Method", "VISA 5555-****") },
+                    Items = new List<ReceiptItem>
+            {
+                new ReceiptItem("Data Transfer", price: "$ 38.45", quantity: "368", image: new CardImage(url: "https://github.com/amido/azure-vector-icons/raw/master/renders/traffic-manager.png")),
+                new ReceiptItem("App Service", price: "$ 45.00", quantity: "720", image: new CardImage(url: "https://github.com/amido/azure-vector-icons/raw/master/renders/cloud-service.png")),
+            },
+                    Tax = "$ 7.50",
+                    Total = "$ 90.95",
+                    Buttons = new List<CardAction>
+            {
+                new CardAction(
+                    ActionTypes.OpenUrl,
+                    "More information",
+                    "https://github.com/amido/azure-vector-icons/raw/master/renders/traffic-manager.png",
+                    "https://azure.microsoft.com/en-us/pricing/")
+            }
                 };

-                Attachment plAttachment = plCard.ToAttachment();
-                context.Attachments.Add(plAttachment);
+                message.Attachments = new List<Attachment>();
+                message.Attachments.Add(receiptCard.ToAttachment());

-                var reply = await connector.Conversations.SendToConversationAsync(replyToConversation);
+                await context.PostAsync(message);
             }
         }
     }


TcpipServer: Delete unused timeLimit field.

--- AIWolfServer/TcpipServer.cs
+++ AIWolfServer/TcpipServer.cs
@@ -33,7 +33,6 @@
         int port;
         IPAddress address = IPAddress.Parse("127.0.0.1");
         int connectionLimit;
-        int timeLimit;

         /// <summary>
         /// Current game data.
@@ -70,7 +69,6 @@
             GameSetting = gameSetting;
             this.port = port;
             connectionLimit = limit;
-            timeLimit = GameSetting.TimeLimit != -1 ? GameSetting.TimeLimit : 1000;
             //ILoggerFactory loggerFactory = new LoggerFactory().AddConsole();
             ILoggerFactory loggerFactory = new LoggerFactory();
             loggerFactory.AddProvider(new ConsoleLoggerProvider((text, logLevel) => logLevel >= LogLevel.Critical, true));


remove a redundant state machine

remove a redundant state machine

--- src/Marten/Services/ManagedConnection.cs
+++ src/Marten/Services/ManagedConnection.cs
@@ -9,7 +9,7 @@
 namespace Marten.Services
 {
     public class ManagedConnection : IManagedConnection
-    {
+    {
         private readonly IConnectionFactory _factory;
         private readonly CommandRunnerMode _mode;
         private readonly IsolationLevel _isolationLevel;
@@ -39,13 +39,14 @@
             }
         }

-        private async Task buildConnectionAsync(CancellationToken token)
+        private Task buildConnectionAsync(CancellationToken token)
         {
             if (_connection == null)
             {
                 _connection = new TransactionState(_factory, _mode, _isolationLevel, _commandTimeout);
-                await _connection.OpenAsync(token).ConfigureAwait(false);
-            }
+                return _connection.OpenAsync(token);
+            }
+            return Task.CompletedTask;
         }

         public IMartenSessionLogger Logger { get; set; } = NulloMartenLogger.Flyweight;