Invoke Close on the UI thread if necessary

--- PlatformWin32/win32/WindowsFormsAbstract.cs
+++ PlatformWin32/win32/WindowsFormsAbstract.cs
@@ -314,7 +314,15 @@
 			if (!aggWidgetHasBeenClosed)
 			{
 				aggIsRequestingClose = true;
-				Close();
+
+				if (this.InvokeRequired)
+				{
+					Invoke(new Action(() => this.Close()));
+				}
+				else
+				{
+					Close();
+				}
 				aggIsRequestingClose = false;
 			}
 		}


Version 1.4.1

Version 1.4.1

--- PracticeSharpApp/Properties/AssemblyInfo.cs
+++ PracticeSharpApp/Properties/AssemblyInfo.cs
@@ -32,5 +32,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.4.0.0")]
-[assembly: AssemblyFileVersion("1.4.0.0")]
+[assembly: AssemblyVersion("1.4.1.0")]
+[assembly: AssemblyFileVersion("1.4.1.0")]


Cosmetics

Cosmetics

--- Presentation.Web/App_Start/SwaggerConfig.cs
+++ Presentation.Web/App_Start/SwaggerConfig.cs
@@ -22,11 +22,11 @@
                 {
                     c.SingleApiVersion("1.0.0", "OS2Kitos API")
                         .Description(
-                            "
Denne dokumentation udstiller de forskellige kald der kan laves til api'et i kitos til brug for applikationsudvikling.

" +
+                            "
Denne dokumentation udstiller Kitos API'et til brug for applikationsudvikling.

" +
                             "Den første udgave af API'et (V1) blev udviklet til understøttelse af projektets brugerflade og vil med tiden blive erstattet " +
                             "af et selvstændigt API (V2) udviklet til brug for integration med udefrakommende systemer. Arbejdet med V2 er påbegyndt og " +
                             "resultatet heraf opdateres løbende på denne side. I første omgang vil V2 omfatte supplerende data fra it-system- og " +
-                            "snitfladekataloget. V2 vil kommer til at omfatte tilsvarende funktionalitet som V1. Du vil i en periode kunne anvende både V1 og V2. " +
+                            "snitfladekataloget. V2 kommer til at omfatte tilsvarende funktionalitet som V1. Du vil i en periode kunne anvende både V1 og V2. " +
                             "Bemærk dog, at overflødiggjorte V1 endpoints vil blive udfaset efter en rum tid. KITOS sekretariatet vil i god tid " +
                             "forinden varsle udfasning af overflødige endpoints.

" +
                             "Særligt for V1 gælder der følgende:
" +


9382: GlyphBone

9382: GlyphBone

--- a_mini/projects/PixelFarm/Typography/Typography.AutoFit/GlyphBone.cs
+++ a_mini/projects/PixelFarm/Typography/Typography.AutoFit/GlyphBone.cs
@@ -6,12 +6,28 @@
 {

     /// <summary>
-    /// line link between 2 centroid contact point
+    /// link between 2 GlyphBoneJoint
     /// </summary>
-    public class GlyphVirtualBone
+    public class GlyphBone
     {
-        //TODO: rename to glyph bone
+        public readonly EdgeLine TipEdge;
+        public readonly GlyphBoneJoint JointA;
+        public readonly GlyphBoneJoint JointB;

+        public GlyphBone(GlyphBoneJoint a, GlyphBoneJoint b)
+        {
+            if (a == b)
+            {
+
+            }
+            JointA = a;
+            JointB = b;
+        }
+        public GlyphBone(GlyphBoneJoint a, EdgeLine tipEdge)
+        {
+            JointA = a;
+            TipEdge = tipEdge;
+        }
     }

     public class GlyphBoneJoint
@@ -36,10 +52,13 @@
         /// get position of this bone joint (mid point of the edge)
         /// </summary>
         /// <returns></returns>
-        public Vector2 GetPos()
+        public Vector2 Position
         {
-            //mid point of the edge line
-            return _p_contact_edge.GetMidPoint();
+            get
+            {
+                //mid point of the edge line
+                return _p_contact_edge.GetMidPoint();
+            }
         }
         public GlyphCentroidLine OwnerCentroidLine
         {
@@ -53,7 +72,7 @@
         public double CalculateSqrDistance(Vector2 v)
         {

-            Vector2 contactPoint = this.GetPos();
+            Vector2 contactPoint = this.Position;
             float xdiff = contactPoint.X - v.X;
             float ydiff = contactPoint.Y - v.Y;

@@ -98,6 +117,9 @@
         public Vector2 RibEndPointA { get { return _ribEndPoint_A; } }
         public Vector2 RibEndPointB { get { return _ribEndPoint_B; } }
         public Vector2 TipPoint { get { return _tipPoint; } }
+        public EdgeLine RibEndEdgeA { get { return _selectedEdgeA; } }
+        public EdgeLine RibEndEdgeB { get { return _selectedEdgeB; } }
+        public EdgeLine TipEdge { get { return _selectedTipEdge; } }
     }


Convert fields and property to local variables

--- R7.University.Division/EditDivision.ascx.cs
+++ R7.University.Division/EditDivision.ascx.cs
@@ -38,8 +38,6 @@
 {
     public partial class EditDivision: UniversityEditPortalModuleBase<DivisionInfo>
     {
-        private int? itemId;
-
         #region Types

         public enum EditDivisionTab
@@ -53,12 +51,6 @@
         #endregion

         #region Properties
-
-        private DivisionSettings settings;
-        protected new DivisionSettings Settings
-        {
-            get { return settings ?? (settings = new DivisionSettingsRepository ().GetSettings (ModuleConfiguration)); }
-        }

         protected EditDivisionTab SelectedTab
         {
@@ -98,7 +90,7 @@
             base.OnInit (e);

             // parse QueryString
-            itemId = TypeUtils.ParseToNullable<int> (Request.QueryString ["division_id"]);
+            var itemId = TypeUtils.ParseToNullable<int> (Request.QueryString ["division_id"]);

             // FIXME: Possible circular dependency as list can still contain childrens of current division
             parentDivisionSelector.DataSource = new DivisionQuery (ModelContext).ListExcept (itemId).OrderBy (d => d.Title);
@@ -229,9 +221,11 @@

                 // then adding new division from Division module,
                 // set calling module to display new division info
-                if (ModuleConfiguration.ModuleDefinition.DefinitionName == "R7.University.Division") {
-                    Settings.DivisionID = item.DivisionID;
-                    new DivisionSettingsRepository ().SaveSettings (ModuleConfiguration, Settings);
+                if (ModuleConfiguration.ModuleDefinition.DefinitionName == "R7.University.Division") {
+                    var settingsRepository = new DivisionSettingsRepository ();
+                    var settings = settingsRepository.GetSettings (ModuleConfiguration);
+                    settings.DivisionID = item.DivisionID;
+                    settingsRepository.SaveSettings (ModuleConfiguration, settings);
                 }
             }
         }


[Employee] Restore occupied positions sorting and grouping

--- R7.University.Employee/ViewEmployee.ascx.cs
+++ R7.University.Employee/ViewEmployee.ascx.cs
@@ -168,7 +168,9 @@
         protected void Display (IEmployee employee)
         {
             if (employee.Positions.Any ()) {
-                repeaterPositions.DataSource = employee.Positions;
+                repeaterPositions.DataSource = employee.Positions
+                    .OrderByDescending (op => op.Position.Weight)
+                    .GroupByDivision ();
                 repeaterPositions.DataBind ();
             }
             else


Endret åpningstider

Endret åpningstider

--- RambergManufaktur/Views/Home/Kontakt.cshtml
+++ RambergManufaktur/Views/Home/Kontakt.cshtml
@@ -38,9 +38,9 @@

<time itemprop="openingHours" datetime="Mo 09:00-16:00">Mandag</time>	09:00 - 16:00

<time itemprop="openingHours" datetime="Tu 09:00-16:00">Tirsdag</time>	09:00 - 16:00

<time itemprop="openingHours" datetime="We 09:00-16:00">Onsdag</time>	09:00 - 16:00

-
<time itemprop="openingHours" datetime="Th 09:00-16:00">Torsdag</time>	09:00 - 19:00

+
<time itemprop="openingHours" datetime="Th 09:00-16:00">Torsdag</time>	09:00 - 16:00

<time itemprop="openingHours" datetime="Fr 09:00-16:00">Fredag</time>	09:00 - 16:00

-
<time itemprop="openingHours" datetime="Sa 09:00-16:00">Lørdag</time>	10:00 - 14:00

+
<time itemprop="openingHours" datetime="Sa 10:00-14:00">Lørdag</time>	10:00 - 14:00


fix seria bug

fix seria bug

--- RapidBase.Client/Properties/AssemblyInfo.cs
+++ RapidBase.Client/Properties/AssemblyInfo.cs
@@ -32,6 +32,6 @@
 // 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: AssemblyInformationalVersion("1.0.0.13")]
-[assembly: AssemblyVersion("1.0.0.13")]
-[assembly: AssemblyFileVersion("1.0.0.13")]
+[assembly: AssemblyInformationalVersion("1.0.0.14")]
+[assembly: AssemblyVersion("1.0.0.14")]
+[assembly: AssemblyFileVersion("1.0.0.14")]


Country list now include an empty item.

Country list now include an empty item.

--- BusinessObjects/Country.cs
+++ BusinessObjects/Country.cs
@@ -33,7 +33,11 @@
         /// <summary>
         /// Extended country name (for use in dropdowns and the likes).
         /// </summary>
-        public string Description { get { return Name + " (" + TwoLetterCode + ")"; } }
+        public string Description {
+            get {
+                return (string.IsNullOrEmpty(Name)) ? string.Empty : Name + " (" + TwoLetterCode + ")";
+            }
+        }

         private Country(string name, string twoLetterCode, string threeLetterCode, string numericCode)
         {
@@ -77,6 +81,7 @@
         /// </summary>
         public static readonly Country[] List = new[]
         {
+            new Country("", "", null, null),
             new Country("Afghanistan", "AF", "AFG", "004"),
             new Country("Åland Islands", "AX", "ALA", "248"),
             new Country("Albania", "AL", "ALB", "008"),


[Direct2D1] Fix issue #104 with RenderToWicApp by disposing the encoder.

--- Samples/Direct2D1/RenderToWicApp/Program.cs
+++ Samples/Direct2D1/RenderToWicApp/Program.cs
@@ -77,6 +77,9 @@

             bitmapFrameEncode.Commit();
             encoder.Commit();
+
+            bitmapFrameEncode.Dispose();
+            encoder.Dispose();
             stream.Dispose();

             System.Diagnostics.Process.Start(Path.GetFullPath(Path.Combine(Environment.CurrentDirectory,filename)));


Corrected Assert parameter order for exceptions

--- Sendwithus/SendwithusTest/SendwithusTest.cs
+++ Sendwithus/SendwithusTest/SendwithusTest.cs
@@ -46,7 +46,7 @@
             Trace.WriteLine(exception.Message);

             // Check the exception's status code
-            Assert.AreEqual(exception.StatusCode, expectedStatusCode);
+            Assert.AreEqual(expectedStatusCode, exception.StatusCode);
         }
     }
 }


reserva scheduler

reserva scheduler

(TFS CS 6888)

--- Signum.Engine/Connection/UserConnections.cs
+++ Signum.Engine/Connection/UserConnections.cs
@@ -24,7 +24,7 @@
                 return new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase);

             Debug.WriteLine("UserConnection's file found on {0}".Formato(FileName));
-
+            Debug.WriteLine("{0}".Formato(File.ReadAllText(FileName)));
             return File.ReadAllLines(FileName).Select(s => s.Split('>')).ToDictionary(a => a[0], a => a[1]);
         }


(TFS CS 5016)

(TFS CS 5016)

--- Signum.Engine/Connection/UserConnections.cs
+++ Signum.Engine/Connection/UserConnections.cs
@@ -24,7 +24,7 @@

             Debug.WriteLine("UserConnections file found on {0}".Formato(FileName));

-            return File.ReadAllLines(FileName).Select(s => s.Split('>')).ToDictionary(a => a[0], a => a[1]);
+            return File.ReadAllLines(FileName).Select(s => s.Split('>')).ToDictionary(a => a[0].ToLowerInvariant(), a => a[1]);
         }

         public static string Replace(string connectionString)
@@ -34,7 +34,7 @@

             string schemaName = new SqlConnection(connectionString).Database;

-            return replacements.TryGetC(schemaName) ?? connectionString;
+            return replacements.TryGetC(schemaName.ToLowerInvariant()) ?? connectionString;
         }
     }
 }


