* Fix for GetTerrainHeightAtXY to make it compatible when Constants.RegionSize isn't 256

--- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -1564,12 +1564,13 @@
             m_parentScene = pScene;

         }
-// Recovered for use by fly height. Kitto Flora
+
+        // Recovered for use by fly height. Kitto Flora
         public float GetTerrainHeightAtXY(float x, float y)
         {

-            int offsetX = ((int) (x/256)) * 256;
-            int offsetY = ((int) (y/256)) * 256;
+            int offsetX = ((int)(x / (int)Constants.RegionSize)) * (int)Constants.RegionSize;
+            int offsetY = ((int)(y / (int)Constants.RegionSize)) * (int)Constants.RegionSize;

             IntPtr heightFieldGeom = IntPtr.Zero;


Config helper class created

Config helper class created

--- EasyBus.Shared/Helpers/ConfigHelper.cs
+++ EasyBus.Shared/Helpers/ConfigHelper.cs
@@ -8,6 +8,7 @@
     public static class ConfigHelper
     {

+        public static string ConnectionString = "Your_RabbitMq_ConnectionString"; //AppConfig.Read<string>("RabbitMqConnectionString", string.Empty);

     }
 }


annotations

annotations

--- Elephanet.Tests/Tests.cs
+++ Elephanet.Tests/Tests.cs
@@ -156,7 +156,7 @@
             var dummyCars = new Fixture().Build<Car>()
                 .With(x => x.Make, "Subaru")
                 .CreateMany().ToList();
-
+            //setup
             using (var session = _store.OpenSession())
             {
                 foreach (var car in dummyCars)
@@ -165,7 +165,7 @@
                 }
                 session.SaveChanges();
             }
-
+            //delete
             using (var session = _store.OpenSession())
             {
                 foreach (var car in dummyCars)
@@ -174,7 +174,7 @@
                     session.SaveChanges();
                 }
             }
-
+            //check
             using (var session = _store.OpenSession())
             {
                 var records = session.Query<Car>().Where(c => c.Make == "Subaru").ToList();


Open URL in new window browser

Open URL in new window browser

--- Plugins/Wox.Plugin.Url/Main.cs
+++ Plugins/Wox.Plugin.Url/Main.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Text.RegularExpressions;
@@ -85,7 +85,7 @@
                                 }
                                 else
                                 {
-                                    Process.Start(_settings.BrowserPath,raw);
+                                    Process.Start(_settings.BrowserPath,"--new-window" + raw);
                                 }

                                 return true;


Auto-add picture box to Components in Game

--- EndlessClient/UIControls/PictureBox.cs
+++ EndlessClient/UIControls/PictureBox.cs
@@ -16,6 +16,8 @@
 			: base(null, null, parent)
 		{
 			SetNewPicture(displayPicture);
+			if (parent == null)
+				Game.Components.Add(this);
 		}

 		public void SetNewPicture(Texture2D displayPicture)


Minor type change

Minor type change

