:memo: add docs around IWindowsServiceUtil

--- source/Win32Service/PeanutButter.WindowsServiceManagement/WindowsServiceUtil.cs
+++ source/Win32Service/PeanutButter.WindowsServiceManagement/WindowsServiceUtil.cs
@@ -21,38 +21,126 @@
 {
     public interface IWindowsServiceUtil
     {
+        /// <summary>
+        /// The name of the service, usable from, eg 'net stop {name}'
+        /// </summary>
         string ServiceName { get; }
+        /// <summary>
+        /// The name displayed in the service manager (service.msc)
+        /// </summary>
         string DisplayName { get; }
+        /// <summary>
+        /// The full commandline run for this service
+        /// </summary>
         string Commandline { get; }
+        /// <summary>
+        /// The current state of this service
+        /// </summary>
         ServiceState State { get; }
+        /// <summary>
+        /// Whether or not this service is installed; will
+        /// also return false if the service is marked for deletion.
+        /// </summary>
         bool IsInstalled { get; }
+        /// <summary>
+        /// Test if the service is marked for deletion.
+        /// </summary>
         bool IsMarkedForDelete { get; }
+        /// <summary>
+        /// How many extra seconds to wait on service operations,
+        /// outside of the recommended wait hint provided by
+        /// the ServiceControlManager
+        /// </summary>
         int ServiceStateExtraWaitSeconds { get; set; }
+        /// <summary>
+        /// Startup type for service, eg auto, disabled, manual
+        /// </summary>
         ServiceStartupTypes StartupType { get; }
+        /// <summary>
+        /// The current process id of the service, if running.
+        /// Will return -1 if not running
+        /// </summary>
         int ServicePID { get; }

+        /// <summary>
+        /// Uninstall the service, waiting for completion and killing
+        /// the service process if it doesn't stop in time, as
+        /// determined by the SCM wait hint and any extra time specified
+        /// in ServiceStateExtraWaitSeconds
+        /// </summary>
         void Uninstall();
-
         [Obsolete("Rather use the overload with ControlOptions")]
         void Uninstall(bool waitForUninstall);
-
+        /// <summary>
+        /// Uninstall the service, with full control over waiting and
+        /// forceful stopping.
+        /// </summary>
+        /// <param name="options"></param>
         void Uninstall(ControlOptions options);
+        /// <summary>
+        /// Installs and starts the service, waiting for the service
+        /// to report that it's running
+        /// </summary>
         void InstallAndStart();
+        /// <summary>
+        /// Install and start the service, with control over whether
+        /// to wait for the service to have properly started
+        /// </summary>
+        /// <param name="waitForStart"></param>
         void InstallAndStart(bool waitForStart);
+        /// <summary>
+        /// Install the service only
+        /// </summary>
         void Install();
+        /// <summary>
+        /// Start the service only, waiting for it to enter the Running state
+        /// </summary>
         void Start();
+        /// <summary>
+        /// Start the service, optionally waiting to enter the Running state
+        /// </summary>
+        /// <param name="wait"></param>
         void Start(bool wait);
+        /// <summary>
+        /// Stop the service, waiting for it to come to rest and forcing stop
+        /// if it doesn't do so in time, as determined by the SCM wait hint
+        /// and any extra time specified in ServiceStateExtraWaitSeconds
+        /// </summary>
         void Stop();

         [Obsolete("Rather use the overload with ControlOptions")]
         void Stop(bool wait);

+        /// <summary>
+        /// Stop the service, with full control over whether to wait and
+        /// whether to force stop
+        /// </summary>
+        /// <param name="options"></param>
         void Stop(ControlOptions options);
+        /// <summary>
+        /// Pause the service, if running
+        /// </summary>
         void Pause();
+        /// <summary>
+        /// Continue a paused service
+        /// </summary>
         void Continue();
+        /// <summary>
+        /// Disable the service from running
+        /// </summary>
         void Disable();
+        /// <summary>
+        /// Set the service to automatically start with the host system
+        /// </summary>
         void SetAutomaticStart();
+        /// <summary>
+        /// Set the service to require manual start
+        /// </summary>
         void SetManualStart();
+        /// <summary>
+        /// Kills the service, if running
+        /// </summary>
+        /// <returns></returns>
         KillServiceResult KillService();
     }

@@ -823,14 +911,22 @@
             }

             Win32Api.StartService(service, 0, 0);
-            if (wait)
-            {
-                var changedStatus = WaitForServiceStatus(service, ServiceState.StartPending, ServiceState.Running);
-                if (!changedStatus)
-                    throw new ServiceOperationException(_serviceName,
-                        ServiceOperationNames.START,
-                        "Unable to start service");
-            }
+            if (!wait)
+            {
+                return;
+            }
+
+            if (WaitForServiceStatus(
+                service,
+                ServiceState.StartPending,
+                ServiceState.Running))
+            {
+                return;
+            }
+
+            throw new ServiceOperationException(_serviceName,
+                ServiceOperationNames.START,
+                "Unable to start service");
         }

         private void StopService(
@@ -862,6 +958,7 @@
             {
                 return;
             }
+
             var pid = process.Id;

             try
@@ -1075,14 +1172,13 @@
                 return status.CurrentState == desiredStatus;
             }

-            var waited = 0;
+            var waitUntil = DateTime.Now.AddSeconds(ServiceStateExtraWaitSeconds);
             while (
-                waited < ServiceStateExtraWaitSeconds &&
+                DateTime.Now > waitUntil &&
                 status.CurrentState != desiredStatus
             )
             {
-                Thread.Sleep(1000);
-                waited++;
+                Thread.Sleep(200);
                 if (Win32Api.QueryServiceStatus(service, status) == 0)
                 {
                     break;


fixed problems with limited access and role assignments generation. Added role assignments to root webs.

--- src/Acceleratio.SPDG.Generator/GenerationTasks/PermissionsDataGenerationTask.cs
+++ src/Acceleratio.SPDG.Generator/GenerationTasks/PermissionsDataGenerationTask.cs
@@ -7,9 +7,9 @@
 namespace Acceleratio.SPDG.Generator.GenerationTasks
 {
     public abstract class PermissionsDataGenerationTaskBase : DataGenerationTaskBase
-    {
-        int _permissionsPerObject = 1;
-        List<SPDGUser> _siteSpUsers = null ;
+    {
+        int _permissionsPerObject = 1;
+        List<SPDGUser> _siteSpUsers = null;
         List<SPDGGroup> _siteSpGroups = null;
         List<SPDGUser> _siteAdGroupSpUsers = null;

@@ -114,25 +114,26 @@

         public override void Execute()
-        {
+        {
             foreach (SiteCollInfo siteCollInfo in Owner.WorkingSiteCollections)
             {
                 using (var siteColl = Owner.ObjectsFactory.GetSite(siteCollInfo.URL))
                 {
                     _siteSpUsers = new List<SPDGUser>();
                     _siteAdGroupSpUsers = new List<SPDGUser>();
-                    _siteSpGroups=new List<SPDGGroup>();
+                    _siteSpGroups = new List<SPDGGroup>();

                     Owner.IncrementCurrentTaskProgress("Ensuring users and groups on '" + siteCollInfo.URL + "'");
                     EnsureUsersAndGroups(siteColl.RootWeb);

+                    setSitePermissions(siteColl.RootWeb);
                     foreach (SiteInfo siteInfo in siteCollInfo.Sites)
                     {
                         using (var web = siteColl.OpenWeb(siteInfo.ID))
-                        {
-                            Owner.IncrementCurrentTaskProgress("Crawling site",0);
-                            if(_allSitesToHaveUniquePermissions.Contains(siteInfo))
-                            {
+                        {
+                            Owner.IncrementCurrentTaskProgress("Crawling site", 0);
+                            if (_allSitesToHaveUniquePermissions.Contains(siteInfo))
+                            {
                                 setSitePermissions(web);
                             }

@@ -142,7 +143,7 @@
                                 {
                                     Owner.IncrementCurrentTaskProgress("Crawling list " + web.Url + "/" + listInfo.Name, 0);
                                     if (_allListsToHavehUniquePermissions.Contains(listInfo))
-                                    {
+                                    {
                                         setListPermissions(web, listInfo.Name);
                                     }

@@ -151,7 +152,7 @@
                                         foreach (FolderInfo folderInfo in listInfo.Folders)
                                         {
                                             if (_allFoldersToHaveUniquePermissions.Contains(folderInfo))
-                                            {
+                                            {
                                                 setFolderPermissions(web, folderInfo.URL);
                                             }
                                             Owner.IncrementCurrentTaskProgress("Crawled folder" + web.Url + "/" + listInfo.Name);
@@ -167,7 +168,7 @@
                                 }
                             }

-                            Owner.IncrementCurrentTaskProgress("Crawled site "+ web.Url);
+                            Owner.IncrementCurrentTaskProgress("Crawled site " + web.Url);
                         }
                     }
                 }
@@ -177,7 +178,7 @@

         protected abstract List<string> GetAvailableUsersInDirectory();
         protected abstract List<string> GetAvailableGroupsInDirectory();
-
+

         private void EnsureUsersAndGroups(SPDGWeb web)
         {
@@ -192,7 +193,7 @@

                 try
                 {
-                    var user = web.EnsureUser(userName);
+                    var user = web.EnsureUser(userName);
                     Log.Write("Ensured user:" + userName + " for site: " + web.Url);
                 }
                 catch (Exception ex)
@@ -213,7 +214,7 @@

                 try
                 {
-                    var user = web.EnsureUser(groupName);
+                    var user = web.EnsureUser(groupName);
                     Log.Write("Ensured user:" + groupName + " for site: " + web.Url);
                 }
                 catch (Exception ex)
@@ -221,9 +222,9 @@
                     Errors.Log(ex);
                     Log.Write("Error adding user:" + groupName);
                 }
-            }
-
-            HashSet<string> createdGroups=new HashSet<string>();
+            }
+
+            HashSet<string> createdGroups = new HashSet<string>();
             /// CREATE SHAREPOINT GROUPS
             if (WorkingDefinition.PermissionsPercentForSPGroups > 0)
             {
@@ -232,7 +233,7 @@
                     string nameCandidate = SampleData.GetSampleValueRandom(SampleData.Accounts) + " Group";
                     try
                     {
-                        web.AddSiteGroup(nameCandidate,
+                        web.AddSiteGroup(nameCandidate,
                         web.CurrentUser,
                         web.CurrentUser,
                         "SPDG generated group");
@@ -243,7 +244,7 @@
                     {
                         Errors.Log(ex);
                     }
-                }
+                }
             }
             _siteSpGroups = web.SiteGroups.ToList();
             _siteSpUsers = web.SiteUsers.Where(x => !x.IsDomainGroup).ToList();
@@ -277,7 +278,7 @@
             Owner.IncrementCurrentTaskProgress("Adding permissions to site " + web.Url + "'", 0);
             if (!web.HasUniqueRoleAssignments)
             {
-                web.BreakRoleInheritance(true);
+                web.BreakRoleInheritance(false);
             }
             for (int i = 0; i < _permissionsPerObject; i++)
             {
@@ -289,9 +290,9 @@
                 {
                     Errors.Log(ex);
                 }
-
-            }
-            Log.Write("Unique permissions added to site: " + web.Url);
+
+            }
+            Log.Write("Unique permissions added to site: " + web.Url);
         }

         private void setListPermissions(SPDGWeb web, string listName)
@@ -300,12 +301,12 @@
             var list = web.GetList(listName);
             if (!list.HasUniqueRoleAssignments)
             {
-                list.BreakRoleInheritance(true);
+                list.BreakRoleInheritance(false);
             }

             for (int i = 0; i < _permissionsPerObject; i++)
             {
-                setupNextRoleAssignment(web, list);
+                setupNextRoleAssignment(web, list);
             }

             Owner.IncrementCurrentTaskProgress("Unique permissions added to list: " + listName + ", site: " + web.Url);
@@ -317,36 +318,36 @@
             SPDGFolder folder = web.GetFolder(folderURL);
             if (!folder.Item.HasUniqueRoleAssignments)
             {
-                folder.Item.BreakRoleInheritance(true);
+                folder.Item.BreakRoleInheritance(false);
             }

             for (int i = 0; i < _permissionsPerObject; i++)
             {
-               setupNextRoleAssignment(web, folder.Item);
-            }
-
-            Owner.IncrementCurrentTaskProgress("Unique permissions added to folder: " + folderURL + " in site: " + web.Url);
+                setupNextRoleAssignment(web, folder.Item);
+            }
+
+            Owner.IncrementCurrentTaskProgress("Unique permissions added to folder: " + folderURL + " in site: " + web.Url);
         }

         private void setItemPermissions(SPDGWeb web, string listName)
         {
             var list = web.GetList(listName);
             foreach (var item in list.Items)
-            {
+            {
                 if (SampleData.GetRandomNumber(1, 100) < WorkingDefinition.PermissionsPercentOfListItems)
                 {
                     Owner.IncrementCurrentTaskProgress("Adding permissions for item/document '" + item.DisplayName + "' in list '" + list.Title, 0);
                     if (!item.HasUniqueRoleAssignments)
                     {
-                        item.BreakRoleInheritance(true);
+                        item.BreakRoleInheritance(false);
                     }

                     for (int i = 0; i < _permissionsPerObject; i++)
                     {
-                        setupNextRoleAssignment(web, item);
-                    }
-
-                    Owner.IncrementCurrentTaskProgress("Unique permissions added for item/document '" + item.DisplayName + "' in list '"+list.Title);
+                        setupNextRoleAssignment(web, item);
+                    }
+
+                    Owner.IncrementCurrentTaskProgress("Unique permissions added for item/document '" + item.DisplayName + "' in list '" + list.Title);
                 }
                 else
                 {
@@ -357,10 +358,10 @@

         private void setupNextRoleAssignment(SPDGWeb web, SPDGSecurableObject securableObject)
-        {
-            SPDGPrincipal principal = null;
+        {
+            SPDGPrincipal principal = null;
             var rnd = SampleData.GetRandomNumber(0, 100);
-            if (rnd< WorkingDefinition.PermissionsPercentForUsers)
+            if (rnd < WorkingDefinition.PermissionsPercentForUsers)
             {
                 principal = _siteSpUsers[SampleData.GetRandomNumber(0, _siteSpUsers.Count - 1)];
             }
@@ -373,13 +374,15 @@
                 principal = _siteAdGroupSpUsers[SampleData.GetRandomNumber(0, _siteAdGroupSpUsers.Count - 1)];
             }

-            if (securableObject.GetRoleAssignmentByPrincipal(principal) == null)
-            {
-                var availableRoledefinitions = web.RoleDefinitions.Where(x=>!x.IsGuestRole).ToList();
-
+            var roleAssignment = securableObject.GetRoleAssignmentByPrincipal(principal);
+
+            if (roleAssignment == null || roleAssignment.RoleDefinitionBindings.All(x => x.IsGuestRole))
+            {
+                var availableRoledefinitions = web.RoleDefinitions.Where(x => !x.IsGuestRole).ToList();
+
                 var selected = availableRoledefinitions[SampleData.GetRandomNumber(0, availableRoledefinitions.Count - 1)];
-                securableObject.AddRoleAssignment(principal, new List<SPDGRoleDefinition> {selected});
-            }
-        }
+                securableObject.AddRoleAssignment(principal, new List<SPDGRoleDefinition> { selected });
+            }
+        }
     }
-}
+}


Add more comment tests.

Add more comment tests.

--- src/EditorFeatures/CSharpTest/InlineDeclaration/CSharpInlineDeclarationTests.cs
+++ src/EditorFeatures/CSharpTest/InlineDeclaration/CSharpInlineDeclarationTests.cs
@@ -719,5 +719,67 @@
     }
 }", compareTokens: false);
         }
+
+        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsInlineDeclaration)]
+        public async Task TestComments7()
+        {
+            await TestAsync(
+@"class C
+{
+    void M()
+    {
+        int j, /*prefix*/ [|i|] /*suffix*/;
+        {
+            if (int.TryParse(v, out i))
+            {
+            }
+        }
+    }
+}",
+@"class C
+{
+    void M()
+    {
+        int j;
+        {
+            if (int.TryParse(v, out int /*prefix*/ i /*suffix*/))
+            {
+            }
+        }
+    }
+}", compareTokens: false);
+        }
+
+        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsInlineDeclaration)]
+        public async Task TestComments8()
+        {
+            await TestAsync(
+@"class C
+{
+    void M()
+    {
+        // prefix
+        int j, [|i|]; // suffix
+        {
+            if (int.TryParse(v, out i))
+            {
+            }
+        }
+    }
+}",
+@"class C
+{
+    void M()
+    {
+        // prefix
+        int j; // suffix
+        {
+            if (int.TryParse(v, out int i))
+            {
+            }
+        }
+    }
+}", compareTokens: false);
+        }
     }
 }