Also print the identifier

Also print the identifier

--- MagiCore/MathParsing.cs
+++ MagiCore/MathParsing.cs
@@ -187,7 +187,7 @@
             }
             catch (Exception ex)
             {
-                MagiCore.LogException(ex, string.Format("Exception encountered while parsing '{0}'. Current value: '{1}' Stack: {2}", input, currentVal, stack));
+                MagiCore.LogException(ex, string.Format("Exception encountered while parsing '{0}' : '{1}'. Current value: '{2}' Stack: {3}", identifier, input, currentVal, stack));
                 currentVal = 0;
             }
             return currentVal;


Perform case insensitive true/false search

--- MagiCore/MathParsing.cs
+++ MagiCore/MathParsing.cs
@@ -36,10 +36,10 @@
                 }

                 //we also replace "true" and "false" with 1 and 0, but only if they are the word by themselves
-                Regex trueReplace = new Regex(@"\btrue\b");
+                Regex trueReplace = new Regex(@"(?i)\btrue\b");
                 cpy = trueReplace.Replace(cpy, variables["true"]);

-                Regex falseReplace = new Regex(@"\bfalse\b");
+                Regex falseReplace = new Regex(@"(?i)\bfalse\b");
                 cpy = falseReplace.Replace(cpy, variables["false"]);
             }
             return cpy;


JSAPI: Make SetFlagValues return all the flag values instead of echoing the input.

--- Snowflake.StandardAjax/StandardAjax.Game.cs
+++ Snowflake.StandardAjax/StandardAjax.Game.cs
@@ -208,7 +208,9 @@
                 }
                 bridge.ConfigurationFlagStore.SetValue(game, flag.Key, castedValue, flag.Type);
             }
-            return new JSResponse(request, values_pre);
+            IDictionary<string, dynamic> flags = bridge.ConfigurationFlags.ToDictionary(flag => flag.Value.Key, flag => bridge.ConfigurationFlagStore.GetValue(game, flag.Value.Key, flag.Value.Type));
+
+            return new JSResponse(request, flags);
         }
         [AjaxMethod(MethodPrefix = "Game")]
         [AjaxMethodParameter(ParameterName = "emulator", ParameterType = AjaxMethodParameterType.StringParameter, Required = true)]


Add anounce check in winning cards

Add anounce check in winning cards

--- Source/AI/Santase.AI.ProPlayer/ProPlayer.cs
+++ Source/AI/Santase.AI.ProPlayer/ProPlayer.cs
@@ -179,13 +179,12 @@
             var myCards = this.CardMemorizer.MyHand.OrderBy(c => c.GetValue());
 			var possibleWins = new Dictionary<Card, int>();

-            //foreach (var myCard in myCards)
-            //{
-            //    possibleWins[myCard] = this.CountPotentialWins(myCard);
-            //}
-            //var winningCards = myCards.Where(c => possibleWins[c] != 0);
-
-            var winningCards = myCards.ToList();
+			foreach (var myCard in myCards)
+			{
+				possibleWins[myCard] = this.CountPotentialWins(myCard);
+			}
+
+			var winningCards = myCards.ToList();
             foreach (var myCard in myCards)
             {
                 foreach (var oponentCard in oponentCards)
@@ -200,20 +199,27 @@
                 }
             }

-            if (winningCards.Any())
-            {
-				Card card = winningCards.FirstOrDefault(this.IsTrumpCard) ?? winningCards.First();
-                return this.PlayCard(card);
-            }
+			var anounce = this.TryToAnnounce20Or40(context, possibleCardsToPlay);
+
+			if (winningCards.Any())
+			{
+				if (anounce != null && winningCards.Contains(anounce))
+				{
+					return this.PlayCard(anounce);
+				}
+
+				Card card = winningCards.FirstOrDefault(this.IsTrumpCard) ?? winningCards.Reverse<Card>().First();
+				return this.PlayCard(card);
+			}
+
+			if (anounce != null)
+			{
+				return this.PlayCard(anounce);
+			}
 			// Playing the cards that will win the hand

-			var anounce = this.TryToAnnounce20Or40(context, possibleCardsToPlay);
-            if (anounce != null)
-            {
-                return anounce;
-            }
-
-            // Likely we will lose the hand so just give the lowest card
+
+			// Likely we will lose the hand so just give the lowest card
 			Card result = myCards.FirstOrDefault(c => !this.IsTrumpCard(c)) ?? myCards.First();
             return this.PlayCard(result);
         }
@@ -270,7 +276,7 @@

 			if (anounce != null)
 			{
-				return anounce;
+				return this.PlayCard(anounce);
 			}

             // Playing the cards that will win the hand
@@ -337,13 +343,13 @@

 		}

-        private PlayerAction TryToAnnounce20Or40(PlayerTurnContext context, ICollection<Card> possibleCardsToPlay)
+        private Card TryToAnnounce20Or40(PlayerTurnContext context, ICollection<Card> possibleCardsToPlay)
         {
 			foreach (var card in possibleCardsToPlay)
 			{
 				if (card.Type == CardType.Queen && this.AnnounceValidator.GetPossibleAnnounce(possibleCardsToPlay, card, this.CardMemorizer.TrumpCard) == Announce.Forty)
 				{
-					return this.PlayCard(card);
+					return card;
 				}
 			}

@@ -351,7 +357,7 @@
 			{
 				if (card.Type == CardType.Queen && this.AnnounceValidator.GetPossibleAnnounce(possibleCardsToPlay, card, this.CardMemorizer.TrumpCard) == Announce.Twenty)
 				{
-					return this.PlayCard(card);
+					return card;
 				}
 			}


POC WIP 24

POC WIP 24

--- Source/AutoPatterns.CompilerHost/Program.cs
+++ Source/AutoPatterns.CompilerHost/Program.cs
@@ -5,6 +5,7 @@
 using System.Threading;
 using System.Threading.Tasks;
 using AutoPatterns.OutOfProcess;
+using AutoPatterns.OutOfProcess.RequestReply;

 namespace AutoPatterns.CompilerHost
 {
@@ -31,17 +32,7 @@
             }
             catch (Exception e)
             {
-                string message;
-                var aggregate = e as AggregateException;
-                if (aggregate != null)
-                {
-                    message = string.Join("; ", aggregate.Flatten().InnerExceptions.Select(x => x.Message));
-                }
-                else
-                {
-                    message = e.Message;
-                }
-                Console.WriteLine($"AutoPatterns Compiler Service >> ABNORMALLY TERMINATED! {e.GetType().Name}: {message}");
+                Console.WriteLine($"AutoPatterns Compiler Service >> ABNORMALLY TERMINATED! {e.GetType().Name}: {GetTerminationExceptionMessage(e)}");
                 return 2;
             }
             finally
@@ -56,6 +47,8 @@
         {
             var shutdownEvent = new ManualResetEvent(initialState: false);
             var service = new RemoteCompilerService();
+
+            Task.Run(() => WarmUp(service));

             service.ShutdownRequested += (sender, e) => shutdownEvent.Set();

@@ -79,5 +72,35 @@

             Console.WriteLine("AutoPatterns Compiler Service >> STOPPED.");
         }
+
+        //-----------------------------------------------------------------------------------------------------------------------------------------------------
+
+        private static void WarmUp(RemoteCompilerService service)
+        {
+            var request = new CompileRequest() {
+                AssemblyName = "WarmUp_0",
+                SourceCode = "using System;namespace WarmUp{[Serializable] public class MyClass{public void Print(){Console.WriteLine(\"Warming up\");}}}",
+                ReferencePaths = new[] { typeof(object).Assembly.Location },
+                EnableDebug = false
+            };
+
+            service.Compile(request);
+        }
+
+        //-----------------------------------------------------------------------------------------------------------------------------------------------------
+
+        private static string GetTerminationExceptionMessage(Exception e)
+        {
+            var aggregate = e as AggregateException;
+
+            if (aggregate != null)
+            {
+                return string.Join("; ", aggregate.Flatten().InnerExceptions.Select(x => x.Message));
+            }
+            else
+            {
+                return e.Message;
+            }
+        }
     }
 }


Fix to build on Vista + VS2010

Fix to build on Vista + VS2010

Right, this is a shame

--- ArxOne.Weavisor.Weaver/Weavisor.cs
+++ ArxOne.Weavisor.Weaver/Weavisor.cs
@@ -53,6 +53,16 @@
     // ReSharper disable once MemberCanBePrivate.Global
     public IAssemblyResolver AssemblyResolver { get; set; }

+    /// <summary>
+    /// Gets or sets the assembly path.
+    /// For some unkown reason, Fody won't weave on some platforms (Vista + VS2010) if this property is missing
+    /// </summary>
+    /// <value>
+    /// The assembly path.
+    /// </value>
+    // ReSharper disable once UnusedMember.Global
+    public string AssemblyPath { get; set; }
+
     public Weavisor()
     {
         LogInfo = m => { };


Reverted Restore to check if package is installed

Also changed the Verbose logging to not output a stacktrace (this is
only in Unity 5.3+).

--- Assets/NuGet/Editor/NugetHelper.cs
+++ Assets/NuGet/Editor/NugetHelper.cs
@@ -746,7 +746,7 @@
         private static NugetPackage GetSpecificPackage(NugetPackageIdentifier packageId)
         {
             // First look to see if the package is already installed
-            NugetPackage package = GetInstalledPackage(packageId);
+            NugetPackage package = GetInstalledPackage(packageId);

             if (package == null)
             {
@@ -907,7 +907,9 @@
         {
             if (NugetConfigFile.Verbose)
             {
+                Application.stackTraceLogType = StackTraceLogType.None;
                 Debug.LogFormat(format, args);
+                Application.stackTraceLogType = StackTraceLogType.ScriptOnly;
             }
         }

@@ -1075,8 +1077,15 @@
                     {
                         EditorUtility.DisplayProgressBar("Restoring NuGet Packages", string.Format("Restoring {0} {1}", package.Id, package.Version), currentProgress);

-                        LogVerbose("---Restoring {0} {1}", package.Id, package.Version);
-                        InstallIdentifier(package);
+                        if (!IsInstalled(package))
+                        {
+                            LogVerbose("---Restoring {0} {1}", package.Id, package.Version);
+                            InstallIdentifier(package);
+                        }
+                        else
+                        {
+                            LogVerbose("---Already installed: {0} {1}", package.Id, package.Version);
+                        }
                     }

                     currentProgress += progressStep;


Fix event dispatcher bugs

Fix event dispatcher bugs

--- Assets/Scripts/BMS/Parser/Chart.cs
+++ Assets/Scripts/BMS/Parser/Chart.cs
@@ -144,18 +144,25 @@
                 List<BMSEvent> bmsEvents = chart.bmsEvents;
                 if(newTime > currentTime) {
                     currentTime = newTime;
-                    while(currentIndex < length - 1 && bmsEvents[currentIndex + 1].time <= currentTime) {
-                        currentIndex++;
-                        if(dispatchEvents && BMSEvent != null)
+                    if(!dispatchEvents)
+                        // If it does not require to dispatch events, use a quicker way to seek to position.
+                        currentIndex = bmsEvents.BinarySearchIndex(new BMSEvent { time = currentTime },
+                            BinarySearchMethod.LastExact | BinarySearchMethod.FloorClosest);
+                    else if(BMSEvent != null)
+                        while(currentIndex < length && bmsEvents[currentIndex].time <= currentTime) {
                             BMSEvent.Invoke(bmsEvents[currentIndex]);
-                    }
+                            currentIndex++;
+                        }
                 } else if(newTime < currentTime) {
                     currentTime = newTime;
-                    while(currentIndex > 0 && bmsEvents[currentIndex - 1].time >= currentTime) {
-                        currentIndex--;
-                        if(dispatchEvents && BMSEvent != null)
+                    if(!dispatchEvents)
+                        currentIndex = bmsEvents.BinarySearchIndex(new BMSEvent { time = currentTime },
+                            BinarySearchMethod.FirstExact | BinarySearchMethod.CeilClosest);
+                    else if(BMSEvent != null)
+                        while(currentIndex >= 0 && bmsEvents[currentIndex].time >= currentTime) {
                             BMSEvent.Invoke(bmsEvents[currentIndex]);
-                    }
+                            currentIndex--;
+                        }
                 }
             }

@@ -163,7 +170,7 @@
                 length = chart.bmsEvents.Count;
                 if(length > 0)
                     endTime = length > 0 ? chart.bmsEvents[length - 1].time : TimeSpan.Zero;
-                currentTime = TimeSpan.Zero;
+                currentTime = TimeSpan.MinValue;
                 currentIndex = 0;
             }
         }


