bunch of comments and deleting commented out code

--- CasualGame1/Assets/Scripts/TileManager.cs
+++ CasualGame1/Assets/Scripts/TileManager.cs
@@ -11,12 +11,15 @@
 {
     //the path each enemy will follow
     public List<Vector2> enemyPath;
+    //map dimensions
     public int x = 10;
     public int y = 10;

     //data on if a tile is occupied
     public bool[,] mapData;
+    //location of the enemy spawn in mapData coordinates
     private Vector2 spawnLocation;
+    //location of the player base in mapData coordinates
     private Vector2 baseLocation;

     public GameObject pathPrefab;
@@ -25,23 +28,20 @@
     public GameObject enemySpawn;
     public GameObject playerBase;

-
+    //file path of the map data file
     public string mapFileName = "Assets\\MapData\\level1.txt";

     // Use this for initialization
     void Start ()
     {
+        //read in the map data file and grab info
         ReadInFileData();

+        //adjust the map in accordance with the new mapData
         AdjustMap();

-
+        //initialize the enemy path
         enemyPath = new List<Vector2>();
-        //spawnLocation = new Vector2(4, 0);
-        //baseLocation = new Vector2(7, 8);
-
-
-        //Debug.Log(mapData);

         //creates the path the enemy will use
         CreatePath();
@@ -50,7 +50,7 @@
 	// Update is called once per frame
 	void Update ()
     {
-
+
 	}

     public void CreatePathIndicator()
@@ -85,8 +85,10 @@
         }
     }

+    //reset the map data
     public void Reset()
     {
+        //set mapData to default value
         for (int i = 0; i < x; i++)
         {
             for (int i2 = 0; i2 < y; i2++)
@@ -96,32 +98,17 @@
         }

         //creates the path each enemy will use
-        if (CreatePath())
-        {
-
-        }
-        /*else
-        {
-            enemyPath.Add(new Vector2(-5, 45));
-            enemyPath.Add(new Vector2(-5, 35));
-            enemyPath.Add(new Vector2(-5, 25));
-            enemyPath.Add(new Vector2(-5, 15));
-            enemyPath.Add(new Vector2(-5, 5));
-            enemyPath.Add(new Vector2(-5, -5));
-            enemyPath.Add(new Vector2(-5, -15));
-            enemyPath.Add(new Vector2(-5, -25));
-            enemyPath.Add(new Vector2(-5, -35));
-            enemyPath.Add(new Vector2(5, -35));
-            enemyPath.Add(new Vector2(15, -35));
-            enemyPath.Add(new Vector2(25, -35));
-
-            CreatePathIndicator();
-        }*/
-    }
-
+        CreatePath();
+
+    }
+
+    //calculate the path from the enemy spawn to the player base
     public bool CreatePath()
     {
+        //2D array of Vector2a to hold the data of the parent node location to find the path after calculation
         Vector2[,] pathParent = new Vector2[x,y];
+
+        //2D array of bools to keep track of visited nodes
         bool[,] availableTiles = new bool[x,y];

         //copy the map data for manipulation
@@ -130,36 +117,42 @@
             for(int j = 0; j < y; j++)
             {
                 availableTiles[i, j] = mapData[i, j];
-                //Debug.Log(i + ", " + j + " " + availableTiles[i, j]);
-            }
-        }
-
+            }
+        }
+
+        //create the priority queue
         Heap prq = new Heap();

+        //int to keep track of the heuristic value
         int heur = 0;

+        //insert the spawn location, this will be the starting location
         prq.Insert(0, spawnLocation);
+        //place a signal value in the pathParent array
         pathParent[(int)spawnLocation.x, (int)spawnLocation.y] = new Vector2(-1, -1);
+        //signal that this location has been visited
         availableTiles[(int)spawnLocation.x, (int)spawnLocation.y] = true;