--- PART/Source/Core/Data/Part/PersonAttribute.cs
+++ PART/Source/Core/Data/Part/PersonAttribute.cs
@@ -58,7 +58,7 @@
     /// </summary>
     public partial class PersonAttributes
     {
-        public static Schemas.Part.AttributListeType ToXmlType(EntitySet<PersonAttributes> allDb)
+        public static Schemas.Part.AttributListeType ToXmlType(IQueryable<PersonAttributes> allDb)
         {
             if (allDb != null)
             {


Fix one last issue

Fix one last issue

--- src/Runner.cs
+++ src/Runner.cs
@@ -1,3 +1,4 @@
+using NValidate.Attributes;
 using NValidate.Internal;
 using System;
 using System.Collections.Generic;


update IsRunning

update IsRunning

--- source/Visibility/ArcMapAddinVisibility/ViewModels/RLOSViewModel.cs
+++ source/Visibility/ArcMapAddinVisibility/ViewModels/RLOSViewModel.cs
@@ -176,176 +176,190 @@
         /// </summary>
         internal override void CreateMapElement()
         {
-            if (!CanCreateElement || ArcMap.Document == null || ArcMap.Document.FocusMap == null || string.IsNullOrWhiteSpace(SelectedSurfaceName))
-                return;
-
-            //base.CreateMapElement();
-
-            var surface = GetSurfaceFromMapByName(ArcMap.Document.FocusMap, SelectedSurfaceName);
-
-            if (surface == null)
-                return;
-
-            // Determine if selected surface is projected or geographic
-            ILayer surfaceLayer = GetLayerFromMapByName(ArcMap.Document.FocusMap, SelectedSurfaceName);
-            var geoDataset = surfaceLayer as IGeoDataset;
-            SelectedSurfaceSpatialRef = geoDataset.SpatialReference;
-
-            if (SelectedSurfaceSpatialRef is IGeographicCoordinateSystem)
-            {
-                MessageBox.Show(VisibilityLibrary.Properties.Resources.RLOSUserPrompt, VisibilityLibrary.Properties.Resources.RLOSUserPromptCaption);
-                return;
-            }
-
-            using (ComReleaser oComReleaser = new ComReleaser())
-            {
-
-                // Create feature workspace
-                IFeatureWorkspace workspace = CreateFeatureWorkspace("tempWorkspace");
-
-                StartEditOperation((IWorkspace)workspace);
-
-                // Create feature class
-                IFeatureClass pointFc = CreateObserversFeatureClass(workspace, SelectedSurfaceSpatialRef, "Output" + RunCount.ToString());
-
-                double finalObserverOffset = GetOffsetInZUnits(ObserverOffset.Value, surface.ZFactor, OffsetUnitType);
-                double finalSurfaceOffset = GetOffsetInZUnits(SurfaceOffset, surface.ZFactor, OffsetUnitType);
-
-                double conversionFactor = GetConversionFactor(SelectedSurfaceSpatialRef);
-                double convertedMinDistance = MinDistance * conversionFactor;
-                double convertedMaxDistance = MaxDistance * conversionFactor;
-                double finalMinDistance = GetLinearDistance(ArcMap.Document.FocusMap, convertedMinDistance, OffsetUnitType);
-                double finalMaxDistance = GetLinearDistance(ArcMap.Document.FocusMap, convertedMaxDistance, OffsetUnitType);
-
-                double finalLeftHorizontalFOV = GetAngularDistance(ArcMap.Document.FocusMap, LeftHorizontalFOV, AngularUnitType);
-                double finalRightHorizontalFOV = GetAngularDistance(ArcMap.Document.FocusMap, RightHorizontalFOV, AngularUnitType);
-                double finalBottomVerticalFOV = GetAngularDistance(ArcMap.Document.FocusMap, BottomVerticalFOV, AngularUnitType);
-                double finalTopVerticalFOV = GetAngularDistance(ArcMap.Document.FocusMap, TopVerticalFOV, AngularUnitType);
-
-                // Out radius geometries
-                List<IGeometry> radius2GeomList = new List<IGeometry>();
-                List<IGeometry> radius1_2GeomList = new List<IGeometry>();
-                List<IGeometry> donutGeomList = new List<IGeometry>();
-
-                foreach (var observerPoint in ObserverAddInPoints)
-                {
-                    // Create buffer geometries for final Min/Max distance
-                    ITopologicalOperator topologicalOperator = observerPoint.Point as ITopologicalOperator;
-                    IGeometry geom = topologicalOperator.Buffer(finalMaxDistance);
-                    radius2GeomList.Add(geom);
-                    radius1_2GeomList.Add(geom);
-                    if (finalMinDistance > 0)
+            try
+            {
+                IsRunning = true;
+
+                if (!CanCreateElement || ArcMap.Document == null || ArcMap.Document.FocusMap == null || string.IsNullOrWhiteSpace(SelectedSurfaceName))
+                    return;
+
+                //base.CreateMapElement();
+
+                var surface = GetSurfaceFromMapByName(ArcMap.Document.FocusMap, SelectedSurfaceName);
+
+                if (surface == null)
+                    return;
+
+                // Determine if selected surface is projected or geographic
+                ILayer surfaceLayer = GetLayerFromMapByName(ArcMap.Document.FocusMap, SelectedSurfaceName);
+                var geoDataset = surfaceLayer as IGeoDataset;
+                SelectedSurfaceSpatialRef = geoDataset.SpatialReference;
+
+                if (SelectedSurfaceSpatialRef is IGeographicCoordinateSystem)
+                {
+                    MessageBox.Show(VisibilityLibrary.Properties.Resources.RLOSUserPrompt, VisibilityLibrary.Properties.Resources.RLOSUserPromptCaption);
+                    return;
+                }
+
+                using (ComReleaser oComReleaser = new ComReleaser())
+                {
+
+                    // Create feature workspace
+                    IFeatureWorkspace workspace = CreateFeatureWorkspace("tempWorkspace");
+
+                    StartEditOperation((IWorkspace)workspace);
+
+                    // Create feature class
+                    IFeatureClass pointFc = CreateObserversFeatureClass(workspace, SelectedSurfaceSpatialRef, "Output" + RunCount.ToString());
+
+                    double finalObserverOffset = GetOffsetInZUnits(ObserverOffset.Value, surface.ZFactor, OffsetUnitType);
+                    double finalSurfaceOffset = GetOffsetInZUnits(SurfaceOffset, surface.ZFactor, OffsetUnitType);
+
+                    double conversionFactor = GetConversionFactor(SelectedSurfaceSpatialRef);
+                    double convertedMinDistance = MinDistance * conversionFactor;
+                    double convertedMaxDistance = MaxDistance * conversionFactor;
+                    double finalMinDistance = GetLinearDistance(ArcMap.Document.FocusMap, convertedMinDistance, OffsetUnitType);
+                    double finalMaxDistance = GetLinearDistance(ArcMap.Document.FocusMap, convertedMaxDistance, OffsetUnitType);
+
+                    double finalLeftHorizontalFOV = GetAngularDistance(ArcMap.Document.FocusMap, LeftHorizontalFOV, AngularUnitType);
+                    double finalRightHorizontalFOV = GetAngularDistance(ArcMap.Document.FocusMap, RightHorizontalFOV, AngularUnitType);
+                    double finalBottomVerticalFOV = GetAngularDistance(ArcMap.Document.FocusMap, BottomVerticalFOV, AngularUnitType);
+                    double finalTopVerticalFOV = GetAngularDistance(ArcMap.Document.FocusMap, TopVerticalFOV, AngularUnitType);
+
+                    // Out radius geometries
+                    List<IGeometry> radius2GeomList = new List<IGeometry>();
+                    List<IGeometry> radius1_2GeomList = new List<IGeometry>();
+                    List<IGeometry> donutGeomList = new List<IGeometry>();
+
+                    foreach (var observerPoint in ObserverAddInPoints)
                     {
-                        IGeometry geom2 = topologicalOperator.Buffer(finalMinDistance);
-
-                        ITopologicalOperator eraseTopo = geom as ITopologicalOperator;
-                        IGeometry erasedGeom = eraseTopo.Difference(geom2);
-                        donutGeomList.Add(erasedGeom);
-                    }
-                    else
+                        // Create buffer geometries for final Min/Max distance
+                        ITopologicalOperator topologicalOperator = observerPoint.Point as ITopologicalOperator;
+                        IGeometry geom = topologicalOperator.Buffer(finalMaxDistance);
+                        radius2GeomList.Add(geom);
+                        radius1_2GeomList.Add(geom);
+                        if (finalMinDistance > 0)
+                        {
+                            IGeometry geom2 = topologicalOperator.Buffer(finalMinDistance);
+
+                            ITopologicalOperator eraseTopo = geom as ITopologicalOperator;
+                            IGeometry erasedGeom = eraseTopo.Difference(geom2);
+                            donutGeomList.Add(erasedGeom);
+                        }
+                        else
+                        {
+                            radius1_2GeomList.Add(geom);
+                        }
+
+                        double z1 = surface.GetElevation(observerPoint.Point) + finalObserverOffset;
+
+                        //create a new point feature
+                        IFeature ipFeature = pointFc.CreateFeature();
+
+                        // Set the field values for the feature
+                        SetFieldValues(finalObserverOffset, finalSurfaceOffset, finalMinDistance, finalMaxDistance, finalLeftHorizontalFOV,
+                            finalRightHorizontalFOV, finalBottomVerticalFOV, finalTopVerticalFOV, ipFeature);
+
+                        //Create shape
+                        IPoint point = new PointClass() { Z = z1, X = observerPoint.Point.X, Y = observerPoint.Point.Y, ZAware = true };
+                        ipFeature.Shape = point;
+                        ipFeature.Store();
+                    }
+
+                    IFeatureClassDescriptor fd = new FeatureClassDescriptorClass();
+                    fd.Create(pointFc, null, "OBJECTID");
+
+                    StopEditOperation((IWorkspace)workspace);
+
+                    try
                     {
-                        radius1_2GeomList.Add(geom);
+                        ILayer layer = GetLayerFromMapByName(ArcMap.Document.FocusMap, SelectedSurfaceName);
+                        string layerPath = GetLayerPath(layer);
+
+                        IFeatureLayer ipFeatureLayer = new FeatureLayerClass();
+                        ipFeatureLayer.FeatureClass = pointFc;
+
+                        IDataset ipDataset = (IDataset)pointFc;
+                        string outputFcName = ipDataset.BrowseName + "_output";
+                        string strPath = ipDataset.Workspace.PathName + "\\" + ipDataset.BrowseName;
+                        string outPath = ipDataset.Workspace.PathName + "\\" + outputFcName;
+
+                        IVariantArray parameters = new VarArrayClass();
+                        parameters.Add(layerPath);
+                        parameters.Add(strPath);
+                        parameters.Add(outPath);
+
+                        esriLicenseStatus status = GetSpatialAnalystLicense();
+
+                        IGeoProcessor2 gp = new GeoProcessorClass();
+
+                        gp.AddOutputsToMap = false;
+
+                        // Add a mask to buffer the output to selected distance
+                        SetGPMask(workspace, radius2GeomList, gp, "radiusMask");
+
+                        object oResult = gp.Execute("Visibility_sa", parameters, null);
+                        IGeoProcessorResult ipResult = (IGeoProcessorResult)oResult;
+
+                        ComReleaser.ReleaseCOMObject(gp);
+                        gp = null;
+                        GC.Collect();
+
+                        // Add buffer geometries to the map
+                        foreach (IGeometry geom in radius1_2GeomList)
+                        {
+                            var color = new RgbColorClass() { Blue = 255 } as IColor;
+                            AddGraphicToMap(geom, color, true);
+                        }
+
+                        IRasterLayer outputRasterLayer = new RasterLayerClass();
+                        outputRasterLayer.CreateFromFilePath(outPath);
+
+                        string fcName = IntersectOutput(outputRasterLayer, ipDataset, workspace, donutGeomList);
+
+                        IFeatureClass finalFc = workspace.OpenFeatureClass(fcName);
+
+                        IFeatureLayer outputFeatureLayer = new FeatureLayerClass();
+                        outputFeatureLayer.FeatureClass = finalFc;
+
+                        //Add it to a map if the layer is valid.
+                        if (outputFeatureLayer != null)
+                        {
+                            // set the renderer
+                            IFeatureRenderer featRend = UniqueValueRenderer(workspace, finalFc);
+                            IGeoFeatureLayer geoLayer = outputFeatureLayer as IGeoFeatureLayer;
+                            geoLayer.Renderer = featRend;
+                            geoLayer.Name = "VisibilityLayer_" + RunCount.ToString();
+
+                            // Set the layer transparency
+                            IDisplayFilterManager filterManager = (IDisplayFilterManager)outputFeatureLayer;
+                            ITransparencyDisplayFilter filter = new TransparencyDisplayFilter();
+                            filter.Transparency = 80;
+                            filterManager.DisplayFilter = filter;
+
+                            ESRI.ArcGIS.Carto.IMap map = ArcMap.Document.FocusMap;
+                            map.AddLayer((ILayer)outputFeatureLayer);
+                        }
+
+                        RunCount += 1;
                     }
-
-                    double z1 = surface.GetElevation(observerPoint.Point) + finalObserverOffset;
-
-                    //create a new point feature
-                    IFeature ipFeature = pointFc.CreateFeature();
-
-                    // Set the field values for the feature
-                    SetFieldValues(finalObserverOffset, finalSurfaceOffset, finalMinDistance, finalMaxDistance, finalLeftHorizontalFOV,
-                        finalRightHorizontalFOV, finalBottomVerticalFOV, finalTopVerticalFOV, ipFeature);
-
-                    //Create shape
-                    IPoint point = new PointClass() { Z = z1, X = observerPoint.Point.X, Y = observerPoint.Point.Y, ZAware = true };
-                    ipFeature.Shape = point;
-                    ipFeature.Store();
-                }
-
-                IFeatureClassDescriptor fd = new FeatureClassDescriptorClass();
-                fd.Create(pointFc, null, "OBJECTID");
-
-                StopEditOperation((IWorkspace)workspace);
-
-                try
-                {
-                    ILayer layer = GetLayerFromMapByName(ArcMap.Document.FocusMap, SelectedSurfaceName);
-                    string layerPath = GetLayerPath(layer);
-
-                    IFeatureLayer ipFeatureLayer = new FeatureLayerClass();
-                    ipFeatureLayer.FeatureClass = pointFc;
-
-                    IDataset ipDataset = (IDataset)pointFc;
-                    string outputFcName = ipDataset.BrowseName + "_output";
-                    string strPath = ipDataset.Workspace.PathName + "\\" + ipDataset.BrowseName;
-                    string outPath = ipDataset.Workspace.PathName + "\\" + outputFcName;
-
-                    IVariantArray parameters = new VarArrayClass();
-                    parameters.Add(layerPath);
-                    parameters.Add(strPath);
-                    parameters.Add(outPath);
-
-                    esriLicenseStatus status = GetSpatialAnalystLicense();
-
-                    IGeoProcessor2 gp = new GeoProcessorClass();
-
-                    gp.AddOutputsToMap = false;
-
-                    // Add a mask to buffer the output to selected distance
-                    SetGPMask(workspace, radius2GeomList, gp, "radiusMask");
-
-                    object oResult = gp.Execute("Visibility_sa", parameters, null);
-                    IGeoProcessorResult ipResult = (IGeoProcessorResult)oResult;
-
-                    ComReleaser.ReleaseCOMObject(gp);
-                    gp = null;
-                    GC.Collect();
-
-                    // Add buffer geometries to the map
-                    foreach (IGeometry geom in radius1_2GeomList)
+                    catch (Exception ex)
                     {
-                        var color = new RgbColorClass() { Blue = 255 } as IColor;
-                        AddGraphicToMap(geom, color, true);
+                        string exception = ex.ToString();
+                        System.Windows.MessageBox.Show(VisibilityLibrary.Properties.Resources.MsgTryAgain, VisibilityLibrary.Properties.Resources.MsgCalcCancelled);
                     }

-                    IRasterLayer outputRasterLayer = new RasterLayerClass();
-                    outputRasterLayer.CreateFromFilePath(outPath);
-
-                    string fcName = IntersectOutput(outputRasterLayer, ipDataset, workspace, donutGeomList);
-
-                    IFeatureClass finalFc = workspace.OpenFeatureClass(fcName);
-
-                    IFeatureLayer outputFeatureLayer = new FeatureLayerClass();
-                    outputFeatureLayer.FeatureClass = finalFc;
-
-                    //Add it to a map if the layer is valid.
-                    if (outputFeatureLayer != null)
-                    {
-                        // set the renderer
-                        IFeatureRenderer featRend = UniqueValueRenderer(workspace, finalFc);
-                        IGeoFeatureLayer geoLayer = outputFeatureLayer as IGeoFeatureLayer;
-                        geoLayer.Renderer = featRend;
-                        geoLayer.Name = "VisibilityLayer_" + RunCount.ToString();
-
-                        // Set the layer transparency
-                        IDisplayFilterManager filterManager = (IDisplayFilterManager)outputFeatureLayer;
-                        ITransparencyDisplayFilter filter = new TransparencyDisplayFilter();
- 			            filter.Transparency = 80;
- 			            filterManager.DisplayFilter = filter;
-
-                        ESRI.ArcGIS.Carto.IMap map = ArcMap.Document.FocusMap;
-                        map.AddLayer((ILayer)outputFeatureLayer);
-                    }
-
-                    RunCount += 1;
-                }
-                catch (Exception ex)
-                {
-                    string exception = ex.ToString();
-                    System.Windows.MessageBox.Show(VisibilityLibrary.Properties.Resources.MsgTryAgain, VisibilityLibrary.Properties.Resources.MsgCalcCancelled);
-                }
-
-                //Reset(true);
+                    //Reset(true);
+                }
+            }
+            catch(Exception ex)
+            {
+                System.Windows.Forms.MessageBox.Show(VisibilityLibrary.Properties.Resources.ExceptionSomethingWentWrong,
+                                                     VisibilityLibrary.Properties.Resources.CaptionError);
+            }
+            finally
+            {
+                IsRunning = false;
             }
         }


Removed vestigial code and reordered methods for clarity.

--- FragmentActivity.cs
+++ FragmentActivity.cs
@@ -25,6 +25,14 @@
             }
         }

+        /// <summary>
+        /// Loads the fragment for this activity and stores it in the Fragment property.
+        /// </summary>
+        protected virtual void LoadFragment()
+        {
+            Fragment = FragmentBase.FindOrCreateFragment<TFragment>(this, FragmentTag, global::Android.Resource.Id.Content);
+        }
+
         /// <inheritdoc />
         protected override void OnCreate(Bundle savedInstanceState)
         {
@@ -37,24 +45,13 @@
         public override void OnAttachedToWindow()
         {
             base.OnAttachedToWindow();
-            if (Fragment != null)
-            {
-                Fragment.OnAttachedToWindow();
-            }
+            Fragment.OnAttachedToWindow();
         }

         /// <inheritdoc />
         protected override void OnNewIntent(Intent intent)
         {
             Fragment.OnNewIntent(intent);
-        }
-
-        /// <summary>
-        /// Loads the fragment for this activity and stores it in the Fragment property.
-        /// </summary>
-        protected virtual void LoadFragment()
-        {
-            Fragment = FragmentBase.FindOrCreateFragment<TFragment>(this, FragmentTag, global::Android.Resource.Id.Content);
         }

         /// <inheritdoc />


Adds square root tests

Adds square root tests

--- RPNCalculatorUnitTests/Test.cs
+++ RPNCalculatorUnitTests/Test.cs
@@ -107,6 +107,29 @@
 			Assert.AreEqual ("Division by 0.", _stack.ErrorMessage);
 			Assert.IsNaN (_stack.Pop ());
 		}
+
+		[Test()]
+		public void SquareRootNoElement()
+		{
+			Assert.False( _stack.PushOperation (Operations.SQUARE_ROOT) );
+			Assert.AreEqual ("Stack has less than 1 elements.", _stack.ErrorMessage);
+		}
+
+		[Test()]
+		public void SquareRootNegativeElement()
+		{
+			_stack.PushValue (-4);
+			Assert.True (_stack.PushOperation (Operations.SQUARE_ROOT));
+			Assert.AreEqual (sqrt (-4), _stack.Pop());
+		}
+
+		[Test()]
+		public void SuqareRootOf4()
+		{
+			_stack.PushValue (4);
+			Assert.True (_stack.PushOperation (Operations.SQUARE_ROOT));
+			Assert.AreEqual (sqrt (4), _stack.Pop ());
+		}
 	}

 }


Fixed EntityBehaviour Render()

Fixed EntityBehaviour Render()

--- Entities/Components/EntityBehaviour.cs
+++ Entities/Components/EntityBehaviour.cs
@@ -8,6 +8,7 @@
 using VorliasEngine2D.Entities.Components.Internal;
 using VorliasEngine2D.System;
 using VorliasEngine2D.System.Utility;
+using SFML.Graphics;

 namespace VorliasEngine2D.Entities.Components
 {
@@ -66,7 +67,7 @@
     /// <summary>
     /// Base class for custom scripted components
     /// </summary>
-    public class EntityBehaviour : Component, IUpdatableComponent
+    public class EntityBehaviour : Component, IUpdatableComponent, IRenderableComponent
     {
         private bool initialized = false;

@@ -208,9 +209,22 @@

         public virtual UpdatePriority UpdatePriority => UpdatePriority.Normal;

+
+        private RenderOrder renderOrder = RenderOrder.Normal;
+        public virtual RenderOrder RenderOrder
+        {
+            get => renderOrder;
+            set => renderOrder = value;
+        }
+
         public new virtual void OnComponentCopy(Entity source, Entity copy)
         {
             // Do nothing, this is a custom component.
+        }
+
+        public void Draw(RenderTarget target, RenderStates states)
+        {
+            Render();
         }
     }
 }


NinoPatcher: Fix not-drawing when paint is raised