Add assert

Add assert

--- src/EditorFeatures/Core/Implementation/NavigationBar/NavigationBarController.cs
+++ src/EditorFeatures/Core/Implementation/NavigationBar/NavigationBarController.cs
@@ -201,6 +201,7 @@

         private void OnDocumentActiveContextChanged(object? sender, DocumentActiveContextChangedEventArgs args)
         {
+            AssertIsForeground();
             if (args.Solution.Workspace != _workspace)
                 return;


LWDEV-6719: impl

LWDEV-6719: impl

--- src/MarginTrading.Backend.Services/Services/OvernightSwapNotificationService.cs
+++ src/MarginTrading.Backend.Services/Services/OvernightSwapNotificationService.cs
@@ -130,10 +130,12 @@
                         }
                     }

-                    await _log.WriteWarningAsync(nameof(OvernightSwapNotificationService), nameof(PerformEmailNotification),
-                        $"Emails of some clients are incorrect: {string.Join(", ", clientsWithIncorrectMail)}.", DateTime.UtcNow);
-                    await _log.WriteInfoAsync(nameof(OvernightSwapNotificationService), nameof(PerformEmailNotification),
-                        $"Emails sent to: {string.Join(", ", clientsSentEmails)}.", DateTime.UtcNow);
+                    if (clientsWithIncorrectMail.Any())
+                        await _log.WriteWarningAsync(nameof(OvernightSwapNotificationService), nameof(PerformEmailNotification),
+                            $"Emails of some clients are incorrect: {string.Join(", ", clientsWithIncorrectMail)}.", DateTime.UtcNow);
+                    if (clientsSentEmails.Any())
+                        await _log.WriteInfoAsync(nameof(OvernightSwapNotificationService), nameof(PerformEmailNotification),
+                            $"Emails sent to: {string.Join(", ", clientsSentEmails)}.", DateTime.UtcNow);
                 }
                 finally
                 {


Remove unnecessary null check from QueryDynamicObject (#40320)

--- src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/DynamicDebuggerProxy.cs
+++ src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/DynamicDebuggerProxy.cs
@@ -423,20 +423,20 @@
                 DynamicMetaObject mo = ido.GetMetaObject(parameter);
                 List<string> names = new List<string>(mo.GetDynamicMemberNames());
                 names.Sort();
-                if (names != null)
-                {
-                    var result = new List<KeyValuePair<string, object>>();
-                    foreach (string name in names)
+
+                var result = new List<KeyValuePair<string, object>>();
+                foreach (string name in names)
+                {
+                    object value;
+                    if ((value = TryGetMemberValue(obj, name, true)) != null)
                     {
-                        object value;
-                        if ((value = TryGetMemberValue(obj, name, true)) != null)
-                        {
-                            result.Add(new KeyValuePair<string, object>(name, value));
-                        }
+                        result.Add(new KeyValuePair<string, object>(name, value));
                     }
-                    return result;
-                }
-            }
+                }
+
+                return result;
+            }
+
             return Array.Empty<KeyValuePair<string, object>>();
         }


more locks

more locks

--- src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectToolsCommandResolver.cs
+++ src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectToolsCommandResolver.cs
@@ -5,12 +5,15 @@
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
 using Microsoft.DotNet.Tools.Common;
 using Microsoft.Extensions.DependencyModel;
 using NuGet.Configuration;
 using NuGet.Frameworks;
 using NuGet.ProjectModel;
 using NuGet.Versioning;
+using ConcurrencyUtilities = NuGet.Common.ConcurrencyUtilities;

 namespace Microsoft.DotNet.Cli.Utils
 {
@@ -220,6 +223,15 @@
             return null;
         }