no message

no message

--- Assets/Scripts/PlayerController.cs
+++ Assets/Scripts/PlayerController.cs
@@ -25,9 +25,7 @@
 	void Update ()
     {
         movement();
-        //armRotation();
-
-        Invoke("detectReach", 2.0f);
+        armRotation();
 	}

     private void movement()
@@ -49,7 +47,7 @@
             }

             transform.position = pos;
-            //detectReach();
+            detectReach();
         }
     }

@@ -67,8 +65,16 @@

     private void detectReach()
     {
-        m_cameraController.setZoom(true);
-        m_reachedGlass = true;
+        GameObject arm = transform.FindChild("ArmPivot/Arm").gameObject;
+
+        foreach (Collider coll in Physics.OverlapSphere(arm.transform.position, arm.GetComponent<SphereCollider>().radius * arm.transform.localScale.x))
+        {
+            if (coll.gameObject.name == "Glass")
+            {
+                m_cameraController.setZoom(true);
+                m_reachedGlass = true;
+            }
+        }
     }

     public bool lookingAtEnemy()


CTRL + Selection = Queue Selection.

CTRL + Selection = Queue Selection.

--- Assets/Scripts/SelectionManager.cs
+++ Assets/Scripts/SelectionManager.cs
@@ -50,13 +50,16 @@
 		//This handles all the input actions the player has done to box select in the game.
 		//Currently, it doesn't handle clicking to select.
 		if (Input.GetMouseButtonDown(0)) {
+			if (!(Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl))) {
+				ClearSelectObjects();
+			}
 			this.isSelecting = true;
-			this.selectedObjects.Clear();
 			this.initialClick = Input.mousePosition;
-
 		}
 		else if (Input.GetMouseButtonUp(0)) {
-			this.selectedObjects.Clear();
+			if (!(Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl))) {
+				ClearSelectObjects();
+			}
 			SelectObjectAtPoint();
 			SelectObjectsInRect();
 			SelectObjects();
@@ -117,9 +120,6 @@
 			if (this.selectionBox.Contains(projectedPosition)) {
 				unit.isSelected = true;
 			}
-			else {
-				unit.isSelected = false;
-			}
 		}
 	}

@@ -133,9 +133,6 @@
 			if (unit != null) {
 				if (this.selectedObjects.Contains(obj)) {
 					unit.isSelected = true;
-				}
-				else {
-					unit.isSelected = false;
 				}
 			}
 		}
@@ -152,13 +149,38 @@
 		}
 	}

+	private void ClearSelectObjects() {
+		foreach (GameObject obj in this.selectedObjects) {
+			if (obj == null) {
+				continue;
+			}
+			GameUnit unit = obj.GetComponent<GameUnit>();
+			unit.isSelected = false;
+		}
+		this.selectedObjects.Clear();
+	}
+
 	private void SelectObjectAtPoint() {
 		Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
 		RaycastHit hit;
 		if (Physics.Raycast(ray, out hit)) {
 			GameObject obj = hit.collider.gameObject;
 			if (obj.tag.Equals("Unit")) {
-				if (this.allObjects.Contains(obj) && !this.selectedObjects.Contains(obj)) {
+				GameUnit unit = obj.GetComponent<GameUnit>();
+				if (Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl)) {
+					if (this.allObjects.Contains(obj)) {
+						if (!this.selectedObjects.Contains(obj)) {
+							unit.isSelected = true;
+							this.selectedObjects.Add(obj);
+						}
+						else if (this.selectedObjects.Contains(obj)) {
+							unit.isSelected = false;
+							this.selectedObjects.Remove(obj);
+						}
+					}
+				}
+				else {
+					unit.isSelected = true;
 					this.selectedObjects.Add(obj);
 				}
 			}


* not used

* not used

--- gui/mockup/gtk-gui/mockup.Progress.cs
+++ gui/mockup/gtk-gui/mockup.Progress.cs
@@ -1,27 +0,0 @@
-// ------------------------------------------------------------------------------
-//  <autogenerated>
-//      This code was generated by a tool.
-//      Mono Runtime Version: 2.0.50727.42
-//
-//      Changes to this file may cause incorrect behavior and will be lost if
-//      the code is regenerated.
-//  </autogenerated>
-// ------------------------------------------------------------------------------
-
-namespace mockup {
-
-
-    public partial class Progress {
-
-        protected virtual void Build() {
-            Stetic.Gui.Initialize(this);
-            // Widget mockup.Progress
-            Stetic.BinContainer.Attach(this);
-            this.Name = "mockup.Progress";
-            if ((this.Child != null)) {
-                this.Child.ShowAll();
-            }
-            this.Show();
-        }
-    }
-}


Added first try to make vehicles fly. Needs more work.

--- Assets/Scripts/SimpleController.cs
+++ Assets/Scripts/SimpleController.cs
@@ -10,7 +10,7 @@
     public float GRAVITY = 9.81f;
     public float FRICTION = 4f;
     public float STEER_FRICTION = 4f;
-    public float deltaGround = 0.2f;
+    public float deltaGround = 2f;
     public float lerpSpeed = 2f;

     private Vector3 velocity = Vector3.zero;
@@ -27,7 +27,7 @@
     private Collider carCollider;

     //private float distGround;
-    private bool isGrounded;
+    private int isGrounded;

     private Vector3 frontWheel;
     private Vector3 backWheel;
@@ -47,10 +47,45 @@
         ray = new Ray();
     }

+    private float cost = -2f;
+
     void FixedUpdate()
     {
-        body.AddForce(-GRAVITY * myNormal, ForceMode.Acceleration);
-        body.MovePosition(body.position + velocity * Time.deltaTime);
+        Vector3 realGravity = -GRAVITY * myNormal;
+
+        if (isGrounded == 1)
+        {
+            cost = 0.05f;
+            body.AddRelativeForce(realGravity * cost, ForceMode.Force);
+        }
+        else if (isGrounded == 2)
+        {
+            if (cost > 0f)
+                cost = -2f;
+
+            cost += Time.fixedDeltaTime;
+
+            if (cost > 0f)
+                cost = 0f;
+
+            body.AddForce(realGravity * cost, ForceMode.Acceleration);
+        }
+        else if (isGrounded == 3)
+        {
+            if (cost < 0f)
+                cost = 1f;
+
+            cost -= Time.fixedDeltaTime;
+
+            if (cost < 0f)
+                cost = 0f;
+
+            body.AddForce(realGravity * cost, ForceMode.Acceleration);
+        }
+
+
+
+        body.MovePosition(body.position + velocity * Time.fixedDeltaTime);
     }
     // Update is called once per frame
     void Update()
@@ -76,16 +111,23 @@

         RaycastHit hit;

-        ray.origin = transform.position;
+        ray.origin = body.position;
         ray.direction = -myNormal; // cast ray downwards
         if (Physics.Raycast(ray, out hit))
         { // use it to update myNormal and isGrounded
-            isGrounded = hit.distance <= deltaGround; //distGround +
+            if (hit.distance <= deltaGround*2.5f)
+                isGrounded = 2; //distGround +
+            else// if (hit.distance > deltaGround * 4f)
+                isGrounded = 3;
+            //else isGrounded = 1;
+
+            if(player)
+            print(hit.distance + " " + cost + " " + isGrounded);
             //print(hit.distance + " " + (deltaGround) + " " + isGrounded);
             surfaceNormal = hit.normal;
         }
         else {
-            isGrounded = false;
+            isGrounded = 0;
             // assume usual ground normal to avoid "falling forever"
             surfaceNormal = Vector3.up;
         }
@@ -102,9 +144,11 @@

         body.angularVelocity = Vector3.zero;

-        Debug.DrawRay(transform.position, transform.TransformDirection(myForward) * 10f, Color.red);
-        Debug.DrawRay(transform.position, transform.TransformDirection(transform.right) * 10f, Color.green);
-        Debug.DrawRay(transform.position, transform.TransformDirection(myNormal) * 10f, Color.blue);
+        Debug.DrawRay(body.position, -myNormal * 10f, Color.red);
+        //Debug.DrawRay(transform.position, transform.TransformDirection(transform.right) * 10f, Color.green);
+        //Debug.DrawRay(transform.position, transform.TransformDirection(myNormal) * 10f, Color.blue);
+
+
     }

     void GetInput()


Changed return type to bool.

Changed return type to bool.

git-svn-id: 53f2a8ff3606f182ef4420064c1f4a5cdcbe6bb1@191 bb9bf1cf-960d-0410-9a3a-baeba60cf407

--- Axiom/Engine/Core/IConfigurable.cs
+++ Axiom/Engine/Core/IConfigurable.cs
@@ -18,6 +18,9 @@
         /// <param name="val">
         ///    Value of the parameter.
         /// </param>
-		void SetParam(string name, string val);
+        /// <returns>
+        ///    False if the param was not dealt with, True if it was.
+        /// </returns>
+		bool SetParam(string name, string val);
 	}
 }


Moved Axiom.SubSystems.Rendering to Axiom.Graphics

git-svn-id: 53f2a8ff3606f182ef4420064c1f4a5cdcbe6bb1@148 bb9bf1cf-960d-0410-9a3a-baeba60cf407