--- Programs/NinoPatcher/NinoPatcher/Animation.cs
+++ Programs/NinoPatcher/NinoPatcher/Animation.cs
@@ -37,6 +37,7 @@
         public Animation(int period, Control parent, params AnimationElement[] elements)
         {
             this.parent = parent;
+            this.parent.Paint += delegate { PaintFrame(null, null); };
             this.elements = elements;

             timer = new Timer();


TC-55 Adds check to login command, displays usage information instead of throwing an exception if no args are passed

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

--- Programs/examples/TestClient/ClientManager.cs
+++ Programs/examples/TestClient/ClientManager.cs
@@ -150,6 +150,12 @@
         /// <returns></returns>
         public TestClient Login(string[] args)
         {
+
+            if (args.Length < 3)
+            {
+                Console.WriteLine("Usage: login firstname lastname password [simname] [login server url]");
+                return null;
+            }
             LoginDetails account = new LoginDetails();
             account.FirstName = args[0];
             account.LastName = args[1];
@@ -157,8 +163,10 @@

             if (args.Length > 3)
                 account.StartLocation = NetworkManager.StartLocation(args[3], 128, 128, 40);
+
             if (args.Length > 4)
-                account.URI = args[4];
+                if(args[4].StartsWith("http://"))
+                    account.URI = args[4];

             return Login(account);
         }


Allow only one parallel caching block at a time

--- Espera/Espera.Core/Library/Playlist.cs
+++ Espera/Espera.Core/Library/Playlist.cs
@@ -8,6 +8,7 @@
     public class Playlist : IEnumerable<Song>
     {
         private Dictionary<int, Song> playlist;
+        private object cacheSyncLock;

         /// <summary>
         /// Gets the index of the currently played song in the playlist.
@@ -42,6 +43,7 @@
         public Playlist()
         {
             this.playlist = new Dictionary<int, Song>();
+            this.cacheSyncLock = new object();
         }

         /// <summary>
@@ -54,13 +56,18 @@

             Task.Factory.StartNew(() =>
             {
-                Parallel.ForEach(songList, options, song =>
+                // This lock synchronizes the case that multiple calls of the AddSongs method occur,
+                // before the first sequence of songs is cached completely
+                lock (cacheSyncLock)
                 {
-                    if (!song.IsCached)
+                    Parallel.ForEach(songList, options, song =>
                     {
-                        song.LoadToCache();
-                    }
-                });
+                        if (!song.IsCached)
+                        {
+                            song.LoadToCache();
+                        }
+                    });
+                }
             });

             foreach (Song song in songList)


Change default values for query creation.

--- ExRam.Gremlinq/Gremlin/GremlinQuery.cs
+++ ExRam.Gremlinq/Gremlin/GremlinQuery.cs
@@ -532,7 +532,7 @@

         public static readonly IGremlinQuery<TElement> Anonymous = GremlinQuery<TElement>.Create("__");

-        public static IGremlinQuery<TElement> Create(string graphName = null)
+        public static IGremlinQuery<TElement> Create(string graphName = "g")
         {
             return new GremlinQueryImpl(graphName, ImmutableList<GremlinStep>.Empty, ImmutableDictionary<StepLabel, string>.Empty);
         }
@@ -542,7 +542,7 @@
     {
         public static readonly IGremlinQuery<Unit> Anonymous = GremlinQuery<Unit>.Anonymous;

-        public static IGremlinQuery<Unit> Create(string graphName = null)
+        public static IGremlinQuery<Unit> Create(string graphName = "g")
         {
             return GremlinQuery<Unit>.Create(graphName);
         }


Show details from map message packet and creating marker on UOAM.

--- ExampleScripts/UOErebor/questarrow.csx
+++ ExampleScripts/UOErebor/questarrow.csx
@@ -14,7 +14,15 @@
     public static void Run() =>
         journal
             .When<QuestArrowEvent>(HandleQuestChange)
+            .When<MapMessageEvent>(HandleMapMessage)
             .Incomming();
+
+    private static void HandleMapMessage(MapMessageEvent e)
+    {
+        var location = new Location2D(e.UpperLeft.X + e.Width, e.UpperLeft.Y + e.Height);
+        UO.ClientPrint($"Center of shown map: {location}");
+        Uoam.SetMarker(location);
+    }

     private static void HandleQuestChange(QuestArrowEvent e)
     {


Null ref checks on dispose

Null ref checks on dispose

--- Facepunch.Steamworks/BaseSteamworks.cs
+++ Facepunch.Steamworks/BaseSteamworks.cs
@@ -25,14 +25,23 @@
             }
             Disposables.Clear();

-            Workshop.Dispose();
-            Workshop = null;
+            if ( Workshop != null )
+            {
+                Workshop.Dispose();
+                Workshop = null;
+            }

-            Inventory.Dispose();
-            Inventory = null;
+            if ( Inventory != null )
+            {
+                Inventory.Dispose();
+                Inventory = null;
+            }

-            Networking.Dispose();
-            Networking = null;
+            if ( Networking != null )
+            {
+                Networking.Dispose();
+                Networking = null;
+            }

             if ( native != null )
             {


[Xwt] Backport performance improvements to Table

--- Xwt/Xwt/Table.cs
+++ Xwt/Xwt/Table.cs
@@ -244,11 +244,31 @@
 					return defaultColSpacing;
 			}
 		}