+
+        private static async Task<bool> FileExistsWithLock(string path)
+        {
+            return await ConcurrencyUtilities.ExecuteWithFileLockedAsync(
+                path,
+                lockedToken => Task.FromResult(File.Exists(path)),
+                CancellationToken.None);
+        }
+
         private bool TryGetToolLockFile(
             SingleProjectInfo toolLibrary,
             string nugetPackagesRoot,
@@ -228,7 +240,7 @@
             lockFile = null;
             var lockFilePath = GetToolLockFilePath(toolLibrary, nugetPackagesRoot);

-            if (!File.Exists(lockFilePath))
+            if (!FileExistsWithLock(lockFilePath).Result)
             {
                 return false;
             }


fixes param replace problem (#447)

fixes param replace problem (#447)

--- src/Microsoft.TemplateEngine.Orchestrator.RunnableProjects/SimpleConfigModel.cs
+++ src/Microsoft.TemplateEngine.Orchestrator.RunnableProjects/SimpleConfigModel.cs
@@ -545,20 +545,27 @@
                         if (sourceVariable != null)
                         {
                             TokenConfig replacementConfig = symbol.Value.Replaces.TokenConfigBuilder();
-                            foreach (IReplacementContext context in symbol.Value.ReplacementContexts)
+                            if (symbol.Value.ReplacementContexts.Count > 0)
                             {
-                                TokenConfig builder = replacementConfig;
-                                if (!string.IsNullOrEmpty(context.OnlyIfAfter))
+                                foreach (IReplacementContext context in symbol.Value.ReplacementContexts)
                                 {
-                                    builder = builder.OnlyIfAfter(context.OnlyIfAfter);
+                                    TokenConfig builder = replacementConfig;
+                                    if (!string.IsNullOrEmpty(context.OnlyIfAfter))
+                                    {
+                                        builder = builder.OnlyIfAfter(context.OnlyIfAfter);
+                                    }
+
+                                    if (!string.IsNullOrEmpty(context.OnlyIfBefore))
+                                    {
+                                        builder = builder.OnlyIfBefore(context.OnlyIfBefore);
+                                    }
+
+                                    macroGeneratedReplacements.Add(new ReplacementTokens(sourceVariable, builder));
                                 }
-
-                                if (!string.IsNullOrEmpty(context.OnlyIfBefore))
-                                {
-                                    builder = builder.OnlyIfBefore(context.OnlyIfBefore);
-                                }
-
-                                macroGeneratedReplacements.Add(new ReplacementTokens(sourceVariable, builder));
+                            }
+                            else
+                            {
+                                macroGeneratedReplacements.Add(new ReplacementTokens(sourceVariable, replacementConfig));
                             }
                         }
                     }


Closes #5389; Admin Culture Picker wrong cookie domain.

--- src/Orchard.Web/Modules/Orchard.Localization/Selectors/CookieCultureSelector.cs
+++ src/Orchard.Web/Modules/Orchard.Localization/Selectors/CookieCultureSelector.cs
@@ -37,9 +37,7 @@
                 Expires = _clock.UtcNow.AddYears(DefaultExpireTimeYear),
             };

-            if (!String.IsNullOrEmpty(_shellSettings.RequestUrlHost)) {
-                cookie.Domain = _shellSettings.RequestUrlHost;
-            }
+            cookie.Domain = httpContext.Request.Url.Host;

             if (!String.IsNullOrEmpty(_shellSettings.RequestUrlPrefix)) {
                 cookie.Path = GetCookiePath(httpContext);


+ added more debug info

+ added more debug info

--- src/Premotion.AspNet.AppHarbor.Integration.TestWebsite/RequestDetailsHandler.cs
+++ src/Premotion.AspNet.AppHarbor.Integration.TestWebsite/RequestDetailsHandler.cs
@@ -37,13 +37,44 @@
 			output.WriteLine("### Server variables");
 			var serverVariables = request.ServerVariables;
 			foreach (var key in serverVariables.AllKeys)
-				output.WriteLine(string.Format("{0}: {1}", key, serverVariables[key]));
+			   output.WriteLine(string.Format("{0}: {1}", key, serverVariables[key]));

 			// dump request headers
 			output.WriteLine("### Request headers");
 			var headerVariables = request.Headers;
 			foreach (var key in headerVariables.AllKeys)
-				output.WriteLine(string.Format("{0}: {1}", key, headerVariables[key]));
+			   output.WriteLine(string.Format("{0}: {1}", key, headerVariables[key]));
+
+			// dump query string
+			output.WriteLine("### Querystring (GET)");
+			var queryStringVariables = request.QueryString;
+			foreach (var key in queryStringVariables.AllKeys)
+			   output.WriteLine(string.Format("{0}: {1}", key, queryStringVariables[key]));
+
+			// dump POST
+			output.WriteLine("### Form variables (POST)");
+			var formVariables = request.Form;
+			foreach (var key in formVariables.AllKeys)
+			   output.WriteLine(string.Format("{0}: {1}", key, formVariables[key]));
+
+			// dump Session
+			output.WriteLine("### Session");
+			var session = context.Session;
+			if (session == null)
+			   output.WriteLine("No session");
+			else
+			{
+			   var count = session.Count;
+			   output.WriteLine("Count: {0}\r\n", count);
+			   foreach (string key in session.Keys)
+			      output.WriteLine(string.Format("{0}: {1}", key, session[key]));
+			}
+
+			// dump cookies
+			output.WriteLine("### Cookies");
+			var cookieCollection = request.Cookies;
+			foreach (var key in cookieCollection.AllKeys)
+			   output.WriteLine(string.Format("{0}: {1}", key, cookieCollection[key]));
 		}
 		/// <summary>
 		/// Gets a value indicating whether another request can use the <see cref="T:System.Web.IHttpHandler"/> instance.


Quarantine StreamPool_MultipleStreamsConcurrent_StreamsReturnedToPool (#41735)

https://github.com/dotnet/aspnetcore/issues/39477

--- src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs
+++ src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs
@@ -427,6 +427,7 @@
     }

     [Fact]
+    [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/39477")]
     public async Task StreamPool_MultipleStreamsConcurrent_StreamsReturnedToPool()
     {
         await InitializeConnectionAsync(_echoApplication);


Unquarantined tests (#27172)

Unquarantined tests (#27172)

--- src/Servers/Kestrel/test/Interop.FunctionalTests/HttpClientHttp2InteropTests.cs
+++ src/Servers/Kestrel/test/Interop.FunctionalTests/HttpClientHttp2InteropTests.cs
@@ -690,7 +690,6 @@

         [Theory]
         [MemberData(nameof(SupportedSchemes))]
-        [QuarantinedTest]
         public async Task ServerReset_BeforeRequestBody_ClientBodyThrows(string scheme)
         {
             var clientEcho = new TaskCompletionSource<string>(TaskCreationOptions.RunContinuationsAsynchronously);
@@ -1019,7 +1018,6 @@
         }

         [Theory]
-        [QuarantinedTest("https://github.com/dotnet/runtime/issues/860")]
         [MemberData(nameof(SupportedSchemes))]
         public async Task RequestHeaders_MultipleFrames_Accepted(string scheme)
         {
@@ -1343,7 +1341,6 @@
         // Settings_MaxFrameSize_Larger_Client - Not configurable

         [Theory]
-        [QuarantinedTest("https://github.com/dotnet/runtime/issues/860")]
         [MemberData(nameof(SupportedSchemes))]
         public async Task Settings_MaxHeaderListSize_Server(string scheme)
         {


1750: test copy selected rgn to clipboard

--- src/Tests/TestWinForm_MiniAgg_GLES_SKIA/3_Samples/09_FloodFill/FloodFillDemo.cs
+++ src/Tests/TestWinForm_MiniAgg_GLES_SKIA/3_Samples/09_FloodFill/FloodFillDemo.cs
@@ -273,6 +273,7 @@
                         p.Draw(_tmpRgn);
                     }
                     break;
+                case TodoWithMagicWandProduct.CreateVxsRgnAndCopyToClipboard:
                 case TodoWithMagicWandProduct.CreateVxsRgnAndDeleteSelectedArea:
                     if (_tmpRgn != null)
                     {
@@ -281,44 +282,52 @@
                         p.Fill(_tmpRgn, Color.White);
                     }
                     break;
-                case TodoWithMagicWandProduct.CreateVxsRgnAndCopyToClipboard:
-                    if (_tmpRgn != null)
-                    {
-                        //we may have some choices
-                        //1). create a new dst bitmap -> set mask with the rgn -> and draw img from src to the bitmap
-                        // or
-                        //2). if we have exact ReconstructedRegionData then
-                        //   create a new dst bitmap-> direct copy src to dst look up with ReconstructedRegionData
-                        //
-                        //this version, we use 1)
-
-                        AggPainter aggPainter = p as AggPainter;
-                        if (aggPainter != null)
-                        {
-                            Rectangle bounds = _tmpRgn.GetRectBounds();
-                            using (MemBitmap bmp = new MemBitmap(bounds.Width, bounds.Height))
-                            using (AggPainterPool.Borrow(bmp, out var painter))
-                            {
-                                painter.SetClipRgn(_reconstructedRgn);
-                                painter.DrawImage(aggPainter.RenderSurface.DestBitmap,
-                                    0, 0, bounds.Left, bounds.Top, bounds.Width, bounds.Height);
-                                //copy to clipboard
-                                //convert to platform specific bitmap data
-
-                            }
-                        }
-
-                    }
-                    break;
-            }
-
-        }
-
+
+            }
+        }
+
+        static void PutBitmapToClipboardPreserveAlpha(System.Drawing.Bitmap bmp)
+        {
+            //save to png
+            string tmpfilename = System.Windows.Forms.Application.CommonAppDataPath + "\\clipboard_tmp.png";
+
+            using (System.IO.FileStream fs = new System.IO.FileStream(tmpfilename, System.IO.FileMode.Create))
+            {
+                bmp.Save(fs, System.Drawing.Imaging.ImageFormat.Png);
+            }
+            var fileList = new System.Collections.Specialized.StringCollection();
+            fileList.Add(tmpfilename);
+            System.Windows.Forms.Clipboard.SetFileDropList(fileList);
+
+        }
+        static System.Drawing.Bitmap CreatePlatformBitmap(MemBitmap memBmp)
+        {
+            System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(
+                memBmp.Width,
+                memBmp.Height,
+                System.Drawing.Imaging.PixelFormat.Format32bppArgb);
+
+            var srcPtr = MemBitmap.GetBufferPtr(memBmp);
+
+            var bmpdata = bmp.LockBits(
+                new System.Drawing.Rectangle(0, 0, memBmp.Width, memBmp.Height),
+                System.Drawing.Imaging.ImageLockMode.ReadWrite,
+                System.Drawing.Imaging.PixelFormat.Format32bppArgb);
+
+            unsafe
+            {
+                MemMx.memcpy(
+                    (byte*)bmpdata.Scan0,
+                    (byte*)srcPtr.Ptr,
+                     srcPtr.LengthInBytes);
+            }
+            bmp.UnlockBits(bmpdata);
+            return bmp;
+        }
         //-------------------------
         //for wanding-tool test
         MemBitmap _tmpMaskBitmap;
         Region _tmpRgn;
-        ReconstructedRegionData _tmpRgnData;
         Drawing.Rectangle _rgnBounds;
         //-------------------------

@@ -328,7 +337,8 @@
             int y = my - _imgOffsetY;

-            ReconstructedRegionData rgnData = null;
+
+
             _tmpMagicWandRgnData = null;
             if (_tmpMaskBitmap != null)
             {
@@ -342,9 +352,10 @@
                 _tmpRgn = null;
             }

+            ReconstructedRegionData rgnData = new ReconstructedRegionData();
+
             if (ToolMode == ToolMode.MagicWand)
             {
-                _tmpRgnData = new ReconstructedRegionData();

                 _magicWand.CollectRegion(_bmpToFillOn, x, y, rgnData);
                 //
@@ -386,17 +397,56 @@
                             _rgnBounds = rgnData.GetBounds();
                         }
                         break;
+                    case TodoWithMagicWandProduct.CreateBitmapRgnAndFill:
+                        {
+                            _tmpRgn = new BitmapBasedRegion(rgnData);
+                        }
+                        break;
                     case TodoWithMagicWandProduct.CreateVxsRgnAndFill:
                     case TodoWithMagicWandProduct.CreateVxsRgnAndDraw:
                     case TodoWithMagicWandProduct.CreateVxsRgnAndDeleteSelectedArea:
+                        {
+                            _tmpRgn = new VxsRegion(_reconstructedRgn);
+                        }
+                        break;
                     case TodoWithMagicWandProduct.CreateVxsRgnAndCopyToClipboard:
                         {
                             _tmpRgn = new VxsRegion(_reconstructedRgn);
-                        }
-                        break;
-                    case TodoWithMagicWandProduct.CreateBitmapRgnAndFill:
-                        {
-                            _tmpRgn = new BitmapBasedRegion(rgnData);
+                            //we may have some choices
+                            //1). create a new dst bitmap -> set mask with the rgn -> and draw img from src to the bitmap
+                            // or
+                            //2). if we have exact ReconstructedRegionData then
+                            //   create a new dst bitmap-> direct copy src to dst look up with ReconstructedRegionData
+                            //
+                            //this version, we use 1)
+
+
+                            Rectangle bounds = _tmpRgn.GetRectBounds();
+                            using (MemBitmap bmp = new MemBitmap(bounds.Width, bounds.Height))
+                            using (AggPainterPool.Borrow(bmp, out var painter))
+                            {
+                                painter.Clear(Color.Transparent); //clear bg color
+
+                                float prevX = painter.OriginX;
+                                float prevY = painter.OriginY;
+                                painter.SetOrigin(-bounds.Left, -bounds.Top);
+                                painter.SetClipRgn(_reconstructedRgn);
+                                painter.EnableBuiltInMaskComposite = true;
+
+                                //painter.Fill(_tmpRgn, Color.Blue);
+                                painter.DrawImage(_bmpToFillOn, 0, 0);
+                                painter.SetOrigin(prevX, prevY);
+
+                                //copy to clipboard
+                                //convert to platform specific bitmap data
+                                painter.EnableBuiltInMaskComposite = false;
+                                using (var platformBmp = CreatePlatformBitmap(bmp))
+                                {
+                                    //PutBitmapToClipboardPreserveAlpha(platformBmp);
+                                    System.Windows.Forms.Clipboard.SetImage(platformBmp);
+                                }
+                            }
+
                         }
                         break;
                 }


Update src/Umbraco.Core/Migrations/Upgrade/V_8_10_0/AddPropertyTypeLabelOnTopColumn.cs

Co-authored-by: Bjarke Berg <1d6e1cf70ec6f9ab28d3ea4b27a49a77654d370e@bergmania.dk>

--- src/Umbraco.Core/Migrations/Upgrade/V_8_10_0/AddPropertyTypeLabelOnTopColumn.cs
+++ src/Umbraco.Core/Migrations/Upgrade/V_8_10_0/AddPropertyTypeLabelOnTopColumn.cs
@@ -1,7 +1,7 @@
 using System.Linq;
 using Umbraco.Core.Persistence.Dtos;

-namespace Umbraco.Core.Migrations.Upgrade.V_8_6_0
+namespace Umbraco.Core.Migrations.Upgrade.V_8_10_0
 {

     public class AddPropertyTypeLabelOnTopColumn : MigrationBase


cleanup of indexes

cleanup of indexes

--- SaintThomas.Kiosk/Global.asax.cs
+++ SaintThomas.Kiosk/Global.asax.cs
@@ -75,10 +75,6 @@
         {
             try
             {
-                //new RavenDB.AspNet.Identity.User_ByUserName<ApplicationUser>().Execute(Store);
-                //var catalog = new CompositionContainer(new AssemblyCatalog(typeof(RavenDB.AspNet.Identity.User_ByUserName<ApplicationUser>).Assembly));
-                //IndexCreation.CreateIndexes(catalog, Store.DatabaseCommands.ForSystemDatabase(), Store.Conventions);
-                //IndexCreation.CreateIndexes(typeof(KnowledgeIndex).Assembly, Store);
                 IndexCreation.CreateIndexes(typeof(PositionIndex).Assembly, Store);
             }
             catch (WebException e)


Close process only after closing the last MdiContainerForm.

--- Sandra.UI/SandraChessMainForm.cs
+++ Sandra.UI/SandraChessMainForm.cs
@@ -128,7 +128,14 @@

             mdiContainerForm.Load += MdiContainerForm_Load;
             mdiContainerForm.Shown += (_, __) => OpenCommandLineArgs(commandLineArgs);
-            mdiContainerForm.FormClosed += (_, __) => Close();
+
+            mdiContainerForm.FormClosed += (_, __) =>
+            {
+                mdiContainerForms.Remove(mdiContainerForm);
+
+                // Close the entire process after the last form is closed.
+                if (mdiContainerForms.Count == 0) Close();
+            };

             mdiContainerForms.Add(mdiContainerForm);
             mdiContainerForm.Show();


Add unit test to ensure large numbers of executions succeed.

--- test/BaristaLabs.BaristaCore.Tests/BaristaRuntimeStability_Facts.cs
+++ test/BaristaLabs.BaristaCore.Tests/BaristaRuntimeStability_Facts.cs
@@ -74,5 +74,26 @@

             Assert.Equal(0, BaristaRuntimeService.Count);
         }
+
+        [Fact]
+        public void LargeNumbersOfRuntimesPropertyEvaluate()
+        {
+            for (int i = 0; i < 100; i++)
+            {
+                using (var rt = BaristaRuntimeService.CreateRuntime())
+                {
+                    using (var ctx = rt.CreateContext())
+                    {
+                        using (ctx.Scope())
+                        {
+                            var result = ctx.EvaluateModule<JsNumber>("export default 1+1");
+                            Assert.Equal(2, result.ToInt32());
+                        }
+                    }
+                }
+            }
+
+            Assert.Equal(0, BaristaRuntimeService.Count);
+        }
     }
 }