--- Axiom/Engine/Enumerations/Enums.cs
+++ Axiom/Engine/Enumerations/Enums.cs
@@ -1,194 +0,0 @@
-#region LGPL License
-/*
-Axiom Game Engine Library
-Copyright (C) 2003  Axiom Project Team
-
-The overall design, and a majority of the core engine and rendering code
-contained within this library is a derivative of the open source Object Oriented
-Graphics Engine OGRE, which can be found at http://ogre.sourceforge.net.
-Many thanks to the OGRE team for maintaining such a high quality project.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-#endregion
-
-using System;
-using Axiom.Scripting;
-
-namespace Axiom.Enumerations {
-    ///
-    ///		Covers what a billboards position means.
-    ///
-    public enum BillboardOrigin {
-        TopLeft,
-        TopCenter,
-        TopRight,
-        CenterLeft,
-        Center,
-        CenterRight,
-        BottomLeft,
-        BottomCenter,
-        BottomRight
-    }
-
-    ///
-    ///		Type of billboard to use for a BillboardSet.
-    ///
-    public enum BillboardType {
-        /// Standard point billboard (default), always faces the camera completely and is always upright
-        [ScriptEnum("point")]
-        Point,
-        /// Billboards are oriented around a shared direction vector (used as Y axis) and only rotate around this to face the camera
-        [ScriptEnum("oriented_common")]
-        OrientedCommon,
-        /// Billboards are oriented around their own direction vector (their own Y axis) and only rotate around this to face the camera
-        [ScriptEnum("oriented_self")]
-        OrientedSelf
-    }
-
-    ///
-    ///		Specifying the side of a box, used for things like skyboxes, etc.
-    ///
-    public enum BoxPlane {
-        Front,
-        Back,
-        Left,
-        Right,
-        Up,
-        Down
-    }
-
-
-
-    ///
-    ///
-    ///
-    public enum DynamicsBodyType {
-        ///
-        Box,
-        ///
-        Sphere,
-
-    }
-
-    ///
-    /// Defines the 6 planes the make up a frustum.
-    ///
-    public enum FrustumPlane {
-        Near = 0,
-        Far,
-        Left,
-        Right,
-        Top,
-        Bottom,
-        /// Used for methods that require returning a value of this type but cannot return null.
-        None
-    }
-
-    ///
-    /// The "positive side" of the plane is the half space to which the
-    /// plane normal points. The "negative side" is the other half
-    /// space. The flag "no side" indicates the plane itself.
-    ///
-    public enum PlaneSide {
-        None,
-        Positive,
-        Negative
-    }
-
-    ///
-    ///		Canned entities that can be created on demand.
-    ///
-    public enum PrefabEntity {
-        /// A flat plane.
-        Plane,
-        /// The obligatory teapot.
-        Teapot,
-        /// Typical box.
-        Box,
-        /// Full cairo action.
-        Pyramid
-    }
-
-    ///
-    ///		Priorities that can be assigned to renderable objects for sorting.
-    ///
-    public enum RenderQueueGroupID {
-        /// Objects that must be rendered first (like backgrounds).
-        Background = 0,
-        ///
-        One = 10,
-        ///
-        Two = 20,
-        ///
-        Three = 30,
-        ///
-        Four = 40,
-        /// Default queue.
-        Main = 50,
-        ///
-        Six = 60,
-        ///
-        Seven = 70,
-        ///
-        Eight = 80,
-        /// Last queue before overlays, used for skyboxes if rendered last.
-        Nine = 90,
-        /// Use this queue for objects which must be rendered last e.g. overlays
-        Overlay = 100
-    }
-
-    ///
-    ///    The different types of scenes types that can be handled by the engine.  The various types can
-    ///    be altered by plugin functionality (i.e. BSP for interior, Octree for Exterior, etc).
-    ///
-    public enum SceneType {
-        Generic,
-        ExteriorClose,
-        ExteriorFar,
-        Interior,
-        Overhead
-    }
-
-    ///
-    ///    This type can be used by collaborating applications & SceneManagers to
-    ///    agree on the type of world geometry to be returned from queries. Not all
-    ///    these types will be supported by all SceneManagers; once the application
-    ///    has decided which SceneManager specialization to use, it is expected that
-    ///    it will know which type of world geometry abstraction is available to it.
-    ///
-    public enum WorldFragmentType {
-        ///
-        ///    Return no world geometry hits at all.
-        ///
-        None,
-        ///
-        ///    Return references to convex plane-bounded regions.
-        ///
-        PlaneBoundedRegion,
-        ///
-        ///    Return a single intersection point (typically RaySceneQuery only)
-        ///
-        SingleIntersection,
-        ///
-        ///    Custom geometry as defined by the SceneManger.
-        ///
-        CustomGeometry,
-        ///
-        ///    General RenderOperation structure.
-        ///
-        RenderOperation
-    }
-}


Make CanUsePayjoin2 more resilient

Make CanUsePayjoin2 more resilient

--- BTCPayServer.Tests/PayJoinTests.cs
+++ BTCPayServer.Tests/PayJoinTests.cs
@@ -377,10 +377,17 @@
                 var alice = tester.NewAccount();
                 await alice.RegisterDerivationSchemeAsync("BTC", ScriptPubKeyType.Segwit, true);
                 await notifications.ListenDerivationSchemesAsync(new[] { alice.DerivationScheme });
-                var address = (await nbx.GetUnusedAsync(alice.DerivationScheme, DerivationFeature.Deposit)).Address;
-                await tester.ExplorerNode.GenerateAsync(1);
-                tester.ExplorerNode.SendToAddress(address, Money.Coins(1.0m));
+
+                BitcoinAddress aliceAddress = null;
+                await tester.WaitForEvent<NewOnChainTransactionEvent>(async() =>
+                {
+                    aliceAddress = (await nbx.GetUnusedAsync(alice.DerivationScheme, DerivationFeature.Deposit)).Address;
+                    await tester.ExplorerNode.GenerateAsync(1);
+                    tester.ExplorerNode.SendToAddress(aliceAddress, Money.Coins(1.0m));
+                });
+
                 await notifications.NextEventAsync();
+
                 var paymentAddress = new Key().PubKey.GetAddress(ScriptPubKeyType.Legacy, Network.RegTest);
                 var otherAddress = new Key().PubKey.GetAddress(ScriptPubKeyType.Legacy, Network.RegTest);
                 var psbt = (await nbx.CreatePSBTAsync(alice.DerivationScheme, new CreatePSBTRequest()
@@ -514,8 +521,8 @@
                 await bob.GrantAccessAsync();
                 await bob.RegisterDerivationSchemeAsync("BTC", ScriptPubKeyType.Segwit, true);
                 await notifications.ListenDerivationSchemesAsync(new[] { bob.DerivationScheme });
-                address = (await nbx.GetUnusedAsync(bob.DerivationScheme, DerivationFeature.Deposit)).Address;
-                tester.ExplorerNode.SendToAddress(address, Money.Coins(1.1m));
+                aliceAddress = (await nbx.GetUnusedAsync(bob.DerivationScheme, DerivationFeature.Deposit)).Address;
+                tester.ExplorerNode.SendToAddress(aliceAddress, Money.Coins(1.1m));
                 await notifications.NextEventAsync();
                 bob.ModifyStore(s => s.PayJoinEnabled = true);
                 var invoice = bob.BitPay.CreateInvoice(


Implement GetValidMoves for King

Implement GetValidMoves for King

--- ChessDotNet/Pieces/King.cs
+++ ChessDotNet/Pieces/King.cs
@@ -1,4 +1,6 @@
 using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;

 namespace ChessDotNet.Pieces
 {
@@ -103,5 +105,31 @@
         {
             return float.PositiveInfinity;
         }
+
+        public override ReadOnlyCollection<Move> GetValidMoves(Position from, bool returnIfAny, ChessGame game)
+        {
+            Utilities.ThrowIfNull(from, "from");
+            List<Move> validMoves = new List<Move>();
+            Piece piece = game.GetPieceAt(from);
+            Piece[][] board = game.GetBoard();
+            int l0 = board.Length;
+            int l1 = board[0].Length;
+            int[][] directions = new int[][] { new int[] { 0, 1 }, new int[] { 1, 0 }, new int[] { 0, -1 }, new int[] { -1, 0 },
+                        new int[] { 1, 1 }, new int[] { 1, -1 }, new int[] { -1, 1 }, new int[] { -1, -1 } };
+            foreach (int[] dir in directions)
+            {
+                if ((int)from.File + dir[0] < 0 || (int)from.File + dir[0] >= l1
+                    || (int)from.Rank + dir[1] < 0 || (int)from.Rank + dir[1] >= l0)
+                    continue;
+                Move move = new Move(from, new Position(from.File + dir[0], from.Rank + dir[1]), piece.Owner);
+                if (game.IsValidMove(move))
+                {
+                    validMoves.Add(move);
+                    if (returnIfAny)
+                        return new ReadOnlyCollection<Move>(validMoves);
+                }
+            }
+            return new ReadOnlyCollection<Move>(validMoves);
+        }
     }
 }


use memory storage for comparison test tool

--- BitSharp.Client/MainWindow.xaml.cs
+++ BitSharp.Client/MainWindow.xaml.cs
@@ -53,9 +53,10 @@
 #if !TEST_TOOL
                 var storageContext = new EsentStorageContext(Path.Combine(Config.LocalStoragePath, "data"));
 #else
-                if (Directory.Exists(Path.Combine(Config.LocalStoragePath, "data-test")))
-                    Directory.Delete(Path.Combine(Config.LocalStoragePath, "data-test"), recursive: true);
-                var storageContext = new EsentStorageContext(Path.Combine(Config.LocalStoragePath, "data-test"));
+                //if (Directory.Exists(Path.Combine(Config.LocalStoragePath, "data-test")))
+                //    Directory.Delete(Path.Combine(Config.LocalStoragePath, "data-test"), recursive: true);
+                //var storageContext = new EsentStorageContext(Path.Combine(Config.LocalStoragePath, "data-test"));
+                var storageContext = new MemoryStorageContext();
 #endif

                 var knownAddressStorage = new BitSharp.Storage.Esent.KnownAddressStorage(storageContext);


made one test case work

made one test case work

--- dotnet/test/Tests.cs
+++ dotnet/test/Tests.cs
@@ -64,7 +64,7 @@
         }

         [Fact]
-        public void TestConnection()
+        public async void TestConnection()
         {
             using (var server = StartWebSocketServer(async context =>
             {
@@ -75,9 +75,8 @@
             }))
             {
                 using (var client = new WebSocket4Net.WebSocket("ws://localhost:54321/"))
-                {
-
-                    //await client.ConnectAsync(new Uri(ClientAddress), CancellationToken.None);
+                {
+                    await client.Open();
                 }
             }
         }


Fix Xwt text rotation (closes #294)

Fix Xwt text rotation (closes #294)

--- Source/OxyPlot.Xwt/GraphicsRenderContext.cs
+++ Source/OxyPlot.Xwt/GraphicsRenderContext.cs
@@ -259,7 +259,7 @@

             Context.Translate (p.X, p.Y);
             if (Math.Abs (rotate) > double.Epsilon) {
-                Context.Rotate (rotate * Math.PI / 180.0);
+                Context.Rotate (rotate);
             }

             Context.Translate (dx, dy);


[D3DCompiler] Bugfix on IncludeShadow

[D3DCompiler] Bugfix on IncludeShadow

--- Source/SharpDX.D3DCompiler/IncludeShadow.cs
+++ Source/SharpDX.D3DCompiler/IncludeShadow.cs
@@ -30,7 +30,7 @@
     internal class IncludeShadow : CppObjectShadow
     {
         private static readonly IncludeVtbl Vtbl = new IncludeVtbl();
-        private Dictionary<IntPtr, Frame> _frames;
+        private readonly Dictionary<IntPtr, Frame> frames = new Dictionary<IntPtr, Frame>();

         private struct Frame
         {
@@ -96,8 +96,8 @@
                         Stream stream = null;
                         Stream parentStream = null;

-                        if (shadow._frames.ContainsKey(pParentData))
-                            parentStream = shadow._frames[pParentData].Stream;
+                        if (shadow.frames.ContainsKey(pParentData))
+                            parentStream = shadow.frames[pParentData].Stream;

                         stream = callback.Open(includeType, new String((sbyte*)fileNameRef), parentStream);
                         if (stream == null)
@@ -122,7 +122,7 @@
                             bytesRef = data.Length;
                         }

-                        shadow._frames.Add(dataRef, new Frame(stream, handle));
+                        shadow.frames.Add(dataRef, new Frame(stream, handle));

                         return Result.Ok;
                     }
@@ -157,9 +157,9 @@
                     var callback = (Include)shadow.Callback;

                     Frame frame;
-                    if (shadow._frames.TryGetValue(pData, out frame))
+                    if (shadow.frames.TryGetValue(pData, out frame))
                     {
-                        shadow._frames.Remove(pData);
+                        shadow.frames.Remove(pData);
                         callback.Close(frame.Stream);
                         frame.Close();
                     }


SELPDCImporter: Updated existing PMU device lookup to restrict search by parent PDC ID since child ID codes may not be unique across infrastructure.

--- Source/Tools/SELPDCImporter/GSFPDCConfig.cs
+++ Source/Tools/SELPDCImporter/GSFPDCConfig.cs
@@ -86,8 +86,8 @@
         public static Phasor QueryPhasorForDevice(this TableOperations<Phasor> phasorTable, int deviceID, int sourceIndex) =>
             phasorTable.QueryRecordWhere("DeviceID = {0} AND SourceIndex = {1}", deviceID, sourceIndex) ?? phasorTable.NewPhasor();

-        public static Device FindDeviceByIDCode(this Device[] devices, ushort idCode) =>
-            devices.FirstOrDefault(device => device.AccessID == idCode);
+        public static Device FindDeviceByIDCode(this Device[] devices, ushort idCode, int? parentID = null) =>
+            devices.FirstOrDefault(device => device.ParentID == parentID && device.AccessID == idCode);

         // Remove any invalid characters from acronym
         public static string GetCleanAcronym(this string acronym) =>
@@ -203,7 +203,7 @@
             ConfigurationFrame configFrame = importParams.ConfigFrame;
             TableOperations<Device> deviceTable = importParams.DeviceTable;
             Guid nodeID = importParams.NodeID;
-            Device device = importParams.Devices?.FindDeviceByIDCode(configFrame.IDCode) ?? deviceTable.NewDevice();
+            Device device = importParams.Devices?.FindDeviceByIDCode(configFrame.IDCode, parentDevice.ID) ?? deviceTable.NewDevice();
             string deviceAcronym = configCell.IDLabel;
             string deviceName = null;


Improve test by verifying that the header value had been set correctly

--- test/CorrelationId.Tests/CorrelationIdMiddlewareTests.cs
+++ test/CorrelationId.Tests/CorrelationIdMiddlewareTests.cs
@@ -83,6 +83,7 @@
         public async Task CorrelationId_SetToCorrelationIdFromRequestHeader()
         {
             var expectedHeaderName = new CorrelationIdOptions().Header;
+            var expectedHeaderValue = "123456";

             var builder = new WebHostBuilder()
                .Configure(app => app.UseCorrelationId());
@@ -90,13 +91,13 @@
             var server = new TestServer(builder);

             var request = new HttpRequestMessage();
-            request.Headers.Add(expectedHeaderName, "123456");
+            request.Headers.Add(expectedHeaderName, expectedHeaderValue);

             var response = await server.CreateClient().SendAsync(request);

             var header = response.Headers.GetValues(expectedHeaderName);

-            Assert.NotNull(header);
+            Assert.Single(header, expectedHeaderValue);
         }
     }
 }


Corrected aggregate beer sample tests to use test configuration

--- Src/Couchbase.Linq.Tests/BeerSampleTests.cs
+++ Src/Couchbase.Linq.Tests/BeerSampleTests.cs
@@ -656,7 +656,7 @@
         [Test()]
         public void AggregateTests_SimpleAverage()
         {
-            using (var cluster = new Cluster())
+            using (var cluster = new Cluster(TestConfigurations.DefaultConfig()))
             {
                 using (var bucket = cluster.OpenBucket("beer-sample"))
                 {
@@ -670,7 +670,7 @@
         [Test()]
         public void AggregateTests_SimpleCount()
         {
-            using (var cluster = new Cluster())
+            using (var cluster = new Cluster(TestConfigurations.DefaultConfig()))
             {
                 using (var bucket = cluster.OpenBucket("beer-sample"))
                 {
@@ -684,7 +684,7 @@
         [Test()]
         public void AggregateTests_GroupBy()
         {
-            using (var cluster = new Cluster())
+            using (var cluster = new Cluster(TestConfigurations.DefaultConfig()))
             {
                 using (var bucket = cluster.OpenBucket("beer-sample"))
                 {
@@ -707,7 +707,7 @@
         [Test()]
         public void AggregateTests_Having()
         {
-            using (var cluster = new Cluster())
+            using (var cluster = new Cluster(TestConfigurations.DefaultConfig()))
             {
                 using (var bucket = cluster.OpenBucket("beer-sample"))
                 {
@@ -731,7 +731,7 @@
         [Test()]
         public void AggregateTests_OrderByAggregate()
         {
-            using (var cluster = new Cluster())
+            using (var cluster = new Cluster(TestConfigurations.DefaultConfig()))
             {
                 using (var bucket = cluster.OpenBucket("beer-sample"))
                 {
@@ -754,7 +754,7 @@
         [Test()]
         public void AggregateTests_JoinBeforeGroupByAndMultipartKey()
         {
-            using (var cluster = new Cluster())
+            using (var cluster = new Cluster(TestConfigurations.DefaultConfig()))
             {
                 using (var bucket = cluster.OpenBucket("beer-sample"))
                 {


Updated version

Updated version

--- Src/MultiSafepay/Properties/AssemblyInfo.cs
+++ Src/MultiSafepay/Properties/AssemblyInfo.cs
@@ -32,7 +32,7 @@
 // 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("0.3.4")]
-[assembly: AssemblyFileVersion("0.3.4")]
+[assembly: AssemblyVersion("0.4.0")]
+[assembly: AssemblyFileVersion("0.4.0")]

 [assembly: InternalsVisibleTo("MultiSafepay.UnitTests")]


INV-1613 - Fix WPF deadlock for getting device name

--- Src/StackifyLib/Models/EnvironmentDetail.cs
+++ Src/StackifyLib/Models/EnvironmentDetail.cs
@@ -225,13 +225,13 @@
             try
             {
                 Client.Timeout = TimeSpan.FromSeconds(5);
-                var content = await Client.GetAsync(EC2InstanceIdUrl);
+                var content = await Client.GetAsync(EC2InstanceIdUrl).ConfigureAwait(false);

                 int statusCode = (int)content.StatusCode;

                 if (statusCode >= 200 && statusCode < 300)
                 {
-                    string id = await content.Content.ReadAsStringAsync();
+                    string id = await content.Content.ReadAsStringAsync().ConfigureAwait(false);
                     r = string.IsNullOrWhiteSpace(id) ? null : id;

                     if (r.Contains("html"))


Client LAN tab, currently empty.

Client LAN tab, currently empty.

--- StardewValleyMP/Interface/ModeSelectMenu.cs
+++ StardewValleyMP/Interface/ModeSelectMenu.cs
@@ -39,6 +39,8 @@
         private List< IConnection > pendingConns = new List< IConnection >();
         private Client pendingClient = null;

+        private bool showingLan = false;
+
         private string localIp, externalIp;

         public ModeSelectMenu(string thePath) : base(Game1.viewport.Width / 2 - (1100 + IClickableMenu.borderWidth * 2) / 2, Game1.viewport.Height / 2 - (600 + IClickableMenu.borderWidth * 2) / 2, 1100 + IClickableMenu.borderWidth * 2, 600 + IClickableMenu.borderWidth * 2, false)
@@ -141,23 +143,32 @@
             {
                 if (Multiplayer.mode == Mode.Client)
                 {
-                    Rectangle r1 = new Rectangle(Game1.viewport.Width / 2 - SpriteText.getWidthOfString("Network") - 50, 20, SpriteText.getWidthOfString("Network"), SpriteText.getHeightOfString("Network"));
-                    Rectangle r2 = new Rectangle(Game1.viewport.Width / 2 + 50, 20, SpriteText.getWidthOfString("Friends"), SpriteText.getHeightOfString("Friends"));
+                    Rectangle r1 = new Rectangle(Game1.viewport.Width / 4, 20, SpriteText.getWidthOfString("Network"), SpriteText.getHeightOfString("Network"));
+                    Rectangle r2 = new Rectangle(Game1.viewport.Width / 2 - 50, 20, SpriteText.getWidthOfString("Friends"), SpriteText.getHeightOfString("Friends"));
+                    Rectangle r3 = new Rectangle(Game1.viewport.Width / 4 * 3 - 100, 20, SpriteText.getWidthOfString("LAN"), SpriteText.getHeightOfString("LAN"));

                     if (r1.Contains(x, y))
                     {
                         showingFriends = false;
+                        showingLan = false;
                         Log.trace("Changing to network tab");
                     }
                     else if (r2.Contains(x, y) && friends != null)
                     {
                         showingFriends = true;
+                        showingLan = false;
                         Log.trace("Changing to friends tab");
                     }
+                    else if ( r3.Contains(x, y))
+                    {
+                        showingFriends = false;
+                        showingLan = true;
+                        Log.trace("Changing to LAN tab");
+                    }
                 }

                 Multiplayer.problemStarting = false;
-                if (!showingFriends)
+                if (!showingFriends && !showingLan)
                 {
                     if (ipBox != null) ipBox.Update();
                     if (portBox != null) portBox.Update();
@@ -296,8 +307,10 @@
             }
             else if ( modeInit == null && Multiplayer.mode == Mode.Client )
             {
-                if (friends != null)
+                if (showingFriends && friends != null)
                     friends.update(time);
+                else if (showingLan)
+                    ;
             }
         }

@@ -341,19 +354,51 @@
                     SpriteText.drawString(b, "Friends", Game1.viewport.Width / 2 + 50, 20,
                         999999, -1, 999999, 1, 0.88f, false, -1, "", friends == null ? 0 : (showingFriends ? 5 : -1));*/