+        //loop forever, will be broken inside the loop
         while (true)
         {
+            //get the next location from the priority queue
             KeyValuePair<int, Vector2> currentTile = prq.Pop();

+            //if the location gotten from the priority queue is the base, the path has been found
             if(currentTile.Value == baseLocation)
             {
+                //break out of the loop
                 break;
             }
-
-            //Debug.Log(currentTile);
-            //Debug.Log(prq.GetSize());
-            //Debug.Log(mapData[(int)currentTile.Value.x, (int)currentTile.Value.y]);

             //check the tile to the left
             if (currentTile.Value.x - 1 >= 0)
             {
+                //if the tile is available
                 if (!availableTiles[(int)currentTile.Value.x - 1, (int)currentTile.Value.y])
                 {
+                    //calculate the heuristic to the player base
                     heur = (int)Vector2.Distance(new Vector2(currentTile.Value.x - 1, currentTile.Value.y), baseLocation);

                     //add the new tile to the heap
@@ -174,8 +167,10 @@

             if(currentTile.Value.x + 1 < x)
             {
+                //if the tile is available
                 if (!availableTiles[(int)currentTile.Value.x + 1, (int)currentTile.Value.y])
                 {
+                    //calculate the heuristic to the player base
                     heur = (int)Vector2.Distance(new Vector2(currentTile.Value.x + 1, currentTile.Value.y), baseLocation);

                     //add the new tile to the heap
@@ -190,8 +185,10 @@

             if(currentTile.Value.y - 1 >= 0)
             {
+                //if the tile is available
                 if (!availableTiles[(int)currentTile.Value.x, (int)currentTile.Value.y - 1])
                 {
+                    //calculate the heuristic to the player base
                     heur = (int)Vector2.Distance(new Vector2(currentTile.Value.x, currentTile.Value.y - 1), baseLocation);

                     //add the new tile to the heap
@@ -206,8 +203,10 @@

             if(currentTile.Value.y + 1 < y)
             {
+                //if the tile is available
                 if (!availableTiles[(int)currentTile.Value.x, (int)currentTile.Value.y + 1])
                 {
+                    //calculate the heuristic to the player base
                     heur = (int)Vector2.Distance(new Vector2(currentTile.Value.x, currentTile.Value.y + 1), baseLocation);

                     //add the new tile to the heap
@@ -219,55 +218,63 @@
                     availableTiles[(int)currentTile.Value.x, (int)currentTile.Value.y + 1] = true;
                 }
             }
-
-
-
-
+
+            //if the priority queue is empty, then there is no possible path to travel
             if(prq.GetSize() == 0)
             {
+                //return false
                 return false;
             }
         }

-        //Debug.Log(pathParent);
-
-        //return false;
-
+        //populate the enemyPath vector with the new path
         AssignPath(pathParent);

+        //create indicators to show the path to the player
         CreatePathIndicator();
         return true;
     }

+    //assign the new path to the enemyPath List
     void AssignPath(Vector2[,] pathParent)
     {
+        //clear the current path
         enemyPath.Clear();

+        //set the current location to start at the player base
         Vector2 currentLocation = baseLocation;
+
+        //while we do not run into the end signal, loop
         while (currentLocation != new Vector2(-1, -1))
         {
-            //Debug.Log(currentLocation);
-
+            //insert the new location into the beginning of the enemyPath
+            //this is because we are moving from the end of the path to the beginning of the path and this will reverse it
             enemyPath.Insert(0, new Vector2((currentLocation.x - 5) * 10 + 5, (currentLocation.y - 5) * -10 - 5));

+            //grab the next location
             currentLocation = pathParent[(int)currentLocation.x,(int)currentLocation.y];
         }
     }

+    //read in data from the current map data file
     void ReadInFileData()
     {
+        //open the file
         StreamReader sr = File.OpenText(mapFileName);

         string line = "";

+        //read size of the map, the first and second line
         line = sr.ReadLine();
         x = Int32.Parse(line);

         line = sr.ReadLine();
         y = Int32.Parse(line);

+        //resize the map array
         mapData = new bool[x, y];

+        //holder variables
         int tempX = 0;
         int tempY = 0;

@@ -280,9 +287,6 @@
                 tempX = Int32.Parse(lineData[1]);
                 tempY = Int32.Parse(lineData[2]);

-                //Debug.Log(x + ", " + y);
-                //Debug.Log(tempX + ", " + tempY);
-
                 mapData[tempX, tempY] = true;

                 enemySpawn.transform.position = new Vector3((tempX - x / 2) * 10 + 5, 0.001f, (tempY - y / 2) * -10 - 5);
@@ -301,6 +305,7 @@
         }
     }

+    //adjust the size of the map
     void AdjustMap()
     {
         ground.transform.localScale = new Vector3(x, 1, y);


Fancified printing of packet logs

Fancified printing of packet logs

--- CoCSharp/Logging/PacketLogger.cs
+++ CoCSharp/Logging/PacketLogger.cs
@@ -50,6 +50,7 @@
         private StreamWriter LogWriter { get; set; }
         private BindingFlags BindingFlags { get; set; }

+        //TODO: Implement nested arrays.
         public void LogPacket(IPacket packet, PacketDirection direction)
         {
             var builder = new StringBuilder();
@@ -113,7 +114,14 @@

             LogWriter.WriteLine(builderString);
             if (LogConsole)
+            {
+                Console.Write("[");
+                Console.ForegroundColor = ConsoleColor.DarkCyan;
+                Console.Write("Packet");
+                Console.ResetColor();
+                Console.Write("] ");
                 Console.WriteLine(builderString);
+            }
         }

         private static string FormatPacketName(string name)


Fixed tests

Fixed tests

--- Code/Tests/BugSnagTargetTests.cs
+++ Code/Tests/BugSnagTargetTests.cs
@@ -48,7 +48,7 @@
         [InlineData(TheoryLoggerEventType.Info)]
         [InlineData(TheoryLoggerEventType.Debug)]
         [InlineData(TheoryLoggerEventType.Trace)]
-        public void GivenAnException_Error_LogsTheException(TheoryLoggerEventType eventType)
+        public void GivenAnException_LogEvent__LogsTheException(TheoryLoggerEventType eventType)
         {
             // Arrange.
             SetupLogManager();
@@ -100,12 +100,35 @@
             }

             // Assert.
-            var ss = error.ToString(Formatting.None);
             error["events"][0]["exceptions"][0]["message"].ToString().ShouldBe(errorMessage);
             error["events"][0]["exceptions"][0]["stacktrace"].HasValues.ShouldBe(true);
             error["events"][0]["metaData"].Count().ShouldBe(2);
             error["events"][0]["metaData"]["Extra Information"]["a1"].ToString().ShouldBe("b1");
             error["events"][0]["metaData"]["Extra Information"].Count().ShouldBe(2);
+        }
+
+        [Fact]
+        public void GivenNoExceptionWithSomeMetaData_Warning_LogsTheException()
+        {
+            // Arrange.
+            SetupLogManager();
+            var logger = LogManager.GetLogger("test");
+            const string errorMessage = "Something sad happened.";
+
+            JObject error;
+
+            // Act.
+            using (var testServer = new TestServer())
+            {
+                logger.Warn(errorMessage);
+                error = testServer.GetLastResponse();
+            }
+
+            // Assert.
+            error["events"][0]["exceptions"][0]["message"].ToString().ShouldBe(errorMessage);
+            error["events"][0]["exceptions"][0]["stacktrace"].HasValues.ShouldBe(true);
+            error["events"][0]["metaData"].Count().ShouldBe(1);
+            error["events"][0]["metaData"]["Exception Details"]["runtimeEnding"].ToString().ShouldBe("False");
         }

         private static string MapTheoryLoggerEventTypeToSeverity(TheoryLoggerEventType eventType)


Partially implement some && and || shortcircuiting if the left hand side is a constant during compile time in Pastel.

Current compile-time constant resolution only considered if both the left and right were constants.

There were some places that did things like this:

  if (@ext_boolean("HAS_FEATURE") && Extension.ThingRelatedToFeature()) { ... }

--- Compiler/Pastel/Nodes/OpChain.cs
+++ Compiler/Pastel/Nodes/OpChain.cs
@@ -210,6 +210,22 @@
                 left = this.Expressions[0] as InlineConstant;
                 right = this.Expressions[1] as InlineConstant;
             }
+
+            // TODO(pastel-split): This is just a quick and dirty short-circuit logic for && and ||
+            // Do full logic later. Currently this is causing problems in specific snippets in Crayon libraries.
+            string opValue = this.Ops[0].Value;
+            if (left != null)
+            {
+                if (opValue == "&&" && left.Value is bool)
+                {
+                    return (bool)left.Value ? (Expression)this : left;
+                }
+                if (opValue == "||" && left.Value is bool)
+                {
+                    return (bool)left.Value ? left : (Expression)this;
+                }
+            }
+
             return this;
         }


[SegmentedButton] Correctly register/unregister children elements.

--- Xwt/Xwt/SegmentedButton.cs
+++ Xwt/Xwt/SegmentedButton.cs
@@ -56,26 +56,32 @@

 			protected override void InsertItem (int index, Button item)
 			{
+				parent.RegisterChild (item);
 				Backend.AddChildButton (index, item);
 				base.InsertItem (index, item);
 			}

 			protected override void RemoveItem (int index)
 			{
+				parent.UnregisterChild (this [index]);
 				Backend.RemoveChildButton (index);
 				base.RemoveItem (index);
 			}

 			protected override void SetItem (int index, Button item)
 			{
+				parent.UnregisterChild (this [index]);
+				parent.RegisterChild (item);
 				Backend.ReplaceChildButton (index, item);
 				base.SetItem (index, item);
 			}

 			protected override void ClearItems ()
 			{
-				for (int i = 0; i < Count; i++)
+				for (int i = 0; i < Count; i++) {
+					parent.UnregisterChild (this [i]);
 					Backend.RemoveChildButton (i);
+				}
 				base.ClearItems ();
 			}
 		}


Format code

Format code

--- Controllers/GenericController.cs
+++ Controllers/GenericController.cs
@@ -18,13 +18,15 @@
 {
     [Authorize(AuthenticationSchemes = OAuthValidationDefaults.AuthenticationScheme)]
     [Route("api/[controller]")]
-    abstract public class GenericController<T,KeyType> : Controller where T:class{
+    abstract public class GenericController<T, KeyType> : Controller where T : class
+    {
         protected ApplicationContext context;
-        public GenericController(ApplicationContext context){
+        public GenericController(ApplicationContext context)
+        {
             this.context = context;
         }
         /// Create
-
+
         [HttpPost]
         public virtual IActionResult Post([FromBody]T item)
         {
@@ -35,7 +37,7 @@

             try
             {
-                var key = typeof(T).GetProperties().FirstOrDefault(p =>
+                var key = typeof(T).GetProperties().FirstOrDefault(p =>
                 p.CustomAttributes.Any(attr => attr.AttributeType == typeof(KeyAttribute)));
                 context.Add(item);
                 context.SaveChanges();
@@ -61,8 +63,8 @@
         [HttpGet("{id}")]
         public virtual IActionResult GetById(KeyType id)
         {
-            var result = context.Find(typeof(T),new object[] {id});
-
+            var result = context.Find(typeof(T), new object[] { id });
+
             //var result = collection.SingleOrDefault(item=>EF.Functions.Like(key.GetValue(item).ToString(), id));

             if (result == null)
@@ -70,13 +72,13 @@
                 return NotFound();
             }

-            return new ObjectResult(result);;
+            return new ObjectResult(result); ;
         }

         [HttpPut("{id}")]
-        public virtual IActionResult Update(KeyType id,[FromBody] T item)
+        public virtual IActionResult Update(KeyType id, [FromBody] T item)
         {
-            var key = typeof(T).GetProperties().FirstOrDefault(p =>
+            var key = typeof(T).GetProperties().FirstOrDefault(p =>
                 p.CustomAttributes.Any(attr => attr.AttributeType == typeof(KeyAttribute)));

             // if (item == null || !((KeyType) key.GetValue(item)).Equals(id))
@@ -84,14 +86,14 @@
             //     return BadRequest();
             // }

-            var result = context.Find(typeof(T),new object[] {id});
+            var result = context.Find(typeof(T), new object[] { id });
             if (result == null)
             {
                 return NotFound();
             }

             var tProperties = typeof(T).GetProperties();
-            foreach(var prop in tProperties)
+            foreach (var prop in tProperties)
             {
                 prop.SetValue(result, prop.GetValue(item));
             }
@@ -104,7 +106,7 @@
         [HttpDelete("{id}")]
         public virtual IActionResult Delete(KeyType id)
         {
-            var result = context.Find(typeof(T),new object[] {id});
+            var result = context.Find(typeof(T), new object[] { id });
             if (result == null)
             {
                 return NotFound();


Missing Contrat.

Missing Contrat.

--- Cogito.Core/Dynamic/DynamicDataContract.cs
+++ Cogito.Core/Dynamic/DynamicDataContract.cs
@@ -1,4 +1,6 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.Contracts;
 using System.Dynamic;
 using System.Linq.Expressions;
 using System.Runtime.Serialization;
@@ -28,7 +30,7 @@
         public dynamic this[string name]
         {
             get { return dictionary.GetOrDefault(name); }
-            set { dictionary[name] = value; }
+            set { Contract.Requires<ArgumentNullException>(name != null); dictionary[name] = value; }
         }

         /// <summary>


Added SuppressMessage attribute on ParameterEqualsConstraint as implementing a real TryMakeGenericType is not worth the effort.

--- Core/Source/Autofac/Util/TypeExtensions.cs
+++ Core/Source/Autofac/Util/TypeExtensions.cs
@@ -25,6 +25,7 @@

 using System;
 using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
 using System.Linq;
 using System.Reflection;

@@ -135,6 +136,7 @@
                        .Any(p => ParameterEqualsConstraint(p, constraint));
         }

+        [SuppressMessage("Microsoft.Design", "CA1031", Justification = "Implementing a real TryMakeGenericType is not worth the effort.")]
         static bool ParameterEqualsConstraint(Type parameter, Type constraint)
         {
             var genericArguments = parameter.GetGenericArguments();


CandleAlgorithm now sends previous point drawn to point view's DrawOrMove method - this'll allow FiniancialColoringRules to actually use the previous point

--- Core40/SeriesAlgorithms/CandleAlgorithm.cs
+++ Core40/SeriesAlgorithms/CandleAlgorithm.cs
@@ -68,6 +68,8 @@
                 candleWidth = totalSpace;
             }

+            ChartPoint previousDrawn = null;
+
             foreach (var chartPoint in View.ActualValues.GetPoints(View))
             {
                 var x = ChartFunctions.ToDrawMargin(chartPoint.X, AxisOrientation.X, Chart, View.ScalesXAt);
@@ -90,7 +92,9 @@

                 chartPoint.ChartLocation = new CorePoint(x + exceed/2, (candeView.High + candeView.Low)/2);

-                chartPoint.View.DrawOrMove(null, chartPoint, 0, Chart);
+                chartPoint.View.DrawOrMove(previousDrawn, chartPoint, 0, Chart);
+
+                previousDrawn = chartPoint;
             }
         }


Tweak tests to await results better.

Tweak tests to await results better.

--- DanTup.DartAnalysis.Tests/AnalysisTests.cs
+++ DanTup.DartAnalysis.Tests/AnalysisTests.cs
@@ -15,20 +15,15 @@
 		{
 			using (var service = new DartAnalysisService(SdkFolder, ServerScript))
 			{
-				bool? isAnalyzing = null; // Keep track of when we're called to say server status has changed
+				var analysisCompleteEvent = service.ServerStatusNotification.FirstAsync(n => n.IsAnalysing == false).PublishLast();
+
 				List<AnalysisError> errors = new List<AnalysisError>(); // Keep track of errors that are reported
-				using (service.ServerStatusNotification.Subscribe(e => { isAnalyzing = e.IsAnalysing; }))
 				using (service.AnalysisErrorsNotification.Subscribe(e => errors.AddRange(e.Errors)))
+				using (analysisCompleteEvent.Connect())
 				{
 					// Send a request to do some analysis.
 					await service.SetAnalysisRoots(new[] { SampleDartProject });
-
-					// Wait for a server status message (which should be that the analysis complete)
-					await service.ServerStatusNotification.FirstAsync();
-
-
-					// Ensure the event fired to say analysing had finished.
-					Assert.Equal(false, isAnalyzing);
+					await analysisCompleteEvent;

 					// Ensure the error-free file got no errors.
 					Assert.Equal(0, errors.Where(e => e.File == HelloWorldFile).Count());
@@ -46,14 +41,16 @@
 		{
 			using (var service = new DartAnalysisService(SdkFolder, ServerScript))
 			{
+				var firstAnalysisCompleteEvent = service.ServerStatusNotification.FirstAsync(n => n.IsAnalysing == false).PublishLast();
+				var secondAnalysisCompleteEvent = service.ServerStatusNotification.FirstAsync(n => n.IsAnalysing == false).PublishLast();
+
 				List<AnalysisError> errors = new List<AnalysisError>(); // Keep track of errors that are reported
 				using (service.AnalysisErrorsNotification.Subscribe(e => errors.AddRange(e.Errors)))
-				{
-					// Set the roots to our known project.
-					await service.SetAnalysisRoots(new[] { SampleDartProject });
-
-					// Wait for a server status message (which should be that the analysis complete)
-					await service.ServerStatusNotification.FirstAsync();
+				using (firstAnalysisCompleteEvent.Connect())
+				{
+					// Set the roots to our known project and wait for analysis to complete.
+					await service.SetAnalysisRoots(new[] { SampleDartProject });
+					await firstAnalysisCompleteEvent;
 				}

 				// Ensure we got the expected error in single_type_error.
@@ -63,8 +60,8 @@
 				errors.Clear();

 				using (service.AnalysisErrorsNotification.Subscribe(e => errors.AddRange(e.Errors)))
-				{
-
+				using (secondAnalysisCompleteEvent.Connect())
+				{
 					// Build a "fix" for this, which is to change the 1 to a string '1'.
 					await service.UpdateContent(
 						SingleTypeErrorFile,
@@ -79,7 +76,7 @@
 					);

 					// Wait for a server status message (which should be that the analysis complete)
-					await service.ServerStatusNotification.FirstAsync();
+					await secondAnalysisCompleteEvent;
 				}

 				// Ensure the error has gone away.
@@ -92,17 +89,21 @@
 		{
 			using (var service = new DartAnalysisService(SdkFolder, ServerScript))
 			{
+				var analysisCompleteEvent = service.ServerStatusNotification.FirstAsync(n => n.IsAnalysing == false).PublishLast();
+				var analysisHighlightEvent = service.AnalysisHighlightsNotification.FirstAsync().PublishLast();
+
 				List<AnalysisHighlightRegion> regions = new List<AnalysisHighlightRegion>(); // Keep track of errors that are reported
 				using (service.AnalysisHighlightsNotification.Subscribe(e => regions.AddRange(e.Regions)))
-				{
-					// Set the roots to our known project.
-					await service.SetAnalysisRoots(new[] { SampleDartProject });
-
-					// Request all the other stuff
+				using (analysisCompleteEvent.Connect())
+				using (analysisHighlightEvent.Connect())
+				{
+					// Set the roots to our known project and wait for the analysis to complete.
+					await service.SetAnalysisRoots(new[] { SampleDartProject });
+					await analysisCompleteEvent;
+
+					// Request Highlights and wait for it to complete (note: assuming first event back means it's complete).
 					await service.SetAnalysisSubscriptions(new[] { AnalysisSubscription.Highlights }, HelloWorldFile);
-
-					// Wait for a server status message (which should be that the analysis complete)
-					await service.ServerStatusNotification.FirstAsync();
+					await analysisHighlightEvent;

 					// Ensure it's what we expect
 					Assert.Equal(4, regions.Count);
@@ -127,17 +128,21 @@
 		{
 			using (var service = new DartAnalysisService(SdkFolder, ServerScript))
 			{
+				var analysisCompleteEvent = service.ServerStatusNotification.FirstAsync(n => n.IsAnalysing == false).PublishLast();
+				var analysisNavigationEvent = service.AnalysisNavigationNotification.FirstAsync().PublishLast();
+
 				List<AnalysisNavigationRegion> regions = new List<AnalysisNavigationRegion>(); // Keep track of errors that are reported
 				using (service.AnalysisNavigationNotification.Subscribe(e => regions.AddRange(e.Regions)))
-				{
-					// Set the roots to our known project.
-					await service.SetAnalysisRoots(new[] { SampleDartProject });
-
-					// Request all the other stuff
+				using (analysisCompleteEvent.Connect())
+				using (analysisNavigationEvent.Connect())
+				{
+					// Set the roots to our known project and wait for the analysis to complete.
+					await service.SetAnalysisRoots(new[] { SampleDartProject });
+					await analysisCompleteEvent;
+
+					// Request Highlights and wait for it to complete (note: assuming first event back means it's complete).
 					await service.SetAnalysisSubscriptions(new[] { AnalysisSubscription.Navigation }, HelloWorldFile);
-
-					// Wait for a server status message (which should be that the analysis complete)
-					await service.ServerStatusNotification.FirstAsync();
+					await analysisNavigationEvent;

 					// Ensure it's what we expect
 					Assert.Equal(2, regions.Count);
@@ -166,17 +171,21 @@
 		{
 			using (var service = new DartAnalysisService(SdkFolder, ServerScript))
 			{
+				var analysisCompleteEvent = service.ServerStatusNotification.FirstAsync(n => n.IsAnalysing == false).PublishLast();
+				var analysisOutlineEvent = service.AnalysisOutlineNotification.FirstAsync().PublishLast();
+
 				List<AnalysisOutline> outlines = new List<AnalysisOutline>(); // Keep track of errors that are reported
 				using (service.AnalysisOutlineNotification.Subscribe(e => outlines.Add(e.Outline)))
+				using (analysisCompleteEvent.Connect())
+				using (analysisOutlineEvent.Connect())
 				{
 					// Set the roots to our known project.
 					await service.SetAnalysisRoots(new[] { SampleDartProject });
+					await analysisCompleteEvent;

 					// Request all the other stuff
 					await service.SetAnalysisSubscriptions(new[] { AnalysisSubscription.Outline }, HelloWorldFile);
-
-					// Wait for a server status message (which should be that the analysis complete)
-					await service.ServerStatusNotification.FirstAsync();
+					await analysisOutlineEvent;

 					// Ensure it's what we expect
 					var expectedOutline = new AnalysisOutline


[datatool] undo this because i'm not creative enough to come up with different names

--- DataTool/ToolLogic/Extract/ExtractFlags.cs
+++ DataTool/ToolLogic/Extract/ExtractFlags.cs
@@ -11,16 +11,16 @@
         [CLIFlag(Default = false, Flag = "convert-lossless-textures", Help = "Output lossless textures (if converted)", Parser = new[] { "DataTool.Flag.Converter", "CLIFlagBoolean" })]
         public bool ConvertTexturesLossless;

-        [CLIFlag(Default = true, Flag = "convert-textures", Help = "Convert .004 files to {convert-textures-type}", Parser = new[] { "DataTool.Flag.Converter", "CLIFlagBooleanInv" })]
+        [CLIFlag(Default = true, Flag = "convert-textures", Help = "Convert .004 files to {convert-textures-type}", Parser = new[] { "DataTool.Flag.Converter", "CLIFlagBoolean" })]
         public bool ConvertTextures;

-        [CLIFlag(Default = true, Flag = "convert-sound", Help = "Convert .wem files to .ogg", Parser = new[] { "DataTool.Flag.Converter", "CLIFlagBooleanInv" })]
+        [CLIFlag(Default = true, Flag = "convert-sound", Help = "Convert .wem files to .ogg", Parser = new[] { "DataTool.Flag.Converter", "CLIFlagBoolean" })]
         public bool ConvertSound;

-        [CLIFlag(Default = true, Flag = "convert-models", Help = "Convert .00C files to .owmdl", Parser = new[] { "DataTool.Flag.Converter", "CLIFlagBooleanInv" })]
+        [CLIFlag(Default = true, Flag = "convert-models", Help = "Convert .00C files to .owmdl", Parser = new[] { "DataTool.Flag.Converter", "CLIFlagBoolean" })]
         public bool ConvertModels;

-        [CLIFlag(Default = true, Flag = "convert-animations", Help = "Convert .006 files to .seanim", Parser = new[] { "DataTool.Flag.Converter", "CLIFlagBooleanInv" })]
+        [CLIFlag(Default = true, Flag = "convert-animations", Help = "Convert .006 files to .seanim", Parser = new[] { "DataTool.Flag.Converter", "CLIFlagBoolean" })]
         public bool ConvertAnimations;

         [CLIFlag(Default = false, Flag = "skip-textures", Help = "Skip texture extraction", Parser = new[] { "DataTool.Flag.Converter", "CLIFlagBoolean" })]


Version bump again.

Version bump again.

--- DirectoryHelper/Properties/AssemblyInfo.cs
+++ DirectoryHelper/Properties/AssemblyInfo.cs
@@ -31,5 +31,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.2")]
-[assembly: AssemblyFileVersion("1.0.0.2")]
+[assembly: AssemblyVersion("1.0.0.3")]
+[assembly: AssemblyFileVersion("1.0.0.3")]


Fix error reading systems from netlog file

--- EDDiscovery/EliteDangerous/NetLogReader.cs
+++ EDDiscovery/EliteDangerous/NetLogReader.cs
@@ -138,6 +138,7 @@
                     else
                     {
                         System.Diagnostics.Trace.WriteLine("System parse error 1:" + line);
+                        return false;
                     }

                 }
@@ -157,6 +158,7 @@
                     else
                     {
                         System.Diagnostics.Trace.WriteLine("System parse error 2:" + line);
+                        return false;
                     }
                 }

@@ -191,7 +193,7 @@
                 if (line.Contains("[PG] Found matchmaking lobby object"))
                     this.CQC = true;

-                int offset = line.IndexOf("} System:") - 9;
+                int offset = line.IndexOf("} System:") - 8;
                 if (offset >= 0 && ParseTime(line.Substring(offset, 8)) && this.CQC == false)
                 {
                     //Console.WriteLine(" RD:" + line );
@@ -199,7 +201,7 @@
                         continue;

                     VisitedSystemsClass ps;
-                    if (ParseVisitedSystem(this.LastLogTime, this.TimeZoneOffset, line.Substring(offset + 11), out ps))
+                    if (ParseVisitedSystem(this.LastLogTime, this.TimeZoneOffset, line.Substring(offset + 10), out ps))
                     {   // Remove some training systems
                         if (ps.Name.Equals("Training"))
                             continue;


Fix tray icon crash and performance fixes for loading tray icons

--- EarTrumpet/ViewModels/TrayIconViewModel.cs
+++ EarTrumpet/ViewModels/TrayIconViewModel.cs
@@ -5,6 +5,7 @@
 using System.Collections.Generic;
 using System.Drawing;
 using System.Linq;
+using System.Windows;
 using Windows.ApplicationModel;
 using Windows.ApplicationModel.AppService;
 using Windows.Foundation;
@@ -21,12 +22,15 @@
             SpeakerTwoBars = 123,
             SpeakerThreeBars = 124,
             NoDevice = 125,
+            OriginalIcon
         }

         private readonly string _trayIconPath = Environment.ExpandEnvironmentVariables(@"%SystemRoot%\System32\SndVolSSO.dll");
         private Icon _trayIcon;
-        private EarTrumpetAudioDeviceService _deviceService;
+        private readonly EarTrumpetAudioDeviceService _deviceService;
         private AppServiceConnection _appServiceConnection;
+        private readonly Dictionary<IconId, Icon> _icons = new Dictionary<IconId, Icon>();
+        private IconId _currentIcon = IconId.OriginalIcon;

         public Icon TrayIcon
@@ -42,8 +46,29 @@
             }
         }

-        public TrayViewModel(EarTrumpetAudioDeviceService deviceService) {
-
+        public TrayViewModel(EarTrumpetAudioDeviceService deviceService)
+        {
+            var originalIcon = new Icon(Application.GetResourceStream(new Uri("pack://application:,,,/EarTrumpet;component/Tray.ico")).Stream);
+            _icons.Add(IconId.OriginalIcon, originalIcon);
+            try
+            {
+                _icons.Add(IconId.NoDevice, IconService.GetIconFromFile(_trayIconPath, (int)IconId.NoDevice));
+                _icons.Add(IconId.Muted, IconService.GetIconFromFile(_trayIconPath, (int)IconId.Muted));
+                _icons.Add(IconId.SpeakerZeroBars, IconService.GetIconFromFile(_trayIconPath, (int)IconId.SpeakerZeroBars));
+                _icons.Add(IconId.SpeakerOneBar, IconService.GetIconFromFile(_trayIconPath, (int)IconId.SpeakerOneBar));
+                _icons.Add(IconId.SpeakerTwoBars, IconService.GetIconFromFile(_trayIconPath, (int)IconId.SpeakerTwoBars));
+                _icons.Add(IconId.SpeakerThreeBars, IconService.GetIconFromFile(_trayIconPath, (int)IconId.SpeakerThreeBars));
+            }
+            catch
+            {
+                _icons.Add(IconId.NoDevice, originalIcon);
+                _icons.Add(IconId.Muted, originalIcon);
+                _icons.Add(IconId.SpeakerZeroBars, originalIcon);
+                _icons.Add(IconId.SpeakerOneBar, originalIcon);
+                _icons.Add(IconId.SpeakerTwoBars, originalIcon);
+                _icons.Add(IconId.SpeakerThreeBars, originalIcon);
+            }
+
             _deviceService = deviceService;
             _deviceService.MasterVolumeChanged += DeviceService_MasterVolumeChanged;

@@ -82,35 +107,47 @@

         public void UpdateTrayIcon(bool noDevice = false, bool isMuted = false, int currentVolume = 100)
         {
-            if (noDevice)
+            if (noDevice && _currentIcon != IconId.NoDevice)
             {
-                TrayIcon = IconService.GetIconFromFile(_trayIconPath, (int)IconId.NoDevice);
+                TrayIcon = _icons[IconId.NoDevice];
+                _currentIcon = IconId.NoDevice;
                 return;
             }
-            if (isMuted)
+            if (isMuted && _currentIcon != IconId.Muted)
             {
-                TrayIcon = IconService.GetIconFromFile(_trayIconPath, (int)IconId.Muted);
+                TrayIcon = _icons[IconId.Muted];
+                _currentIcon = IconId.Muted;
                 return;
             }
-            if (currentVolume == 0)
+            if (currentVolume == 0 && _currentIcon != IconId.SpeakerZeroBars)
             {
-                TrayIcon = IconService.GetIconFromFile(_trayIconPath, (int)IconId.SpeakerZeroBars);
+                TrayIcon = _icons[IconId.SpeakerZeroBars];
+                _currentIcon = IconId.SpeakerZeroBars;
                 return;
             }
-            if (currentVolume >= 1 && currentVolume < 33)
+            if (currentVolume >= 1 && currentVolume < 33 && _currentIcon != IconId.SpeakerOneBar)
             {
-                TrayIcon = IconService.GetIconFromFile(_trayIconPath, (int)IconId.SpeakerOneBar);
+                TrayIcon = _icons[IconId.SpeakerOneBar];
+                _currentIcon = IconId.SpeakerOneBar;
                 return;
             }
-            if (currentVolume >= 33 && currentVolume < 66)
+            if (currentVolume >= 33 && currentVolume < 66 && _currentIcon != IconId.SpeakerTwoBars)
             {
-                TrayIcon = IconService.GetIconFromFile(_trayIconPath, (int)IconId.SpeakerTwoBars);
+                TrayIcon = _icons[IconId.SpeakerTwoBars];
+                _currentIcon = IconId.SpeakerTwoBars;
                 return;
             }
-            if (currentVolume >= 66 && currentVolume <= 100)
+            if (currentVolume >= 66 && currentVolume <= 100 && _currentIcon != IconId.SpeakerThreeBars)
             {
-                TrayIcon = IconService.GetIconFromFile(_trayIconPath, (int)IconId.SpeakerThreeBars);
+                TrayIcon = _icons[IconId.SpeakerThreeBars];
+                _currentIcon = IconId.SpeakerThreeBars;
                 return;
+            }
+
+            if (_currentIcon == IconId.OriginalIcon)
+            {
+                TrayIcon = _icons[IconId.OriginalIcon];
+                _currentIcon = IconId.OriginalIcon;
             }
         }


Added check back in for when row and col position are passed in as strings

--- ClosedXML/ClosedXML/ClosedXML/XLHelper.cs
+++ ClosedXML/ClosedXML/ClosedXML/XLHelper.cs
@@ -62,7 +62,15 @@
         {
             if (string.IsNullOrEmpty(columnLetter)) throw new ArgumentNullException("columnLetter");

-            columnLetter = columnLetter.ToUpperInvariant();
+            int retVal;
+            columnLetter = columnLetter.ToUpper();
+
+            //Extra check because we allow users to pass row col positions in as strings
+            if (columnLetter[0] <= '9')
+            {
+                retVal = Int32.Parse(columnLetter, NumberFormatForParse);
+                return retVal;
+            }

             int sum = 0;


Display ellipsis in the middle of the value rather than at the end.

--- Eutherion/Win/Storage/PTypeErrorBuilder.cs
+++ Eutherion/Win/Storage/PTypeErrorBuilder.cs
@@ -144,9 +144,10 @@
             if (valueNode == null) throw new ArgumentNullException(nameof(valueNode));
             if (json == null) throw new ArgumentNullException(nameof(json));

-            const int maxLength = 30;
+            const int maxLength = 31;
             const string ellipsis = "...";
             const int ellipsisLength = 3;
+            const int halfLength = (maxLength - ellipsisLength) / 2;

             switch (valueNode)
             {
@@ -163,8 +164,10 @@
                     else
                     {
                         // Remove quotes, add ellipsis to inner string value, then quote again.
-                        // Somehow it looks like placing the ellipsis inside the string quotes makes more sense.
-                        return QuoteStringValue(json.Substring(valueNode.Start + 1, maxLength - ellipsisLength - 2) + ellipsis);
+                        return QuoteStringValue(
+                            json.Substring(valueNode.Start + 1, halfLength - 1)
+                            + ellipsis
+                            + json.Substring(valueNode.Start + valueNode.Length - halfLength + 1, halfLength - 1));
                     }
                 default:
                     if (valueNode.Length <= maxLength)
@@ -173,7 +176,10 @@
                     }
                     else
                     {
-                        return QuoteValue(json.Substring(valueNode.Start, maxLength - ellipsisLength) + ellipsis);
+                        return QuoteValue(
+                            json.Substring(valueNode.Start, halfLength)
+                            + ellipsis
+                            + json.Substring(valueNode.Start + valueNode.Length - halfLength, halfLength));
                     }
             }
         }


Make default font Noto Sans 12.

Make default font Noto Sans 12.

--- Content.Client/UserInterface/NanoStyle.cs
+++ Content.Client/UserInterface/NanoStyle.cs
@@ -19,8 +19,8 @@
         public NanoStyle()
         {
             var resCache = IoCManager.Resolve<IResourceCache>();
-            var notoSans14 = new VectorFont(resCache.GetResource<FontResource>("/Nano/NotoSans/NotoSans-Regular.ttf"),
-                14);
+            var notoSans12 = new VectorFont(resCache.GetResource<FontResource>("/Nano/NotoSans/NotoSans-Regular.ttf"),
+                12);
             var notoSans28 = new VectorFont(resCache.GetResource<FontResource>("/Nano/NotoSans/NotoSans-Regular.ttf"),
                 28);
             var notoSansBold16 =
@@ -88,7 +88,7 @@
                     new SelectorElement(null, null, null, null),
                     new[]
                     {
-                        new StyleProperty("font", notoSans14),
+                        new StyleProperty("font", notoSans12),
                     }),

                 // Window title.


Infinite lathe fix again (#12384)

Infinite lathe fix again (#12384)

* lathe fix again

fuck me i need to test shit more

* Whitespace

--- Content.Shared/Lathe/SharedLatheSystem.cs
+++ Content.Shared/Lathe/SharedLatheSystem.cs
@@ -51,10 +51,10 @@
         foreach (var (material, needed) in recipe.RequiredMaterials)
         {
             var adjustedAmount = recipe.ApplyMaterialDiscount
-                ? (int) (amount * component.MaterialUseMultiplier)
-                : amount;
+                ? (int) (needed * component.MaterialUseMultiplier)
+                : needed;

-            if (_materialStorage.GetMaterialAmount(component.Owner, material) < adjustedAmount * needed)
+            if (_materialStorage.GetMaterialAmount(component.Owner, material) < adjustedAmount * amount)
                 return false;
         }
         return true;


Comparison of versions is now possible

Comparison of versions is now possible

This will allow to order by VersionToken

--- Core/Theraot/Threading/VersionProvider.cs
+++ Core/Theraot/Threading/VersionProvider.cs
@@ -30,7 +30,7 @@
         }

         [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible", Justification = "By Design")]
-        public sealed class VersionToken
+        public sealed class VersionToken : IComparable<VersionToken>
         {
             private long _number;
             private VersionProvider _provider;
@@ -39,6 +39,26 @@
             internal VersionToken(VersionProvider provider)
             {
                 _provider = provider;
+            }
+
+            public int CompareTo(VersionToken other)
+            {
+                if (ReferenceEquals(other, null))
+                {
+                    return 1;
+                }
+                else
+                {
+                    var check = _target.CompareTo(other._target);
+                    if (check == 0)
+                    {
+                        return _number.CompareTo(other._number);
+                    }
+                    else
+                    {
+                        return check;
+                    }
+                }
             }

             public void UpdateIfNeeded(Action update)
@@ -62,9 +82,10 @@
             }
         }

-        private sealed class Target
+        private sealed class Target : IComparable<Target>
         {
             private long _number = long.MinValue;
+            private long _time = DateTime.Now.Ticks;

             internal Target(out Func<bool> tryAdvance)
             {
@@ -76,6 +97,18 @@
                 get
                 {
                     return _number;
+                }
+            }
+
+            public int CompareTo(Target other)
+            {
+                if (ReferenceEquals(other, null))
+                {
+                    return 1;
+                }
+                else
+                {
+                    return _time.CompareTo(other._time);
                 }
             }


Remove redundant null check

Remove redundant null check

--- osu.Framework/Graphics/Textures/TextureStore.cs
+++ osu.Framework/Graphics/Textures/TextureStore.cs
@@ -28,9 +28,7 @@

         private Texture getTexture(string name)
         {
-            RawTexture raw = base.Get($@"{name}");
-            if (raw == null) return null;
-            return TextureLoader.FromRawTexture(raw, atlas);
+            return TextureLoader.FromRawTexture(base.Get($@"{name}"), atlas);
         }

         public async Task<Texture> GetAsync(string name) => await Task.Run(() => Get(name));


Add `updateImeWindowPosition()`

Add `updateImeWindowPosition()`

--- osu.Framework/Graphics/UserInterface/TextBox.cs
+++ osu.Framework/Graphics/UserInterface/TextBox.cs
@@ -13,6 +13,7 @@
 using osuTK.Input;
 using osu.Framework.Allocation;
 using osu.Framework.Bindables;
+using osu.Framework.Graphics.Primitives;
 using osu.Framework.Platform;
 using osu.Framework.Input.Bindings;
 using osu.Framework.Input.Events;
@@ -408,6 +409,9 @@
             {
                 updateCursorAndLayout();
                 cursorAndLayout.Validate();
+
+                // keep the IME window up-to date with the current selection / composition string.
+                updateImeWindowPosition();
             }
         }

@@ -1085,6 +1089,13 @@

                 if (string.IsNullOrEmpty(newComposition))
                 {
+                    // we might get an empty composition when the IME is first activated,
+                    // the IME mode has changed (eg. plaintext -> kana),
+                    // or when the keyboard layout and language have changed to a one supported by an IME.
+                    // we can use this opportunity to update the IME window so it appears in
+                    // the correct place once the user starts compositing.
+                    updateImeWindowPosition();
+
                     // early return as SDL might sometimes send empty text editing events.
                     // we don't want the currently selected text to be removed in that case
                     // (we only want it removed once the user has entered _some_ text).
@@ -1163,6 +1174,43 @@
             cursorAndLayout.Invalidate();
         }

+        /// <summary>
+        /// Updates the location of the platform-native IME composition window
+        /// to the current composition string / current selection.
+        /// </summary>
+        private void updateImeWindowPosition()
+        {
+            if (!cursorAndLayout.IsValid)
+                return;
+
+            int startIndex, endIndex;
+
+            if (imeCompositionDrawables.Count > 0)
+            {
+                startIndex = imeCompositionStart;
+                endIndex = imeCompositionStart + imeCompositionDrawables.Count;
+            }
+            else
+            {
+                startIndex = selectionLeft;
+                endIndex = selectionRight;
+            }
+
+            float start = getPositionAt(startIndex);
+            float end = getPositionAt(endIndex);
+
+            var compositionTextRectangle = new RectangleF
+            {
+                X = start,
+                Y = 0,
+                Width = end - start,
+                Height = DrawHeight,
+            };
+
+            var quad = ToScreenSpace(compositionTextRectangle);
+            textInput?.SetImeRectangle(quad.AABBFloat);
+        }
+
         #endregion
     }
 }


Fix nub position getting offset by size changes

--- osu.Game/Graphics/UserInterface/OsuSliderBar.cs
+++ osu.Game/Graphics/UserInterface/OsuSliderBar.cs
@@ -9,6 +9,7 @@
 using osu.Framework.Audio;
 using osu.Framework.Audio.Sample;
 using osu.Framework.Graphics;
+using osu.Framework.Graphics.Containers;
 using osu.Framework.Graphics.UserInterface;
 using osu.Framework.Graphics.Cursor;
 using osu.Framework.Graphics.Shapes;
@@ -31,6 +32,7 @@
         protected readonly Nub Nub;
         private readonly Box leftBox;
         private readonly Box rightBox;
+        private readonly Container nubContainer;

         public virtual string TooltipText { get; private set; }

@@ -72,10 +74,15 @@
                     Origin = Anchor.CentreRight,
                     Alpha = 0.5f,
                 },
-                Nub = new Nub
-                {
-                    Origin = Anchor.TopCentre,
-                    Expanded = true,
+                nubContainer = new Container
+                {
+                    RelativeSizeAxes = Axes.Both,
+                    Child = Nub = new Nub
+                    {
+                        Origin = Anchor.TopCentre,
+                        RelativePositionAxes = Axes.X,
+                        Expanded = true,
+                    },
                 },
                 new HoverClickSounds()
             };
@@ -88,6 +95,13 @@
         {
             sample = audio.Samples.Get(@"UI/sliderbar-notch");
             AccentColour = colours.Pink;
+        }
+
+        protected override void Update()
+        {
+            base.Update();
+
+            nubContainer.Padding = new MarginPadding { Horizontal = RangePadding };
         }

         protected override void LoadComplete()
@@ -176,14 +190,14 @@
         {
             base.UpdateAfterChildren();
             leftBox.Scale = new Vector2(Math.Clamp(
-                Nub.DrawPosition.X - Nub.DrawWidth / 2, 0, DrawWidth), 1);
+                RangePadding + Nub.DrawPosition.X - Nub.DrawWidth / 2, 0, DrawWidth), 1);
             rightBox.Scale = new Vector2(Math.Clamp(
-                DrawWidth - Nub.DrawPosition.X - Nub.DrawWidth / 2, 0, DrawWidth), 1);
+                DrawWidth - Nub.DrawPosition.X - RangePadding - Nub.DrawWidth / 2, 0, DrawWidth), 1);
         }

         protected override void UpdateValue(float value)
         {
-            Nub.MoveToX(RangePadding + UsableWidth * value, 250, Easing.OutQuint);
+            Nub.MoveToX(value, 250, Easing.OutQuint);
         }

         /// <summary>


Adjust colours

Adjust colours

--- osu.Game/Graphics/UserInterface/PageSelector.cs
+++ osu.Game/Graphics/UserInterface/PageSelector.cs
@@ -172,8 +172,8 @@
             [BackgroundDependencyLoader]
             private void load(OsuColour colours)
             {
-                IdleColour = colours.Seafoam;
-                HoverColour = colours.Seafoam.Lighten(30f);
+                IdleColour = colours.Lime;
+                HoverColour = colours.Lime.Lighten(20f);
             }

             protected abstract Drawable CreateText(string text);


Revert string type changes in `MetadataLineInfo`

--- osu.Game/Screens/Play/BeatmapMetadataDisplay.cs
+++ osu.Game/Screens/Play/BeatmapMetadataDisplay.cs
@@ -226,10 +226,10 @@

         private class MetadataLineInfo : OsuSpriteText
         {
-            public MetadataLineInfo(LocalisableString text)
+            public MetadataLineInfo(string text)
             {
                 Margin = new MarginPadding { Left = 5 };
-                Text = string.IsNullOrEmpty(text.ToString()) ? @"-" : text;
+                Text = string.IsNullOrEmpty(text) ? @"-" : text;
             }
         }
     }


Crankshaft[BU000004XWX91J] .NET client @ 2018-01-18 12:33:00 UTC

--- GoCardless/Services/SubscriptionService.cs
+++ GoCardless/Services/SubscriptionService.cs
@@ -194,6 +194,15 @@
         ///
         /// - `number_of_subscription_amendments_exceeded` error if the
         /// subscription amount has already been changed 10 times.
+        ///
+        /// - `forbidden` if the amount is being changed, and the subscription
+        /// was created by an app and you are not authenticated as that app, or
+        /// if the subscription was not created by an app and you are
+        /// authenticated as an app
+        ///
+        /// - `resource_created_by_another_app` if the app fee is being changed,
+        /// and the subscription was created by an app other than the app you
+        /// are authenticated as
         ///
         /// </summary>
         /// <param name="identity">Unique identifier, beginning with "SB".</param>
@@ -583,6 +592,15 @@
     /// - `number_of_subscription_amendments_exceeded` error if the subscription
     /// amount has already been changed 10 times.
     ///
+    /// - `forbidden` if the amount is being changed, and the subscription was
+    /// created by an app and you are not authenticated as that app, or if the
+    /// subscription was not created by an app and you are authenticated as an
+    /// app
+    ///
+    /// - `resource_created_by_another_app` if the app fee is being changed, and
+    /// the subscription was created by an app other than the app you are
+    /// authenticated as
+    ///
     /// </summary>
     public class SubscriptionUpdateRequest
     {


Remove useless part

Remove useless part

--- Grabacr07.KanColleWrapper/PreviewBattle.cs
+++ Grabacr07.KanColleWrapper/PreviewBattle.cs
@@ -28,10 +28,6 @@
 		/// 전투가 끝나고 모항에 돌아왔는지를 채크
 		/// </summary>
 		private bool BattleEnd { get; set; }
-		/// <summary>
-		/// 연합함대가 크리티컬이 맞는지 조회하는 부분
-		/// </summary>
-		//private bool IsCombineCritical { get; set; }

 		public delegate void CriticalEventHandler();
 		/// <summary>
@@ -50,11 +46,11 @@
 		{
 			proxy.api_req_sortie_battle.TryParse<kcsapi_battle>().Subscribe(x => this.Battle(false,false, x.Data));
 			proxy.api_req_sortie_night_to_day.TryParse<kcsapi_battle>().Subscribe(x => this.Battle(false,false, x.Data));
-			proxy.api_req_battle_midnight_battle.TryParse<kcsapi_midnight_battle>().Subscribe(x => this.MidBattle(false,false, x.Data));
-			proxy.api_req_battle_midnight_sp_midnight.TryParse<kcsapi_midnight_battle>().Subscribe(x => this.MidBattle(true,false, x.Data));
+			proxy.api_req_battle_midnight_battle.TryParse<kcsapi_midnight_battle>().Subscribe(x => this.MidBattle(false, x.Data));
+			proxy.api_req_battle_midnight_sp_midnight.TryParse<kcsapi_midnight_battle>().Subscribe(x => this.MidBattle(false, x.Data));
 			proxy.api_req_combined_battle_airbattle.TryParse<kcsapi_battle>().Subscribe(x => this.AirBattle(x.Data));
 			proxy.api_req_combined_battle_battle.TryParse<kcsapi_battle>().Subscribe(x => this.Battle(true,false, x.Data));
-			proxy.api_req_combined_battle_midnight_battle.TryParse<kcsapi_midnight_battle>().Subscribe(x => this.MidBattle(true,true, x.Data));
+			proxy.api_req_combined_battle_midnight_battle.TryParse<kcsapi_midnight_battle>().Subscribe(x => this.MidBattle(true, x.Data));
 			proxy.api_req_combined_battle_battle_water.TryParse<kcsapi_battle>().Subscribe(x => this.Battle(true,true, x.Data));

 			proxy.api_req_map_start.Subscribe(x => this.Cleared(false));
@@ -70,12 +66,10 @@
 		/// <param name="IsEnd">전투가 끝난건지 안 끝난건지의 여부를 입력</param>
 		private void Cleared(bool IsEnd)
 		{
-			//if (this.IsCombineCritical || this.IsCritical)
 			if (this.IsCritical)
 			{
 				this.CriticalCleared();
 				this.IsCritical = false;
-				//this.IsCombineCritical = false;

 				if (IsEnd) this.BattleEnd = true;
 				else this.BattleEnd = false;
@@ -110,7 +104,6 @@
 		private void AirBattle(kcsapi_battle battle)
 		{
 			this.IsCritical = false;
-			//this.IsCombineCritical = false;
 			List<listup> lists = new List<listup>();
 			List<int> CurrentHPList = new List<int>();
 			List<int> HPList = new List<int>();
@@ -123,7 +116,6 @@
 			if (battle.api_kouku != null && battle.api_kouku.api_stage3 != null)
 			{
 				int[] numlist = battle.api_kouku.api_stage3.api_frai_flag;
-				//int[] numlistCl = battle.api_kouku.api_stage3.api_fcl_flag;//이건 뭐지?

 				decimal[] damlist = battle.api_kouku.api_stage3.api_fdam;

@@ -136,7 +128,6 @@
 				if (battle.api_kouku != null && battle.api_kouku.api_stage3_combined != null)
 				{
 					numlist = battle.api_kouku.api_stage3_combined.api_frai_flag;
-					//numlistCl = battle.api_kouku.api_stage3_combined.api_fcl_flag;//이건 뭐지?

 					damlist = battle.api_kouku.api_stage3_combined.api_fdam;

@@ -154,7 +145,6 @@
 			{
 				int[] numlist = battle.api_kouku2.api_stage3.api_frai_flag;//뇌격
 				int[] numlistBak = battle.api_kouku2.api_stage3.api_fbak_flag;//폭격
-				//int[] numlistCl = battle.api_kouku2.api_stage3.api_fcl_flag;//이건 뭐지?

 				decimal[] damlist = battle.api_kouku2.api_stage3.api_fdam;

@@ -168,7 +158,6 @@
 				{
 					numlist = battle.api_kouku2.api_stage3_combined.api_frai_flag;//뇌격
 					numlistBak = battle.api_kouku2.api_stage3_combined.api_fbak_flag;//폭격
-					//numlistCl = battle.api_kouku2.api_stage3_combined.api_fcl_flag;//이건 뭐지?

 					damlist = battle.api_kouku2.api_stage3_combined.api_fdam;
 					for (int i = 0; i < battle.api_kouku2.api_stage3_combined.api_frai_flag.Count(); i++)//컴바인 함대 플래그
@@ -201,7 +190,6 @@
 		private void Battle(bool IsCombined,bool IsWater, kcsapi_battle battle)
 		{
 			this.IsCritical = false;
-			//this.IsCombineCritical = false;
 			List<int> CurrentHPList = new List<int>();
 			List<listup> lists = new List<listup>();
 			List<int> HPList = new List<int>();
@@ -249,7 +237,6 @@
 			if (battle.api_kouku != null && battle.api_kouku.api_stage3 != null)
 			{
 				int[] numlist = battle.api_kouku.api_stage3.api_frai_flag;//뇌격
-				//int[] numlistCl = battle.api_kouku.api_stage3.api_fcl_flag;//이건 뭐지?

 				decimal[] damlist = battle.api_kouku.api_stage3.api_fdam;
 				ChangeKoukuFlagToNumber(battle.api_kouku.api_stage3.api_frai_flag,
@@ -262,7 +249,6 @@
 					if (battle.api_kouku.api_stage3_combined != null)
 					{
 						numlist = battle.api_kouku.api_stage3_combined.api_frai_flag;//뇌격
-						//numlistCl = battle.api_kouku.api_stage3_combined.api_fcl_flag;//이건 뭐지?

 						damlist = battle.api_kouku.api_stage3_combined.api_fdam;
 						ChangeKoukuFlagToNumber(battle.api_kouku.api_stage3_combined.api_frai_flag,
@@ -299,11 +285,9 @@
 		/// </summary>
 		/// <param name="battle"></param>
 		/// <param name="IsCombined">연합함대인지 아닌지 입력합니다.연합함대인경우 True입니다.</param>
-		private void MidBattle(bool IsMidBattleStart,bool IsCombined, kcsapi_midnight_battle battle)
-		{
-			//if(IsCombined && IsMidBattleStart) this.IsCombineCritical = false;
-			if (IsCombined && IsMidBattleStart) this.IsCritical = false;
-			else if (!IsCombined) this.IsCritical = false;
+		private void MidBattle(bool IsCombined, kcsapi_midnight_battle battle)
+		{
+			if (!IsCombined) this.IsCritical = false;

 			List<listup> lists = new List<listup>();
 			List<int> HPList = new List<int>();


"fixed" !next

"fixed" !next

--- JefBot/Commands/NextStreamPluginCommand.cs
+++ JefBot/Commands/NextStreamPluginCommand.cs
@@ -11,7 +11,7 @@
     {
         public string PluginName => "NextStream";
         public string Command => "next";
-        public string Help => "!n will give the estimated time untill the next stream.";
+        public string Help => "!next will give the estimated time untill the next stream.";
         public IEnumerable<string> Aliases => new[] { "n", "nextstream", "countdown" };
         public bool Loaded { get; set; } = true;

@@ -28,13 +28,22 @@
         {
             if (command.ChatMessage.Channel == "jefmajor")
             {
-                client.SendMessage(command.ChatMessage.Channel, time().Result);
+                client.SendMessage(command.ChatMessage.Channel, time());
             }
         }

-        public async Task<string> time()
+        public string time()
         {
-            var uptime = await TwitchApi.Streams.GetUptimeAsync("jefmajor");
+            TimeSpan uptime = new TimeSpan();
+
+            try
+            {
+                uptime = TwitchApi.Streams.GetUptime("jefmajor");
+            }
+            catch (Exception){}
+
+
+
             if (uptime.Ticks == 0)
             {
                 List<DateTime> times = new List<DateTime>();
@@ -68,7 +77,7 @@

         public void Discord(MessageEventArgs arg, DiscordClient client)
         {
-            arg.Channel.SendMessage(time().Result);
+            arg.Channel.SendMessage(time());
         }
     }
 }


Fixing issue with getters that throw exceptions

--- Jot/Configuration/TrackingConfiguration.cs
+++ Jot/Configuration/TrackingConfiguration.cs
@@ -188,9 +188,9 @@
                 var values = new Dictionary<string, object>();
                 foreach (string propertyName in TrackedProperties.Keys)
                 {
-                var value = TrackedProperties[propertyName].Getter(target);
                     try
                     {
+                        var value = TrackedProperties[propertyName].Getter(target);
                         var shouldPersist = OnPersistingProperty(target, propertyName, ref value);
                         if (shouldPersist)
                         {


modal dialog moved to androidscreen for now

--- Joyride/Platforms/Android/AndroidScreen.cs
+++ Joyride/Platforms/Android/AndroidScreen.cs
@@ -1,6 +1,7 @@

 using System;
 using System.Collections.Generic;
+using System.Linq;
 using Joyride.Extensions;
 using OpenQA.Selenium;
 using OpenQA.Selenium.Appium.Android;
@@ -13,6 +14,51 @@
         protected static ScreenFactory ScreenFactory = new AndroidScreenFactory();
         protected static IModalDialogDetector ModalDialogDetector;
         protected static new AndroidDriver Driver = (AndroidDriver) RemoteMobileDriver.GetInstance();
+
+        public virtual IModalDialog DetectModalDialog()
+        {
+            return ModalDialogDetector.Detect();
+        }
+
+        public virtual IModalDialog DetectModalDialog(Type dialogType)
+        {
+            return ModalDialogDetector.Detect(dialogType);
+        }
+
+        public virtual IModalDialog DetectModalDialog(string modalDialogName)
+        {
+            return ModalDialogDetector.Detect(modalDialogName);
+        }
+
+        public virtual Screen AcceptModalDialog(bool accept, string modalDialogName)
+        {
+            return AcceptModalDialogs(accept, modalDialogName);
+        }
+
+        public virtual Screen AcceptModalDialog(bool accept)
+        {
+            return AcceptModalDialogs(accept);
+        }
+
+        protected Screen AcceptModalDialogs(bool accept, params string[] dialogs)
+        {
+            var dialog = !dialogs.Any() ? ModalDialogDetector.Detect() : ModalDialogDetector.Detect(dialogs);
+
+            if (dialog == null)
+                return this;
+
+            return accept ? dialog.Accept() : dialog.Dismiss();
+        }
+
+        protected Screen AcceptModalDialogs(bool accept, Type[] dialogTypes)
+        {
+            var dialog = !dialogTypes.Any() ? ModalDialogDetector.Detect() : ModalDialogDetector.Detect(dialogTypes);
+
+            if (dialog == null)
+                return this;
+
+            return accept ? dialog.Accept() : dialog.Dismiss();
+        }

         public void HideKeyboard()
         {


Formatting

Formatting

--- KerbalFuture/HelperFiles/Vector3dHelper.cs
+++ KerbalFuture/HelperFiles/Vector3dHelper.cs
@@ -4,18 +4,18 @@
 	{
 		double v3dX, v3dY, v3dZ;

-		public static void ConvertVector3dToXYZCoords(Vector3d v3d, ref double x,
-													  ref double y, ref double z)
+		public static void ConvertVector3dToXYZCoords(Vector3d v3d, ref double x,
+		    ref double y, ref double z)
 		{
 			x = v3d.x;
 			y = v3d.y;
 			z = v3d.z;
 		}
 		public static Vector3d ConvertXYZCoordsToVector3d(double x, double y,
-														  double z)
+			double z)
 		=> new Vector3d(x, y, z);
 		public static void ConvertXYZCoordsToVector3d(double x, double y,
-													  double z, ref Vector3d v3d)
+			double z, ref Vector3d v3d)
 		=> v3d = new Vector3d(x, y, z);
 		public double Vector3dX() => v3dX;
 		public double Vector3dY() => v3dY;


Average operator selector overloads refactoring

--- LINQlone/System/Linq/ImmediateExecution.cs
+++ LINQlone/System/Linq/ImmediateExecution.cs
@@ -2570,29 +2570,7 @@
         /// <exception cref="System.OverflowException">The sum of the elements in the sequence is larger than System.Int64.MaxValue.</exception>
         public static double? Average<TSource>(this IEnumerable<TSource> source, Func<TSource, int?> selector)
         {
-            if (source == null) { throw Exceptions.ArgumentNull(Parameter.Source); }
-            if (selector == null) { throw Exceptions.ArgumentNull(Parameter.Selector); }
-
-            long sum = 0L;
-            long count = 0L;
-
-            foreach (TSource item in source)
-            {
-                int? selectedNullable = selector(item);
-
-                if (selectedNullable.HasValue)
-                {
-                    checked
-                    {
-                        sum += selectedNullable.Value;
-                        count++;
-                    }
-                }
-            }
-
-            if (count == 0) { return new double?(); }
-
-            return (double)sum / count;
+            return Average(source.Select(selector));
         }

         /// <summary>
@@ -2607,29 +2585,7 @@
         /// <exception cref="System.OverflowException">The sum of the elements in the sequence is larger than System.Int64.MaxValue.</exception>
         public static double Average<TSource>(this IEnumerable<TSource> source, Func<TSource, int> selector)
         {
-            if (source == null) { throw Exceptions.ArgumentNull(Parameter.Source); }
-            if (selector == null) { throw Exceptions.ArgumentNull(Parameter.Selector); }
-
-            long sum = 0L;
-            long count = 0L;
-
-            foreach (TSource item in source)
-            {
-                int selectedValue = selector(item);
-
-                checked
-                {
-                    sum += selectedValue;
-                    count++;
-                }
-            }
-
-            if (count == 0)
-            {
-                throw Exceptions.NoElements();
-            }
-
-            return (double)sum / count;
+            return Average(source.Select(selector));
         }

         /// <summary>
@@ -2641,29 +2597,7 @@
         /// <returns>The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.</returns>
         public static double? Average<TSource>(this IEnumerable<TSource> source, Func<TSource, long?> selector)
         {
-            if (source == null) { throw Exceptions.ArgumentNull(Parameter.Source); }
-            if (selector == null) { throw Exceptions.ArgumentNull(Parameter.Selector); }
-
-            long sum = 0L;
-            long count = 0L;
-
-            foreach (TSource item in source)
-            {
-                long? selectedNullable = selector(item);
-
-                if (selectedNullable.HasValue)
-                {
-                    checked
-                    {
-                        sum += selectedNullable.Value;
-                        count++;
-                    }
-                }
-            }
-
-            if (count == 0) { return new long?(); }
-
-            return (double)sum / count;
+            return Average(source.Select(selector));
         }

         /// <summary>
@@ -2678,29 +2612,7 @@
         /// <exception cref="System.OverflowException">The sum of the elements in the sequence is larger than System.Int64.MaxValue.</exception>
         public static double Average<TSource>(this IEnumerable<TSource> source, Func<TSource, long> selector)
         {
-            if (source == null) { throw Exceptions.ArgumentNull(Parameter.Source); }
-            if (selector == null) { throw Exceptions.ArgumentNull(Parameter.Selector); }
-
-            long sum = 0L;
-            long count = 0L;
-
-            foreach (TSource item in source)
-            {
-                long selectedValue = selector(item);
-
-                checked
-                {
-                    sum += selectedValue;
-                    count++;
-                }
-            }
-
-            if (count == 0)
-            {
-                throw Exceptions.NoElements(); // ~ Source had no elements, operation is invalid.
-            }
-
-            return (double)sum / count;
+            return Average(source.Select(selector));
         }

         /// <summary>
@@ -2713,29 +2625,7 @@
         /// <exception cref="System.ArgumentNullException">source or selector is null.</exception>
         public static float? Average<TSource>(this IEnumerable<TSource> source, Func<TSource, float?> selector)
         {
-            if (source == null) { throw Exceptions.ArgumentNull(Parameter.Source); }
-            if (selector == null) { throw Exceptions.ArgumentNull(Parameter.Selector); }
-
-            double sum = 0D;
-            long count = 0L;
-
-            foreach (TSource item in source)
-            {
-                float? selectedNullable = selector(item);
-
-                if (selectedNullable.HasValue)
-                {
-                    checked
-                    {
-                        sum += selectedNullable.Value;
-                        count++;
-                    }
-                }
-            }
-
-            if (count == 0) { return new float?(); }
-
-            return (float)(sum / count);
+            return Average(source.Select(selector));
         }

         /// <summary>
@@ -2749,29 +2639,7 @@
         /// <exception cref="System.InvalidOperationException">source contains no elements.</exception>
         public static float Average<TSource>(this IEnumerable<TSource> source, Func<TSource, float> selector)
         {
-            if (source == null) { throw Exceptions.ArgumentNull(Parameter.Source); }
-            if (selector == null) { throw Exceptions.ArgumentNull(Parameter.Selector); }
-
-            double sum = 0D;
-            long count = 0L;
-
-            foreach (TSource item in source)
-            {
-                float selectedValue = selector(item);
-
-                checked
-                {
-                    sum += selectedValue;
-                    count++;
-                }
-            }
-
-            if (count == 0)
-            {
-                throw Exceptions.NoElements();
-            }
-
-            return (float)(sum / count);
+            return Average(source.Select(selector));
         }

         /// <summary>
@@ -2785,29 +2653,7 @@
         /// <exception cref="System.OverflowException">The sum of the elements in the sequence is larger than System.Decimal.MaxValue.</exception>
         public static decimal? Average<TSource>(this IEnumerable<TSource> source, Func<TSource, decimal?> selector)
         {
-            if (source == null) { throw Exceptions.ArgumentNull(Parameter.Source); }
-            if (selector == null) { throw Exceptions.ArgumentNull(Parameter.Selector); }
-
-            decimal sum = 0M;
-            long count = 0L;
-
-            foreach (TSource item in source)
-            {
-                decimal? selectedNullable = selector(item);
-
-                if (selectedNullable.HasValue)
-                {
-                    checked
-                    {
-                        sum += selectedNullable.Value;
-                        count++;
-                    }
-                }
-            }
-
-            if (count == 0) { return new decimal?(); }
-
-            return sum / count;
+            return Average(source.Select(selector));
         }

         /// <summary>
@@ -2822,29 +2668,7 @@
         /// <exception cref="System.OverflowException">The sum of the elements in the sequence is larger than System.Decimal.MaxValue.</exception>
         public static decimal Average<TSource>(this IEnumerable<TSource> source, Func<TSource, decimal> selector)
         {
-            if (source == null) { throw Exceptions.ArgumentNull(Parameter.Source); }
-            if (selector == null) { throw Exceptions.ArgumentNull(Parameter.Selector); }
-
-            decimal sum = 0M;
-            long count = 0L;
-
-            foreach (TSource item in source)
-            {
-                decimal selectedValue = selector(item);
-
-                checked
-                {
-                    sum += selectedValue;
-                    count++;
-                }
-            }
-
-            if (count == 0)
-            {
-                throw Exceptions.NoElements();
-            }
-
-            return sum / count;
+            return Average(source.Select(selector));
         }

         /// <summary>
@@ -2857,29 +2681,7 @@
         /// <exception cref="System.ArgumentNullException">source or selector is null.</exception>
         public static double? Average<TSource>(this IEnumerable<TSource> source, Func<TSource, double?> selector)
         {
-            if (source == null) { throw Exceptions.ArgumentNull(Parameter.Source); }
-            if (selector == null) { throw Exceptions.ArgumentNull(Parameter.Selector); }
-
-            double sum = 0D;
-            long count = 0L;
-
-            foreach (TSource item in source)
-            {
-                double? selectedNullable = selector(item);
-
-                if (selectedNullable.HasValue)
-                {
-                    checked
-                    {
-                        sum += selectedNullable.Value;
-                        count++;
-                    }
-                }
-            }
-
-            if (count == 0) { return new double?(); }
-
-            return sum / count;
+            return Average(source.Select(selector));
         }

         /// <summary>
@@ -2893,29 +2695,7 @@
         /// <exception cref="System.InvalidOperationException">source contains no elements.</exception>
         public static double Average<TSource>(this IEnumerable<TSource> source, Func<TSource, double> selector)
         {
-            if (source == null) { throw Exceptions.ArgumentNull(Parameter.Source); }
-            if (selector == null) { throw Exceptions.ArgumentNull(Parameter.Selector); }
-
-            double sum = 0D;
-            long count = 0L;
-
-            foreach (TSource item in source)
-            {
-                double selectedValue = selector(item);
-
-                checked
-                {
-                    sum += selectedValue;
-                    count++;
-                }
-            }
-
-            if (count == 0)
-            {
-                throw Exceptions.NoElements();
-            }
-
-            return sum / count;
+            return Average(source.Select(selector));
         }

         #endregion ENDOF: Average Overloads


Cleaned up TimerForm

Cleaned up TimerForm

Removed unused or duplicate code and stopped logging common
WebExceptions caused by missing game images for SRL Races.

--- LiveSplit/LiveSplit.View/View/TimerForm.cs
+++ LiveSplit/LiveSplit.View/View/TimerForm.cs
@@ -237,8 +237,6 @@
             Hook.KeyOrButtonPressed += hook_KeyOrButtonPressed;
             Settings.RegisterHotkeys(Hook);

-            RegisterTaskbarButtons();
-
             SizeChanged += TimerForm_SizeChanged;

             lock (BackBufferLock)
@@ -338,32 +336,7 @@
                 item.Click += Race_Click;
                 addItem(item);

-                Task.Factory.StartNew(() =>
-                {
-                    try
-                    {
-                        var image = SpeedRunsLiveAPI.Instance.GetGameImage(race.game.abbrev);
-                        Action setImage = () =>
-                            {
-                                try
-                                {
-                                    item.Image = image;
-                                }
-                                catch (Exception ex)
-                                {
-                                    Log.Error(ex);
-                                }
-                            };
-                        if (InvokeRequired)
-                            Invoke(setImage);
-                        else
-                            setImage();
-                    }
-                    catch (Exception ex)
-                    {
-                        Log.Error(ex);
-                    }
-                });
+                SetGameImage(item, race);
             }

             if (racingMenuItem.DropDownItems.Count > 0)
@@ -422,32 +395,7 @@
                         }
                     };

-                Task.Factory.StartNew(() =>
-                    {
-                        try
-                        {
-                            var image = SpeedRunsLiveAPI.Instance.GetGameImage(race.game.abbrev);
-                            Action setImage = () =>
-                            {
-                                try
-                                {
-                                    tsItem.Image = image;
-                                }
-                                catch (Exception ex)
-                                {
-                                    Log.Error(ex);
-                                }
-                            };
-                            if (InvokeRequired)
-                                Invoke(setImage);
-                            else
-                                setImage();
-                        }
-                        catch (Exception ex)
-                        {
-                            Log.Error(ex);
-                        }
-                    });
+                SetGameImage(tsItem, race);

                 updateTitleAction();

@@ -480,6 +428,33 @@
             addItem(newRaceItem);
         }

+        void SetGameImage(ToolStripMenuItem item, dynamic race)
+        {
+            Task.Factory.StartNew(() =>
+            {
+                try
+                {
+                    var image = SpeedRunsLiveAPI.Instance.GetGameImage(race.game.abbrev);
+                    Action setImage = () =>
+                    {
+                        try
+                        {
+                            item.Image = image;
+                        }
+                        catch (Exception ex)
+                        {
+                            Log.Error(ex);
+                        }
+                    };
+                    if (InvokeRequired)
+                        Invoke(setImage);
+                    else
+                        setImage();
+                }
+                catch { }
+            });
+        }
+
         void Race_Click(object sender, EventArgs e)
         {
             if (ShowSRLRules())
@@ -674,32 +649,16 @@
                 x();
         }

-        private void RegisterTaskbarButtons()
-        {
-            return; //TODO Crashes with plugin when using OBS twice.
-            /*if (TaskbarManager.IsPlatformSupported)
-            {
-                var taskbarSplitButton = new ThumbnailToolBarButton(Properties.Resources.Split, "Split");
-                taskbarSplitButton.Click += (s, e) => { StartOrSplit(); };
-                var taskbarSkipSplitButton = new ThumbnailToolBarButton(Properties.Resources.SkipSplit, "Skip Split");
-                taskbarSkipSplitButton.Click += (s, e) => { Model.SkipSplit(); };
-                var taskbarUnsplitButton = new ThumbnailToolBarButton(Properties.Resources.Unsplit, "Undo Split");
-                taskbarUnsplitButton.Click += (s, e) => { Model.UndoSplit(); };
-                var taskbarStopButton = new ThumbnailToolBarButton(Properties.Resources.Stop, "Reset Run");
-                taskbarStopButton.Click += (s, e) => { Model.Reset(); };
-                TaskbarManager.Instance.ThumbnailToolBars.AddButtons(this.Handle, taskbarSplitButton, taskbarSkipSplitButton, taskbarUnsplitButton, taskbarStopButton);
-            }*/
-        }
-
-        private void UnregisterTaskbarButtons()
-        {
-            //TODO idk how to do this O.o
-        }
-
-        private void AddFileToLRU(string filePath, IRun run)
+        private void AddSplitsFileToLRU(string filePath, IRun run)
         {
             Settings.AddToRecentSplits(filePath, run);
             UpdateRecentSplits();
+        }
+
+        private void AddLayoutFileToLRU(string filePath)
+        {
+            Settings.AddToRecentLayouts(filePath);
+            UpdateRecentLayouts();
         }

         protected void SetInTimerOnlyMode()
@@ -1286,11 +1245,9 @@
                         var graphics = Graphics.FromImage(BackBuffer);

                         graphics.CompositingMode = CompositingMode.SourceCopy;
-                        //graphics.Clip = e.Graphics.Clip;
                         graphics.FillRectangle(Brushes.Transparent, 0, 0, BackBuffer.Width, BackBuffer.Height);
                         graphics.CompositingMode = CompositingMode.SourceOver;

-                        //var clip = e.Graphics.Clip;
                         graphics.Clip = new Region();
                         PaintForm(graphics, graphics.Clip);

@@ -1298,7 +1255,6 @@
                         graphicsForm.CompositingQuality = CompositingQuality.GammaCorrected;

                         graphicsForm.DrawImage(BackBuffer, 0, 0);
-                        //SelectBitmap(BackBuffer);
                     }
                 }
                 else
@@ -1312,87 +1268,6 @@
             {
                 Log.Error(ex);
                 Invalidate();
-            }
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="bitmap"></param>
-        public void SelectBitmap(Bitmap bitmap)
-        {
-            SelectBitmap(bitmap, 255);
-        }
-
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="bitmap">
-        ///
-        /// </param>
-        /// <param name="opacity">
-        /// Specifies an alpha transparency value to be used on the entire source
-        /// bitmap. The SourceConstantAlpha value is combined with any per-pixel
-        /// alpha values in the source bitmap. The value ranges from 0 to 255. If
-        /// you set SourceConstantAlpha to 0, it is assumed that your image is
-        /// transparent. When you only want to use per-pixel alpha values, set
-        /// the SourceConstantAlpha value to 255 (opaque).
-        /// </param>
-        public void SelectBitmap(Bitmap bitmap, int opacity)
-        {
-            // Does this bitmap contain an alpha channel?
-            if (bitmap.PixelFormat != PixelFormat.Format32bppArgb)
-            {
-                throw new ApplicationException("The bitmap must be 32bpp with alpha-channel.");
-            }
-
-            // Get device contexts
-            IntPtr screenDc = Win32.GetDC(IntPtr.Zero);
-            IntPtr memDc = Win32.CreateCompatibleDC(screenDc);
-            IntPtr hBitmap = IntPtr.Zero;
-            IntPtr hOldBitmap = IntPtr.Zero;
-
-            try
-            {
-                // Get handle to the new bitmap and select it into the current
-                // device context.
-                hBitmap = bitmap.GetHbitmap(Color.FromArgb(0));
-                hOldBitmap = Win32.SelectObject(memDc, hBitmap);
-
-                // Set parameters for layered window update.
-                Win32.Size newSize = new Win32.Size(bitmap.Width, bitmap.Height);
-                Win32.Point sourceLocation = new Win32.Point(0, 0);
-                Win32.Point newLocation = new Win32.Point(Left, Top);
-                Win32.BLENDFUNCTION blend = new Win32.BLENDFUNCTION();
-                blend.BlendOp = Win32.AC_SRC_OVER;
-                blend.BlendFlags = 0;
-                blend.SourceConstantAlpha = (byte)opacity;
-                blend.AlphaFormat = Win32.AC_SRC_ALPHA;
-
-                // Update the window.
-                Win32.UpdateLayeredWindow(
-                    Handle,     // Handle to the layered window
-                    screenDc,        // Handle to the screen DC
-                    ref newLocation, // New screen position of the layered window
-                    ref newSize,     // New size of the layered window
-                    memDc,           // Handle to the layered window surface DC
-                    ref sourceLocation, // Location of the layer in the DC
-                    0,               // Color key of the layered window
-                    ref blend,       // Transparency of the layered window
-                    Win32.ULW_ALPHA        // Use blend as the blend function
-                    );
-            }
-            finally
-            {
-                // Release device context.
-                Win32.ReleaseDC(IntPtr.Zero, screenDc);
-                if (hBitmap != IntPtr.Zero)
-                {
-                    Win32.SelectObject(memDc, hOldBitmap);
-                    Win32.DeleteObject(hBitmap);
-                }
-                Win32.DeleteDC(memDc);
             }
         }

@@ -1581,7 +1456,7 @@
             }

             if (addToRecent)
-                AddFileToLRU(filePath, run);
+                AddSplitsFileToLRU(filePath, run);
             if (InTimerOnlyMode)
                 RemoveTimerOnly();
             return run;
@@ -1593,8 +1468,7 @@
             {
                 var layout = new XMLLayoutFactory(stream).Create(CurrentState);
                 layout.FilePath = filePath;
-                Settings.AddToRecentLayouts(filePath);
-                UpdateRecentLayouts();
+                AddLayoutFileToLRU(filePath);
                 return layout;
             }
         }
@@ -1722,8 +1596,7 @@
                     CurrentState.Run.HasChanged = false;
                 }

-                Settings.AddToRecentSplits(savePath, stateCopy.Run);
-                UpdateRecentSplits();
+                AddSplitsFileToLRU(savePath, stateCopy.Run);
             }
             catch (Exception ex)
             {
@@ -1772,8 +1645,7 @@
                     Layout.HasChanged = false;
                 }

-                Settings.AddToRecentLayouts(savePath);
-                UpdateRecentLayouts();
+                AddLayoutFileToLRU(savePath);
             }
             catch (Exception ex)
             {


Fix parameter display and remove unnecessary code

--- Locana/DataModel/LiveviewScreenViewData.cs
+++ Locana/DataModel/LiveviewScreenViewData.cs
@@ -30,13 +30,9 @@
                 NotifyChangedOnUI(nameof(RecordbaleAmount));
                 NotifyChangedOnUI(nameof(RecordingCount));
                 NotifyChangedOnUI(nameof(IsRecordingCountAvailable));
-                NotifyChangedOnUI("EvVisibility");
                 NotifyChangedOnUI(nameof(EvDisplayValue));
-                NotifyChangedOnUI("FnumberVisibility");
                 NotifyChangedOnUI(nameof(FnumberDisplayValue));
-                NotifyChangedOnUI("ISOVisibility");
                 NotifyChangedOnUI(nameof(ISODisplayValue));
-                NotifyChangedOnUI("ShutterSpeedVisibility");
                 NotifyChangedOnUI(nameof(ShutterSpeedDisplayValue));
                 NotifyChangedOnUI(nameof(IsAudioMode));
                 NotifyChangedOnUI(nameof(LiveviewImageDisplayed));
@@ -65,6 +61,7 @@
                 NotifyChangedOnUI(nameof(IsShootingParamAvailable));
                 NotifyChangedOnUI(nameof(IsShootingParamSettingAvailable));
                 NotifyChangedOnUI(nameof(IsProgramShiftAvailable));
+                NotifyChangedOnUI(nameof(IsShootingParamDisplayAvailable));
             };

             ApplicationSettings.GetInstance().PropertyChanged += (sender, args) =>


增加获取目录下所有文件(夹)的全路径集合

增加获取目录下所有文件(夹)的全路径集合

--- Masuit.Tools.Abstractions/Files/FileExt.cs
+++ Masuit.Tools.Abstractions/Files/FileExt.cs
@@ -1,4 +1,6 @@
-using System.IO;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
 using System.Security.Cryptography;
 using System.Text;
 using System.Threading.Tasks;
@@ -96,5 +98,15 @@
             }
             return sb.ToString();
         }
+
+        /// <summary>
+        /// 获取目录下所有文件(夹)的全路径集合
+        /// </summary>
+        /// <param name="dir"></param>
+        /// <returns></returns>
+        public static List<string> ListDirectory(this string dir)
+        {
+            return Directory.GetFiles(dir).Union(Directory.GetDirectories(dir).SelectMany(ListDirectory)).ToList();
+        }
     }
 }


Added FixInvalidPointPosition method to corrent RenderTransform bug

--- MatrixPanAndZoomDemo.Perspex/PanAndZoom.cs
+++ MatrixPanAndZoomDemo.Perspex/PanAndZoom.cs
@@ -10,7 +10,7 @@
     {
         private Control _element;
         private double _zoomSpeed = 1.2;
-        //private Point _pan;
+        private Point _pan;
         private Point _previous;
         private Matrix _matrix = MatrixHelper.Identity;

@@ -95,7 +95,7 @@

         private void StartPan(Point point)
         {
-            //_pan = new Point();
+            _pan = new Point();
             _previous = new Point(point.X, point.Y);
         }

@@ -104,10 +104,8 @@
             Point delta = new Point(point.X - _previous.X, point.Y - _previous.Y);
             _previous = new Point(point.X, point.Y);

-            // Pan is not working when using '_pan = _pan + delta' calculation.
-            //_pan = new Point(_pan.X + delta.X, _pan.Y + delta.Y);
-            //_matrix = MatrixHelper.TranslatePrepend(_matrix, _pan.X, _pan.Y);
-            _matrix = MatrixHelper.TranslatePrepend(_matrix, delta.X, delta.Y);
+            _pan = new Point(_pan.X + delta.X, _pan.Y + delta.Y);
+            _matrix = MatrixHelper.TranslatePrepend(_matrix, _pan.X, _pan.Y);

             Invalidate();
         }
@@ -154,11 +152,17 @@
             Invalidate();
         }

+        public static Point FixInvalidPointPosition(Matrix matrix, Point point)
+        {
+            return MatrixHelper.TransformPoint(matrix.Invert(), point);
+        }
+
         private void Border_PointerWheelChanged(object sender, PointerWheelEventArgs e)
         {
             if (_element != null)
             {
                 Point point = e.GetPosition(_element);
+                point = FixInvalidPointPosition(_matrix, point);
                 ZoomDeltaTo(e.Delta.Y, point);
             }
         }
@@ -172,6 +176,7 @@
                         if (_element != null)
                         {
                             Point point = e.GetPosition(_element);
+                            point = FixInvalidPointPosition(_matrix, point);
                             StartPan(point);
                             e.Device.Capture(_element);
                         }
@@ -203,6 +208,7 @@
             if (_element != null && e.Device.Captured == _element)
             {
                 Point point = e.GetPosition(_element);
+                point = FixInvalidPointPosition(_matrix, point);
                 PanTo(point);
             }
         }


- baseline must be scaled with the current experience mode - RateOfChange must include baseline value

--- ModComponentMapper/src/ModHealthManager.cs
+++ ModComponentMapper/src/ModHealthManager.cs
@@ -29,7 +29,7 @@

         ModHealthManager()
         {
-            thirstMonitor.hourlyBaseline = GameManager.GetThirstComponent().m_ThirstIncreasePerDay / 24;
+            thirstMonitor.hourlyBaseline = GameManager.GetThirstComponent().m_ThirstIncreasePerDay / 24 * GameManager.GetExperienceModeManagerComponent().GetThirstRateScale();
             thirstMonitor.scale = 0.2f;
         }

@@ -221,7 +221,7 @@
             {
                 var thirstMonitor = ModHealthManager.GetThirstMonitor();
                 __result = thirstMonitor.getRateOfChange();
-
+
                 return false;
             }

@@ -245,7 +245,7 @@

         public float getRateOfChange()
         {
-            return (hourlyChange - hourlyBaseline) * scale;
+            return 1 + (hourlyChange - hourlyBaseline) * scale;
         }
     }


Revert "Only resume VM when suspended."

Revert "Only resume VM when suspended."

This reverts commit bb5d31bd1db5224b1f5f4315afa38ea23d615a44.

--- Mono.Debugging.Soft/SoftDebuggerSession.cs
+++ Mono.Debugging.Soft/SoftDebuggerSession.cs
@@ -1736,8 +1736,7 @@
 			}

 			try {
-				if (es.SuspendPolicy != SuspendPolicy.None)
-					vm.Resume ();
+				vm.Resume ();
 			} catch (VMNotSuspendedException) {
 				if (type != EventType.VMStart && vm.Version.AtLeast (2, 2))
 					throw;


Fixing build on linux/mac by resolving conflict between Mono.Math and System.Math

--- Mono.Debugging.Soft/SoftDebuggerSession.cs
+++ Mono.Debugging.Soft/SoftDebuggerSession.cs
@@ -2636,7 +2636,7 @@
 						} else {
 							if (line != target.LineNumber) {
 								//None of targets has exact line match decide which is closest
-								if (Math.Abs (line - target.LineNumber) > Math.Abs (line - methodTarget.LineNumber)) {
+								if (System.Math.Abs (line - target.LineNumber) > System.Math.Abs (line - methodTarget.LineNumber)) {
 									target = methodTarget;
 									genericMethod = IsGenericMethod (method);
 								}


release

release

--- NGnono.Doubts.IDisposableDoubts/Program.cs
+++ NGnono.Doubts.IDisposableDoubts/Program.cs
@@ -14,16 +14,12 @@

         static void Main(string[] args)
         {
-<<<<<<< HEAD
-=======
-
             using (var cc = new A())
             {
                 var t = cc.ToString();
                 Console.WriteLine(t);
             }

->>>>>>> master
             var a = new A();
             a = null;
             Logger.Debug("GC释放前");


Fix controller visibility

Fix controller visibility

--- NServiceMVC/Metadata/MetadataController.cs
+++ NServiceMVC/Metadata/MetadataController.cs
@@ -6,7 +6,7 @@

 namespace NServiceMVC.Metadata
 {
-    class MetadataController : Controller
+    public class MetadataController : Controller
     {
         public ActionResult Index()
         {