+
+		TablePlacement[] VisibleChildren ()
+		{
+			TablePlacement[] result = new TablePlacement[children.Count];
+
+			int j = 0;
+			for (int i = 0; i < children.Count; i++) {
+				var item = children[i];
+				if (item.Child.Visible) {
+					result[j] = item;
+					j++;
+				}
+			}
+
+			if (j != children.Count - 1) {
+				Array.Resize (ref result, j);
+			}
+
+			return result;
+		}

 		void CalcDefaultSizes (SizeRequestMode mode, bool calcHeights, out TablePlacement[] visibleChildren, out Dictionary<int,WidgetSize> fixedSizesByCell, out HashSet<int> cellsWithExpand, out WidgetSize[] sizes, out double spacing)
 		{
 			bool useLengthConstraint = mode == SizeRequestMode.HeightForWidth && calcHeights || mode == SizeRequestMode.WidthForHeight && !calcHeights;
-			visibleChildren = children.Where (b => b.Child.Visible).ToArray ();
+			visibleChildren = VisibleChildren ();
 			int lastCell = 0;

 			fixedSizesByCell = new Dictionary<int, WidgetSize> ();
@@ -349,44 +369,47 @@
 			// 60px for column 2 and 60px for column 3. So the widgets are overlapping at column 2. Since A requires at least 100px in column 2, it means that B can assume
 			// that it will have 100px available in column 2, which means 40px more than it requested. Those extra 40px can then be substracted from the 60px that
 			// it required for column 3.
-
+
 			foreach (var n in cellsWithWidget) {
-				// Get a list of all widgets that cover this cell
-				var colCells = widgetsToAdjust.Where (bp => GetStartAttach (bp, calcHeights) <= n && GetEndAttach (bp, calcHeights) > n).ToArray ();
 				WidgetSize maxv = new WidgetSize (0);
 				TablePlacement maxtMin = null;
 				TablePlacement maxtNatural = null;
-
+
 				// Find the widget that requires the maximum size for this cell
-				foreach (var bp in colCells) {
-					WidgetSize cv = growSizes[bp][n - GetStartAttach (bp, calcHeights)];
-					if (cv.MinSize > maxv.MinSize) {
-						maxv.MinSize = cv.MinSize;
-						maxtMin = bp;
+				foreach (var bp in widgetsToAdjust) {
+					// could be expressed as where clause, but this is faster and performance matters here
+					if (GetStartAttach (bp, calcHeights) <= n && GetEndAttach (bp, calcHeights) > n) {
+						WidgetSize cv = growSizes[bp][n - GetStartAttach (bp, calcHeights)];
+						if (cv.MinSize > maxv.MinSize) {
+							maxv.MinSize = cv.MinSize;
+							maxtMin = bp;
+						}
+						if (cv.NaturalSize > maxv.NaturalSize) {
+							maxv.NaturalSize = cv.NaturalSize;
+							maxtNatural = bp;
+						}
 					}
-					if (cv.NaturalSize > maxv.NaturalSize) {
-						maxv.NaturalSize = cv.NaturalSize;
-						maxtNatural = bp;
-					}
-				}
-
+				}
+
 				// Adjust the required size of all widgets of the cell (excluding the widget with the max size)
-				foreach (var bp in colCells) {
-					WidgetSize[] widgetGrows = growSizes[bp];
-					int cellIndex = n - GetStartAttach (bp, calcHeights);
-					if (bp != maxtMin) {
-						double cv = widgetGrows[cellIndex].MinSize;
-						// splitExtraSpace is the additional space that the widget can take from this cell (because there is a widget
-						// that is requiring more space), split among all other cells of the widget
-						double splitExtraSpace = (maxv.MinSize - cv) / (widgetGrows.Length - 1);
-						for (int i=0; i<widgetGrows.Length; i++)
-							widgetGrows[i].MinSize -= splitExtraSpace;
-					}
-					if (bp != maxtNatural) {
-						double cv = widgetGrows[cellIndex].NaturalSize;
-						double splitExtraSpace = (maxv.NaturalSize - cv) / (widgetGrows.Length - 1);
-						for (int i=0; i<widgetGrows.Length; i++)
-							widgetGrows[i].NaturalSize -= splitExtraSpace;
+				foreach (var bp in widgetsToAdjust) {
+					if (GetStartAttach (bp, calcHeights) <= n && GetEndAttach (bp, calcHeights) > n) {
+						var widgetGrows = growSizes[bp];
+						int cellIndex = n - GetStartAttach (bp, calcHeights);
+						if (bp != maxtMin) {
+							double cv = widgetGrows[cellIndex].MinSize;
+							// splitExtraSpace is the additional space that the widget can take from this cell (because there is a widget
+							// that is requiring more space), split among all other cells of the widget
+							double splitExtraSpace = (maxv.MinSize - cv) / (widgetGrows.Length - 1);
+							for (int i=0; i<widgetGrows.Length; i++)
+								widgetGrows[i].MinSize -= splitExtraSpace;
+						}
+						if (bp != maxtNatural) {
+							double cv = widgetGrows[cellIndex].NaturalSize;
+							double splitExtraSpace = (maxv.NaturalSize - cv) / (widgetGrows.Length - 1);
+							for (int i=0; i<widgetGrows.Length; i++)
+								widgetGrows[i].NaturalSize -= splitExtraSpace;
+						}
 					}
 				}
 			}


Bus: Returning the exception message when the message cannot be dumped on disk (thx @Julion)

--- src/Abc.Zebus/Core/Bus.cs
+++ src/Abc.Zebus/Core/Bus.cs
@@ -514,9 +514,9 @@
                 File.WriteAllBytes(dumpFilePath, messageBytes);
                 return dumpFilePath;
             }
-            catch
-            {
-                return "Message could not be dumped";
+            catch (Exception ex)
+            {
+                return "Message could not be dumped: " + ex;
             }
         }


Checked tag and site name for ' and escaped them.


removed dummy assertion from ping pong sample


code maintenance (generics in PhpDbConnection.Execute*)

Originally checked in by DEVSENSE\Jakub on 2012-01-29 13:11:56.553 as Changeset 2361

git-tfs-id: [https://devsense.visualstudio.com/DefaultCollection]$/Phalanger/Main;C6440

--- Source/ClassLibrary/Data.CLR/Connection.cs
+++ Source/ClassLibrary/Data.CLR/Connection.cs
@@ -14,6 +14,7 @@
 using System.Text;
 using System.Data;
 using System.Collections;
+using System.Collections.Generic;

 using PHP.Core;

@@ -223,7 +224,7 @@
 		/// <returns>PhpDbResult class representing the data read from database.</returns>
 		/// <exception cref="ArgumentNullException"><paramref name="procedureName"/> is a null reference.</exception>
 		/// <exception cref="PhpException">Procedure execution failed (Warning).</exception>
-		public PhpDbResult ExecuteProcedure(string/*!*/ procedureName, IEnumerable parameters, bool skipResults)     // GENERICS
+		public PhpDbResult ExecuteProcedure(string/*!*/ procedureName, IEnumerable<IDataParameter> parameters, bool skipResults)
 		{
 			if (procedureName == null)
 				throw new ArgumentNullException("procedureName");
@@ -243,7 +244,7 @@
 		/// <exception cref="ArgumentNullException"><paramref name="commandText"/> is a null reference.</exception>
 		/// <exception cref="PhpException">Command execution failed (Warning).</exception>
 		public PhpDbResult ExecuteCommand(string/*!*/ commandText, CommandType commandType, bool convertTypes,
-		  IEnumerable parameters, bool skipResults) // GENERICS: IDataParameter
+		  IEnumerable<IDataParameter> parameters, bool skipResults)
 		{
 			if (commandText == null)
 				throw new ArgumentNullException("commandText");


Fix Log Format for Trigger Listener

Fix Log Format for Trigger Listener


Cleanup TimeUuid

Cleanup TimeUuid

--- src/Cassandra/TimeUuid.cs
+++ src/Cassandra/TimeUuid.cs
@@ -1,7 +1,4 @@
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;

 namespace Cassandra
 {
@@ -26,11 +23,11 @@
         {
             if (nodeId == null || nodeId.Length != 6)
             {
-                throw new ArgumentException("node id should contain 6 bytes");
+                throw new ArgumentException("node Id should contain 6 bytes", "nodeId");
             }
             if (clockId == null || clockId.Length != 2)
             {
-                throw new ArgumentException("node id should contain 6 bytes");
+                throw new ArgumentException("clock Id should contain 2 bytes", "clockId");
             }
             var timeBytes = BitConverter.GetBytes((time - GregorianCalendarTime).Ticks);
             var buffer = new byte[16];
@@ -105,7 +102,7 @@
         /// </summary>
         public byte[] ToByteArray()
         {
-            return this._value.ToByteArray();
+            return _value.ToByteArray();
         }

         /// <summary>


Adjustment to Parser class

Adjustment to Parser class

--- src/CommandLine/Parser.cs
+++ src/CommandLine/Parser.cs
@@ -83,11 +83,21 @@
         /// and a sequence of <see cref="CommandLine.Error"/>.</returns>
         /// <exception cref="System.ArgumentNullException">Thrown if one or more arguments are null.</exception>
         public ParserResult<T> ParseArguments<T>(IEnumerable<string> args)
-            where T : new()
         {
             if (args == null) throw new ArgumentNullException("args");

-            return ParseArguments(() => new T(), args);
+            var factory = typeof(T).IsMutable()
+                ? Maybe.Just<Func<T>>(Activator.CreateInstance<T>)
+                : Maybe.Nothing<Func<T>>();
+
+            return MakeParserResult(
+                () => InstanceBuilder.Build(
+                    factory,
+                    (arguments, optionSpecs) => Tokenize(arguments, optionSpecs, settings),
+                    args,
+                    settings.NameComparer,
+                    settings.ParsingCulture),
+                settings);
         }

         /// <summary>
@@ -104,6 +114,7 @@
             where T : new()
         {
             if (factory == null) throw new ArgumentNullException("factory");
+            if (!typeof(T).IsMutable()) throw new ArgumentException("factory");
             if (args == null) throw new ArgumentNullException("args");

             return MakeParserResult(


增加一些注释。 :incoming_envelope:

增加一些注释。 :incoming_envelope:

--- src/Common/DataSession.cs
+++ src/Common/DataSession.cs
@@ -41,6 +41,9 @@

 namespace Zongsoft.Data.Common
 {
+	/// <summary>
+	/// 表示数据操作的会话类。
+	/// </summary>
 	public class DataSession : IDisposable
 	{
 		#region 常量定义
@@ -81,21 +84,33 @@
 		#endregion

 		#region 公共属性
+		/// <summary>
+		/// 获取一个值，指示当前数据会话是否位于环境事务中。
+		/// </summary>
 		public bool InAmbient
 		{
 			get => _ambient != null;
 		}

+		/// <summary>
+		/// 获取当前数据会话的数据源对象。
+		/// </summary>
 		public IDataSource Source
 		{
 			get => _source;
 		}

+		/// <summary>
+		/// 获取当前数据会话的主连接对象。
+		/// </summary>
 		public IDbConnection Connection
 		{
 			get => _connection;
 		}

+		/// <summary>
+		/// 获取当前数据会话关联的数据事务。
+		/// </summary>
 		public IDbTransaction DbTransaction
 		{
 			get => _transaction;
@@ -129,6 +144,9 @@
 			return new SessionCommand(this, _source.Driver.CreateCommand(statement));
 		}

+		/// <summary>
+		/// 提交当前会话事务。
+		/// </summary>
 		public void Commit()
 		{
 			/*
@@ -138,6 +156,9 @@
 				this.Complete(true);
 		}

+		/// <summary>
+		/// 回滚当前会话事务。
+		/// </summary>
 		public void Rollback()
 		{
 			/*
@@ -147,11 +168,19 @@
 				this.Complete(false);
 		}

+		/// <summary>
+		/// 释放会话，如果当前会话没有完成则回滚事务。
+		/// </summary>
 		public void Dispose()
 		{
 			this.Complete(false);
 		}

+		/// <summary>
+		/// 完成当前数据会话。
+		/// </summary>
+		/// <param name="commit">指定是否提交当前数据事务。</param>
+		/// <returns>如果当前会话已经完成了则返回假(False)，否则返回真(True)。</returns>
 		private bool Complete(bool? commit)
 		{
 			//设置完成标记


set version number to prerelease alpha

set version number to prerelease alpha

--- src/Common/VersionInfo.cs
+++ src/Common/VersionInfo.cs
@@ -33,11 +33,11 @@
         /// <remarks>
         /// Use this for the enterprise model framework libraries.
         /// </remarks>
-        internal const string ModelProductVersion = "1.0.0";
+        internal const string ModelProductVersion = "1.0.0-alpha";
         /// <summary>
         /// Specifies the product version for Silverlight enterprise model.
         /// </summary>
-        internal const string ModelSilverlightProductVersion = "1.0.0 for Silverlight";
+        internal const string ModelSilverlightProductVersion = "1.0.0-alpha for Silverlight";

         /// <summary>
         /// Specifies the assembly version for use when the .NET runtime loads an assembly. Use a
@@ -55,18 +55,18 @@
         /// <remarks>
         /// Use this for the core framework libraries.
         /// </remarks>
-        internal const string GlobalFileVersion = "1.0.5358.29535";
+        internal const string GlobalFileVersion = "1.0.5387.16636";
         /// <summary>
         /// Specifies the product version to display in the Details tab of Windows Explorer.
         /// </summary>
         /// <remarks>
         /// Use this for the core framework libraries.
         /// </remarks>
-        internal const string GlobalProductVersion = "1.0.0";
+        internal const string GlobalProductVersion = "1.0.0-alpha";
         /// <summary>
         /// Specifies the product version for Silverlight
         /// </summary>
-        internal const string GlobalSilverlightProductVersion = "1.0.0 for Silverlight";
+        internal const string GlobalSilverlightProductVersion = "1.0.0-alpha for Silverlight";
         /// <summary>
         /// Use this for all assemblies throughout the solution.
         /// </summary>


Moved the tree around.

Moved the tree around.

--- Game/TestWorldFactory.cs
+++ Game/TestWorldFactory.cs
@@ -13,7 +13,6 @@
 			Adventurer adventurer = new Adventurer();
 			World world = new World();
 			world.AddEntity(adventurer);
-			world.AddEntity(new Explorer(world));

 			// Conga conga conga conga!
 			const int CongaSize = 4;
@@ -24,6 +23,8 @@
 				world.AddEntity(lastInConga);
 			}
 			world.AddCollidingEntity(new House(new Vector2()));
+			world.AddCollidingEntity(new Tree(new Vector2(-900, 200)));
+			world.AddEntity(new Explorer(world));
 			return world;
 		}
 	}


Fix SimulateFuture

Fix SimulateFuture

Accidentally wrote the inverse condition of what I wanted.

--- GameOfLifeUI/MainForm.cs
+++ GameOfLifeUI/MainForm.cs
@@ -305,7 +305,7 @@

          //require an enabled cell in order to simulate into the future
          SimulateFutureMenuItem.Enabled = _simulationStateProvider.CurrentState == SimulationState.Initial &&
-                                          !_worldProvider.CurrentWorld.Cells.Any(x => x.IsAlive);
+                                          _worldProvider.CurrentWorld.Cells.Any(x => x.IsAlive);
       }

       private void WorldGrid_GridCellMouseOver(object sender, EventArgs e)


new name

new name

--- Ghpr.Core/Utils/Names.cs
+++ Ghpr.Core/Utils/Names.cs
@@ -3,6 +3,8 @@
 {
     public static class Names
     {
+        public const string ScreenshotKeyTemplate = "ghpr_screenshot_";
+
         public const string TestsFolderName = "tests";
         public const string RunsFolderName = "runs";
         public const string ImgFolderName = "img";


Filter awai untracked files in status, which are temp conflict files

--- GitMind/Git/GitStatus.cs
+++ GitMind/Git/GitStatus.cs
@@ -1,3 +1,4 @@
+using System.Collections.Generic;
 using System.Linq;
 using LibGit2Sharp;

@@ -8,8 +9,7 @@
 	{
 		public GitStatus(RepositoryStatus status, ConflictCollection conflicts)
 		{
-			SetStatus(status);
-			SetConflicts(conflicts);
+			SetStatus(status, conflicts);
 		}

@@ -28,19 +28,38 @@

-		private void SetStatus(RepositoryStatus status)
+		private void SetStatus(RepositoryStatus status, ConflictCollection conflicts)
 		{
 			Modified = status.Modified.Count();
-			Added = status.Added.Count() + status.Untracked.Count();
+			Added = status.Added.Count() + GetUntrackedCount(status, conflicts);
 			Deleted = status.Missing.Count() + status.Removed.Count();
 			Other = status.Staged.Count();

 			CommitFiles = new GitCommitFiles(GitCommit.UncommittedId, status);
+
+			ConflictFiles = new GitCommitFiles(GitCommit.UncommittedId, conflicts);
 		}

-		private void SetConflicts(ConflictCollection conflicts)
+
+		private static int GetUntrackedCount(RepositoryStatus status, ConflictCollection conflicts)
 		{
-			ConflictFiles = new GitCommitFiles(GitCommit.UncommittedId, conflicts);
+			// When there are conflicts, tools create temp files like these, lets filter them.
+			IEnumerable<string> conflictFiles = conflicts.Select(c => c.Ours.Path + ".LOCAL.")
+				.Concat(conflicts.Select(c => c.Ancestor.Path + ".BASE."))
+				.Concat(conflicts.Select(c => c.Theirs.Path + ".REMOTE."))
+				.ToList();
+
+			int untrackedCount = 0;
+
+			foreach (StatusEntry statusEntry in status.Untracked)
+			{
+				if (!conflictFiles.Any(f => statusEntry.FilePath.StartsWith(f)))
+				{
+					untrackedCount++;
+				}
+			}
+
+			return untrackedCount;
 		}
 	}
 }


[appkit] NSDocument.FileURL: allow null, from Jon Lipsky

--- src/appkit.cs
+++ src/appkit.cs
@@ -3725,7 +3725,7 @@
 		[Export ("fileType")]
 		string FileType { get; set; }

-		[Export ("fileURL")]
+		[Export ("fileURL"), NullAllowed]
 		NSUrl FileUrl { get; set; }

 		[Export ("fileModificationDate")]


Don't use CleverbotUser class

Don't use CleverbotUser class

--- KraxbotOSS/Form1.cs
+++ KraxbotOSS/Form1.cs
@@ -23,8 +23,8 @@
         public  static   string ConfigPath;
         public  static   Config config;

-	    private readonly Dictionary<SteamID, Settings>      chatrooms;
-		private readonly Dictionary<SteamID, CleverbotUser> cleverbotUsers;
+	    private readonly Dictionary<SteamID, Settings>         chatrooms;
+		private readonly Dictionary<SteamID, CleverbotSession> cleverbotSessions;

 	    private bool running;

@@ -62,7 +62,7 @@
 	        version   = "1.1.0";
 	        chatrooms = new Dictionary<SteamID, Settings>();
 	        config    = new Config();
-	        cleverbotUsers = new Dictionary<SteamID, CleverbotUser>();
+	        cleverbotSessions = new Dictionary<SteamID, CleverbotSession>();

 			// Crash handler
 			Application.ThreadException                += OnThreadException;
@@ -235,11 +235,6 @@
             // We may use these later
             public int Disconnect = 0;
             public int Warning    = 0;
-        }
-        public class CleverbotUser
-        {
-            public SteamID          SteamID;
-            public CleverbotSession Session;
         }

         // Settings
@@ -589,18 +584,14 @@
                     Log($"\n{friends.GetFriendPersonaName(callback.Sender)}: {message}");

                     // Check if we have a Cleverbot session
-                    if (!cleverbotUsers.ContainsKey(userID))
+                    if (!cleverbotSessions.ContainsKey(userID))
                     {
                         Log($"\nCreated Cleverbot session for {friends.GetFriendPersonaName(userID)}");
                         var apikey = config.API_CleverbotIO.Split(';');
-                        cleverbotUsers[userID] = new CleverbotUser
-                        {
-                            SteamID = userID,
-                            Session = CleverbotSession.NewSession(apikey[0], apikey[1])
-                        };
+	                    cleverbotSessions[userID] = CleverbotSession.NewSession(apikey[0], apikey[1]);
                     }
                     // Use Cleverbot
-	                var session = cleverbotUsers[userID].Session;
+	                var session = cleverbotSessions[userID];
 	                try
 	                {
 		                SendMessage(userID, session.Send(message));
@@ -747,18 +738,14 @@
             if (message.StartsWith(".") && !string.IsNullOrEmpty(config.API_CleverbotIO))
             {
                 // Check if we have a Cleverbot session
-                if (!cleverbotUsers.ContainsKey(chatRoomID))
+                if (!cleverbotSessions.ContainsKey(chatRoomID))
                 {
                     Log($"\nCreated Cleverbot session for {chatRoom.ChatName}");
                     var apikey = config.API_CleverbotIO.Split(';');
-                    cleverbotUsers[chatRoomID] = new CleverbotUser
-                    {
-                        SteamID = chatRoomID,
-                        Session = CleverbotSession.NewSession(apikey[0], apikey[1])
-                    };
+	                cleverbotSessions[chatRoomID] = CleverbotSession.NewSession(apikey[0], apikey[1]);
                 }
                 // Use Cleverbot
-                var session = cleverbotUsers[chatRoomID].Session;
+                var session = cleverbotSessions[chatRoomID];
 	            try
 	            {
 		            SendChatMessage(chatRoomID, session.Send(message));


Add more info when creating settings

Add more info when creating settings

--- KraxbotOSS/Form1.cs
+++ KraxbotOSS/Form1.cs
@@ -312,7 +312,7 @@

             // Add value to chatroom settings if needed
             if (CR.SingleOrDefault(s => s.ChatID == callback.ChatID) == null)
-                CreateSettings(callback.ChatID);
+                CreateSettings(callback.ChatID, callback.ChatRoomName, callback.FriendID.AccountID, friends.GetFriendPersonaName(callback.FriendID));
             Settings chatRoom = CR.Single(s => s.ChatID == callback.ChatID);

             // Add all current users to the Users list
@@ -810,10 +810,15 @@
             friends.SendChatMessage(userID, EChatEntryType.ChatMsg, message);
         }

-        void CreateSettings(SteamID ChatRoomID)
+        void CreateSettings(SteamID ChatRoomID, string ChatRoomName, SteamID InvitedID, string InvitedName)
         {
             // TODO: Get ChatName, InvitedName and InvitedID
-            CR.Add(new Settings() { ChatID = ChatRoomID });
+            CR.Add(new Settings() {
+                ChatID = ChatRoomID,
+                ChatName = ChatRoomName,
+                InvitedID = InvitedID,
+                InvitedName = InvitedName
+            });
         }
         void SaveSettings(Settings setting)
         {


Remove commented code

Remove commented code

This will be reverted in a future change, no need to keep it around.

--- osu.Game/Overlays/Toolbar/ToolbarButton.cs
+++ osu.Game/Overlays/Toolbar/ToolbarButton.cs
@@ -205,16 +205,6 @@

             var realmKeyBinding = realmFactory.Context.All<RealmKeyBinding>().FirstOrDefault(rkb => rkb.RulesetID == null && rkb.ActionInt == (int)Hotkey.Value);

-            // TODO: temporarily disabled to avoid crashes when querying after ExecutionState is changed.
-            // if (realmKeyBinding != null)
-            // {
-            //     realmKeyBinding.PropertyChanged += (sender, args) =>
-            //     {
-            //         if (args.PropertyName == nameof(realmKeyBinding.KeyCombinationString))
-            //             updateKeyBindingTooltip();
-            //     };
-            // }
-
             if (realmKeyBinding != null)
             {
                 var keyBindingString = realmKeyBinding.KeyCombination.ReadableString();


Specify the CLI exit code

Specify the CLI exit code

--- src/Evolve.Cli/Program.cs
+++ src/Evolve.Cli/Program.cs
@@ -12,7 +12,7 @@
     {
         private static readonly Evolve Default = new Evolve(new System.Data.SQLite.SQLiteConnection());

-        static void Main(string[] args) => CommandLineApplication.Execute<Program>(args);
+        static int Main(string[] args) => CommandLineApplication.Execute<Program>(args);

         private int OnExecute(CommandLineApplication app, IConsole console)
         {


Fix implementation leakage

Fix implementation leakage

--- Kip/PrintSchemaReader.cs
+++ Kip/PrintSchemaReader.cs
@@ -348,7 +348,7 @@

         public override void Add(ParameterDef parameterDef)
         {
-            throw new NotImplementedException();
+            Result.Add(parameterDef);
         }

         public override void Add(Property property)
@@ -526,7 +526,7 @@

         public override void Add(Property property)
         {
-            throw new NotImplementedException();
+            _property.Add(property);
         }

         public override void Add(Value value)


Fixed not checking chatroom correctly

Fixed not checking chatroom correctly

--- KraxbotOSS/DiscordBot.cs
+++ KraxbotOSS/DiscordBot.cs
@@ -110,7 +110,7 @@
 			{
 				case "SteamToDiscord":
 				case "Both":
-					return chatID == steamChat;
+					return chatID.AccountID == steamChat.AccountID;
 				default:
 					return false;
 			}


Modify unittest

Modify unittest

Summary:
- Disable destructor tests in Unity Editor, seems GC is flaky.
- Use current native instance counts

Reviewed By: emilsjolander

Differential Revision: D4018951

fbshipit-source-id: a57f0e1fa5a46e7de0b88235124d437d20e4082b

--- csharp/tests/Facebook.CSSLayout/CSSNodeTest.cs
+++ csharp/tests/Facebook.CSSLayout/CSSNodeTest.cs
@@ -105,76 +105,23 @@
         public void TestDispose()
         {
             ForceGC();
-            Assert.AreEqual(0, CSSNode.GetInstanceCount());
-            CSSNode node = new CSSNode();
-            Assert.AreEqual(1, CSSNode.GetInstanceCount());
+            int instanceCount = CSSNode.GetInstanceCount();
+            CSSNode node = new CSSNode();
+            Assert.AreEqual(instanceCount + 1, CSSNode.GetInstanceCount());
             node.Dispose();
-            Assert.AreEqual(0, CSSNode.GetInstanceCount());
+            Assert.AreEqual(instanceCount, CSSNode.GetInstanceCount());
         }

         [Test]
         public void TestDisposeWithUsing()
         {
             ForceGC();
-            Assert.AreEqual(0, CSSNode.GetInstanceCount());
+            int instanceCount = CSSNode.GetInstanceCount();
             using (CSSNode node = new CSSNode())
             {
-                Assert.AreEqual(1, CSSNode.GetInstanceCount());
+                Assert.AreEqual(instanceCount + 1, CSSNode.GetInstanceCount());
             }
-            Assert.AreEqual(0, CSSNode.GetInstanceCount());
-        }
-
-        [Test]
-        public void TestDestructor()
-        {
-            ForceGC();
-            Assert.AreEqual(0, CSSNode.GetInstanceCount());
-            TestDestructorForGC();
-            ForceGC();
-            Assert.AreEqual(0, CSSNode.GetInstanceCount());
-        }
-
-        private void TestDestructorForGC()
-        {
-            CSSNode node = new CSSNode();
-            Assert.IsNotNull(node);
-            Assert.AreEqual(1, CSSNode.GetInstanceCount());
-            node = null;
-        }
-
-        [Test]
-        public void TestDestructorWithChildren()
-        {
-            ForceGC();
-            Assert.AreEqual(0, CSSNode.GetInstanceCount());
-            TestDestructorWithChildrenForGC1();
-            ForceGC();
-            Assert.AreEqual(0, CSSNode.GetInstanceCount());
-        }
-
-        private void TestDestructorWithChildrenForGC1()
-        {
-            CSSNode node = new CSSNode();
-            Assert.AreEqual(1, CSSNode.GetInstanceCount());
-
-            TestDestructorWithChildrenForGC2(node, 1);
-            ForceGC();
-            Assert.AreEqual(2, CSSNode.GetInstanceCount());
-
-            TestDestructorWithChildrenForGC2(node, 2);
-            ForceGC();
-            Assert.AreEqual(3, CSSNode.GetInstanceCount());
-
-            node = null;
-        }
-
-        private void TestDestructorWithChildrenForGC2(CSSNode parent, int count)
-        {
-            CSSNode child = new CSSNode();
-            Assert.AreEqual(count + 1, CSSNode.GetInstanceCount());
-
-            parent.Insert(0, child);
-            child = null;
+            Assert.AreEqual(instanceCount, CSSNode.GetInstanceCount());
         }

         [Test]
@@ -198,37 +145,14 @@
         }

         [Test]
-        public void TestDisposeParent()
-        {
-            ForceGC();
-            Assert.AreEqual(0, CSSNode.GetInstanceCount());
-            CSSNode parent = new CSSNode();
-            Assert.AreEqual(1, CSSNode.GetInstanceCount());
-            TestDisposeParentForGC(parent);
-            ForceGC();
-            Assert.AreEqual(2, CSSNode.GetInstanceCount());
-            parent.Dispose();
-            ForceGC();
-            Assert.AreEqual(0, CSSNode.GetInstanceCount());
-        }
-
-        private void TestDisposeParentForGC(CSSNode parent)
-        {
-            CSSNode child = new CSSNode();
-            Assert.AreEqual(2, CSSNode.GetInstanceCount());
-            parent.Insert(0, child);
-            child = null;
-        }
-
-        [Test]
         public void TestDisposeChild()
         {
             ForceGC();
-            Assert.AreEqual(0, CSSNode.GetInstanceCount());
+            int instanceCount = CSSNode.GetInstanceCount();
             CSSNode parent = new CSSNode();
             CSSNode child0 = new CSSNode();
             CSSNode child1 = new CSSNode();
-            Assert.AreEqual(3, CSSNode.GetInstanceCount());
+            Assert.AreEqual(instanceCount + 3, CSSNode.GetInstanceCount());
             Assert.AreEqual(0, parent.Count);
             parent.Insert(0, child1);
             Assert.AreEqual(0, parent.IndexOf(child1));
@@ -236,7 +160,7 @@
             Assert.AreEqual(0, parent.IndexOf(child0));
             Assert.AreEqual(1, parent.IndexOf(child1));
             child0.Dispose();
-            Assert.AreEqual(2, CSSNode.GetInstanceCount());
+            Assert.AreEqual(instanceCount + 2, CSSNode.GetInstanceCount());
             Assert.AreEqual(1, parent.Count);
             Assert.AreEqual(0, parent.IndexOf(child1));
         }
@@ -259,5 +183,83 @@
             GC.Collect(GC.MaxGeneration);
             GC.WaitForPendingFinalizers();
         }
+
+#if !UNITY_EDITOR
+        [Test]
+        public void TestDestructor()
+        {
+            ForceGC();
+            int instanceCount = CSSNode.GetInstanceCount();
+            TestDestructorForGC(instanceCount);
+            ForceGC();
+            Assert.AreEqual(instanceCount, CSSNode.GetInstanceCount());
+        }
+
+        private void TestDestructorForGC(int instanceCount)
+        {
+            CSSNode node = new CSSNode();
+            Assert.IsNotNull(node);
+            Assert.AreEqual(instanceCount + 1, CSSNode.GetInstanceCount());
+            node = null;
+        }
+
+        [Test]
+        public void TestDestructorWithChildren()
+        {
+            ForceGC();
+            int instanceCount = CSSNode.GetInstanceCount();
+            TestDestructorWithChildrenForGC1(instanceCount);
+            ForceGC();
+            Assert.AreEqual(instanceCount, CSSNode.GetInstanceCount());
+        }
+
+        private void TestDestructorWithChildrenForGC1(int instanceCount)
+        {
+            CSSNode node = new CSSNode();
+            Assert.AreEqual(instanceCount + 1, CSSNode.GetInstanceCount());
+
+            TestDestructorWithChildrenForGC2(node, instanceCount + 1);
+            ForceGC();
+            Assert.AreEqual(instanceCount + 2, CSSNode.GetInstanceCount());
+
+            TestDestructorWithChildrenForGC2(node, instanceCount + 2);
+            ForceGC();
+            Assert.AreEqual(instanceCount + 3, CSSNode.GetInstanceCount());
+
+            node = null;
+        }
+
+        private void TestDestructorWithChildrenForGC2(CSSNode parent, int instanceCount)
+        {
+            CSSNode child = new CSSNode();
+            Assert.AreEqual(instanceCount + 1, CSSNode.GetInstanceCount());
+
+            parent.Insert(0, child);
+            child = null;
+        }
+
+        [Test]
+        public void TestDisposeParent()
+        {
+            ForceGC();
+            int instanceCount = CSSNode.GetInstanceCount();
+            CSSNode parent = new CSSNode();
+            Assert.AreEqual(instanceCount + 1, CSSNode.GetInstanceCount());
+            TestDisposeParentForGC(parent, instanceCount + 1);
+            ForceGC();
+            Assert.AreEqual(instanceCount + 2, CSSNode.GetInstanceCount());
+            parent.Dispose();
+            ForceGC();
+            Assert.AreEqual(instanceCount, CSSNode.GetInstanceCount());
+        }
+
+        private void TestDisposeParentForGC(CSSNode parent, int instanceCount)
+        {
+            CSSNode child = new CSSNode();
+            Assert.AreEqual(instanceCount + 1, CSSNode.GetInstanceCount());
+            parent.Insert(0, child);
+            child = null;
+        }
+#endif
     }
 }


Update samples/FishTank/Properties/AssemblyInfo.cs

Fix sample typo

--- samples/FishTank/Properties/AssemblyInfo.cs
+++ samples/FishTank/Properties/AssemblyInfo.cs
@@ -24,7 +24,7 @@
 // {name}.js
 //

-'use script';
+'use strict';
 (function($global) {
   {script}
 })(this);


Check volume argument in PlaySound

Check volume argument in PlaySound

--- Lego.Ev3.Core/Command.cs
+++ Lego.Ev3.Core/Command.cs
@@ -496,6 +496,9 @@
 		/// <param name="filename">Filename on the Brick of the sound to play</param>
 		public void PlaySound(int volume, string filename)
 		{
+			if(volume < 0 || volume > 100)
+				throw new ArgumentException("Volume must be between 0 and 100", "volume");
+
 			AddOpcode(Opcode.Sound_Play);
 			AddParameter((byte)volume);
 			AddParameter(filename);


Update code analysis suppression list.

Update code analysis suppression list.

--- src/GlobalSuppressions.cs
+++ src/GlobalSuppressions.cs
@@ -1,4 +1,34 @@
-using System.Diagnostics.CodeAnalysis;
+#region auto-generated FILE INFORMATION
+
+
+
+// ==============================================
+
+// This file is distributed under the MIT License
+
+// ==============================================
+
+//
+
+// Filename: GlobalSuppressions.cs
+
+// Version:  2019-01-30 11:50
+
+//
+
+// Copyright (c) 2019, Si13n7 Developments (r)
+
+// All rights reserved.
+
+// ______________________________________________
+
+
+
+#endregion
+
+
+
+using System.Diagnostics.CodeAnalysis;

@@ -6,36 +36,4 @@

 [assembly: SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", Scope = "member", Target = "SilDev.WinApi+NativeMethods.#SetWindowLongPtr32(System.IntPtr,System.Int32,System.IntPtr)")]

-[assembly: SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible", Scope = "member", Target = "SilDev.WinApi+AppBarData.#hWnd")]
-
-[assembly: SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible", Scope = "member", Target = "SilDev.WinApi+CallWndProcRet.#hwnd")]
-
-[assembly: SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible", Scope = "member", Target = "SilDev.WinApi+CallWndProcRet.#lParam")]
-
-[assembly: SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible", Scope = "member", Target = "SilDev.WinApi+CallWndProcRet.#lResult")]
-
-[assembly: SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible", Scope = "member", Target = "SilDev.WinApi+CallWndProcRet.#wParam")]
-
-[assembly: SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible", Scope = "member", Target = "SilDev.WinApi+CopyData.#dwData")]
-
-[assembly: SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible", Scope = "member", Target = "SilDev.WinApi+CopyData.#lpData")]
-
-[assembly: SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible", Scope = "member", Target = "SilDev.WinApi+MouseInput.#ExtraInfo")]
-
-[assembly: SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible", Scope = "member", Target = "SilDev.WinApi+ProcessBasicInformation.#AffinityMask")]
-
-[assembly: SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible", Scope = "member", Target = "SilDev.WinApi+ProcessBasicInformation.#BasePriority")]
-
-[assembly: SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible", Scope = "member", Target = "SilDev.WinApi+ProcessBasicInformation.#ExitStatus")]
-
-[assembly: SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible", Scope = "member", Target = "SilDev.WinApi+ProcessBasicInformation.#InheritedFromUniqueProcessId")]
-
-[assembly: SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible", Scope = "member", Target = "SilDev.WinApi+ProcessBasicInformation.#PebBaseAddress")]
-
-[assembly: SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible", Scope = "member", Target = "SilDev.WinApi+ProcessBasicInformation.#UniqueProcessId")]
-
-[assembly: SuppressMessage("Microsoft.Usage", "CA2240:ImplementISerializableCorrectly", Scope = "type", Target = "SilDev.MemoryException")]
-
-[assembly: SuppressMessage("Microsoft.Usage", "CA2240:ImplementISerializableCorrectly", Scope = "type", Target = "SilDev.PathNotFoundException")]
-


RA-1248 Added retry logic to SearchApprenticeshipVacanciesAsync

--- src/Esfa.Vacancy.Register.Infrastructure/Services/ApprenticeshipSearchService.cs
+++ src/Esfa.Vacancy.Register.Infrastructure/Services/ApprenticeshipSearchService.cs
@@ -24,6 +24,17 @@
         }

         public async Task<SearchApprenticeshipVacanciesResponse> SearchApprenticeshipVacanciesAsync(
+            VacancySearchParameters parameters)
+        {
+            var retry = VacancyRegisterRetryPolicy.GetFixedIntervalPolicy((exception, time, retryCount, context) =>
+            {
+                _logger.Warn($"Error searching for vacancies in search index: ({exception.Message}). Retrying...attempt {retryCount})");
+            });
+
+            return await retry.ExecuteAsync(() => InternalSearchApprenticeshipVacanciesAsync(parameters));
+        }
+
+        private async Task<SearchApprenticeshipVacanciesResponse> InternalSearchApprenticeshipVacanciesAsync(
             VacancySearchParameters parameters)
         {
             var indexName = _provideSettings.GetSetting(ApplicationSettingKeyConstants.ApprenticeshipIndexAliasKey);


Improve GetRelevantNodesAsync for selection.

Return smallestEncompassingNode only if a part of / a few tokens have been skipped at the beginning/end but not when a whole Node has been skipped.

--- src/Features/Core/Portable/CodeRefactorings/AbstractRefactoringHelpersService.cs
+++ src/Features/Core/Portable/CodeRefactorings/AbstractRefactoringHelpersService.cs
@@ -54,6 +54,7 @@
             //   - The smallest node whose FullSpan includes the whole (trimmed) selection
             //   - Using FullSpan is important because it handles over-selection with comments
             //   - Travels upwards through same-sized (FullSpan) nodes, extracting
+            //   - Skipping a few / parts of Tokens at the beginning/end is ok as long as a whole node hasn't been skipped.
             // - Token with wanted Node as direct parent is selected (e.g. IdentifierToken for LocalFunctionStatement: `C [|Fun|]() {}`)
             // Note: Whether we have selection or location has to be checked against original selection because selecting just
             // whitespace could collapse selectionTrimmed into and empty Location. But we don't want `[|   |]token`
@@ -271,12 +272,31 @@
                     // For selections we need to handle an edge case where only AttributeLists are within selection (e.g. `Func([|[in][out]|] arg1);`).
                     // In that case the smallest encompassing node is still the whole argument node but it's hard to justify showing refactorings for it
                     // if user selected only its attributes.
+                    //
+                    // As for partial selection we allow them as long as no nodes have been skipped. I.e. it's ok to skip part of tokens at the beginning
+                    // or endof the smallest encompassing node but not a whole (child) Node.

                     // Selection contains only AttributeLists -> don't consider current Node
                     var spanWithoutAttributes = GetSpanWithoutAttributes(selectedNode, root, syntaxFacts);
                     if (!selectionTrimmed.IntersectsWith(spanWithoutAttributes))
                     {
                         break;
+                    }
+
+                    // selection starts somewhere in the selectionNode
+                    if (selectionTrimmed.Start > selectionNode.Span.Start)
+                    {
+                        // selection starts so late it skipped one whole node -> bail out
+                        if (root.FindToken(selectionTrimmed.Start).Parent != root.FindToken(selectionNode.Span.Start).Parent)
+                        { continue; }
+                    }
+
+                    // selection ends somewhere in the selectionNode
+                    if (selectionTrimmed.End < selectionNode.Span.End)
+                    {
+                        // selection ends so early it skipped one whole node -> bail out
+                        if (root.FindToken(selectionTrimmed.End).Parent != root.FindToken(selectionNode.Span.End).Parent)
+                        { continue; }
                     }

                     relevantNodesBuilder.Add(selectedNode);


Generalize the code action for browsing to a URL

--- src/Microsoft.DotNet.Analyzers.Compatibility/Fixes/ReportIssueCodeFixProvider.cs
+++ src/Microsoft.DotNet.Analyzers.Compatibility/Fixes/ReportIssueCodeFixProvider.cs
@@ -39,43 +39,45 @@
             var diagnostic = context.Diagnostics.First();
             var diagnosticSpan = diagnostic.Location.SourceSpan;

-            var title = $"{diagnostic.Id}: {diagnostic.GetMessage()}";
-            var action = new ReportIssueCodeAction(title);
+            var issueTitle = $"{diagnostic.Id}: {diagnostic.GetMessage()}";
+            var issueTitleEncoded = WebUtility.UrlEncode(issueTitle);
+            var url = $"https://github.com/dotnet/platform-compat/issues/new?title={issueTitleEncoded}";
+
+            var action = new OpenInBrowserAction(Resources.ReportAnIssueTitle, url);
             context.RegisterCodeFix(action, diagnostic);

             return Task.CompletedTask;
         }

-        private sealed class ReportIssueCodeAction : CodeAction
+        private sealed class OpenInBrowserAction : CodeAction
         {
-            private readonly string _issueTitle;
-
-            public ReportIssueCodeAction(string issueTitle)
+            public OpenInBrowserAction(string title, string url)
             {
-                _issueTitle = issueTitle;
+                Title = title;
+                Url = url;
             }

-            public override string Title => Resources.ReportAnIssueTitle;
+            public override string Title { get; }

             public override string EquivalenceKey => Title;

+            public string Url { get; }
+
             protected override Task<IEnumerable<CodeActionOperation>> ComputeOperationsAsync(CancellationToken cancellationToken)
             {
-                var issueTitleEncoded = WebUtility.UrlEncode(_issueTitle);
-                var url = $"https://github.com/dotnet/platform-compat/issues/new?title={issueTitleEncoded}";
-                var result = new[] { new StartProcessCodeOperation(url) };
+                var result = new[] { new OpenInBrowserOperation(Url) };
                 return Task.FromResult<IEnumerable<CodeActionOperation>>(result);
             }
         }

-        private sealed class StartProcessCodeOperation : CodeActionOperation
+        private sealed class OpenInBrowserOperation : CodeActionOperation
         {
-            public StartProcessCodeOperation(string fileName)
+            public OpenInBrowserOperation(string url)
             {
-                FileName = fileName;
+                Url = url;
             }

-            public string FileName { get; }
+            public string Url { get; }

             public override void Apply(Workspace workspace, CancellationToken cancellationToken)
             {
@@ -91,7 +93,7 @@
                                                 m.GetParameters().Length == 1 &&
                                                 m.GetParameters()[0].ParameterType == typeof(string));

-                startMethod.Invoke(null, new[] { FileName });
+                startMethod.Invoke(null, new[] { Url });
             }
         }
     }


Refactoring and minor bug fix

Refactoring and minor bug fix

SVN: 488784591515bd4cdaa016be4ec9b172dc4e7caf@3273

--- src/NHibernate.Validator/src/NHibernate.Validator/Event/ValidateEventListener.cs
+++ src/NHibernate.Validator/src/NHibernate.Validator/Event/ValidateEventListener.cs
@@ -1,27 +1,28 @@
+using System;
+using System.Collections.Generic;
+using NHibernate.Cfg;
+using NHibernate.Event;
+using NHibernate.Mapping;
+using NHibernate.Properties;
+using NHibernate.Util;
+
 namespace NHibernate.Validator.Event
 {
-	using System;
-	using System.Collections.Generic;
-	using NHibernate.Cfg;
-	using NHibernate.Event;
-	using NHibernate.Mapping;
-	using Properties;
-	using Util;
-
 	/// <summary>
 	/// Before insert and update, executes the validator framework
-    /// </summary>
-    public class ValidateEventListener : IPreInsertEventListener, IPreUpdateEventListener, IInitializable
-    {
+	/// </summary>
+	public class ValidateEventListener : IPreInsertEventListener, IPreUpdateEventListener, IInitializable
+	{
 		private bool isInitialized;
-		private Dictionary<Type, ValidatableElement> validators = new Dictionary<Type, ValidatableElement>();
-
+		private Dictionary<System.Type, ValidatableElement> validators = new Dictionary<System.Type, ValidatableElement>();
+
+		#region IInitializable Members

 		/// <summary>
 		/// Initialize the validators, any non significant validators are not kept
 		/// </summary>
 		/// <param name="cfg"></param>
-		public void Initialize(Configuration cfg)
+		public void Initialize(Configuration cfg)
 		{
 			if (isInitialized) return;

@@ -31,25 +32,56 @@

 			foreach(PersistentClass clazz in classes)
 			{
-				Type mappedClass = clazz.MappedClass;
-				ClassValidator validator = new ClassValidator(mappedClass, null, null, interpolator, new Dictionary<Type, ClassValidator>());
+				System.Type mappedClass = clazz.MappedClass;
+				ClassValidator validator =
+					new ClassValidator(mappedClass, null, null, interpolator, new Dictionary<System.Type, ClassValidator>());

 				ValidatableElement element = new ValidatableElement(mappedClass, validator);
 				AddSubElement(clazz.IdentifierProperty, element);
-
+
 				foreach(Property property in clazz.PropertyIterator)
 				{
 					AddSubElement(property, element);
 				}

-				if (element.SubElements.Count != 0 || element.Validator.HasValidationRules)
-				{
+				if (element.SubElements.Count != 0 || element.Validator.HasValidationRules)
 					validators.Add(mappedClass, element);
-				}
 			}

 			isInitialized = true;
 		}
+
+		#endregion
+
+		#region IPreInsertEventListener Members
+
+		/// <summary>
+		///
+		/// </summary>
+		/// <param name="event"></param>
+		/// <returns></returns>
+		public bool OnPreInsert(PreInsertEvent @event)
+		{
+			Validate(@event.Entity, @event.Source.EntityMode);
+			return false;
+		}
+
+		#endregion
+
+		#region IPreUpdateEventListener Members
+
+		/// <summary>
+		///
+		/// </summary>
+		/// <param name="event"></param>
+		/// <returns></returns>
+		public bool OnPreUpdate(PreUpdateEvent @event)
+		{
+			Validate(@event.Entity, @event.Source.EntityMode);
+			return false;
+		}
+
+		#endregion

 		/// <summary>
 		/// Get the custom <see cref="IMessageInterpolator"/> from the <see cref="Configuration"/>
@@ -61,11 +93,11 @@
 			string interpolatorString = cfg.GetProperty(NHibernate.Validator.Environment.MESSAGE_INTERPOLATOR_CLASS);
 			IMessageInterpolator interpolator = null;

-			if(!string.IsNullOrEmpty(interpolatorString))
+			if (!string.IsNullOrEmpty(interpolatorString))
 			{
 				try
 				{
-					Type interpolatorType = ReflectHelper.ClassForName(interpolatorString);
+					System.Type interpolatorType = ReflectHelper.ClassForName(interpolatorString);
 					interpolator = (IMessageInterpolator) Activator.CreateInstance(interpolatorType);
 				}
 				catch(MissingMethodException ex)
@@ -87,38 +119,16 @@
 		}

 		/// <summary>
-        ///
-        /// </summary>
-        /// <param name="event"></param>
-        /// <returns></returns>
-        public bool OnPreInsert(PreInsertEvent @event)
-        {
-            Validate( @event.Entity, @event.Source.EntityMode );
-			return false;
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="event"></param>
-        /// <returns></returns>
-        public bool OnPreUpdate(PreUpdateEvent @event)
-        {
-			Validate(@event.Entity, @event.Source.EntityMode);
-			return false;
-        }
-
-		/// <summary>
 		/// Add sub elements. Composite Elements.
 		/// </summary>
 		/// <param name="property"></param>
 		/// <param name="element"></param>
 		private void AddSubElement(Property property, ValidatableElement element)
 		{
-			if(property != null && property.IsComposite && !property.BackRef)
+			if (property != null && property.IsComposite && !property.BackRef)
 			{
 				Component component = (Component) property.Value;
-				if(component.IsEmbedded) return;
+				if (component.IsEmbedded) return;

 				IPropertyAccessor accesor = PropertyAccessorFactory.GetPropertyAccessor(property, EntityMode.Poco);

@@ -130,7 +140,7 @@

 				foreach(Property currentProperty in component.PropertyIterator)
 				{
-					AddSubElement(currentProperty,subElement);
+					AddSubElement(currentProperty, subElement);
 				}

 				if (subElement.SubElements.Count != 0 || subElement.Validator.HasValidationRules)
@@ -149,24 +159,26 @@

 			ValidatableElement element;

-			if(isInitialized)
-				element = validators[entity.GetType()];
+			if (isInitialized)
+				if (validators.ContainsKey(entity.GetType()))
+					element = validators[entity.GetType()];
+				else
+					return; //no validation to do
 			else
 				throw new AssertionFailure("Validator event not initialized");
-
-			if (element == null) return; //No validation to do

 			List<InvalidValue> consolidatedInvalidValues = new List<InvalidValue>();
 			ValidateSubElements(element, entity, consolidatedInvalidValues);
 			InvalidValue[] invalidValues = element.Validator == null ? null : element.Validator.GetInvalidValues(entity);
-			if (invalidValues != null)
-			{
-				foreach (InvalidValue invalidValue in invalidValues)
-					consolidatedInvalidValues.Add( invalidValue );
+			if (invalidValues != null)
+			{
+				foreach(InvalidValue invalidValue in invalidValues)
+				{
+					consolidatedInvalidValues.Add(invalidValue);
+				}
 			}
 			if (consolidatedInvalidValues.Count > 0)
-				throw new InvalidStateException(consolidatedInvalidValues.ToArray(),entity.GetType().Name);
-
+				throw new InvalidStateException(consolidatedInvalidValues.ToArray(), entity.GetType().Name);
 		}

 		/// <summary>
@@ -175,23 +187,28 @@
 		/// <param name="element"></param>
 		/// <param name="entity"></param>
 		/// <param name="consolidatedInvalidValues"></param>
-		private void ValidateSubElements(ValidatableElement element, Object entity, IList<InvalidValue> consolidatedInvalidValues)
-		{
-			if ( element != null )
-			{
-				foreach (ValidatableElement subElement in element.SubElements)
+		private void ValidateSubElements(ValidatableElement element, Object entity,
+		                                 IList<InvalidValue> consolidatedInvalidValues)
+		{
+			if (element != null)
+			{
+				foreach(ValidatableElement subElement in element.SubElements)
 				{
 					Object component = subElement.Getter.Get(entity);
-
+
 					InvalidValue[] invalidValues = subElement.Validator.GetInvalidValues(component);
-
-					foreach (InvalidValue invalidValue in invalidValues)
-						consolidatedInvalidValues.Add( invalidValue );
-
-					ValidateSubElements( subElement, component, consolidatedInvalidValues );
-				}
-			}
-		}
+
+					foreach(InvalidValue invalidValue in invalidValues)
+					{
+						consolidatedInvalidValues.Add(invalidValue);
+					}
+
+					ValidateSubElements(subElement, component, consolidatedInvalidValues);
+				}
+			}
+		}
+
+		#region Nested type: ValidatableElement

 		/// <summary>
 		///
@@ -199,51 +216,51 @@
 		[Serializable]
 		private class ValidatableElement
 		{
-			private Type clazz;
-
+			private System.Type clazz;
+
+			private IGetter getter;
+
+			private List<ValidatableElement> subElements = new List<ValidatableElement>();
 			private ClassValidator validator;

-			private IGetter getter;
-
-			private List<ValidatableElement> subElements = new List<ValidatableElement>();
-
-			public ValidatableElement(Type clazz, ClassValidator validator, IGetter getter)
-				:this(clazz,validator)
+			public ValidatableElement(System.Type clazz, ClassValidator validator, IGetter getter)
+				: this(clazz, validator)
 			{
 				this.getter = getter;
 			}

-			public ValidatableElement(Type clazz, ClassValidator validator)
+			public ValidatableElement(System.Type clazz, ClassValidator validator)
 			{
 				this.clazz = clazz;
 				this.validator = validator;
 			}

-			public IList<ValidatableElement> SubElements
+			public IList<ValidatableElement> SubElements
 			{
 				get { return this.subElements; }
 			}

+			public IGetter Getter
+			{
+				get { return getter; }
+			}
+
+			public System.Type Clazz
+			{
+				get { return clazz; }
+			}
+
+			public ClassValidator Validator
+			{
+				get { return validator; }
+			}
+
 			public void AddSubElement(ValidatableElement subValidatableElement)
 			{
 				subElements.Add(subValidatableElement);
 			}
-
-			public IGetter Getter
-			{
-				get { return getter; }
-			}
-
-			public Type Clazz
-			{
-				get { return clazz; }
-			}
-
-			public ClassValidator Validator
-			{
-				get { return validator; }
-			}
-		}
-
-    }
+		}
+
+		#endregion
+	}
 }


Fix UpdateIndexSettingsRequest unit tests

--- src/Nest/Indices/IndexSettings/UpdateIndexSettings/UpdateIndexSettingsRequest.cs
+++ src/Nest/Indices/IndexSettings/UpdateIndexSettings/UpdateIndexSettingsRequest.cs
@@ -1,9 +1,10 @@
 using System;
+using Utf8Json;

 namespace Nest
 {
 	[MapsApi("indices.put_settings.json")]
-	[ReadAs(typeof(UpdateIndexSettingsRequest))]
+	[JsonFormatter(typeof(UpdateIndexSettingsRequestFormatter))]
 	public partial interface IUpdateIndexSettingsRequest
 	{
 		IDynamicIndexSettings IndexSettings { get; set; }
@@ -22,4 +23,27 @@
 		public UpdateIndexSettingsDescriptor IndexSettings(Func<DynamicIndexSettingsDescriptor, IPromise<IDynamicIndexSettings>> settings) =>
 			Assign(a => a.IndexSettings = settings?.Invoke(new DynamicIndexSettingsDescriptor())?.Value);
 	}
+
+	internal class UpdateIndexSettingsRequestFormatter : IJsonFormatter<IUpdateIndexSettingsRequest>
+	{
+		private static readonly DynamicIndexSettingsFormatter DynamicIndexSettingsFormatter =
+			new DynamicIndexSettingsFormatter();
+
+		public IUpdateIndexSettingsRequest Deserialize(ref JsonReader reader, IJsonFormatterResolver formatterResolver)
+		{
+			var dynamicSettings = DynamicIndexSettingsFormatter.Deserialize(ref reader, formatterResolver);
+			return new UpdateIndexSettingsRequest { IndexSettings = dynamicSettings };
+		}
+
+		public void Serialize(ref JsonWriter writer, IUpdateIndexSettingsRequest value, IJsonFormatterResolver formatterResolver)
+		{
+			if (value == null)
+			{
+				writer.WriteNull();
+				return;
+			}
+
+			DynamicIndexSettingsFormatter.Serialize(ref writer, value.IndexSettings, formatterResolver);
+		}
+	}
 }


Delete LoadingFunctions.cs

Delete LoadingFunctions.cs

--- LoadingFunctions.cs
+++ LoadingFunctions.cs
@@ -1,53 +0,0 @@
-using ICities;
-using UnityEngine;
-using System.Reflection;
-using System.Collections.Generic;
-using Rainfall.Redirection;
-
-namespace Rainfall
-{
-    public class LoadingFunctions : LoadingExtensionBase
-    {
-        private LoadMode _mode;
-
-
-        public override void OnCreated(ILoading loading)
-        {
-            base.OnCreated(loading);
-            AssemblyRedirector.Deploy();
-        }
-
-        public override void OnLevelLoaded(LoadMode mode)
-        {
-
-            _mode = mode;
-            if (mode != LoadMode.LoadGame && mode != LoadMode.NewGame)
-                return;
-            Hydrology.instance.loaded = true;
-            Hydraulics.instance.loaded = true;
-            Debug.Log("[RF] Level Loaded!");
-
-            base.OnLevelLoaded(mode);
-        }
-
-
-
-        public override void OnLevelUnloading()
-        {
-            if (_mode != LoadMode.LoadGame && _mode != LoadMode.NewGame)
-                return;
-            Hydrology.deinitialize();
-            Hydraulics.deinitialize();
-            Debug.Log("[RF] Level Unloaded!");
-            base.OnLevelUnloading();
-        }
-
-
-       public override void OnReleased()
-        {
-            base.OnReleased();
-            AssemblyRedirector.Revert();
-        }
-    }
-}
-


CR feedback

CR feedback

--- src/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/Utilities.cs
+++ src/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/Utilities.cs
@@ -98,26 +98,23 @@
                     return Int32_1;
                 case 2:
                     return Int32_2;
-                case 3:
-                    return Int32_3;
             }

             return i;
         }

-        internal static readonly object Int32_m = -1;
-        internal static readonly object Int32_0 = 0;
-        internal static readonly object Int32_1 = 1;
-        internal static readonly object Int32_2 = 2;
-        internal static readonly object Int32_3 = 3;
+        private static readonly object Int32_m = -1;
+        private static readonly object Int32_0 = 0;
+        private static readonly object Int32_1 = 1;
+        private static readonly object Int32_2 = 2;

         public static object BooleanToObject(bool b)
         {
             return b ? True : False;
         }

-        internal static readonly object True = true;
-        internal static readonly object False = false;
+        private static readonly object True = true;
+        private static readonly object False = false;

         internal static object GetPrimitiveDefaultValue(Type type)
         {


PR feedback: document tempUtf8CodeUnitCountAdjustment usage

--- src/System.Private.CoreLib/shared/System/Text/Unicode/Utf16Utility.Validation.cs
+++ src/System.Private.CoreLib/shared/System/Text/Unicode/Utf16Utility.Validation.cs
@@ -200,11 +200,15 @@
                                 inputLength++;
                             }

-                            int surrogatePairsCount = BitOperations.PopCount(highSurrogatesMask);
+                            // If we're 64-bit, we can perform the zero-extension of the surrogate pairs count for
+                            // free right now, saving the extension step a few lines below. If we're 32-bit, the
+                            // convertion to nuint immediately below is a no-op, and we'll pay the cost of the real
+                            // 64 -bit extension a few lines below.
+                            nuint surrogatePairsCountNuint = (uint)BitOperations.PopCount(highSurrogatesMask);

                             // 2 UTF-16 chars become 1 Unicode scalar

-                            tempScalarCountAdjustment -= surrogatePairsCount;
+                            tempScalarCountAdjustment -= (int)surrogatePairsCountNuint;

                             // Since each surrogate code unit was >= 0x0800, we eagerly assumed
                             // it'd be encoded as 3 UTF-8 code units, so our earlier popcnt computation
@@ -212,9 +216,18 @@
                             // pair is in reality only encoded as 4 UTF-8 code units, we need to
                             // perform this adjustment now.

-                            nint surrogatePairsCountNint = (nint)(nuint)(uint)surrogatePairsCount; // zero-extend to native int size
-                            tempUtf8CodeUnitCountAdjustment -= surrogatePairsCountNint;
-                            tempUtf8CodeUnitCountAdjustment -= surrogatePairsCountNint;
+                            if (IntPtr.Size == 8)
+                            {
+                                // Since we've already zero-extended surrogatePairsCountNuint, we can directly
+                                // sub + sub. It's more efficient than shl + sub.
+                                tempUtf8CodeUnitCountAdjustment -= (long)surrogatePairsCountNuint;
+                                tempUtf8CodeUnitCountAdjustment -= (long)surrogatePairsCountNuint;
+                            }
+                            else
+                            {
+                                // Take the hit of the 64-bit extension now.
+                                tempUtf8CodeUnitCountAdjustment -= 2 * surrogatePairsCountNuint;
+                            }
                         }

                         tempUtf8CodeUnitCountAdjustment += popcnt;


Adding DisplayUnits property to all the runtime counters (#25598)

--- src/System.Private.CoreLib/src/System/Diagnostics/Eventing/RuntimeEventSource.cs
+++ src/System.Private.CoreLib/src/System/Diagnostics/Eventing/RuntimeEventSource.cs
@@ -53,9 +53,9 @@
                 // overhead by at all times even when counters aren't enabled.

                 // On disable, PollingCounters will stop polling for values so it should be fine to leave them around.
-                _cpuTimeCounter = _cpuTimeCounter ?? new PollingCounter("cpu-usage", this, () => RuntimeEventSourceHelper.GetCpuUsage()) { DisplayName = "CPU Usage" };
-                _workingSetCounter = _workingSetCounter ?? new PollingCounter("working-set", this, () => (double)(Environment.WorkingSet / 1000000)) { DisplayName = "Working Set" };
-                _gcHeapSizeCounter = _gcHeapSizeCounter ?? new PollingCounter("gc-heap-size", this, () => (double)(GC.GetTotalMemory(false) / 1000000)) { DisplayName = "GC Heap Size" };
+                _cpuTimeCounter = _cpuTimeCounter ?? new PollingCounter("cpu-usage", this, () => RuntimeEventSourceHelper.GetCpuUsage()) { DisplayName = "CPU Usage", DisplayUnits = "%" };
+                _workingSetCounter = _workingSetCounter ?? new PollingCounter("working-set", this, () => (double)(Environment.WorkingSet / 1000000)) { DisplayName = "Working Set", DisplayUnits = "MB" };
+                _gcHeapSizeCounter = _gcHeapSizeCounter ?? new PollingCounter("gc-heap-size", this, () => (double)(GC.GetTotalMemory(false) / 1000000)) { DisplayName = "GC Heap Size", DisplayUnits = "MB" };
                 _gen0GCCounter = _gen0GCCounter ?? new IncrementingPollingCounter("gen-0-gc-count", this, () => GC.CollectionCount(0)) { DisplayName = "Gen 0 GC Count", DisplayRateTimeScale = new TimeSpan(0, 1, 0) };
                 _gen1GCCounter = _gen1GCCounter ?? new IncrementingPollingCounter("gen-1-gc-count", this, () => GC.CollectionCount(1)) { DisplayName = "Gen 1 GC Count", DisplayRateTimeScale = new TimeSpan(0, 1, 0) };
                 _gen2GCCounter = _gen2GCCounter ?? new IncrementingPollingCounter("gen-2-gc-count", this, () => GC.CollectionCount(2)) { DisplayName = "Gen 2 GC Count", DisplayRateTimeScale = new TimeSpan(0, 1, 0) };
@@ -64,12 +64,12 @@
                 _monitorContentionCounter = _monitorContentionCounter ?? new IncrementingPollingCounter("monitor-lock-contention-count", this, () => Monitor.LockContentionCount) { DisplayName = "Monitor Lock Contention Count", DisplayRateTimeScale = new TimeSpan(0, 0, 1) };
                 _threadPoolQueueCounter = _threadPoolQueueCounter ?? new PollingCounter("threadpool-queue-length", this, () => ThreadPool.PendingWorkItemCount) { DisplayName = "ThreadPool Queue Length" };
                 _completedItemsCounter = _completedItemsCounter ?? new IncrementingPollingCounter("threadpool-completed-items-count", this, () => ThreadPool.CompletedWorkItemCount) { DisplayName = "ThreadPool Completed Work Item Count", DisplayRateTimeScale = new TimeSpan(0, 0, 1) };
-                _gcTimeCounter = _gcTimeCounter ?? new PollingCounter("time-in-gc", this, () => GC.GetLastGCPercentTimeInGC()) { DisplayName = "Time in GC" };
-                _gen0SizeCounter = _gen0SizeCounter ?? new PollingCounter("gen-0-size", this, () => GC.GetGenerationSize(0)) { DisplayName = "Gen 0 Size" };
-                _gen1SizeCounter = _gen1SizeCounter ?? new PollingCounter("gen-1-size", this, () => GC.GetGenerationSize(1)) { DisplayName = "Gen 1 Size" };
-                _gen2SizeCounter = _gen2SizeCounter ?? new PollingCounter("gen-2-size", this, () => GC.GetGenerationSize(2)) { DisplayName = "Gen 2 Size" };
-                _lohSizeCounter = _lohSizeCounter ?? new PollingCounter("loh-size", this, () => GC.GetGenerationSize(3)) { DisplayName = "LOH Size" };
-                _allocRateCounter = _allocRateCounter ?? new IncrementingPollingCounter("alloc-rate", this, () => GC.GetTotalAllocatedBytes()) { DisplayName = "Allocation Rate", DisplayRateTimeScale = new TimeSpan(0, 0, 1) };
+                _gcTimeCounter = _gcTimeCounter ?? new PollingCounter("time-in-gc", this, () => GC.GetLastGCPercentTimeInGC()) { DisplayName = "% Time in GC since last GC", DisplayUnits = "%" };
+                _gen0SizeCounter = _gen0SizeCounter ?? new PollingCounter("gen-0-size", this, () => GC.GetGenerationSize(0)) { DisplayName = "Gen 0 Size", DisplayUnits="B" };
+                _gen1SizeCounter = _gen1SizeCounter ?? new PollingCounter("gen-1-size", this, () => GC.GetGenerationSize(1)) { DisplayName = "Gen 1 Size", DisplayUnits="B" };
+                _gen2SizeCounter = _gen2SizeCounter ?? new PollingCounter("gen-2-size", this, () => GC.GetGenerationSize(2)) { DisplayName = "Gen 2 Size", DisplayUnits="B" };
+                _lohSizeCounter = _lohSizeCounter ?? new PollingCounter("loh-size", this, () => GC.GetGenerationSize(3)) { DisplayName = "LOH Size", DisplayUnits="B" };
+                _allocRateCounter = _allocRateCounter ?? new IncrementingPollingCounter("alloc-rate", this, () => GC.GetTotalAllocatedBytes()) { DisplayName = "Allocation Rate", DisplayUnits="B", DisplayRateTimeScale = new TimeSpan(0, 0, 1) };
                 _assemblyCounter = _assemblyCounter ?? new PollingCounter("assembly-count", this, () => System.Reflection.Assembly.GetAssemblyCount()) { DisplayName = "Number of Assemblies Loaded" };
                 _timerCounter = _timerCounter ?? new PollingCounter("active-timer-count", this, () => Timer.ActiveCount) { DisplayName = "Number of Active Timers" };
             }


163: Trim()

163: Trim()

--- src/Tests/Test_BasicPixelFarm/Demo2/2.5_Demo_MultiLineTextBox_WithSugggestion.cs
+++ src/Tests/Test_BasicPixelFarm/Demo2/2.5_Demo_MultiLineTextBox_WithSugggestion.cs
@@ -8,7 +8,7 @@
 {
     [DemoNote("2.5 MultiLineText_WithSuggestion")]
     class Demo_MultiLineText_WithSuggestion : DemoBase
-    {
+    {
         LayoutFarm.CustomWidgets.TextBox textbox;
         LayoutFarm.CustomWidgets.ListView listView;
         Dictionary<char, List<string>> words = new Dictionary<char, List<string>>();
@@ -88,7 +88,7 @@
             e.PreventDefault = true;
         }
         static string GetString(char[] buffer, LayoutFarm.Composers.TextSplitBound bound)
-        {
+        {
             return new string(buffer, bound.startIndex, bound.length);
         }
         string currentLocalText = null;
@@ -403,7 +403,7 @@
             int j = seplist.Length;
             for (int i = 0; i < j; ++i)
             {
-                string sepWord = seplist[i];
+                string sepWord = seplist[i].Trim();
                 if (sepWord.StartsWith("'"))
                 {
                     sepWord = sepWord.Substring(1, sepWord.Length - 2);


remove get all users api #1650 (#1656)

remove get all users api #1650 (#1656)

--- src/Tooling/Bit.Tooling.Templates/TodoTemplate/Api/Controllers/UserController.cs
+++ src/Tooling/Bit.Tooling.Templates/TodoTemplate/Api/Controllers/UserController.cs
@@ -23,23 +23,17 @@
         _signInManager = signInManager;
     }

-    [HttpGet, EnableQuery]
-    public IQueryable<UserDto> Get(CancellationToken cancellationToken)
-    {
-        return _userManager.Users.ProjectTo<UserDto>(_mapper.ConfigurationProvider, cancellationToken);
-    }
-
     [HttpGet("[action]")]
     public async Task<UserDto> GetCurrentUser(CancellationToken cancellationToken)
     {
         var userId = User.GetUserId();

-        var user = await Get(cancellationToken).FirstOrDefaultAsync(user => user.Id == userId, cancellationToken);
-
+        var user = await _userManager.Users.FirstOrDefaultAsync(user => user.Id == userId, cancellationToken);
+
         if (user is null)
             throw new ResourceNotFoundException(nameof(ErrorStrings.UserCouldNotBeFound));

-        return user;
+        return _mapper.Map<User, UserDto>(user);
     }

     [HttpPut]