-                    b.DrawString(Game1.dialogueFont, "Network", new Vector2(Game1.viewport.Width / 2 - Game1.dialogueFont.MeasureString("Network").X - 50+0, 20+2), (Color.Black)*0.25f);
-                    b.DrawString(Game1.dialogueFont, "Network", new Vector2(Game1.viewport.Width / 2 - Game1.dialogueFont.MeasureString("Network").X - 50+2, 20+0), (Color.Black) *0.25f);
-                    b.DrawString(Game1.dialogueFont, "Network", new Vector2(Game1.viewport.Width / 2 - Game1.dialogueFont.MeasureString("Network").X - 50+0, 20-2), (Color.Black) *0.25f);
-                    b.DrawString(Game1.dialogueFont, "Network", new Vector2(Game1.viewport.Width / 2 - Game1.dialogueFont.MeasureString("Network").X - 50-2, 20-0), (Color.Black) *0.25f);
-                    b.DrawString(Game1.dialogueFont, "Network", new Vector2(Game1.viewport.Width / 2 - Game1.dialogueFont.MeasureString("Network").X - 50, 20), (showingFriends ? Color.SaddleBrown : Color.OrangeRed));
-                    b.DrawString(Game1.dialogueFont, "Friends", new Vector2(Game1.viewport.Width / 2 + 50 + 0, 20 + 2), (Color.Black) * 0.25f);
-                    b.DrawString(Game1.dialogueFont, "Friends", new Vector2(Game1.viewport.Width / 2 + 50 + 2, 20 + 0), (Color.Black) * 0.25f);
-                    b.DrawString(Game1.dialogueFont, "Friends", new Vector2(Game1.viewport.Width / 2 + 50 + 0, 20 - 2), (Color.Black) * 0.25f);
-                    b.DrawString(Game1.dialogueFont, "Friends", new Vector2(Game1.viewport.Width / 2 + 50 - 2, 20 - 0), (Color.Black) * 0.25f);
-                    b.DrawString(Game1.dialogueFont, "Friends", new Vector2(Game1.viewport.Width / 2 + 50, 20), friends == null ? Color.Black : (showingFriends ? Color.OrangeRed : Color.SaddleBrown));
-                }
-
-                if (!showingFriends)
+                    b.DrawString(Game1.dialogueFont, "Network", new Vector2(Game1.viewport.Width / 4 +0, 20+2), (Color.Black)*0.25f);
+                    b.DrawString(Game1.dialogueFont, "Network", new Vector2(Game1.viewport.Width / 4 +2, 20+0), (Color.Black) *0.25f);
+                    b.DrawString(Game1.dialogueFont, "Network", new Vector2(Game1.viewport.Width / 4 +0, 20-2), (Color.Black) *0.25f);
+                    b.DrawString(Game1.dialogueFont, "Network", new Vector2(Game1.viewport.Width / 4 -2, 20-0), (Color.Black) *0.25f);
+                    b.DrawString(Game1.dialogueFont, "Network", new Vector2(Game1.viewport.Width / 4, 20), (!showingFriends && !showingLan ? Color.OrangeRed : Color.SaddleBrown));
+                    b.DrawString(Game1.dialogueFont, "Friends", new Vector2(Game1.viewport.Width / 2 - 50 + 0, 20 + 2), (Color.Black) * 0.25f);
+                    b.DrawString(Game1.dialogueFont, "Friends", new Vector2(Game1.viewport.Width / 2 - 50 + 2, 20 + 0), (Color.Black) * 0.25f);
+                    b.DrawString(Game1.dialogueFont, "Friends", new Vector2(Game1.viewport.Width / 2 - 50 + 0, 20 - 2), (Color.Black) * 0.25f);
+                    b.DrawString(Game1.dialogueFont, "Friends", new Vector2(Game1.viewport.Width / 2 - 50 - 2, 20 - 0), (Color.Black) * 0.25f);
+                    b.DrawString(Game1.dialogueFont, "Friends", new Vector2(Game1.viewport.Width / 2 - 50, 20), friends == null ? Color.Black : (showingFriends ? Color.OrangeRed : Color.SaddleBrown));
+                    b.DrawString(Game1.dialogueFont, "LAN", new Vector2(Game1.viewport.Width / 4 * 3 - 100 + 0, 20 + 2), (Color.Black) * 0.25f);
+                    b.DrawString(Game1.dialogueFont, "LAN", new Vector2(Game1.viewport.Width / 4 * 3 - 100 + 2, 20 + 0), (Color.Black) * 0.25f);
+                    b.DrawString(Game1.dialogueFont, "LAN", new Vector2(Game1.viewport.Width / 4 * 3 - 100 + 0, 20 - 2), (Color.Black) * 0.25f);
+                    b.DrawString(Game1.dialogueFont, "LAN", new Vector2(Game1.viewport.Width / 4 * 3 - 100 - 2, 20 - 0), (Color.Black) * 0.25f);
+                    b.DrawString(Game1.dialogueFont, "LAN", new Vector2(Game1.viewport.Width / 4 * 3 - 100, 20), friends == null ? Color.Black : (showingLan ? Color.OrangeRed : Color.SaddleBrown));
+                }
+
+                if (showingFriends)
+                {
+                    if (pendingClient == null)
+                    {
+                        if (pendingConns.Count > 0)
+                        {
+                            PlatformConnection conn = (PlatformConnection)pendingConns[0];
+                            Friend friend = conn.friend;
+
+                            int ix = xPositionOnScreen + width / 5;
+                            int iw = width / 5 * 3;
+                            int ih = 80 * 2 + 64;
+                            int iy = (Game1.viewport.Height - ih) / 2;
+
+                            IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(384, 373, 18, 18), ix, iy, iw, ih, Color.White, (float)Game1.pixelZoom, true);
+                            ix += 32;
+                            iy += 32;
+                            b.Draw(friend.avatar, new Rectangle(ix, iy, 64, 64), Color.White);
+                            SpriteText.drawString(b, friend.displayName, ix + 88, iy + 8);
+                            SpriteText.drawString(b, "Connecting...", ix + 32, iy + 96);
+                        }
+                        else friends.draw(b);
+                    }
+                }
+                else if (showingLan)
+                {
+                }
+                else
                 {
                     Color gray = new Color(127, 127, 127);
                     Color text = new Color(86, 22, 12);
@@ -381,27 +426,6 @@
                     IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(384, 373, 18, 18), x, y, w, h, new Rectangle(x, y, w, h).Contains(Game1.getOldMouseX(), Game1.getOldMouseY()) ? Color.Wheat : Color.White, (float)Game1.pixelZoom, true);
                     SpriteText.drawString(b, str, x + w / 2 - SpriteText.getWidthOfString(str) / 2, y + h / 2 - SpriteText.getHeightOfString(str) / 2);
                 }