Added tests for known naming normalizers

--- test/SimpleSoft.Database.Migrator.Tests/MigratorHostBuilderTests.cs
+++ test/SimpleSoft.Database.Migrator.Tests/MigratorHostBuilderTests.cs
@@ -45,7 +45,7 @@
         #region NamingNormalizer

         [Fact]
-        public void GivenAHostBuilderWhenBuildingThenDefaultNamingNormalizerMustNotBeNull()
+        public void GivenNewAHostBuilderThenNamingNormalizerMustNotBeNull()
         {
             using (var builder = new MigratorHostBuilder())
             {
@@ -55,6 +55,30 @@
         }

         [Fact]
+        public void GivenAHostBuilderWhenUsingDefaultNamingNormalizerThenMustBeOfTypeDefaultNamingNormalizer()
+        {
+            using (var builder = new MigratorHostBuilder())
+            {
+                builder.UseDefaultNamingNormalizer();
+
+                Assert.NotNull(builder.NamingNormalizer);
+                Assert.IsType<DefaultNamingNormalizer>(builder.NamingNormalizer);
+            }
+        }
+
+        [Fact]
+        public void GivenAHostBuilderWhenUsingTrimNamingNormalizerThenMustBeOfTypeTrimNamingNormalizer()
+        {
+            using (var builder = new MigratorHostBuilder())
+            {
+                builder.UseTrimNamingNormalizer();
+
+                Assert.NotNull(builder.NamingNormalizer);
+                Assert.IsType<TrimNamingNormalizer>(builder.NamingNormalizer);
+            }
+        }
+
+        [Fact]
         public void GivenAHostBuilderWhenSettingACustomNamingNormalizerThenItMustBeUsed()
         {
             var namingNormalizer = new TrimNamingNormalizer();
@@ -69,6 +93,20 @@
         }

         [Fact]
+        public void GivenAHostBuilderWhenUsingACustomNamingNormalizerThenItMustBeUsed()
+        {
+            var namingNormalizer = new TrimNamingNormalizer();
+
+            using (var builder = new MigratorHostBuilder())
+            {
+                builder.UseNamingNormalizer(namingNormalizer);
+
+                Assert.NotNull(builder.NamingNormalizer);
+                Assert.Same(namingNormalizer, builder.NamingNormalizer);
+            }
+        }
+
+        [Fact]
         public void GivenAHostBuilderWhenSettingANullNamingNormalizerThenArgumentNullExceptionMustBeThrown()
         {
             using (var builder = new MigratorHostBuilder())
@@ -76,6 +114,20 @@
                 var ex = Assert.Throws<ArgumentNullException>(() =>
                 {
                     builder.NamingNormalizer = null;
+                });
+
+                Assert.NotNull(ex);
+            }
+        }
+
+        [Fact]
+        public void GivenAHostBuilderWhenUsingANullNamingNormalizerThenArgumentNullExceptionMustBeThrown()
+        {
+            using (var builder = new MigratorHostBuilder())
+            {
+                var ex = Assert.Throws<ArgumentNullException>(() =>
+                {
+                    builder.UseNamingNormalizer(null);
                 });

                 Assert.NotNull(ex);


Fixed indentation.

Fixed indentation.

--- tests/Magick.NET.Tests/Shared/MagickNETTests/TheFeaturesProperty.cs
+++ tests/Magick.NET.Tests/Shared/MagickNETTests/TheFeaturesProperty.cs
@@ -25,13 +25,13 @@
             {
                 var expected = "Cipher DPC ";
 #if Q16HDRI
-            expected += "HDRI ";
+                expected += "HDRI ";
 #endif
 #if WINDOWS_BUILD
                 expected += "OpenCL ";
 #endif
 #if OPENMP
-            expected += "OpenMP(2.0) ";
+                expected += "OpenMP(2.0) ";
 #endif
 #if DEBUG_TEST
                 expected = "Debug " + expected;


Fix stackalloc in loop

Fix stackalloc in loop

--- test/Duracellko.PlanningPoker.Client.Test/MockSignalR/SentMessagesObservable.cs
+++ test/Duracellko.PlanningPoker.Client.Test/MockSignalR/SentMessagesObservable.cs
@@ -82,12 +82,11 @@

         private void ReadMessages(ref ReadOnlySequence<byte> buffer)
         {
+            Span<byte> messageIdBytes = stackalloc byte[8];
             while (buffer.Length >= 8)
             {
                 var messageIdBuffer = buffer.Slice(0, 8);
-                Span<byte> messageIdBytes = stackalloc byte[8];
                 messageIdBuffer.CopyTo(messageIdBytes);
-
                 long messageId = BitConverter.ToInt64(messageIdBytes);
                 ReadMessage(messageId);


update

update

--- CSharpGL/0Foundations/OpenGLObjects/Rendering/Renderer/Renderer.UniformArrays.cs
+++ CSharpGL/0Foundations/OpenGLObjects/Rendering/Renderer/Renderer.UniformArrays.cs
@@ -313,10 +313,10 @@
             {
                 //int location = Program.GetUniformLocation(varNameInShader);
                 //if (location < 0)
-                {
-                    //throw new Exception(string.Format(
-                    //"niform variable [{0}] not exists! Remember to invoke RendererBase.Initialize(); before this method.", varNameInShader));
-                }
+                //{
+                //throw new Exception(string.Format(
+                //"niform variable [{0}] not exists! Remember to invoke RendererBase.Initialize(); before this method.", varNameInShader));
+                //}

                 var variable = GetVariableArray(value, varNameInShader) as UniformFloatArray;
                 variable.Value = new NoisyArray<float>(value);


Fix issue with tagHelper that requries field or property to target for

--- DioLive.Cache/src/DioLive.Cache.WebUI/Views/Shared/_SelectLanguagePartial.cshtml
+++ DioLive.Cache/src/DioLive.Cache.WebUI/Views/Shared/_SelectLanguagePartial.cshtml
@@ -9,12 +9,13 @@

 @{
     var cultureItems = new SelectList(LocOptions.Value.SupportedUICultures, nameof(CultureInfo.Name), nameof(CultureInfo.DisplayName));
+    var currentCulture = Context.GetCurrentCulture();
 }

 <div>
     <form id="selectLanguage" asp-area="" asp-controller="Home" asp-action="SetLanguage" asp-route-returnUrl="@Context.Request.Path" method="post" class="form-horizontal" role="form">
         @Localizer["Language:"]
-        <select name="culture" asp-for="@Context.GetCurrentCulture()" asp-items="cultureItems"></select>
+        <select name="culture" asp-for="@currentCulture" asp-items="cultureItems"></select>
         <button>OK</button>
     </form>
 </div>


Fixed config file search for company acronym in subscriber authentication requests.

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS07]$/openPG/Main;C75350

--- Source/Libraries/openPG.UI.WPF/UserControls/SubscriberRequestUserControl.xaml.cs
+++ Source/Libraries/openPG.UI.WPF/UserControls/SubscriberRequestUserControl.xaml.cs
@@ -272,6 +272,7 @@
         // Attempt to get the company acronym stored in the openPG configuration file.
         private bool TryGetCompanyAcronym(out string acronym)
         {
+            string configFileName;
             FileStream configStream = null;
             StreamReader configStreamReader = null;
             XElement configRoot;
@@ -280,7 +281,8 @@
             try
             {
                 // Set up XML searching
-                configStream = File.Open("openPG.exe.config", FileMode.Open);
+                configFileName = FilePath.GetAbsolutePath("openPG.exe.config");
+                configStream = File.Open(configFileName, FileMode.Open);
                 configStreamReader = new StreamReader(configStream);
                 configRoot = XElement.Parse(configStreamReader.ReadToEnd());


RigidBody Shape Layer Tweaks #CHANGE: Adjusted shape outline width.

--- Source/Plugins/EditorModules/CamView/CamViewLayers/RigidBodyShapeCamViewLayer.cs
+++ Source/Plugins/EditorModules/CamView/CamViewLayers/RigidBodyShapeCamViewLayer.cs
@@ -17,7 +17,7 @@
 {
 	public class RigidBodyShapeCamViewLayer : CamViewLayer
 	{
-		private float shapeOutlineWidth = 2.5f;
+		private float shapeOutlineWidth = 2.0f;
 		private float depthOffset = -0.5f;

 		public override string LayerName


tweak D_Parser integration

tweak D_Parser integration

--- vdc/abothe/VDServer.cs
+++ vdc/abothe/VDServer.cs
@@ -15,105 +15,109 @@
 using D_Parser.Misc;
 using D_Parser.Dom;
 using D_Parser.Completion;
+using D_Parser.Resolver;

 namespace ABothe
 {
-    [ComVisible(true), Guid("002a2de9-8bb6-484d-9901-7e4ad4084715")]
-    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
-    public interface IVDServer
-    {
-	    void ConfigureSemanticProject(string filename, string imp, string stringImp, string versionids, string debugids, uint flags);
-	    void ClearSemanticProject();
+	[ComVisible(true), Guid("002a2de9-8bb6-484d-9901-7e4ad4084715")]
+	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
+	public interface IVDServer
+	{
+		void ConfigureSemanticProject(string filename, string imp, string stringImp, string versionids, string debugids, uint flags);
+		void ClearSemanticProject();
 		void UpdateModule(string filename, string srcText, bool verbose);
-	    void GetTip(string filename, int startLine, int startIndex, int endLine, int endIndex);
-        void GetTipResult(out int startLine, out int startIndex, out int endLine, out int endIndex, out string answer);
-        void GetSemanticExpansions(string filename, string tok, uint line, uint idx, string expr);
-	    void GetSemanticExpansionsResult(out string stringList);
-	    void IsBinaryOperator(string filename, uint startLine, uint startIndex, uint endLine, uint endIndex, out bool pIsOp);
-        void GetParseErrors(string filename, out string errors);
-	    void GetBinaryIsInLocations(string filename, out uint[] locs); // array of pairs of DWORD
-	    void GetLastMessage(out string message);
+		void GetTip(string filename, int startLine, int startIndex, int endLine, int endIndex);
+		void GetTipResult(out int startLine, out int startIndex, out int endLine, out int endIndex, out string answer);
+		void GetSemanticExpansions(string filename, string tok, uint line, uint idx, string expr);
+		void GetSemanticExpansionsResult(out string stringList);
+		void IsBinaryOperator(string filename, uint startLine, uint startIndex, uint endLine, uint endIndex, out bool pIsOp);
+		void GetParseErrors(string filename, out string errors);
+		void GetBinaryIsInLocations(string filename, out uint[] locs); // array of pairs of DWORD
+		void GetLastMessage(out string message);
 		void GetDefinition(string filename, uint startLine, uint startIndex, uint endLine, uint endIndex);
 		void GetDefinitionResult(out int startLine, out int startIndex, out int endLine, out int endIndex, out string filename);
 	}

-    class VDServerCompletionDataGenerator : ICompletionDataGenerator
-    {
+	class VDServerCompletionDataGenerator : ICompletionDataGenerator
+	{
 		public VDServerCompletionDataGenerator (string pre)
 		{
 			prefix = pre;
 		}

-        /// <summary>
-        /// Adds a token entry
-        /// </summary>
-        public void Add(byte Token)
-        {
-			if(DTokens.Keywords[Token].StartsWith(prefix))
-            	expansions += DTokens.Keywords[Token] + "\n";
-        }
-
-        /// <summary>
-        /// Adds a property attribute
-        /// </summary>
-        public void AddPropertyAttribute(string AttributeText)
-        {
-			if(AttributeText.StartsWith(prefix))
-				expansions += AttributeText + "\n";
-        }
-
-        public void AddTextItem(string Text, string Description)
-        {
-			if(Text.StartsWith(prefix))
-				expansions += Text + "\n";
-        }
-
-        /// <summary>
-        /// Adds a node to the completion data
-        /// </summary>
-        /// <param name="Node"></param>
-        public void Add(INode Node)
-        {
-			if(Node.Name.StartsWith(prefix))
-				expansions += Node.Name + "\n";
-        }
-
-        /// <summary>
-        /// Adds a module (name stub) to the completion data
-        /// </summary>
-        /// <param name="ModuleName"></param>
-        /// <param name="AssocModule"></param>
-        public void Add(string ModuleName, IAbstractSyntaxTree Module = null, string PathOverride = null)
-        {
-            expansions += ModuleName + "\n";
-        }
+		/// <summary>
+		/// Adds a token entry
+		/// </summary>
+		public void Add(byte Token)
+		{
+			addExpansion(DTokens.Keywords[Token]);
+		}
+
+		/// <summary>
+		/// Adds a property attribute
+		/// </summary>
+		public void AddPropertyAttribute(string AttributeText)
+		{
+			addExpansion(AttributeText);
+		}
+
+		public void AddTextItem(string Text, string Description)
+		{
+			addExpansion(Text);
+		}
+
+		/// <summary>
+		/// Adds a node to the completion data
+		/// </summary>
+		/// <param name="Node"></param>
+		public void Add(INode Node)
+		{
+			addExpansion(Node.Name);
+		}
+
+		/// <summary>
+		/// Adds a module (name stub) to the completion data
+		/// </summary>
+		/// <param name="ModuleName"></param>
+		/// <param name="AssocModule"></param>
+		public void Add(string ModuleName, IAbstractSyntaxTree Module = null, string PathOverride = null)
+		{
+			addExpansion(ModuleName);
+		}

 		public void AddModule(IAbstractSyntaxTree module, string nameOverride = null)
 		{
-			if(nameOverride.Length > 0)
-				expansions += nameOverride + "\n";
+			if(string.IsNullOrEmpty(nameOverride))
+				addExpansion(module.Name);
 			else
-				expansions += module.Name + "\n";
+				addExpansion(nameOverride);
 		}

 		public void AddPackage(string packageName)
 		{
-			expansions += packageName + "\n";
-		}
-
-        public string expansions;
-        public string prefix;
-    }
-
-    [ComVisible(true), Guid("002a2de9-8bb6-484d-AA05-7e4ad4084715")]
-    [ClassInterface(ClassInterfaceType.None)]
-    public class VDServer : IVDServer
-    {
-        private ParseCacheList _parseCacheList;
-        private ParseCache     _parseCache;
-        private CodeLocation   _tipStart, _tipEnd;
-        private string _tipText;
-        private string _expansions;
+			addExpansion(packageName);
+		}
+
+		void addExpansion(string name)
+		{
+			if(!string.IsNullOrEmpty(name))
+				if(name.StartsWith(prefix))
+					expansions += name + "\n";
+		}
+
+		public string expansions;
+		public string prefix;
+	}
+
+	[ComVisible(true), Guid("002a2de9-8bb6-484d-AA05-7e4ad4084715")]
+	[ClassInterface(ClassInterfaceType.None)]
+	public class VDServer : IVDServer
+	{
+		private ParseCacheList _parseCacheList;
+		private ParseCache     _parseCache;
+		private CodeLocation   _tipStart, _tipEnd;
+		private string _tipText;
+		private string _expansions;
 		private string _imports;
 		private string _stringImports;
 		private string _versionIds;
@@ -121,19 +125,19 @@
 		private uint   _flags;
 		EditorData _editorData = new EditorData();

-        public Dictionary<string, IAbstractSyntaxTree> _modules = new Dictionary<string, IAbstractSyntaxTree>();
-        public Dictionary<string, string> _sources = new Dictionary<string, string>();
-
-        public VDServer()
-        {
+		public Dictionary<string, IAbstractSyntaxTree> _modules = new Dictionary<string, IAbstractSyntaxTree>();
+		public Dictionary<string, string> _sources = new Dictionary<string, string>();
+
+		public VDServer()
+		{
 			_parseCacheList = new ParseCacheList();
-            _parseCache = new ParseCache();
+			_parseCache = new ParseCache();
 			_parseCacheList.Add(_parseCache);

-            // MessageBox.Show("VDServer()");
-        }
-
-        public void ConfigureSemanticProject(string filename, string imp, string stringImp, string versionids, string debugids, uint flags)
+			// MessageBox.Show("VDServer()");
+		}
+
+		public void ConfigureSemanticProject(string filename, string imp, string stringImp, string versionids, string debugids, uint flags)
 		{
 			if (_imports != imp)
 			{
@@ -147,144 +151,163 @@
 			_debugIds = debugids;
 			_flags = flags;
 			_setupEditorData();
-            //MessageBox.Show("ConfigureSemanticProject()");
-            //throw new NotImplementedException();
-        }
-        public void ClearSemanticProject()
-        {
-            MessageBox.Show("ClearSemanticProject()");
-            //throw new NotImplementedException();
-        }
-        public void UpdateModule(string filename, string srcText, bool verbose)
-        {
+			//MessageBox.Show("ConfigureSemanticProject()");
+			//throw new NotImplementedException();
+		}
+		public void ClearSemanticProject()
+		{
+			MessageBox.Show("ClearSemanticProject()");
+			//throw new NotImplementedException();
+		}
+		public void UpdateModule(string filename, string srcText, bool verbose)
+		{
 			IAbstractSyntaxTree ast;
-            try
-            {
-                ast = DParser.ParseString(srcText, false);
-            }
-            catch(Exception ex)
-            {
+			try
+			{
+				ast = DParser.ParseString(srcText, false);
+			}
+			catch(Exception ex)
+			{
 				ast = new DModule{ ParseErrors = new System.Collections.ObjectModel.ReadOnlyCollection<ParserError>(
 						new List<ParserError>{
 						new ParserError(false, ex.Message + "\n\n" + ex.StackTrace, DTokens.Invariant, CodeLocation.Empty)
 					}) }; //WTF
-            }
+			}
 			if(string.IsNullOrEmpty(ast.ModuleName))
 				ast.ModuleName = Path.GetFileNameWithoutExtension(filename);
 			ast.FileName = filename;
+
+			IAbstractSyntaxTree oldast = null;
+			if (_modules.TryGetValue(filename, out oldast))
+			{
+				_parseCache.UfcsCache.RemoveModuleItems(oldast);
+				_parseCache.Remove(oldast);
+			}
 			_parseCache.AddOrUpdate(ast);
+			ConditionalCompilationFlags cflags = new ConditionalCompilationFlags(_editorData);
+			_parseCache.UfcsCache.CacheModuleMethods(ast, ResolutionContext.Create(_parseCacheList, cflags, null, null));
+
 			_modules[filename] = ast;
 			_sources[filename] = srcText;
 			//MessageBox.Show("UpdateModule(" + filename + ")");
-            //throw new NotImplementedException();
-        }
-        static int getCodeOffset(string s, CodeLocation loc)
-        {
+			//throw new NotImplementedException();
+		}
+
+		static int getCodeOffset(string s, CodeLocation loc)
+		{
 			// column/line 1-based
-            int off = 0;
-            for (int ln = 1; ln < loc.Line; ln++)
-                off = s.IndexOf('\n', off) + 1;
-            return off + loc.Column - 1;
-        }
-
-        public void GetTip(string filename, int startLine, int startIndex, int endLine, int endIndex)
-        {
-            IAbstractSyntaxTree ast = null;
-            if (!_modules.TryGetValue(filename, out ast))
-                throw new COMException("module not found", 1);
-
-            _tipStart = new CodeLocation(startIndex + 1, startLine);
-            _tipEnd = new CodeLocation(startIndex + 2, startLine);
-            _tipText = "";
-
-            _editorData.CaretLocation = _tipStart;
-            _editorData.SyntaxTree = ast as DModule;
-            _editorData.ModuleCode = _sources[filename];
-            _editorData.CaretOffset = getCodeOffset(_editorData.ModuleCode, _tipStart);
-            AbstractTooltipContent[] content = AbstractTooltipProvider.BuildToolTip(_editorData);
-            if(content == null || content.Length == 0)
-                _tipText = "";
-            else
-                foreach (var c in content)
-                   _tipText += c.Title + ":" + c.Description + "\n";
-
-            //MessageBox.Show("GetTip()");
-            //throw new NotImplementedException();
-        }
-        public void GetTipResult(out int startLine, out int startIndex, out int endLine, out int endIndex, out string answer)
-        {
-            startLine = _tipStart.Line;
-            startIndex = _tipStart.Column - 1;
-            endLine = _tipEnd.Line;
-            endIndex = _tipEnd.Column - 1;
-            answer = _tipText;
-            //MessageBox.Show("GetTipResult()");
-            //throw new NotImplementedException();
-        }
-        public void GetSemanticExpansions(string filename, string tok, uint line, uint idx, string expr)
-        {
-            IAbstractSyntaxTree ast = null;
-            if (!_modules.TryGetValue(filename, out ast))
-                throw new COMException("module not found", 1);
-
-            CodeLocation loc = new CodeLocation((int)idx + 1, (int) line);
-
-            _editorData.CaretLocation = loc;
-            _editorData.SyntaxTree = ast as DModule;
-            _editorData.ModuleCode = _sources[filename];
-            _editorData.CaretOffset = getCodeOffset(_editorData.ModuleCode, loc);
+			int off = 0;
+			for (int ln = 1; ln < loc.Line; ln++)
+				off = s.IndexOf('\n', off) + 1;
+			return off + loc.Column - 1;
+		}
+		static bool isIdentifierCharacter(Char ch)
+		{
+			return Char.IsLetterOrDigit(ch) || ch == '_';
+		}
+
+		public void GetTip(string filename, int startLine, int startIndex, int endLine, int endIndex)
+		{
+			IAbstractSyntaxTree ast = null;
+			if (!_modules.TryGetValue(filename, out ast))
+				throw new COMException("module not found", 1);
+
+			_tipStart = new CodeLocation(startIndex + 1, startLine);
+			_tipEnd = new CodeLocation(startIndex + 2, startLine);
+			_tipText = "";
+
+			_editorData.CaretLocation = _tipStart;
+			_editorData.SyntaxTree = ast as DModule;
+			_editorData.ModuleCode = _sources[filename];
+			// codeOffset+1 because otherwise it does not work on the first character
+			_editorData.CaretOffset = getCodeOffset(_editorData.ModuleCode, _tipStart) + 1;
+			AbstractTooltipContent[] content = AbstractTooltipProvider.BuildToolTip(_editorData);
+			if(content == null || content.Length == 0)
+				_tipText = "";
+			else
+				foreach (var c in content)
+				   _tipText += c.Title + ":" + c.Description + "\n";
+
+			//MessageBox.Show("GetTip()");
+			//throw new NotImplementedException();
+		}
+		public void GetTipResult(out int startLine, out int startIndex, out int endLine, out int endIndex, out string answer)
+		{
+			startLine = _tipStart.Line;
+			startIndex = _tipStart.Column - 1;
+			endLine = _tipEnd.Line;
+			endIndex = _tipEnd.Column - 1;
+			answer = _tipText;
+			//MessageBox.Show("GetTipResult()");
+			//throw new NotImplementedException();
+		}
+		public void GetSemanticExpansions(string filename, string tok, uint line, uint idx, string expr)
+		{
+			IAbstractSyntaxTree ast = null;
+			if (!_modules.TryGetValue(filename, out ast))
+				throw new COMException("module not found", 1);
+
+			CodeLocation loc = new CodeLocation((int)idx + 1, (int) line);
+
+			_editorData.CaretLocation = loc;
+			_editorData.SyntaxTree = ast as DModule;
+			_editorData.ModuleCode = _sources[filename];
+			_editorData.CaretOffset = getCodeOffset(_editorData.ModuleCode, loc);
+			// step back to beginning of identifier
+			while(_editorData.CaretOffset > 0 && isIdentifierCharacter(_editorData.ModuleCode[_editorData.CaretOffset-1]))
+				  _editorData.CaretOffset--;

 			VDServerCompletionDataGenerator cdgen = new VDServerCompletionDataGenerator(tok);
-            AbstractCompletionProvider provider = AbstractCompletionProvider.BuildCompletionData(cdgen, _editorData, null); //tok
-
-            _expansions = cdgen.expansions;
-        }
-        public void GetSemanticExpansionsResult(out string stringList)
-        {
-            stringList = _expansions;
-            //MessageBox.Show("GetSemanticExpansionsResult()");
-            //throw new NotImplementedException();
-        }
-        public void IsBinaryOperator(string filename, uint startLine, uint startIndex, uint endLine, uint endIndex, out bool pIsOp)
-        {
-            IAbstractSyntaxTree ast = null;
-            if (!_modules.TryGetValue(filename, out ast))
-                throw new COMException("module not found", 1);
-
-            MessageBox.Show("IsBinaryOperator()");
-            throw new NotImplementedException();
-        }
-        public void GetParseErrors(string filename, out string errors)
-        {
-            IAbstractSyntaxTree ast = null;
-            if (!_modules.TryGetValue(filename, out ast))
-                throw new COMException("module not found", 1);
-
-            var asterrors = ast.ParseErrors;
-
-            string errs = "";
-            int cnt = asterrors.Count();
-            for (int i = 0; i < cnt; i++)
-            {
-                var err = asterrors[i];
-                errs += String.Format("{0},{1},{2},{3}:{4}\n", err.Location.Line, err.Location.Column - 1, err.Location.Line, err.Location.Column, err.Message);
-            }
-            errors = errs;
-            //MessageBox.Show("GetParseErrors()");
-            //throw new COMException("No Message", 1);
-        }
-        public void GetBinaryIsInLocations(string filename, out uint[] locs) // array of pairs of DWORD
-        {
-            //MessageBox.Show("GetBinaryIsInLocations()");
-            locs = null;
-            //throw new COMException("No Message", 1);
-        }
-        public void GetLastMessage(out string message)
-        {
-            //MessageBox.Show("GetLastMessage()");
+			AbstractCompletionProvider provider = AbstractCompletionProvider.BuildCompletionData(cdgen, _editorData, null); //tok
+
+			_expansions = cdgen.expansions;
+		}
+		public void GetSemanticExpansionsResult(out string stringList)
+		{
+			stringList = _expansions;
+			//MessageBox.Show("GetSemanticExpansionsResult()");
+			//throw new NotImplementedException();
+		}
+		public void IsBinaryOperator(string filename, uint startLine, uint startIndex, uint endLine, uint endIndex, out bool pIsOp)
+		{
+			IAbstractSyntaxTree ast = null;
+			if (!_modules.TryGetValue(filename, out ast))
+				throw new COMException("module not found", 1);
+
+			MessageBox.Show("IsBinaryOperator()");
+			throw new NotImplementedException();
+		}
+		public void GetParseErrors(string filename, out string errors)
+		{
+			IAbstractSyntaxTree ast = null;
+			if (!_modules.TryGetValue(filename, out ast))
+				throw new COMException("module not found", 1);
+
+			var asterrors = ast.ParseErrors;
+
+			string errs = "";
+			int cnt = asterrors.Count();
+			for (int i = 0; i < cnt; i++)
+			{
+				var err = asterrors[i];
+				errs += String.Format("{0},{1},{2},{3}:{4}\n", err.Location.Line, err.Location.Column - 1, err.Location.Line, err.Location.Column, err.Message);
+			}
+			errors = errs;
+			//MessageBox.Show("GetParseErrors()");
+			//throw new COMException("No Message", 1);
+		}
+		public void GetBinaryIsInLocations(string filename, out uint[] locs) // array of pairs of DWORD
+		{
+			//MessageBox.Show("GetBinaryIsInLocations()");
+			locs = null;
+			//throw new COMException("No Message", 1);
+		}
+		public void GetLastMessage(out string message)
+		{
+			//MessageBox.Show("GetLastMessage()");
 			message = "__no_message__"; // avoid throwing exception
-            //throw new COMException("No Message", 1);
-        }
+			//throw new COMException("No Message", 1);
+		}
 		public void GetDefinition(string filename, uint startLine, uint startIndex, uint endLine, uint endIndex)
 		{
 		}
@@ -328,6 +351,7 @@
 			_editorData.VersionNumber = (int)(_flags >> 8) & 0xff;
 			_editorData.GlobalVersionIds = versions.Split('\n');
 			_editorData.GlobalDebugIds = _debugIds.Split('\n');
+			_editorData.Options = new CompletionOptions { ShowUFCSItems = true };
 		}
 	}
 }


Update resource names

Update resource names

--- test/Microsoft.AspNet.Razor.Test/Utils/TestFile.cs
+++ test/Microsoft.AspNet.Razor.Test/Utils/TestFile.cs
@@ -11,13 +11,13 @@
     {
         public const string ResourceNameFormat = "{0}.TestFiles.{1}";

-        public string ResourceName { get; set; }
+        public string ResourceName { get; }
         public Assembly Assembly { get; set; }

         public TestFile(string resName, Assembly asm)
         {
-            ResourceName = resName;
             Assembly = asm;
+            ResourceName = Assembly.GetName().Name + "." + resName.Replace('/', '.');
         }

         public static TestFile Create(string localResourceName)


fix #300 missing multiget overloads on IElasticClient

--- src/Nest/IElasticClient.cs
+++ src/Nest/IElasticClient.cs
@@ -153,6 +153,9 @@

 		IEnumerable<T> MultiGet<T>(IEnumerable<int> ids) where T : class;
 		IEnumerable<T> MultiGet<T>(IEnumerable<string> ids) where T : class;
+		IEnumerable<T> MultiGet<T>(string index, IEnumerable<int> ids) where T : class;
+		IEnumerable<T> MultiGet<T>(string index, IEnumerable<string> ids) where T : class;
+
 		IEnumerable<T> MultiGet<T>(string index, string type, IEnumerable<int> ids) where T : class;
 		IEnumerable<T> MultiGet<T>(string index, string type, IEnumerable<string> ids) where T : class;


[Modify] Edit it

[Modify] Edit it

--- websocket-sharp/Logger.cs
+++ websocket-sharp/Logger.cs
@@ -272,14 +272,14 @@
     }

     /// <summary>
-    /// Outputs <paramref name="message"/> as a log with <see cref="LogLevel.Info"/>.
-    /// </summary>
-    /// <remarks>
-    /// If the current logging level is higher than <see cref="LogLevel.Info"/>,
-    /// this method doesn't output <paramref name="message"/> as a log.
-    /// </remarks>
-    /// <param name="message">
-    /// A <see cref="string"/> that represents the message to output as a log.
+    /// Outputs the specified message as a log with the Info level.
+    /// </summary>
+    /// <remarks>
+    /// If the current logging level is higher than the Info level,
+    /// this method does not output the message as a log.
+    /// </remarks>
+    /// <param name="message">
+    /// A <see cref="string"/> that specifies the message to output.
     /// </param>
     public void Info (string message)
     {


Unit test changed to make use of rawLogLevel and shouldCreateDirectory parameters.

--- tests/NLog.UnitTests/Common/InternalLoggerTests.cs
+++ tests/NLog.UnitTests/Common/InternalLoggerTests.cs
@@ -403,8 +403,6 @@
         [InlineData("off", false)]
         public void CreateDirectoriesIfNeededTests(string rawLogLevel, bool shouldCreateDirectory)
         {
-            var logLevel = LogLevel.FromString(rawLogLevel);
-
             string expected =
                     "Warn WWW" + Environment.NewLine +
                     "Error EEE" + Environment.NewLine +
@@ -413,13 +411,12 @@
                     "Debug DDD" + Environment.NewLine +
                     "Info III" + Environment.NewLine;

-
             var tempPath = Path.GetTempPath();
             var tempFileName = Path.GetRandomFileName();
             var randomSubDirectory = Path.Combine(tempPath, Path.GetRandomFileName());
             string tempFile = Path.Combine(randomSubDirectory, tempFileName);

-            InternalLogger.LogLevel = LogLevel.Trace;
+            InternalLogger.LogLevel = LogLevel.FromString(rawLogLevel);
             InternalLogger.IncludeTimestamp = false;

             Assert.False(Directory.Exists(randomSubDirectory));
@@ -427,7 +424,7 @@
             // Set the log file, which will only create the needed directories
             InternalLogger.LogFile = tempFile;

-            Assert.True(Directory.Exists(randomSubDirectory));
+            Assert.True(Directory.Exists(randomSubDirectory) == shouldCreateDirectory);

             try
             {


Add Name property to clients.

Add Name property to clients.


Adapted C#-API-URI to server code

Adapted C#-API-URI to server code

--- src/Client/Docular.Client.Core/Model/Rest/DocularClient.cs
+++ src/Client/Docular.Client.Core/Model/Rest/DocularClient.cs
@@ -62,7 +62,7 @@
         /// <summary>
         /// The sub path for a documents content by ID.
         /// </summary>
-        public const String DocumentsIdContent = DocumentsId + "/content";
+        public const String DocumentsIdPayload = DocumentsId + "/payload";

         /// <summary>
         /// The sub path for a documents thumbnail by ID.
@@ -167,7 +167,7 @@
         /// <returns>The <see cref="Document"/>'s content.</returns>
         public async Task<Stream> GetContentAsync(String documentId)
         {
-            RestRequest contentRequest = new RestRequest(DocumentsIdContent, HttpMethod.Get);
+            RestRequest contentRequest = new RestRequest(DocumentsIdPayload, HttpMethod.Get);
             contentRequest.Serializer = this.serializer;
             contentRequest.AddUrlSegment("id", documentId);
             return (await this.restClient.Execute<Stream>(contentRequest)).Data;


Fix error

Fix error

--- tests/Core2D.ViewModels.UnitTests/Style/ArrowStyleTests.cs
+++ tests/Core2D.ViewModels.UnitTests/Style/ArrowStyleTests.cs
@@ -1,5 +1,6 @@
 // Copyright (c) Wiesław Šoltés. All rights reserved.
 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
+using Core2D.Interfaces;
 using Core2D.Style;
 using Xunit;


Addressing comments.

Addressing comments.

--- src/Host/Client/Impl/BrokerServices/RemoteUriWebService.cs
+++ src/Host/Client/Impl/BrokerServices/RemoteUriWebService.cs
@@ -58,11 +58,11 @@
                 }
             } finally {
                 if (response != null) {
-                    if (context.Request.IsWebSocketRequest) {
+                    if (context.Request.IsWebSocketRequest && response.StatusCode == HttpStatusCode.SwitchingProtocols) {
                         Stream respStream = response.GetResponseStream();
                         string subProtocol = response.Headers[Constants.Headers.SecWebSocketProtocol];
-                        var remoteWebSocket = CommonWebSocket.CreateClientWebSocket(respStream, subProtocol, TimeSpan.FromMinutes(10), 65335, true);
-                        var websocketContext = await context.AcceptWebSocketAsync(subProtocol, 65335, TimeSpan.FromMinutes(10));
+                        var remoteWebSocket = CommonWebSocket.CreateClientWebSocket(respStream, subProtocol, TimeSpan.FromMinutes(10), receiveBufferSize: 65335, useZeroMask: true);
+                        var websocketContext = await context.AcceptWebSocketAsync(subProtocol, receiveBufferSize: 65335, keepAliveInterval: TimeSpan.FromMinutes(10));
                         await WebSocketHelper.SendReceiveAsync(websocketContext.WebSocket, remoteWebSocket, ct);
                     } else {
                         context.Response.StatusCode = (int)response.StatusCode;


updated tests

updated tests

--- tests/OmniSharp.Roslyn.CSharp.Tests/GoToDefinitionFacts.cs
+++ tests/OmniSharp.Roslyn.CSharp.Tests/GoToDefinitionFacts.cs
@@ -9,6 +9,7 @@
 using Xunit;
 using Xunit.Abstractions;
 using System.Collections.Generic;
+using Microsoft.CodeAnalysis;

 namespace OmniSharp.Roslyn.CSharp.Tests
 {
@@ -400,6 +401,7 @@
                 // 3. the metadata response contains SourceName (metadata "file") and SourceText (syntax tree)
                 // use the source to locate "IComparable" which is an interface implemented by Int32 struct
                 var metadataTree = CSharpSyntaxTree.ParseText(metadataResponse.Source);
+
                 var iComparable = metadataTree.GetCompilationUnitRoot().
                     DescendantNodesAndSelf().
                     OfType<BaseTypeDeclarationSyntax>().First().
@@ -427,6 +429,94 @@
             }
         }

+        [Theory]
+        [InlineData("bar.cs")]
+        [InlineData("bar.csx")]
+        public async Task ReturnsDecompiledDefinition_FromMetadata_WhenSymbolIsType(string filename)
+        {
+            var testFile = new TestFile(filename, @"
+using System;
+class Bar {
+    public void Baz() {
+        var number = in$$t.MaxValue;
+    }
+}");
+
+            using var host = CreateOmniSharpHost(new[] { testFile }, new Dictionary<string, string>
+            {
+                ["RoslynExtensionsOptions:EnableDecompilationSupport"] = "true"
+            });
+
+            var point = testFile.Content.GetPointFromPosition();
+
+            // 1. start by asking for definition of "int"
+            var gotoDefinitionRequest = new GotoDefinitionRequest
+            {
+                FileName = testFile.FileName,
+                Line = point.Line,
+                Column = point.Offset,
+                WantMetadata = true
+            };
+            var gotoDefinitionRequestHandler = GetRequestHandler(host);
+            var gotoDefinitionResponse = await gotoDefinitionRequestHandler.Handle(gotoDefinitionRequest);
+
+            // 2. now, based on the response information
+            // go to the metadata endpoint, and ask for "int" specific decompiled source
+            var metadataRequest = new MetadataRequest
+            {
+                AssemblyName = gotoDefinitionResponse.MetadataSource.AssemblyName,
+                TypeName = gotoDefinitionResponse.MetadataSource.TypeName,
+                ProjectName = gotoDefinitionResponse.MetadataSource.ProjectName,
+                Language = gotoDefinitionResponse.MetadataSource.Language
+            };
+            var metadataRequestHandler = host.GetRequestHandler<MetadataService>(OmniSharpEndpoints.Metadata);
+            var metadataResponse = await metadataRequestHandler.Handle(metadataRequest);
+
+            // 3. the response contains SourceName ("file") and SourceText (syntax tree)
+            // use the source to locate "IComparable" which is an interface implemented by Int32 struct
+            var decompiledTree = CSharpSyntaxTree.ParseText(metadataResponse.Source);
+            var compilationUnit = decompiledTree.GetCompilationUnitRoot();
+
+            // second comment should indicate we have decompiled
+            var comments = compilationUnit.DescendantTrivia().Where(t => t.Kind() == SyntaxKind.SingleLineCommentTrivia).ToArray();
+            Assert.NotNull(comments);
+            Assert.Equal("// Decompiled with ICSharpCode.Decompiler 5.0.2.5153", comments[1].ToString());
+
+            // contrary to regular metadata, we should have methods with full bodies
+            // this condition would fail if decompilation wouldn't work
+            var methods = compilationUnit.
+                DescendantNodesAndSelf().
+                OfType<MethodDeclarationSyntax>().
+                Where(m => m.Body != null);
+
+            Assert.NotEmpty(methods);
+
+            var iComparable = compilationUnit.
+                DescendantNodesAndSelf().
+                OfType<BaseTypeDeclarationSyntax>().First().
+                BaseList.Types.FirstOrDefault(x => x.Type.ToString() == "IComparable");
+            var relevantLineSpan = iComparable.GetLocation().GetLineSpan();
+
+            // 4. now ask for the definition of "IComparable"
+            // pass in the SourceName (metadata "file") as FileName - since it's not a regular file in our workspace
+            var metadataNavigationRequest = new GotoDefinitionRequest
+            {
+                FileName = metadataResponse.SourceName,
+                Line = relevantLineSpan.StartLinePosition.Line,
+                Column = relevantLineSpan.StartLinePosition.Character,
+                WantMetadata = true
+            };
+            var metadataNavigationResponse = await gotoDefinitionRequestHandler.Handle(metadataNavigationRequest);
+
+            // 5. validate the response to be matching the expected IComparable meta info
+            Assert.NotNull(metadataNavigationResponse.MetadataSource);
+            Assert.Equal(AssemblyHelpers.CorLibName, metadataNavigationResponse.MetadataSource.AssemblyName);
+            Assert.Equal("System.IComparable", metadataNavigationResponse.MetadataSource.TypeName);
+
+            Assert.NotEqual(0, metadataNavigationResponse.Line);
+            Assert.NotEqual(0, metadataNavigationResponse.Column);
+        }
+
         [Fact]
         public async Task ReturnsNoResultsButDoesNotThrowForNamespaces()
         {
@@ -462,7 +552,7 @@
             using var host = CreateOmniSharpHost(new[] { testFile }, new Dictionary<string, string>
             {
                 ["RoslynExtensionsOptions:EnableDecompilationSupport"] = "true"
-            }, TestAssets.Instance.TestFilesFolder);
+            });

             var response = await GetResponseAsync(new[] { testFile }, wantMetadata: true);


restart main site because of locked files

--- AzureFunctions/Controllers/AzureFunctionsController.cs
+++ AzureFunctions/Controllers/AzureFunctionsController.cs
@@ -127,6 +127,7 @@
                     if (!appSettings.properties.ContainsKey(Constants.SiteExtensionsVersion) ||
                         !appSettings.properties[Constants.SiteExtensionsVersion].Equals(currentSiteExtensionsVersion, StringComparison.OrdinalIgnoreCase))
                     {
+                        await client.PutAsJsonAsync(ArmUriTemplates.PutSiteAppSettings.Bind(new { subscriptionId = subscription.subscriptionId, resourceGroupName = resourceGroup.name, siteName = site.name }), new { properties = appSettings.properties });
                         await PublishSiteExtensions(client, scmUrl, firstTime: false);
                         appSettings.properties[Constants.SiteExtensionsVersion] = currentSiteExtensionsVersion;
                         updateAppSettings = true;
@@ -158,11 +159,16 @@
                     vfsResponse = await client.SendAsync(deleteReq);
                     await vfsResponse.EnsureSuccessStatusCodeWithFullError();
                 }
+                else
+                {
+                    await client.DeleteAsync($"{scmUrl}/api/processes/-1");
+                }
                 var pKuduResponse = await client.PutAsync($"{scmUrl}/api/zip", new StreamContent(kuduStream));
                 await pKuduResponse.EnsureSuccessStatusCodeWithFullError();
                 pKuduResponse = await client.PutAsync($"{scmUrl}/api/zip", new StreamContent(sdkStream));
                 await pKuduResponse.EnsureSuccessStatusCodeWithFullError();
-                pKuduResponse = await client.DeleteAsync($"{scmUrl}/api/processes/0");
+                await client.DeleteAsync($"{scmUrl}/api/processes/0");
+                await client.DeleteAsync($"{scmUrl}/api/processes/-1");
                 //pKuduResponse.EnsureSuccessStatusCode();
             }
         }


Speedup? probably not according to msdn readers and writers now use own buffer

--- BigFileTransformation/BigFileTransformation/Program.cs
+++ BigFileTransformation/BigFileTransformation/Program.cs
@@ -12,13 +12,17 @@
     class Program
     {
         private const int FlushAfterLines = 100*1000;
+        private const string path = @"D:\TestTP\triada_export.txt";
+        private const string outputFile = @"D:\TestTP\output2.txt";

         static void Main(string[] args)
         {
             var timer = new Stopwatch();
             timer.Start();
-            using (var reader = System.IO.File.OpenText(@"D:\TestTP\triada_export.txt"))
-            using (var writer = new StreamWriter(@"D:\TestTP\output.txt", false))
+            using (FileStream fs = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.None))
+            using (BufferedStream bs = new BufferedStream(fs))
+            using (StreamReader reader = new StreamReader(bs))
+            using (var writer = new StreamWriter(outputFile, false))
             {
                 string line = null;
                 int processedLines = 0;
@@ -41,7 +45,7 @@
                     if (processedLines % FlushAfterLines == 0)
                     {
                         processed10kLinesCount++;
-                        Console.WriteLine("Processed {0} lines. Elapsed time: {1:T}", processed10kLinesCount*FlushAfterLines, timer.Elapsed);
+                        Console.WriteLine("Processed {0:N} lines. Elapsed time: {1:T}", processed10kLinesCount*FlushAfterLines, timer.Elapsed);
                         writer.Flush();
                     }
                 }


New GetProduct test added

New GetProduct test added

--- Cdiscount.OpenApi.ProxyClient.Tests/GetProductTests.cs
+++ Cdiscount.OpenApi.ProxyClient.Tests/GetProductTests.cs
@@ -41,5 +41,23 @@
             Assert.AreEqual("fincpangfirrnoir".ToUpper(), product.Id);
             Assert.IsFalse(string.IsNullOrEmpty(product.Ean));
         }
+
+        [TestMethod]
+        public void GetProduct_2ProductsByProductId_OperationSuccess()
+        {
+            var response = _openApiProxyClient.GetProduct(new GetProductRequest
+            {
+                ProductIdList = new List<string> { "fincpangfirrnoir", "tu03" },
+                Scope = new GetProductRequestScope
+                {
+                    Ean = true
+                }
+            });
+
+            Assert.IsNotNull(response);
+            Assert.IsTrue(response.OperationSuccess);
+            Assert.IsTrue(string.IsNullOrEmpty(response.ErrorMessage));
+            Assert.AreEqual(2, response.Products.Count);
+        }
     }
 }


Change public commands to be straight ICommand (easier for them to be replaced if we implement an mvvm framework later)

--- CefSharp.Wpf.Example/ViewModels/BrowserTabViewModel.cs
+++ CefSharp.Wpf.Example/ViewModels/BrowserTabViewModel.cs
@@ -63,10 +63,10 @@
             set { PropertyChanged.ChangeAndNotify(ref showSidebar, value, () => ShowSidebar); }
         }

-        public DelegateCommand GoCommand { get; set; }
-        public DelegateCommand HomeCommand { get; set; }
-        public DelegateCommand<string> ExecuteJavaScriptCommand { get; set; }
-        public DelegateCommand<string> EvaluateJavaScriptCommand { get; set; }
+        public ICommand GoCommand { get; set; }
+        public ICommand HomeCommand { get; set; }
+        public ICommand ExecuteJavaScriptCommand { get; set; }
+        public ICommand EvaluateJavaScriptCommand { get; set; }

         public event PropertyChangedEventHandler PropertyChanged;


add game Timer

add game Timer

--- ClickerGameEngine/ClickerGameEngine/MainWindow.xaml.cs
+++ ClickerGameEngine/ClickerGameEngine/MainWindow.xaml.cs
@@ -12,6 +12,7 @@
 using System.Windows.Media.Imaging;
 using System.Windows.Navigation;
 using System.Windows.Shapes;
+using System.Timers;

 namespace ClickerGameEngine
 {
@@ -20,9 +21,19 @@
     /// </summary>
     public partial class MainWindow : Window
     {
+        private Timer _timer;
+
         public MainWindow()
         {
             InitializeComponent();
+
+            //Timer object to handle each second auto-click. Game main-loop
+            //Set timer tact to 1sec
+            _timer = new Timer(1000);
+            //Timer start
+            _timer.Enabled = true;
+            //Add event method to our timer
+            _timer.Elapsed += OnTimedEvent;

             //We will need Builder to build our game objects
             GameObjectBuilder gameObjectBuilder = new GameObjectBuilder();
@@ -123,5 +134,11 @@
                 .Build();
             ((MainWindow)Application.Current.MainWindow).GameObjectImage8.Source = gameObject8.GetBitmap();
         }
+
+        //Timer event method
+        private static void OnTimedEvent(Object source, ElapsedEventArgs e)
+        {
+            Console.WriteLine("The Elapsed event was raised at {0}", e.SignalTime);
+        }
     }
 }


The grades for individual projects can now exceed 100, but the final grades will not exceed 10

--- CoursesAPI.Services/Services/CoursesServiceProvider.cs
+++ CoursesAPI.Services/Services/CoursesServiceProvider.cs
@@ -578,8 +578,8 @@
 				throw new MissingFieldException("A \"PersonSSN\" field is required");
 			}

-			if(viewModel.Grade < 0 || viewModel.Grade > 100){
-				throw new ArgumentException("The grade must be an integer value  between 0 and 100");
+			if(viewModel.Grade < 0){
+				throw new ArgumentException("The grade must be a positive integer value (A perfect score is 100)");
 			}

 			//See if the courseInstance exists
@@ -873,6 +873,9 @@
 			returnValue.Grade = Math.Round(returnValue.Grade, MidpointRounding.AwayFromZero);
 			returnValue.Grade /= 2;

+			if(returnValue.Grade > 10){
+				returnValue.Grade = 10;
+			}
 			return returnValue;
 		}


Correct AssemblyProduct name from Security to Credentials

--- Credentials/src/Credentials/Properties/AssemblyInfo.cs
+++ Credentials/src/Credentials/Properties/AssemblyInfo.cs
@@ -7,7 +7,7 @@
 // associated with an assembly.
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Security")]
+[assembly: AssemblyProduct("Credentials")]
 [assembly: AssemblyTrademark("")]

 // Setting ComVisible to false makes the types in this assembly not visible


US50230 - Make functions in D2LSecurityToken virtual

This allows people to mock this class. An interface would be akward due to
using SecurityToken as a base class, etc.

--- D2L.Security.OAuth2/SecurityTokens/D2LSecurityToken.cs
+++ D2L.Security.OAuth2/SecurityTokens/D2LSecurityToken.cs
@@ -8,7 +8,7 @@
 	/// <summary>
 	/// This implementation of SecurityToken has a configurable validFrom/validTo
 	/// </summary>
-	public sealed class D2LSecurityToken : SecurityToken, IDisposable {
+	public class D2LSecurityToken : SecurityToken, IDisposable {
 		private readonly Guid m_id;
 		private readonly DateTime m_validFrom;
 		private readonly DateTime m_validTo;
@@ -60,7 +60,7 @@
 			}
 		}

-		public Guid KeyId {
+		public virtual Guid KeyId {
 			get { return m_id; }
 		}

@@ -80,19 +80,19 @@
 			get { return m_validTo; }
 		}

-		public bool IsExpired() {
+		public virtual bool IsExpired() {
 			return DateTime.UtcNow > m_validTo;
 		}

-		public bool IsExpiringSoon( TimeSpan rolloverWindow ) {
+		public virtual bool IsExpiringSoon( TimeSpan rolloverWindow ) {
 			return DateTime.UtcNow >= m_validTo - rolloverWindow;
 		}

-		public bool HasPrivateKey() {
+		public virtual bool HasPrivateKey() {
 			return m_key.HasPrivateKey();
 		}

-		public AsymmetricAlgorithm GetAsymmetricAlgorithm() {
+		public virtual AsymmetricAlgorithm GetAsymmetricAlgorithm() {
 			if( m_key is X509AsymmetricSecurityKey ) {
 				throw new InvalidOperationException(
 					"This hacky thing is not applicable to the X509AsymmetricSecurityKey implementation"
@@ -108,7 +108,7 @@
 			return alg;
 		}

-		public void Dispose() {
+		public virtual void Dispose() {
 			var alg = GetAsymmetricAlgorithm();
 			alg.Dispose();
 		}


Formatting cleanup

Formatting cleanup

--- RailPhase/App.cs
+++ RailPhase/App.cs
@@ -333,44 +333,51 @@

                 while (IsRunning)
                 {
-                    if (listenerTask == null)
-                    {
-                        listenerTask = listener.GetContextAsync();
-                    }
-
-                    if (listenerTask.IsCompleted)
-                    {
-                        var httpContext = listenerTask.Result;
-                        listenerTask = null;
-
-                        ApplyDefaultSettings(httpContext);
-
-                        var requestTask = new Task(() =>
-                        {
-                            HandleRequest(httpContext);
-                            httpContext.Response.OutputStream.Flush();
-                            httpContext.Response.Close();
-                        });
-
-                        requestTask.Start();
-
-                        if (EnableAsyncProcessing)
-                        {
-                            OpenRequests.Enqueue(requestTask);
-                            while (OpenRequests.Count > MaxParallelRequests && OpenRequests.Count > 0)
-                            {
-                                var oldestTask = OpenRequests.Dequeue();
-                                oldestTask.Wait();
+                    try
+                    {
+                        if (listenerTask == null)
+                        {
+                            listenerTask = listener.GetContextAsync();
+                        }
+
+                        if (listenerTask.IsCompleted)
+                        {
+                            var httpContext = listenerTask.Result;
+                            listenerTask = null;
+
+                            ApplyDefaultSettings(httpContext);
+
+                            var requestTask = new Task(() =>
+                            {
+                                HandleRequest(httpContext);
+                                httpContext.Response.OutputStream.Flush();
+                                httpContext.Response.Close();
+                            });
+
+                            requestTask.Start();
+
+                            if (EnableAsyncProcessing)
+                            {
+                                OpenRequests.Enqueue(requestTask);
+                                while (OpenRequests.Count > MaxParallelRequests && OpenRequests.Count > 0)
+                                {
+                                    var oldestTask = OpenRequests.Dequeue();
+                                    oldestTask.Wait();
+                                }
                             }
+                            else
+                            {
+                                requestTask.Wait();
+                            }
                         }
                         else
                         {
-                            requestTask.Wait();
-                        }
-                    }
-                    else
-                    {
-                        Thread.Sleep(1);
+                            Thread.Sleep(1);
+                        }
+                    }
+                    catch(Exception e)
+                    {
+
                     }
                 }


Remove non-matching width/padding

Remove non-matching width/padding

--- osu.Framework/Testing/Drawables/Sections/ToolbarAssemblySection.cs
+++ osu.Framework/Testing/Drawables/Sections/ToolbarAssemblySection.cs
@@ -48,8 +48,7 @@
                     {
                         LabelText = "Run all steps",
                         RightHandedCheckbox = true,
-                        AutoSizeAxes = Axes.Y,
-                        Width = 140,
+                        AutoSizeAxes = Axes.Both,
                         Anchor = Anchor.CentreLeft,
                         Origin = Anchor.CentreLeft,
                         Current = browser.RunAllSteps


git-svn-id: 21cdf44b51306c1f0753fc51e774ecf5fc1851ba@1706 a61f9e97-bd4c-0410-8c65-85b29eaa70ff


Fixing donation deletions

Fixing donation deletions


reenabled test for https://github.com/pythonnet/pythonnet/issues/1256 : NoStackOverflowOnSystemType (#1943)

--- src/embed_tests/Codecs.cs
+++ src/embed_tests/Codecs.cs
@@ -285,7 +285,6 @@
         }

         // regression for https://github.com/pythonnet/pythonnet/issues/1427
-        [Ignore("https://github.com/pythonnet/pythonnet/issues/1256")]
         [Test]
         public void PythonRegisteredDecoder_NoStackOverflowOnSystemType()
         {


Use adjustable max message size

Use adjustable max message size

The network connection provider was not using it's newer adjustable max
message size.

--- Desktop/Tempest/Providers/Network/NetworkConnection.cs
+++ Desktop/Tempest/Providers/Network/NetworkConnection.cs
@@ -291,7 +291,6 @@
 		private const int ResponseFlag = 16777216;
 		private const int MaxMessageId = 8388608;
 		private const int BaseHeaderLength = 11;
-		private int maxMessageLength = 1048576;

 		protected int connectionId;
 		protected readonly string typeName;
@@ -992,7 +991,7 @@
 				}

 				length = header.MessageLength;
-				if (length > maxMessageLength)
+				if (length > maxMessageSize)
 				{
 					Disconnect (true);
 					Trace.WriteLineIf (NTrace.TraceVerbose, "Exiting (bad message size)", callCategory);
@@ -1367,7 +1366,7 @@
 		private static volatile int bufferCount = 0;

 		internal static readonly TraceSwitch NTrace = new TraceSwitch ("Tempest.Networking", "NetworkConnectionProvider");
-		internal static int maxMessageSize;
+		internal static int maxMessageSize = 1048576;
 		internal static int sendBufferLimit = Environment.ProcessorCount;
 		private static bool autoSizeSendBufferLimit = true;


git-svn-id: 21cdf44b51306c1f0753fc51e774ecf5fc1851ba@1419 a61f9e97-bd4c-0410-8c65-85b29eaa70ff

--- Dorian/Gorgon/Gorgon.Graphics/Buffers/BufferTesting.cs
+++ Dorian/Gorgon/Gorgon.Graphics/Buffers/BufferTesting.cs
@@ -36,14 +36,14 @@
     /// <para>This buffer type is meant to be used to be used with the <see cref="GorgonLibrary.Graphics.GorgonOutputMerger.DrawInstancedIndirect">DrawInstancedIndirect</see> method.</para>
     /// <para>This buffer type is only available to video devices that are SM_5 or better.</para>
     /// </remarks>
-    public class GorgonIndirectArgumentBuffer
+    public class BufferTesting
     {
         #region Constructor/Destructor.
         /// <summary>
-        /// Initializes a new instance of the <see cref="GorgonIndirectArgumentBuffer"/> class.
+        /// Initializes a new instance of the <see cref="BufferTesting"/> class.
         /// </summary>
         /// <param name="graphics">The graphics interface that owns this object.</param>
-        public GorgonIndirectArgumentBuffer(GorgonGraphics graphics)
+        public BufferTesting(GorgonGraphics graphics)
         {
 			/*
 			   A resource cannot created with both D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS and D3D11_RESOURCE_MISC_BUFFER_STRUCTURED. [ STATE_CREATION ERROR #68: CREATEBUFFER_INVALIDMISCFLAGS]


Strengthen data type of JsonIntegerLiteralSyntax.IntegerToken.

--- Eutherion/Shared/Text/Json/JsonIntegerLiteralSyntax.cs
+++ Eutherion/Shared/Text/Json/JsonIntegerLiteralSyntax.cs
@@ -28,13 +28,13 @@
     /// </summary>
     public sealed class JsonIntegerLiteralSyntax : JsonValueSyntax
     {
-        public JsonSymbol IntegerToken { get; }
+        public JsonValue IntegerToken { get; }

         public BigInteger Value { get; }

         public override int Length => IntegerToken.Length;

-        public JsonIntegerLiteralSyntax(JsonSymbol integerToken, BigInteger value)
+        public JsonIntegerLiteralSyntax(JsonValue integerToken, BigInteger value)
         {
             IntegerToken = integerToken;
             Value = value;