-                else if ( pendingClient == null )
-                {
-                    if (pendingConns.Count > 0)
-                    {
-                        PlatformConnection conn = (PlatformConnection)pendingConns[0];
-                        Friend friend = conn.friend;
-
-                        int ix = xPositionOnScreen + width / 5;
-                        int iw = width / 5 * 3;
-                        int ih = 80 * 2 + 64;
-                        int iy = (Game1.viewport.Height - ih) / 2;
-
-                        IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(384, 373, 18, 18), ix, iy, iw, ih, Color.White, (float)Game1.pixelZoom, true);
-                        ix += 32;
-                        iy += 32;
-                        b.Draw(friend.avatar, new Rectangle(ix, iy, 64, 64), Color.White);
-                        SpriteText.drawString(b, friend.displayName, ix + 88, iy + 8);
-                        SpriteText.drawString(b, "Connecting...", ix + 32, iy + 96);
-                    }
-                    else friends.draw(b);
-                }
             }
             else if (Multiplayer.problemStarting)
             {


bug  修复

bug  修复

--- SalamanderWnmp/Programs/Mysql.cs
+++ SalamanderWnmp/Programs/Mysql.cs
@@ -36,15 +36,8 @@

         public override void Start()
         {
-            try
-            {
-                if (IsRunning())
-                    return;
-            }
-            catch(Exception ex)
-            {
-                Log.wnmp_log_notice(ex.Message, progLogSection);
-            }
+            if (IsRunning())
+                return;
             try {
                 mysqlController.Start();
                 mysqlController.WaitForStatus(ServiceControllerStatus.Running);
@@ -56,7 +49,7 @@

         public override void Stop()
         {
-            if(mysqlController.Status == ServiceControllerStatus.Stopped)
+            if(isStopped())
             {
                 return;
             }
@@ -76,7 +69,14 @@
         /// <returns></returns>
         public override bool IsRunning()
         {
-            return mysqlController.Status == ServiceControllerStatus.Running;
+            try
+            {
+                return mysqlController.Status == ServiceControllerStatus.Running;
+            }
+            catch
+            {
+                return false;
+            }
         }

         /// <summary>


fix reapertura login cuando cierras ventana login

--- Signum.Windows/Facades/Server.cs
+++ Signum.Windows/Facades/Server.cs
@@ -15,6 +15,7 @@

 namespace Signum.Windows
 {
+
     public static class Server
     {
         static Func<IBaseServer> getServer;
@@ -44,7 +45,7 @@
                 current = getServer();

                 if (current == null)
-                    throw new InvalidOperationException(Properties.Resources.AConnectionWithTheServerIsNecessaryToContinue);
+                    throw new NotConnectedToServerException(Properties.Resources.AConnectionWithTheServerIsNecessaryToContinue);

                 if (Connecting != null)
                     Connecting();
@@ -342,4 +343,17 @@
             return lite;
         }
     }
+
+    [Serializable]
+    public class NotConnectedToServerException : Exception
+    {
+        public NotConnectedToServerException() { }
+        public NotConnectedToServerException(string message) : base(message) { }
+        public NotConnectedToServerException(string message, Exception inner) : base(message, inner) { }
+        protected NotConnectedToServerException(
+          System.Runtime.Serialization.SerializationInfo info,
+          System.Runtime.Serialization.StreamingContext context)
+            : base(info, context) { }
+    }
+
 }


TSI-191 Impossible to zoom in a page is fixed.

--- Site/Views/Shared/_Layout.cshtml
+++ Site/Views/Shared/_Layout.cshtml
@@ -5,7 +5,7 @@
 <head>
     <meta charset="UTF-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
     <title>@Model.Title</title>
     @foreach (var meta in Model.Meta)
     {


add define guard for UnityEngine.GUIText


OAuth20: Set a non-null fake client_id in the vProgram.

--- SVAuth/AuthClassHierarchy/OAuth20.cs
+++ SVAuth/AuthClassHierarchy/OAuth20.cs
@@ -205,6 +205,10 @@
             if (redierct_uri1 == null)
                 redierct_uri1 = $"https://{rpPrincipal.name}/dummy";

+            // Ditto for client_id.
+            if (client_id1 == null)
+                client_id1 = "dummy:" + rpPrincipal.name;
+
             client_id = client_id1;
             redirect_uri = redierct_uri1;
             client_secret = client_secret1;


Added some elements to WPF in QN

Added some elements to WPF in QN

--- Saveyour/Saveyour/Quicknotes.xaml.cs
+++ Saveyour/Saveyour/Quicknotes.xaml.cs
@@ -71,5 +71,15 @@
         {
             Shell.getSaveLoader().save();
         }
+
+        private void AddQN_Click(object sender, RoutedEventArgs e)
+        {
+
+        }
+
+        private void RemoveQN_Click(object sender, RoutedEventArgs e)
+        {
+
+        }
     }
 }


Updated telemetry tracking

Updated telemetry tracking

--- Commands/Base/PnPCmdlet.cs
+++ Commands/Base/PnPCmdlet.cs
@@ -115,13 +115,8 @@
             }
             catch (Exception ex)
             {
-                if (SPOnlineConnection.CurrentConnection.TelemetryClient != null)
-                {
-                    SPOnlineConnection.CurrentConnection.TelemetryClient.TrackException(ex);
-                }
                 SPOnlineConnection.CurrentConnection.RestoreCachedContext(SPOnlineConnection.CurrentConnection.Url);
                 WriteError(new ErrorRecord(ex, "EXCEPTION", ErrorCategory.WriteError, null));
-                SPOnlineConnection.CurrentConnection.TelemetryClient.Flush();
             }
         }


Disabling check in shared pointer test for UnsafeElement when it is Linux dump without RTTI.

--- Tests/CsDebugScript.Tests/NativeDumpTest.cs
+++ Tests/CsDebugScript.Tests/NativeDumpTest.cs
@@ -32,6 +32,8 @@
         public bool ReleaseDump { get; set; }

         public bool LinuxDump { get; set; }
+
+        public bool NoRtti { get; set; }

         [Fact]
         public void CurrentThreadContainsMainSourceFileName()
@@ -251,7 +253,10 @@
             Assert.True(ewptr1.IsEmpty);
             Assert.Equal(0, ewptr1.SharedCount);
             Assert.Equal(1, ewptr1.WeakCount);
-            Assert.Equal(42, ewptr1.UnsafeElement);
+            if (!LinuxDump || !NoRtti)
+            {
+                Assert.Equal(42, ewptr1.UnsafeElement);
+            }
             Assert.True(ewptr1.IsCreatedWithMakeShared);

             Assert.True(esptr2.IsEmpty);
@@ -672,6 +677,7 @@
             : base(initialization)
         {
             LinuxDump = true;
+            NoRtti = true;
         }
     }

@@ -684,6 +690,7 @@
             : base(initialization)
         {
             LinuxDump = true;
+            NoRtti = true;
         }
     }

@@ -696,6 +703,7 @@
             : base(initialization)
         {
             LinuxDump = true;
+            NoRtti = true;
         }
     }
     #endregion


Code cleanup

--- ConsoleApp1/Models/Grid.cs
+++ ConsoleApp1/Models/Grid.cs
@@ -11,31 +11,9 @@
         public int VectorY = 0;
         public int VectorZ = 0;

-        [Flags]
-        public enum Vectors
-        {
-            X,
-            Y,
-            Z,
-            XY,
-            minXY,
-            YZ,
-            minYZ,
-            XZ,
-            minXZ,
-            XYZ,
-            minXYZ,
-            XminYZ,
-            minXminYZ
-        }
-
-        public enum Direction
-        {
-            Up,
-            Down
-        }
-
-        public Dictionary<Vectors, int> VectorValues { get; set; }
+        private Dictionary<Vectors, int> VectorValues { get; set; }
+
+        public List<int> Values { get; set; }

         public Grid(int lineWidth)
         {
@@ -66,8 +44,6 @@
             }
         }

-        public List<int> Values { get; set; }
-
         public string Draw(List<int> winningPositions = null)
         {
             if (winningPositions == null)
@@ -286,6 +262,30 @@
             return true;
         }

+        [Flags]
+        public enum Vectors
+        {
+            X,
+            Y,
+            Z,
+            XY,
+            minXY,
+            YZ,
+            minYZ,
+            XZ,
+            minXZ,
+            XYZ,
+            minXYZ,
+            XminYZ,
+            minXminYZ
+        }
+
+        public enum Direction
+        {
+            Up,
+            Down
+        }
+
         public class Coordinate
         {
             public Coordinate(int x, int y, int z)


Don't add blank line after single statement else block.

--- Scripting/Generator/Emission/Flow.cs
+++ Scripting/Generator/Emission/Flow.cs
@@ -36,13 +36,15 @@

                 writer.Write(Parser.FlowElse);

-                if (options.ElseOnClosing)
-                    writer.Write(Parser.SingleSpace);
-                else
-                    WriteSpace();
+                if (cond.FalseStatements.Count > 1)
+                {
+                    if (options.ElseOnClosing)
+                        writer.Write(Parser.SingleSpace);
+                    else
+                        WriteSpace();

-                if (cond.FalseStatements.Count > 1)
                     writer.Write(Parser.BlockOpen);
+                }

                 depth++;
                 EmitStatements(cond.FalseStatements);


Misc: Remove logging of skinPath exception

--- plugins/OsuMemoryEventSource/MemoryDataProcessor.cs
+++ plugins/OsuMemoryEventSource/MemoryDataProcessor.cs
@@ -192,29 +192,28 @@
             }
         }

-        private bool providedDataForSkinPathException = false;
         private void InitLiveTokens()
         {
             var osuSkinsDirectory = Path.Combine(_settings.Get<string>(SettingNames.Instance.MainOsuDirectory), "Skins");
             var notPlaying = (OsuStatus)(OsuStatus.All - OsuStatus.Playing);
             _liveTokens["status"] = new LiveToken(_tokenSetter("status", OsuStatus.Null, TokenType.Live, "", OsuStatus.Null), null);
-            _liveTokens["skin"] = new LiveToken(_tokenSetter("skin", string.Empty, TokenType.Live, null, string.Empty, notPlaying), () =>_reader?.GetSkinFolderName() ?? string.Empty);
+            _liveTokens["skin"] = new LiveToken(_tokenSetter("skin", string.Empty, TokenType.Live, null, string.Empty, notPlaying),
+                () =>
+                {
+                    //TODO: memoryReader sometimes returns malformed skinName string
+                    var name = _reader?.GetSkinFolderName() ?? string.Empty;
+                    return name.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0
+                        ? string.Empty
+                        : name;
+                });
             _liveTokens["skinPath"] = new LiveToken(_tokenSetter("skinPath", string.Empty, TokenType.Live, null, string.Empty, notPlaying), () =>
             {
                 try
                 {
                     return Path.Combine(osuSkinsDirectory, (string) _liveTokens["skin"].Token.Value);
                 }
-                catch (ArgumentException ex)
-                {
-                    if (!providedDataForSkinPathException)
-                    {
-                        providedDataForSkinPathException = true;
-                        _logger.SetContextData("!skin!", $"{_liveTokens["skin"].Token.Value}");
-                        _logger.SetContextData("osuSkinsDirectory", $"{osuSkinsDirectory}");
-                        _logger.Log(ex, LogLevel.Error);
-                    }
-
+                catch (ArgumentException)
+                {
                     return string.Empty;
                 }
             });


handle culture for Recaptcha

handle culture for Recaptcha

--- Serenity.Script.UI/Misc/Recaptcha.cs
+++ Serenity.Script.UI/Misc/Recaptcha.cs
@@ -21,8 +21,7 @@
                 J("script#RecaptchaInclude").Length == 0)
             {
                 var src = "https://www.google.com/recaptcha/api.js";
-                if (options.Language != null)
-                    src += "?hl=" + options.Language;
+                src += "?hl=" + (options.Language ?? J("html").GetAttribute("lang") ?? "");

                 J("<script/>").Attribute("id", "RecaptchaInclude").Attribute("src", src)
                     .AppendTo(Document.Body);


Index for 5 articles!

Index for 5 articles!

We are slowly growning....

--- Sibelius.Web/Views/Home/Index.cshtml
+++ Sibelius.Web/Views/Home/Index.cshtml
@@ -9,6 +9,7 @@
         Sibelius.Web.Models.Article second = Model["1"];
         Sibelius.Web.Models.Article third = Model["2"];
         Sibelius.Web.Models.Article fourth = Model["3"];
+        Sibelius.Web.Models.Article fifth = Model["4"];
     }

@@ -57,6 +58,11 @@

@fourth.Section

Por @fourth.Author

+

+
@fifth.Title

+
@fifth.Section

+
Por @fifth.Author

+


Update Polynomial.cs

Update Polynomial.cs

--- MathUtils/Polynomial.cs
+++ MathUtils/Polynomial.cs
@@ -121,7 +121,7 @@
                 {
                     D = Sqrt(D);
                     double[] roots = new double[2];
-                    roots[0] = -0.5 * a + D;
+                    roots[0] = -0.5 * a - D;
                     roots[1] = -0.5 * a + D;
                     return roots;
                 }


Made multiple stereo options and Added disable plane option

--- UnityRenderingPlugin/RenderStereoCubemap.cs
+++ UnityRenderingPlugin/RenderStereoCubemap.cs
@@ -25,11 +25,11 @@
     public bool printFPS = false, adjustFOV = false;

     public int faceCount = 6;
-    public bool extract = true;
+    public bool extract = true, disablePlanes=false;

     public float fovAdjustValue=0.5f;

-    public enum Ceiling_Floor_StereoOption {None, PositiveX, All}
+    public enum Ceiling_Floor_StereoOption {None, PositiveZ, NegativeZ, PositiveX, NegativeX, All}

     public Ceiling_Floor_StereoOption option;

@@ -43,8 +43,8 @@
     private GameObject[] CameraFL;  //for left floor view
     private GameObject[] CameraFR;  //for right floor view

-    private GameObject[] planes,planeCeiling,planeFloor;
-    private GameObject cube, cubeCeiling, cubeFloor, cameras,cameraCeiling,cameraFloor;
+    private GameObject[] planes, planeCeiling_4Way, planeFloor_4Way; //planeCeiling_1Way, planeFloor_1Way;
+    private GameObject cube, cubeCeiling1, cubeFloor1, cubeCeiling4, cubeFloor4, cameras, cameraCeiling, cameraFloor;

     private Vector3 prePos;
     private Transform OVRCamRig, OVRPlayer;
@@ -224,47 +224,76 @@
             renderTexturesFloor[i].Create();
         }
         cube = new GameObject();
-        cubeCeiling = new GameObject();
-        cubeFloor = new GameObject();
-
-
-        planes = new GameObject[8];
-        planeCeiling = new GameObject[8];
-        planeFloor = new GameObject[8];
+        //cubeCeiling1 = new GameObject();
+        //cubeFloor1 = new GameObject();
+        cubeCeiling4 = new GameObject();
+        cubeFloor4 = new GameObject();
+
+        cube.transform.parent = transform;
+        //cubeCeiling1.transform.parent = transform;
+        //cubeFloor1.transform.parent = transform;
+        cubeCeiling4.transform.parent = transform;
+        cubeFloor4.transform.parent = transform;
+        cube.transform.localPosition = new Vector3(0, 0, 0);
+        //cubeCeiling1.transform.localPosition = new Vector3(0, 0, 0);
+        //cubeFloor1.transform.localPosition = new Vector3(0, 0, 0);
+        cubeCeiling4.transform.localPosition = new Vector3(0, 0, 0);
+        cubeFloor4.transform.localPosition = new Vector3(0, 0, 0);
+
+        cube.name = "Cube Walls";
+        //cubeCeiling1.name = "Cube Ceiling 1 Way Stereo";
+        //cubeFloor1.name = "Cube Floor 1 Way Stereo";
+        cubeCeiling4.name = "Cube Ceiling 4 Way Stereo";
+        cubeFloor4.name = "Cube Floor 4 Way Stereo";
+
+        planes = new GameObject[12];
+        planeCeiling_4Way = new GameObject[8];
+        planeFloor_4Way = new GameObject[8];
+        //planeCeiling_1Way = new GameObject[8];
+        //planeFloor_1Way = new GameObject[8];
         int k = 0;
-        for (int i = 0; i < planes.Length; i++)
+        for (int i = 0; i < 8; i++)
         {
             if (k == 2 || k == 8)
                 k += 2;
             planes[i] = GameObject.CreatePrimitive(PrimitiveType.Plane);
-            planes[i].transform.parent = transform;
+            planes[i].transform.parent = cube.transform;
             planes[i].transform.localScale = new Vector3(focal_length / 5, 1, focal_length / 5);

-            planeCeiling[i] = new GameObject();
-            planeCeiling[i].transform.parent = transform;
-            planeCeiling[i].transform.localScale = new Vector3(focal_length / 10, 1, focal_length / 10);
-            planeCeiling[i].AddComponent<MeshFilter>();
-            planeCeiling[i].AddComponent<MeshRenderer>();
-
-            planeFloor[i] = new GameObject();
-            planeFloor[i].transform.parent = transform;
-            planeFloor[i].transform.localScale = new Vector3(focal_length / 10, 1, focal_length / 10);
-            planeFloor[i].AddComponent<MeshFilter>();
-            planeFloor[i].AddComponent<MeshRenderer>();
-
-            Mesh mesh = planeCeiling[i].GetComponent<MeshFilter>().mesh;
+            /*
+            planeCeiling_1Way[i] = GameObject.CreatePrimitive(PrimitiveType.Plane);
+            planeCeiling_1Way[i].transform.parent = cubeCeiling1.transform;
+            planeCeiling_1Way[i].transform.localScale = new Vector3(focal_length / 5, 1, focal_length / 5);
+
+            planeFloor_1Way[i] = GameObject.CreatePrimitive(PrimitiveType.Plane);
+            planeFloor_1Way[i].transform.parent = cubeFloor1.transform;
+            planeFloor_1Way[i].transform.localScale = new Vector3(focal_length / 5, 1, focal_length / 5);
+            */
+            planeCeiling_4Way[i] = new GameObject();
+            planeCeiling_4Way[i].transform.parent = cubeCeiling4.transform;
+            planeCeiling_4Way[i].transform.localScale = new Vector3(focal_length / 10, 1, focal_length / 10);
+            planeCeiling_4Way[i].AddComponent<MeshFilter>();
+            planeCeiling_4Way[i].AddComponent<MeshRenderer>();
+
+            planeFloor_4Way[i] = new GameObject();
+            planeFloor_4Way[i].transform.parent = cubeFloor4.transform;
+            planeFloor_4Way[i].transform.localScale = new Vector3(focal_length / 10, 1, focal_length / 10);
+            planeFloor_4Way[i].AddComponent<MeshFilter>();
+            planeFloor_4Way[i].AddComponent<MeshRenderer>();
+
+            Mesh mesh = planeCeiling_4Way[i].GetComponent<MeshFilter>().mesh;
             mesh.Clear();
             mesh.vertices = ceilingVertices[i];
             mesh.uv = ceilingUV[i];
             mesh.triangles = ceilingTriangles[i];

-            mesh = planeFloor[i].GetComponent<MeshFilter>().mesh;
+            mesh = planeFloor_4Way[i].GetComponent<MeshFilter>().mesh;
             mesh.Clear();
             mesh.vertices = floorVertices[i];
             mesh.uv = floorUV[i];
             mesh.triangles = floorTriangles[i];
-
-            Renderer[] r = new Renderer[]{ planes[i].GetComponent<Renderer>(),planeCeiling[i].GetComponent<Renderer>(),planeFloor[i].GetComponent<Renderer>()};
+
+            Renderer[] r = new Renderer[] { planes[i].GetComponent<Renderer>(), planeCeiling_4Way[i].GetComponent<Renderer>(), planeFloor_4Way[i].GetComponent<Renderer>()};//, planeCeiling_1Way[i].GetComponent<Renderer>(), planeFloor_1Way[i].GetComponent<Renderer>() };
             for (int j = 0; j < r.Length; j++) {
                 r[j].shadowCastingMode = ShadowCastingMode.Off;
                 r[j].receiveShadows = false;
@@ -276,34 +305,82 @@
             r[0].material.mainTexture = renderTextures[k];
             r[1].material.mainTexture = renderTexturesCeiling[i];
             r[2].material.mainTexture = renderTexturesFloor[i];
+            //r[3].material.mainTexture = renderTexturesCeiling[i];
+            //r[4].material.mainTexture = renderTexturesFloor[i];

             if (i < 4)
             {
                 planes[i].layer = leftLayer;
-                planeCeiling[i].layer = leftLayer;
-                planeFloor[i].layer = leftLayer;
+                planeCeiling_4Way[i].layer = leftLayer;
+                planeFloor_4Way[i].layer = leftLayer;
+            //    planeCeiling_1Way[i].layer = leftLayer;
+            //    planeFloor_1Way[i].layer = leftLayer;
             }
             else {
                 planes[i].layer = rightLayer;
-                planeCeiling[i].layer = rightLayer;
-                planeFloor[i].layer = rightLayer;
+                planeCeiling_4Way[i].layer = rightLayer;
+                planeFloor_4Way[i].layer = rightLayer;
+            //    planeCeiling_1Way[i].layer = rightLayer;
+            //    planeFloor_1Way[i].layer = rightLayer;
             }

             planes[i].name = cubemapFaceNames[k];
             planes[i].transform.localPosition = cubemapFacePositions[i];
             planes[i].transform.eulerAngles = cubemapFaceRotations[i];

-            planeCeiling[i].name = cubemapCeilingFaceNames[i];
-            planeCeiling[i].transform.localPosition = new Vector3(0, focal_length,0) ;
-            planeCeiling[i].transform.eulerAngles =new Vector3(0, 180, 180);
-
-            planeFloor[i].name = cubemapFloorFaceNames[i];
-            planeFloor[i].transform.localPosition = new Vector3(0,-focal_length, 0);
-            planeFloor[i].transform.eulerAngles = new Vector3(0, 0, 0);
-
+            planeCeiling_4Way[i].name = cubemapCeilingFaceNames[i];
+            planeCeiling_4Way[i].transform.localPosition = new Vector3(0, focal_length,0) ;
+            planeCeiling_4Way[i].transform.eulerAngles =new Vector3(0, 180, 180);
+
+            planeFloor_4Way[i].name = cubemapFloorFaceNames[i];
+            planeFloor_4Way[i].transform.localPosition = new Vector3(0,-focal_length, 0);
+            planeFloor_4Way[i].transform.eulerAngles = new Vector3(0, 0, 0);
+            /*
+            planeCeiling_1Way[i].name = cubemapCeilingFaceNames[i];
+            planeCeiling_1Way[i].transform.localPosition = new Vector3(0, focal_length, 0);
+            planeCeiling_1Way[i].transform.eulerAngles = new Vector3(0, 180, 180);
+
+            planeFloor_1Way[i].name = cubemapFloorFaceNames[i];
+            planeFloor_1Way[i].transform.localPosition = new Vector3(0, -focal_length, 0);
+            planeFloor_1Way[i].transform.eulerAngles = new Vector3(0, 0, 0);
+            */
             k++;
         }
-
+        k = 2;
+        for (int i = 8; i < 12; i++) {
+            if (k == 4)
+                k =8;
+            planes[i] = GameObject.CreatePrimitive(PrimitiveType.Plane);
+            planes[i].transform.parent = cube.transform;
+            planes[i].transform.localScale = new Vector3(focal_length / 5, 1, focal_length / 5);
+
+            Renderer r = planes[i].GetComponent<Renderer>();
+            r.shadowCastingMode = ShadowCastingMode.Off;
+            r.receiveShadows = false;
+            r.useLightProbes = false;
+            r.reflectionProbeUsage = ReflectionProbeUsage.Off;
+            r.material.shader = Shader.Find("Unlit/Texture");
+            r.material.mainTexture = renderTextures[k];
+
+            if (i < 10)
+                planes[i].layer = leftLayer;
+            else
+                planes[i].layer = rightLayer;
+
+            planes[i].name = cubemapFaceNames[k];
+
+            if (i % 2 == 0)
+            {
+                planes[i].transform.localPosition = new Vector3(0, focal_length, 0);
+                planes[i].transform.eulerAngles = new Vector3(0, 0, 180);
+            }
+            else {
+                planes[i].transform.localPosition = new Vector3(0, -focal_length, 0);
+                planes[i].transform.eulerAngles = new Vector3(0, 180, 0);
+            }
+
+            k++;
+        }

     }
@@ -535,20 +612,206 @@

     }
-
+    void enablePlanes(bool enable) {
+        cube.SetActive(enable);
+        //cubeCeiling1.SetActive(enable);
+        //cubeFloor1.SetActive(enable);
+        if (enable || option != Ceiling_Floor_StereoOption.All)
+        {
+            cubeCeiling4.SetActive(enable);
+            cubeFloor4.SetActive(enable);
+        }
+        else {
+            cubeCeiling4.SetActive(true);
+            cubeFloor4.SetActive(true);
+        }
+        if(enable)
+            Plane_CameraSetUp();
+    }
+    void OneWayStereoPlaneCameraSetUp(int side) {
+        CameraL[2].SetActive(false); CameraR[2].SetActive(false);
+        CameraL[3].SetActive(false); CameraR[3].SetActive(false);
+
+        for (int i = 0; i < CameraCL.Length; i++)
+        {
+            CameraCL[i].SetActive(false);
+            CameraCR[i].SetActive(false);
+            CameraFL[i].SetActive(false);
+            CameraFR[i].SetActive(false);
+        }
+
+        CameraCL[side].SetActive(true);
+        CameraCR[side].SetActive(true);
+        CameraFL[side].SetActive(true);
+        CameraFR[side].SetActive(true);
+
+        if (disablePlanes)
+        {
+            enablePlanes(false);
+            return;
+        }
+
+        for (int i = 0; i < 8; i++)
+        {
+            //planeCeiling_1Way[i].SetActive(false);
+            //planeFloor_1Way[i].SetActive(false);
+            planeCeiling_4Way[i].SetActive(false);
+            planeFloor_4Way[i].SetActive(false);
+
+        }
+
+        for (int i = 8; i < 12; i++)
+        {
+            planes[i].SetActive(true);
+            if (i % 2 == 0)
+                planes[i].GetComponent<Renderer>().material.mainTexture = renderTexturesCeiling[side];
+            else
+            {
+                planes[i].GetComponent<Renderer>().material.mainTexture = renderTexturesFloor[side];
+                side += 4;
+            }
+
+        }
+
+    }
+    void Plane_CameraSetUp() {
+        switch(option){
+            case Ceiling_Floor_StereoOption.None:
+                CameraL[2].SetActive(true);    CameraR[2].SetActive(true);
+                CameraL[3].SetActive(true);    CameraR[3].SetActive(true);
+
+                CameraL[2].GetComponent<Camera>().cullingMask= ~((1 << leftLayer) | (1 << rightLayer));
+                CameraR[2].GetComponent<Camera>().cullingMask = ~((1 << leftLayer) | (1 << rightLayer));
+                CameraL[3].GetComponent<Camera>().cullingMask= ~((1 << leftLayer) | (1 << rightLayer));
+                CameraR[3].GetComponent<Camera>().cullingMask = ~((1 << leftLayer) | (1 << rightLayer));
+
+                for (int i = 0; i < CameraCL.Length; i++)
+                {
+                    CameraCL[i].SetActive(false);
+                    CameraCR[i].SetActive(false);
+                    CameraFL[i].SetActive(false);
+                    CameraFR[i].SetActive(false);
+                }
+
+                if (disablePlanes)
+                {
+                    enablePlanes(false);
+                    break;
+                }
+
+                for (int i = 0; i < 8; i++)
+                {
+                    //planeCeiling_1Way[i].SetActive(false);
+                    //planeFloor_1Way[i].SetActive(false);
+                    planeCeiling_4Way[i].SetActive(false);
+                    planeFloor_4Way[i].SetActive(false);
+
+                }
+
+                for (int i = 8; i < 12; i++)
+                    planes[i].SetActive(true);
+
+                break;
+            case Ceiling_Floor_StereoOption.PositiveX:
+                OneWayStereoPlaneCameraSetUp(0);
+                break;
+            case Ceiling_Floor_StereoOption.NegativeX:
+                OneWayStereoPlaneCameraSetUp(1);
+                break;
+            case Ceiling_Floor_StereoOption.PositiveZ:
+                OneWayStereoPlaneCameraSetUp(2);
+                break;
+            case Ceiling_Floor_StereoOption.NegativeZ:
+                OneWayStereoPlaneCameraSetUp(3);
+                break;
+            case Ceiling_Floor_StereoOption.All:
+                CameraL[2].SetActive(true);    CameraR[2].SetActive(true);
+                CameraL[3].SetActive(true);    CameraR[3].SetActive(true);
+
+                CameraL[2].GetComponent<Camera>().cullingMask = 1 << leftLayer;
+                CameraR[2].GetComponent<Camera>().cullingMask = 1 << rightLayer;
+                CameraL[3].GetComponent<Camera>().cullingMask = 1 << leftLayer;
+                CameraR[3].GetComponent<Camera>().cullingMask = 1 << rightLayer;
+
+                for (int i = 0; i < CameraCL.Length; i++)
+                {
+                    CameraCL[i].SetActive(true);
+                    CameraCR[i].SetActive(true);
+                    CameraFL[i].SetActive(true);
+                    CameraFR[i].SetActive(true);
+                }
+
+                if (disablePlanes)
+                {
+                    enablePlanes(false);
+                    break;
+                }
+
+                for (int i = 0; i < 8; i++)
+                {
+                    //planeCeiling_1Way[i].SetActive(false);
+                    //planeFloor_1Way[i].SetActive(false);
+                    planeCeiling_4Way[i].SetActive(true);
+                    planeFloor_4Way[i].SetActive(true);
+
+                }
+                for (int i = 8; i < 12; i++)
+                    planes[i].SetActive(false);
+
+                break;
+
+        }
+    }
+    System.IntPtr[] OneWayStereoExtractionSetUp(int side) {
+        System.IntPtr[] texturePtrs = new System.IntPtr[faceCount];
+        for (int i = 0; i < Math.Min(faceCount, 12); i++)
+        {
+            if (i != 2 || i != 3 || i != 8 || i != 9)
+                texturePtrs[i] = renderTextures[i].GetNativeTexturePtr();
+        }
+
+        texturePtrs[2] = renderTexturesCeiling[side].GetNativeTexturePtr();
+        texturePtrs[3] = renderTexturesCeiling[side].GetNativeTexturePtr();
+        texturePtrs[8] = renderTexturesCeiling[side+4].GetNativeTexturePtr();
+        texturePtrs[9] = renderTexturesCeiling[side+4].GetNativeTexturePtr();
+
+        return texturePtrs;
+    }
+    System.IntPtr[] ExtractionSetUp() {
+        System.IntPtr[] texturePtrs = new System.IntPtr[faceCount];
+        switch (option) {
+            case Ceiling_Floor_StereoOption.None:
+            case Ceiling_Floor_StereoOption.All:
+                for (int i = 0; i < Math.Min(faceCount, 12); i++)
+                {
+                    texturePtrs[i] = renderTextures[i].GetNativeTexturePtr();
+                }
+                break;
+            case Ceiling_Floor_StereoOption.PositiveX:
+                return OneWayStereoExtractionSetUp(0);
+            case Ceiling_Floor_StereoOption.NegativeX:
+                return OneWayStereoExtractionSetUp(1);
+            case Ceiling_Floor_StereoOption.PositiveZ:
+                return OneWayStereoExtractionSetUp(2);
+            case Ceiling_Floor_StereoOption.NegativeZ:
+                return OneWayStereoExtractionSetUp(3);
+        }
+
+        return texturePtrs;
+    }
     IEnumerator Start()
     {
         PlaneInit();
         CameraInit();
-
-        System.IntPtr[] texturePtrs = new System.IntPtr[faceCount];
-
-        for (int i = 0; i < Math.Min(faceCount,12); i++)
+
+        Plane_CameraSetUp();
+
+        /*System.IntPtr[] texturePtrs = new System.IntPtr[faceCount];
+        for (int i = 0; i < Math.Min(faceCount, 12); i++)
         {
             texturePtrs[i] = renderTextures[i].GetNativeTexturePtr();
         }
-
-
+        */System.IntPtr[] texturePtrs=ExtractionSetUp();

         // Tell native plugin that rendering has started
@@ -591,6 +854,12 @@
         {
             angleY = getAngle();
             transform.Translate(new Vector3(-Mathf.Sin(angleY), 0, -Mathf.Cos(angleY)) * moveSpeed);//*Time.deltaTime);
+        }
+        if (Input.GetKey(KeyCode.U)) {
+            transform.Translate(new Vector3(0, 1, 0) * moveSpeed);//*Time.deltaTime);
+        }
+        if (Input.GetKey(KeyCode.O)) {
+            transform.Translate(new Vector3(0, -1, 0) * moveSpeed);//*Time.deltaTime);
         }
     }

@@ -611,11 +880,11 @@
     {
         if (printFPS)
             print(1.0f / Time.deltaTime);
-        if (preFOVAdjustValue != fovAdjustValue)
+        /*if (preFOVAdjustValue != fovAdjustValue)
         {
             CameraProjectionInit();
             preFOVAdjustValue = fovAdjustValue;
-        }
+        }*/

     }


Remove unused variable

Remove unused variable

--- ValveKeyValue/ValveKeyValue/KVTextReader.cs
+++ ValveKeyValue/ValveKeyValue/KVTextReader.cs
@@ -1,5 +1,4 @@
 using System;
-using System.Collections.Generic;
 using System.Globalization;
 using System.IO;

@@ -13,12 +12,10 @@

             tokenReader = new KVTokenReader(stream);
             stateMachine = new KVTextReaderStateMachine();
-            objects = new List<KVObject>();
         }

         readonly KVTokenReader tokenReader;
         readonly KVTextReaderStateMachine stateMachine;
-        readonly IList<KVObject> objects;
         bool disposed;

         public KVObject ReadObject()


Add R32G32B32A32_FLOAT

Add R32G32B32A32_FLOAT

--- ValveResourceFormat/Resource/Blocks/VBIB.cs
+++ ValveResourceFormat/Resource/Blocks/VBIB.cs
@@ -160,6 +160,13 @@
                     break;
                 }

+                case DXGI_FORMAT.R32G32B32A32_FLOAT:
+                {
+                    result = new float[4];
+                    Buffer.BlockCopy(vertexBuffer.Buffer, offset, result, 0, 16);
+                    break;
+                }
+
                 case DXGI_FORMAT.R16G16_UNORM:
                 {
                     var shorts = new ushort[2];


Added test to demonstrate problem.

Added test to demonstrate problem.

--- tests/Perspex.Markup.Xaml.UnitTests/Xaml/BindingTests.cs
+++ tests/Perspex.Markup.Xaml.UnitTests/Xaml/BindingTests.cs
@@ -9,6 +9,52 @@
 {
     public class BindingTests
     {
+        [Fact]
+        public void Binding_To_DataContext_Works()
+        {
+            using (UnitTestApplication.Start(TestServices.StyledWindow))
+            {
+                var xaml = @"
+<Window xmlns='https://github.com/perspex'
+             xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
+             xmlns:local='clr-namespace:Perspex.Markup.Xaml.UnitTests.Xaml;assembly=Perspex.Markup.Xaml.UnitTests'>
+    <Button Name='button' Content='{Binding Foo}'/>
+</Window>";
+                var loader = new PerspexXamlLoader();
+                var window = (Window)loader.Load(xaml);
+                var button = window.FindControl<Button>("button");
+
+                button.DataContext = new { Foo = "foo" };
+
+                Assert.Equal("foo", button.Content);
+            }
+        }
+
+        [Fact]
+        public void Longhand_Binding_To_DataContext_Works()
+        {
+            using (UnitTestApplication.Start(TestServices.StyledWindow))
+            {
+                var xaml = @"
+<Window xmlns='https://github.com/perspex'
+             xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
+             xmlns:local='clr-namespace:Perspex.Markup.Xaml.UnitTests.Xaml;assembly=Perspex.Markup.Xaml.UnitTests'>
+    <Button Name='button'>
+        <Button.Content>
+            <Binding Path='Foo'/>
+        </Button.Content>
+    </Button>
+</Window>";
+                var loader = new PerspexXamlLoader();
+                var window = (Window)loader.Load(xaml);
+                var button = window.FindControl<Button>("button");
+
+                button.DataContext = new { Foo = "foo" };
+
+                Assert.Equal("foo", button.Content);
+            }
+        }
+
         [Fact]
         public void Can_Bind_Control_To_Non_Control()
         {


Another comment on github.com

Another comment on github.com

--- Meiot.Library/Class1.cs
+++ Meiot.Library/Class1.cs
@@ -14,6 +14,8 @@
         {
             //Adding this comment on github.com
             someDataSet = new DataSet();
+
+            // Adding another comment on github.com
         }
     }
 }