Refactored Heros Update routine.

Refactored Heros Update routine.

--- Some2DRPG/Some2DRPG/GameObjects/Hero.cs
+++ Some2DRPG/Some2DRPG/GameObjects/Hero.cs
@@ -1,7 +1,6 @@
 using System;
 using System.Collections.Generic;
 using GameEngine;
-using GameEngine.Drawing;
 using GameEngine.GameObjects;
 using GameEngine.Tiled;
 using Microsoft.Xna.Framework;
@@ -16,7 +15,6 @@
     {
         const int INPUT_DELAY = 0;
         const float MOVEMENT_SPEED = 2.9f;
-        double PrevGameTime = 0;

         public bool CollisionDetection { get; set; }

@@ -76,34 +74,28 @@
         {
             KeyboardState keyboardState = Keyboard.GetState();

+            Vector2 movement = Vector2.Zero;
             float prevX = Pos.X;
             float prevY = Pos.Y;

             Tile prevTile = Engine.Map.GetPxTopMostTile(Pos.X, Pos.Y);
             float moveSpeedModifier = prevTile.GetProperty<float>("MoveSpeed", 1.0f);

-            if (gameTime.TotalGameTime.TotalMilliseconds - PrevGameTime > INPUT_DELAY)
-            {
-                bool moved = false;
-                Vector2 movement = Vector2.Zero;
-
-                // ATTACK KEY.
-                if (keyboardState.IsKeyDown(Keys.A))
-                {
-                    bool reset = !CurrentDrawableState.StartsWith("Slash");
-
-                    CurrentDrawableState = "Slash_" + Direction;
-                    moved = true;
-
-                    if (reset) Drawables.ResetState(CurrentDrawableState, gameTime);
-                }
-
+            // ATTACK KEY.
+            if (keyboardState.IsKeyDown(Keys.A))
+            {
+                bool reset = !CurrentDrawableState.StartsWith("Slash");
+                CurrentDrawableState = "Slash_" + Direction;
+
+                if (reset) Drawables.ResetState(CurrentDrawableState, gameTime);
+            }
+            else
+            {
                 // MOVEMENT BASED KEYBOARD EVENTS.
                 if (keyboardState.IsKeyDown(Keys.Up))
                 {
                     CurrentDrawableState = "Walk_Up";
                     Direction = Direction.Up;
-                    moved = true;

                     movement.Y--;
                 }
@@ -111,7 +103,6 @@
                 {
                     CurrentDrawableState = "Walk_Down";
                     Direction = Direction.Down;
-                    moved = true;

                     movement.Y++;
                 }
@@ -119,7 +110,6 @@
                 {
                     CurrentDrawableState = "Walk_Left";
                     Direction = Direction.Left;
-                    moved = true;

                     movement.X--;
                 }
@@ -127,115 +117,104 @@
                 {
                     CurrentDrawableState = "Walk_Right";
                     Direction = Direction.Right;
-                    moved = true;

                     movement.X++;
                 }

                 // Set animation to idle of no movements where made.
-                if (moved == false)
+                if (movement.Length() == 0)
                     CurrentDrawableState = "Idle_" + Direction;
                 else
                 {
-                    PrevGameTime = gameTime.TotalGameTime.TotalMilliseconds;
                     movement.Normalize();
                     Pos += movement * MOVEMENT_SPEED * moveSpeedModifier;
                 }
-
-                // Prevent from going out of range.
-                if (Pos.X < 0) Pos.X = 0;
-                if (Pos.Y < 0) Pos.Y = 0;
-                if (Pos.X >= Engine.Map.pxWidth - 1) Pos.X = Engine.Map.pxWidth - 1;
-                if (Pos.Y >= Engine.Map.pxHeight - 1) Pos.Y = Engine.Map.pxHeight - 1;
-
-                if (CollisionDetection)
-                {
-                    // Iterate through each layer and determine if the tile is passable.
-                    int tileX = (int) Pos.X / Engine.Map.TileWidth;
-                    int tileY = (int) Pos.Y / Engine.Map.TileHeight;
-
-                    int pxTileX = tileX * Engine.Map.TileWidth;
-                    int pxTileY = tileY * Engine.Map.TileHeight;
-                    int pxTileWidth = Engine.Map.TileWidth;
-                    int pxTileHeight = Engine.Map.TileHeight;
-
-                    Tile currentTile = Engine.Map.GetPxTopMostTile(Pos.X, Pos.Y);
-                    bool impassable = currentTile.HasProperty("Impassable");
-
-                    // CORRECT ENTRY AND EXIT MOVEMENT BASED ON TILE PROPERTIES
-                    // TODO
-                    // to improve structure
-                    // Current very very ineffecient way of checking Entry
-                    string[] entryPoints = currentTile.GetProperty("Entry", "Top Bottom Left Right").Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
-                    string[] exitPoints = prevTile.GetProperty("Entry", "Top Bottom Left Right").Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
-
-                    bool top = prevY < pxTileY;
-                    bool bottom = prevY > pxTileY + pxTileHeight;
-                    bool left = prevX < pxTileX;
-                    bool right = prevX > pxTileX + pxTileWidth;
-
-                    // Ensure entry points.
-                    impassable |= top && !ContainsItem(entryPoints, "Top");
-                    impassable |= bottom && !ContainsItem(entryPoints, "Bottom");
-                    impassable |= left && !ContainsItem(entryPoints, "Left");
-                    impassable |= right && !ContainsItem(entryPoints, "Right");
-
-                    // Ensure exit points.
-                    impassable |= top && !ContainsItem(exitPoints, "Bottom");
-                    impassable |= bottom && !ContainsItem(exitPoints, "Top");
-                    impassable |= left && !ContainsItem(exitPoints, "Right");
-                    impassable |= right && !ContainsItem(exitPoints, "Left");
-
-                    // IF THE MOVEMENT WAS DEEMED IMPASSABLE, CORRECT IT.
-                    // if impassable, adjust X and Y accordingly.
-                    float padding = 0.001f;
-                    if (impassable)
+            }
+
+            // Prevent from going out of range.
+            if (Pos.X < 0) Pos.X = 0;
+            if (Pos.Y < 0) Pos.Y = 0;
+            if (Pos.X >= Engine.Map.pxWidth - 1) Pos.X = Engine.Map.pxWidth - 1;
+            if (Pos.Y >= Engine.Map.pxHeight - 1) Pos.Y = Engine.Map.pxHeight - 1;
+
+            if (CollisionDetection)
+            {
+                // Iterate through each layer and determine if the tile is passable.
+                int tileX = (int) Pos.X / Engine.Map.TileWidth;
+                int tileY = (int) Pos.Y / Engine.Map.TileHeight;
+
+                int pxTileX = tileX * Engine.Map.TileWidth;
+                int pxTileY = tileY * Engine.Map.TileHeight;
+                int pxTileWidth = Engine.Map.TileWidth;
+                int pxTileHeight = Engine.Map.TileHeight;
+
+                Tile currentTile = Engine.Map.GetPxTopMostTile(Pos.X, Pos.Y);
+                bool impassable = currentTile.HasProperty("Impassable");
+
+                // CORRECT ENTRY AND EXIT MOVEMENT BASED ON TILE PROPERTIES
+                // TODO
+                // to improve structure
+                // Current very very ineffecient way of checking Entry
+                string[] entryPoints = currentTile.GetProperty("Entry", "Top Bottom Left Right").Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
+                string[] exitPoints = prevTile.GetProperty("Entry", "Top Bottom Left Right").Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
+
+                bool top = prevY < pxTileY;
+                bool bottom = prevY > pxTileY + pxTileHeight;
+                bool left = prevX < pxTileX;
+                bool right = prevX > pxTileX + pxTileWidth;
+
+                // Ensure entry points.
+                impassable |= top && !ContainsItem(entryPoints, "Top");
+                impassable |= bottom && !ContainsItem(entryPoints, "Bottom");
+                impassable |= left && !ContainsItem(entryPoints, "Left");
+                impassable |= right && !ContainsItem(entryPoints, "Right");
+
+                // Ensure exit points.
+                impassable |= top && !ContainsItem(exitPoints, "Bottom");
+                impassable |= bottom && !ContainsItem(exitPoints, "Top");
+                impassable |= left && !ContainsItem(exitPoints, "Right");
+                impassable |= right && !ContainsItem(exitPoints, "Left");
+
+                // IF THE MOVEMENT WAS DEEMED IMPASSABLE, CORRECT IT.
+                // if impassable, adjust X and Y accordingly.
+                float padding = 0.001f;
+                if (impassable)
+                {
+                    if (prevY <= pxTileY && Pos.Y > pxTileY)
+                        Pos.Y = pxTileY - padding;
+                    else
+                        if (prevY >= pxTileY + pxTileHeight && Pos.Y < pxTileY + pxTileHeight)
+                            Pos.Y = pxTileY + pxTileHeight + padding;
+
+                    if (prevX <= pxTileX && Pos.X > pxTileX)
+                        Pos.X = pxTileX - padding;
+                    else
+                        if (prevX >= pxTileX + pxTileWidth && Pos.X < pxTileX + pxTileWidth)
+                            Pos.X = pxTileX + pxTileWidth + padding;
+                }
+            }
+
+            // Change the radius of the LightSource overtime using a SINE wave pattern.
+            LightSource.PX = Pos.X;
+            LightSource.PY = Pos.Y;
+            LightSource.RadiusX = (float)(32 * (8.0f + 0.5 * Math.Sin(gameTime.TotalGameTime.TotalSeconds * 3)));
+            LightSource.RadiusY = (float)(32 * (8.0f + 0.5 * Math.Sin(gameTime.TotalGameTime.TotalSeconds * 3)));
+
+            prevIntersectingEntities = Engine.QuadTree.GetIntersectingEntites(this.CurrentBoundingBox);
+            foreach (Entity entity in prevIntersectingEntities)
+            {
+                // TODO: Should be more general than just a Bat.
+                // In the future it should be something along the lines of if NPC.IsEnemy()
+                if (entity is Bat)
+                {
+                    if (CurrentDrawableState.Contains("Slash") &&
+                        Entity.IntersectsWith(this, "Weapon", entity, "Body", gameTime))
                     {
-                        if (prevY <= pxTileY && Pos.Y > pxTileY)
-                            Pos.Y = pxTileY - padding;
-                        else
-                            if (prevY >= pxTileY + pxTileHeight && Pos.Y < pxTileY + pxTileHeight)
-                                Pos.Y = pxTileY + pxTileHeight + padding;
-
-                        if (prevX <= pxTileX && Pos.X > pxTileX)
-                            Pos.X = pxTileX - padding;
-                        else
-                            if (prevX >= pxTileX + pxTileWidth && Pos.X < pxTileX + pxTileWidth)
-                                Pos.X = pxTileX + pxTileWidth + padding;
+                        Bat bat = (Bat)entity;
+                        bat.HP -= 10;
                     }
                 }
-
-                // Change the radius of the LightSource overtime using a SINE wave pattern.
-                LightSource.PX = Pos.X;
-                LightSource.PY = Pos.Y;
-                LightSource.RadiusX = (float)(32 * (8.0f + 0.5 * Math.Sin(gameTime.TotalGameTime.TotalSeconds * 3)));
-                LightSource.RadiusY = (float)(32 * (8.0f + 0.5 * Math.Sin(gameTime.TotalGameTime.TotalSeconds * 3)));
-
-                // EXAMPLE OF HOW THE QUAD TREE INTERSECTING ENTITIES FUNCTION CAN WORK
-                // TODO: Add PER PIXEL collision detection to each one of these entities
-                //if (prevIntersectingEntities != null)
-                //    foreach (Entity entity in prevIntersectingEntities)
-                //        entity.Opacity = 1.0f;
-
-                prevIntersectingEntities = Engine.QuadTree.GetIntersectingEntites(this.CurrentBoundingBox);
-                foreach (Entity entity in prevIntersectingEntities)
-                {
-                    if (entity is Bat)
-                    {
-                        if (CurrentDrawableState.Contains("Slash") &&
-                            Entity.IntersectsWith(this, "Weapon", entity, "Body", gameTime))
-                        {
-                            Bat bat = (Bat)entity;
-                            bat.HP -= 10;
-                        }
-                    }
-                    //else
-                    //if ( entity!= this &&
-                    //     entity.CurrentBoundingBox.Intersects(CurrentBoundingBox) &&
-                    //     entity.Pos.Y > this.Pos.Y )
-                    //    entity.Opacity = 0.8f;
-                }
-            }
+            }
         }
     }
 }


edit start page copy

edit start page copy

--- src/Sir.HttpServer/Views/Home/Index.cshtml
+++ src/Sir.HttpServer/Views/Home/Index.cshtml
@@ -7,7 +7,7 @@
     var millionDocs = ViewBag.DocumentCount == null ? 0 : (double)ViewBag.DocumentCount / 1000000;
 }

-    Indices were built from analyzing ~@progress.ToString("0.##")% of Common Crawl's December 2019 crawl (~@millionDocs.ToString("0.##")M documents),
+    Hi beta tester, indices were built from analyzing ~@progress.ToString("0.##")% of Common Crawl's December 2019 crawl (~@millionDocs.ToString("0.##")M documents),
     here are some instructions that you don't have to read,
     let us know if anything breaks,
     and good luck!


Add documentation for trakt client implementation.

--- Source/Lib/TraktApiSharp/TraktClient.cs
+++ Source/Lib/TraktApiSharp/TraktClient.cs
@@ -8,6 +8,13 @@
     using Core;
     using Modules;

+    /// <summary>
+    /// A Trakt client, which provides access to all functionality of this library.
+    /// </summary>
+    /// <remarks>
+    /// The client provides the only access to all of its library modules.
+    /// You can instantiate multiple clients.
+    /// </remarks>
     public class TraktClient
     {
         private TraktConfiguration _configuration;
@@ -37,134 +44,235 @@
             DeviceAuth = new TraktDeviceAuth(this);
         }

+        /// <summary>
+        /// Instantiates a new TraktClient and initializes all of its modules.
+        /// </summary>
+        /// <param name="clientId">The Trakt client id. <seealso cref="ClientId" /></param>
         public TraktClient(string clientId) : this()
         {
             ClientId = clientId;
         }

+        /// <summary>
+        /// Instantiates a new TraktClient and initializes all of its modules.
+        /// </summary>
+        /// <param name="clientId">The Trakt client id. <seealso cref="ClientId" /></param>
+        /// <param name="clientSecret">The Trakt client secret. <seealso cref="ClientSecret" /></param>
         public TraktClient(string clientId, string clientSecret) : this(clientId)
         {
             ClientSecret = clientSecret;
         }

+        /// <summary>
+        /// Gets or sets the Trakt client id. <seealso cref="ClientSecret" />
+        /// </summary>
         public string ClientId
         {
             get { return Authentication.ClientId; }
             set { Authentication.ClientId = value; }
         }

+        /// <summary>
+        /// Gets or sets the Trakt client secret. <seealso cref="ClientId" />
+        /// </summary>
         public string ClientSecret
         {
             get { return Authentication.ClientSecret; }
             set { Authentication.ClientSecret = value; }
         }

+        /// <summary>
+        /// Returns, whether the client is valid to use for API requests, that do not require OAuth authentication.
+        /// </summary>
+        /// <remarks>
+        /// To enable this behavior, you must set a valid Trakt client id.
+        /// </remarks>
+        /// <seealso cref="ClientId" />
         public bool IsValidForUseWithoutAuthorization => !string.IsNullOrEmpty(ClientId);

+        /// <summary>
+        /// Returns, whether the client is valid to use for API requests, that require OAuth authentication.
+        /// </summary>
+        /// <remarks>
+        /// To enable this behavior, you must set a valid Trakt client id and a valid Trakt client secret.
+        /// </remarks>
+        /// <seealso cref="ClientId" /> <seealso cref="ClientSecret" />
         public bool IsValid => !string.IsNullOrEmpty(ClientId) && !string.IsNullOrEmpty(ClientSecret);

+        /// <summary>
+        /// Provides access to the configuration settings for the <see cref="TraktClient" />.
+        /// <seealso cref="TraktConfiguration" />
+        /// </summary>
         public TraktConfiguration Configuration
         {
             get { return _configuration = _configuration ?? new TraktConfiguration(); }
             private set { _configuration = value; }
         }

+        /// <summary>
+        /// Provides access to the authentication module.
+        /// <seealso cref="TraktAuthentication" />
+        /// </summary>
         public TraktAuthentication Authentication
         {
             get { return _authentication = _authentication ?? new TraktAuthentication(this); }
             private set { _authentication = value; }
         }

+        /// <summary>
+        /// Provides access to the OAuth authentication module.
+        /// <seealso cref="TraktOAuth" />
+        /// </summary>
         public TraktOAuth OAuth
         {
             get { return _oauth = _oauth ?? new TraktOAuth(this); }
             private set { _oauth = value; }
         }

+        /// <summary>
+        /// Provides accesss to the Device authentication module.
+        /// <seealso cref="TraktDeviceAuth" />
+        /// </summary>
         public TraktDeviceAuth DeviceAuth
         {
             get { return _deviceAuth = _deviceAuth ?? new TraktDeviceAuth(this); }
             private set { _deviceAuth = value; }
         }

+        /// <summary>
+        /// Provides access to the shows module.
+        /// <seealso cref="TraktShowsModule" />
+        /// </summary>
         public TraktShowsModule Shows
         {
             get { return _shows = _shows ?? new TraktShowsModule(this); }
             private set { _shows = value; }
         }

+        /// <summary>
+        /// Provides access to the seasons module.
+        /// <seealso cref="TraktSeasonsModule" />
+        /// </summary>
         public TraktSeasonsModule Seasons
         {
             get { return _seasons = _seasons ?? new TraktSeasonsModule(this); }
             private set { _seasons = value; }
         }

+        /// <summary>
+        /// Provides access to the episodes module.
+        /// <seealso cref="TraktEpisodesModule" />
+        /// </summary>
         public TraktEpisodesModule Episodes
         {
             get { return _episodes = _episodes ?? new TraktEpisodesModule(this); }
             private set { _episodes = value; }
         }

+        /// <summary>
+        /// Provides access to the movies module.
+        /// <seealso cref="TraktMoviesModule" />
+        /// </summary>
         public TraktMoviesModule Movies
         {
             get { return _movies = _movies ?? new TraktMoviesModule(this); }
             private set { _movies = value; }
         }

+        /// <summary>
+        /// Provides access to the calendar module.
+        /// <seealso cref="TraktCalendarModule" />
+        /// </summary>
         public TraktCalendarModule Calendar
         {
             get { return _calendar = _calendar ?? new TraktCalendarModule(this); }
             private set { _calendar = value; }
         }

+        /// <summary>
+        /// Provides access to the commends module.
+        /// <seealso cref="TraktCommentsModule" />
+        /// </summary>
         public TraktCommentsModule Comments
         {
             get { return _comments = _comments ?? new TraktCommentsModule(this); }
             private set { _comments = value; }
         }

+        /// <summary>
+        /// Provides access to the people module.
+        /// <seealso cref="TraktPeopleModule" />
+        /// </summary>
         public TraktPeopleModule People
         {
             get { return _people = _people ?? new TraktPeopleModule(this); }
             private set { _people = value; }
         }

+        /// <summary>
+        /// Provides access to the genres module.
+        /// <seealso cref="TraktGenresModule" />
+        /// </summary>
         public TraktGenresModule Genres
         {
             get { return _genres = _genres ?? new TraktGenresModule(this); }
             private set { _genres = value; }
         }

+        /// <summary>
+        /// Provides access to the search module.
+        /// <seealso cref="TraktSearchModule" />
+        /// </summary>
         public TraktSearchModule Search
         {
             get { return _search = _search ?? new TraktSearchModule(this); }
             private set { _search = value; }
         }

+        /// <summary>
+        /// Provides access to the recommendations module.
+        /// <seealso cref="TraktRecommendationsModule" />
+        /// </summary>
         public TraktRecommendationsModule Recommendations
         {
             get { return _recommendations = _recommendations ?? new TraktRecommendationsModule(this); }
             private set { _recommendations = value; }
         }

+        /// <summary>
+        /// Provides access to the sync module.
+        /// <seealso cref="TraktSyncModule" />
+        /// </summary>
         public TraktSyncModule Sync
         {
             get { return _sync = _sync ?? new TraktSyncModule(this); }
             private set { _sync = value; }
         }

+        /// <summary>
+        /// Provides access to the users module.
+        /// <seealso cref="TraktUsersModule" />
+        /// </summary>
         public TraktUsersModule Users
         {
             get { return _users = _users ?? new TraktUsersModule(this); }
             private set { _users = value; }
         }

+        /// <summary>
+        /// Provides access to the checkins module.
+        /// <seealso cref="TraktCheckinsModule" />
+        /// </summary>
         public TraktCheckinsModule Checkins
         {
             get { return _checkins = _checkins ?? new TraktCheckinsModule(this); }
             private set { _checkins = value; }
         }

+        /// <summary>
+        /// Provides access to the scrobble module.
+        /// <seealso cref="TraktScrobbleModule" />
+        /// </summary>
         public TraktScrobbleModule Scrobble
         {
             get { return _scrobble = _scrobble ?? new TraktScrobbleModule(this); }


Fixed pinging and image with just a stream.

--- Source/Magick.NET/Shared/MagickImage.cs
+++ Source/Magick.NET/Shared/MagickImage.cs
@@ -4509,7 +4509,7 @@
         /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
         public void Ping(Stream stream)
         {
-            Read(stream, null);
+            Ping(stream, null);
         }

         /// <summary>


(GH-430) Fix missing Gallery link in details page

Initially, I thought the issue here was one where the information from
Chocolatey API didn't have everything that was needed compared to what
used to come from the oData feed, however, this wasn't the case.  In
the end, it was a mapper issue.  IPackage doesn't have a property
called GalleryDetailsUrl, but it does have one called ReportAbuseUrl.
That is why that one worked, but the other one didn't.  Adding an
additional map between DataServicePackage and Package is what was
needed to make all this work.  This concrete type has all the required
properties needed to display information in the UI.

--- Source/ChocolateyGui/Startup/ChocolateyGuiModule.cs
+++ Source/ChocolateyGui/Startup/ChocolateyGuiModule.cs
@@ -78,7 +78,9 @@
                 config.CreateMap<IPackageViewModel, IPackageViewModel>()
                     .ForMember(vm => vm.IsInstalled, options => options.Ignore());

+                config.CreateMap<DataServicePackage, Package>();
                 config.CreateMap<IPackage, Package>();
+
                 config.CreateMap<ConfigFileFeatureSetting, ChocolateyFeature>();
                 config.CreateMap<ConfigFileConfigSetting, ChocolateySetting>();
                 config.CreateMap<ConfigFileSourceSetting, Models.ChocolateySource>();


#485 Don't run old-style data portal tests that crash test runner

--- Source/Csla.test/DataPortal/AsynchDataPortalTest.cs
+++ Source/Csla.test/DataPortal/AsynchDataPortalTest.cs
@@ -92,7 +92,7 @@

       Csla.DataPortal.BeginCreate<Single>((o, e) =>
       {
-        var created = e.Object;
+        var created = e.Object;
         context.Assert.IsNotNull(created);
         context.Assert.AreEqual(created.Id, 0);//DP_Create without criteria called
         context.Assert.IsNull(e.Error);
@@ -185,7 +185,7 @@
     public void CreateAsync_WithException()
     {
       var lck = new AutoResetEvent(false);
-      new Action(async () =>
+      new Action(async () =>
       {
         try
         {
@@ -244,7 +244,7 @@
     public void BeginFetch_overload_with_Crieria_only_passed_Results_in_UserState_defaulted_to_Null_and_Id_set()
     {
       var context = GetContext();
-      Csla.DataPortal.BeginFetch<Single>(5,
+      Csla.DataPortal.BeginFetch<Single>(5,
         (o, e) =>
         {
           var fetched = e.Object;
@@ -278,7 +278,7 @@
     {
       var context = GetContext();
       object userState = "state";
-      Csla.DataPortal.BeginFetch<Single>(5,
+      Csla.DataPortal.BeginFetch<Single>(5,
         (o, e) =>
         {
           var fetched = e.Object;
@@ -288,7 +288,7 @@
           context.Assert.AreEqual(userState, e.UserState);
           context.Assert.AreEqual("Fetched", fetched.MethodCalled);
           context.Assert.Success();
-        },
+        },
         userState);
       context.Complete();
     }
@@ -350,6 +350,8 @@
 #endif

     #endregion
+
+#if DEBUG

     #region BeginSave

@@ -381,21 +383,23 @@
     public void BeginSave_must_call_OnSaved_when_object_is_child_and_throws_error()
     {
       var context = GetContext();
-      Csla.DataPortal.BeginCreate<SingleWithException>((o, e) =>
-      {
-        var test = e.Object;
-        test.SetAsChild();
-        context.Assert.IsNotNull(test);
-        context.Assert.AreEqual("Created", e.Object.MethodCalled);
-        test.Saved += ((o1, e1) =>
-        {
-          var error = e1.Error;
-          context.Assert.IsNotNull(error);
-          context.Assert.AreEqual(typeof(InvalidOperationException), error.GetType());
-          context.Assert.Success();
-        });
-        test.BeginSave();
-
+      context.Assert.Try(() =>
+      {
+        Csla.DataPortal.BeginCreate<SingleWithException>((o, e) =>
+        {
+          var test = e.Object;
+          test.SetAsChild();
+          context.Assert.IsNotNull(test);
+          context.Assert.AreEqual("Created", e.Object.MethodCalled);
+          test.Saved += ((o1, e1) =>
+          {
+            var error = e1.Error;
+            context.Assert.IsNotNull(error);
+            context.Assert.AreEqual(typeof(InvalidOperationException), error.GetType());
+            context.Assert.Success();
+          });
+          test.BeginSave();
+        });
       });
       context.Complete();
     }
@@ -718,49 +722,60 @@
 #endif

     [TestMethod]
-    public async Task SaveAsyncWithException()
-    {
-      var result = await Csla.DataPortal.CreateAsync<Single2>(555);
-      Assert.IsNotNull(result);
-      Assert.AreEqual(555, result.Id);
-      Assert.IsTrue(result.IsNew);
-      Assert.IsTrue(result.IsDirty);
-      var lck = new AutoResetEvent(false);
-      new Action(async () =>
-      {
-        try
-        {
-          result = await result.SaveAsync();
-          Assert.Fail("Expected exception not thrown");
-        }
-        catch (Exception ex)
-        {
-          Assert.IsInstanceOfType(ex, typeof(Csla.DataPortalException));
-        }
-        finally
-        {
-          lck.Set();
-        }
-      }).Invoke();
-      lck.WaitOne();
+    public void SaveAsyncWithException()
+    {
+      var context = GetContext();
+      context.Assert.Try(async () =>
+      {
+        var result = await Csla.DataPortal.CreateAsync<Single2>(555);
+        Assert.IsNotNull(result);
+        Assert.AreEqual(555, result.Id);
+        Assert.IsTrue(result.IsNew);
+        Assert.IsTrue(result.IsDirty);
+        var lck = new AutoResetEvent(false);
+        new Action(async () =>
+        {
+          try
+          {
+            result = await result.SaveAsync();
+            Assert.Fail("Expected exception not thrown");
+          }
+          catch (Exception ex)
+          {
+            context.Assert.IsTrue(ex.GetType() == typeof(Csla.DataPortalException));
+          }
+          finally
+          {
+            lck.Set();
+          }
+        }).Invoke();
+        lck.WaitOne();
+        context.Assert.Success();
+      });
+      context.Complete();
     }
 #endif

     #endregion

+#endif
+
     #region Delete

     [TestMethod]
     public void Delete_called_with_UserState_results_in_UserState_set_on_server()
     {
       var context = GetContext();
-      object userState = "state";
-      Single.DeleteObject(5, (o1, e1) =>
-                               {
-                                 context.Assert.IsNull(e1.Error);
-                                 context.Assert.AreEqual(userState, e1.UserState);
-                                 context.Assert.Success();
-                               }, userState);
+      context.Assert.Try(() =>
+      {
+        object userState = "state";
+        Single.DeleteObject(5, (o1, e1) =>
+                                 {
+                                   context.Assert.IsNull(e1.Error);
+                                   context.Assert.AreEqual(userState, e1.UserState);
+                                   context.Assert.Success();
+                                 }, userState);
+      });
       context.Complete();
     }

@@ -768,44 +783,46 @@
     public void Delete_called_without_UserState_results_in_UserState_defaulted_to_Null_server()
     {
       var context = GetContext();
-      Single.DeleteObject(5, (o1, e1) =>
+      context.Assert.Try(() =>
+      {
+        Single.DeleteObject(5, (o1, e1) =>
                                {
                                  context.Assert.IsNull(e1.Error);
                                  context.Assert.IsNull(e1.UserState);
                                  context.Assert.Success();
                                });
-      context.Complete();
-    }
-
-#if !SILVERLIGHT
-    [TestMethod]
-    public async Task DeleteAsync()
-    {
-      await Csla.DataPortal.DeleteAsync<Single2>(123);
-      Assert.Inconclusive("how to test when method is void?");
-    }
-
+      });
+      context.Complete();
+    }
+
+#if !SILVERLIGHT
     [TestMethod]
     public void DeleteAsync_WithException()
     {
-      var lck = new AutoResetEvent(false);
-      new Action(async () =>
-      {
-        try
-        {
-          await Csla.DataPortal.DeleteAsync<Single2>(555);
-          Assert.Fail("Expected exception not thrown");
-        }
-        catch (Exception ex)
-        {
-          Assert.IsInstanceOfType(ex, typeof(Csla.DataPortalException));
-        }
-        finally
-        {
-          lck.Set();
-        }
-      }).Invoke();
-      lck.WaitOne();
+      var context = GetContext();
+      context.Assert.Try(() =>
+      {
+        var lck = new AutoResetEvent(false);
+        new Action(async () =>
+        {
+          try
+          {
+            await Csla.DataPortal.DeleteAsync<Single2>(555);
+            context.Assert.Fail("Expected exception not thrown");
+          }
+          catch (Exception ex)
+          {
+            context.Assert.IsTrue(ex.GetType() == typeof(Csla.DataPortalException));
+          }
+          finally
+          {
+            lck.Set();
+          }
+        }).Invoke();
+        lck.WaitOne();
+        context.Assert.Success();
+      });
+      context.Complete();
     }
 #endif

@@ -883,7 +900,6 @@
 #endif
     #endregion

-
     /// <summary>
     /// Create is an exception - called with SingleCriteria, if BO does not have DP_Create() overload
     /// with that signature, ends up calling parameterless DP_Create() - this is by design


Fix CA2202: Do not dispose objects multiple times

Nested using statements often result in this warning. The warning is
technically correct, and one way to deal with it is to combine the
using statements.

--- Source/Examples/ExampleLibrary/Misc/MiscExamples.cs
+++ Source/Examples/ExampleLibrary/Misc/MiscExamples.cs
@@ -184,34 +184,31 @@

 #if UNIVERSAL
-            using (var stream = typeof(MiscExamples).GetTypeInfo().Assembly.GetManifestResourceStream("ExampleLibrary.Resources.west0479.mtx"))
+            using (var reader = new StreamReader(typeof(MiscExamples).GetTypeInfo().Assembly.GetManifestResourceStream("ExampleLibrary.Resources.west0479.mtx")))
 #else
-            using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("ExampleLibrary.Resources.west0479.mtx"))
+            using (var reader = new StreamReader(Assembly.GetExecutingAssembly().GetManifestResourceStream("ExampleLibrary.Resources.west0479.mtx")))
 #endif
             {
-                using (var reader = new StreamReader(stream))
+                while (!reader.EndOfStream)
                 {
-                    while (!reader.EndOfStream)
+                    var line = reader.ReadLine();
+                    if (line.StartsWith("%"))
                     {
-                        var line = reader.ReadLine();
-                        if (line.StartsWith("%"))
-                        {
-                            continue;
-                        }
-
-                        var v = line.Split(' ');
-                        if (matrix == null)
-                        {
-                            int m = int.Parse(v[0]);
-                            int n = int.Parse(v[1]);
-                            matrix = new double[m, n];
-                            continue;
-                        }
-
-                        int i = int.Parse(v[0]) - 1;
-                        int j = int.Parse(v[1]) - 1;
-                        matrix[i, j] = double.Parse(v[2], CultureInfo.InvariantCulture);
+                        continue;
                     }
+
+                    var v = line.Split(' ');
+                    if (matrix == null)
+                    {
+                        int m = int.Parse(v[0]);
+                        int n = int.Parse(v[1]);
+                        matrix = new double[m, n];
+                        continue;
+                    }
+
+                    int i = int.Parse(v[0]) - 1;
+                    int j = int.Parse(v[1]) - 1;
+                    matrix[i, j] = double.Parse(v[2], CultureInfo.InvariantCulture);
                 }
             }

@@ -269,123 +266,120 @@
                 });

             // Read the train schedule from a .csv resource
-            using (var stream = GetResourceStream("Bergensbanen.csv"))
-            {
-                using (var reader = new StreamReader(stream))
+            using (var reader = new StreamReader(GetResourceStream("Bergensbanen.csv")))
+            {
+                string header = reader.ReadLine();
+                var headerFields = header.Split(';');
+                int lines = headerFields.Length - 3;
+                var stations = new LineSeries()
+                                   {
+                                       StrokeThickness = 0,
+                                       MarkerType = MarkerType.Circle,
+                                       MarkerFill = OxyColor.FromAColor(200, OxyColors.Black),
+                                       MarkerSize = 4,
+                                   };
+
+                // Add the line series for each train line
+                var series = new LineSeries[lines];
+                for (int i = 0; i < series.Length; i++)
                 {
-                    string header = reader.ReadLine();
-                    var headerFields = header.Split(';');
-                    int lines = headerFields.Length - 3;
-                    var stations = new LineSeries()
-                                       {
-                                           StrokeThickness = 0,
-                                           MarkerType = MarkerType.Circle,
-                                           MarkerFill = OxyColor.FromAColor(200, OxyColors.Black),
-                                           MarkerSize = 4,
-                                       };
-
-                    // Add the line series for each train line
-                    var series = new LineSeries[lines];
+                    series[i] = new LineSeries
+                                    {
+                                        Title = headerFields[3 + i],
+                                        Color =
+                                            OxyColor.FromAColor(
+                                                180, OxyColors.Black),
+                                        StrokeThickness = 2,
+                                        TrackerFormatString =
+                                            "Train {0}\nTime: {2}\nDistance from Oslo S: {4:0.0} km",
+                                    };
+                    model.Series.Add(series[i]);
+                }
+
+                // Parse the train schedule
+                while (!reader.EndOfStream)
+                {
+                    var line = reader.ReadLine();
+
+                    // skip comments
+                    if (line == null || line.StartsWith("//"))
+                    {
+                        continue;
+                    }
+
+                    var fields = line.Split(';');
+                    double x = double.Parse(fields[1], CultureInfo.InvariantCulture);
+                    if (!string.IsNullOrEmpty(fields[0]))
+                    {
+                        // Add a horizontal annotation line for the station
+                        model.Annotations.Add(
+                            new LineAnnotation
+                                {
+                                    Type = LineAnnotationType.Horizontal,
+                                    Y = x,
+                                    Layer = AnnotationLayer.BelowSeries,
+                                    LineStyle = LineStyle.Solid,
+                                    Color = OxyColors.LightGray,
+                                    Text = fields[0] + "  ",
+                                    TextVerticalAlignment = VerticalAlignment.Middle,
+                                    TextLinePosition = 1,
+                                    TextMargin = 0,
+                                    TextPadding = 4,
+                                    ClipText = false,
+                                    TextHorizontalAlignment = HorizontalAlignment.Left
+                                });
+                    }
+
                     for (int i = 0; i < series.Length; i++)
                     {
-                        series[i] = new LineSeries
-                                        {
-                                            Title = headerFields[3 + i],
-                                            Color =
-                                                OxyColor.FromAColor(
-                                                    180, OxyColors.Black),
-                                            StrokeThickness = 2,
-                                            TrackerFormatString =
-                                                "Train {0}\nTime: {2}\nDistance from Oslo S: {4:0.0} km",
-                                        };
-                        model.Series.Add(series[i]);
-                    }
-
-                    // Parse the train schedule
-                    while (!reader.EndOfStream)
-                    {
-                        var line = reader.ReadLine();
-
-                        // skip comments
-                        if (line == null || line.StartsWith("//"))
+                        if (string.IsNullOrEmpty(fields[i + 3]))
                         {
                             continue;
                         }

-                        var fields = line.Split(';');
-                        double x = double.Parse(fields[1], CultureInfo.InvariantCulture);
-                        if (!string.IsNullOrEmpty(fields[0]))
+                        // Convert time from hhmm to a time span
+                        int hhmm = int.Parse(fields[i + 3]);
+                        var span = new TimeSpan(0, hhmm / 100, (hhmm % 100), 0);
+                        double t = TimeSpanAxis.ToDouble(span);
+
+                        // Add the point to the line
+                        series[i].Points.Add(new DataPoint(t, x));
+
+                        // Add the point for the station
+                        stations.Points.Add(new DataPoint(t, x));
+                    }
+                }
+
+                // add points and NaN (to make a line break) when passing midnight
+                double tmidnight = TimeSpanAxis.ToDouble(TimeSpan.FromHours(24));
+                foreach (LineSeries s in model.Series)
+                {
+                    for (int i = 0; i + 1 < s.Points.Count; i++)
+                    {
+                        if (Math.Abs(s.Points[i].X - s.Points[i + 1].X) > tmidnight / 2)
                         {
-                            // Add a horizontal annotation line for the station
-                            model.Annotations.Add(
-                                new LineAnnotation
-                                    {
-                                        Type = LineAnnotationType.Horizontal,
-                                        Y = x,
-                                        Layer = AnnotationLayer.BelowSeries,
-                                        LineStyle = LineStyle.Solid,
-                                        Color = OxyColors.LightGray,
-                                        Text = fields[0] + "  ",
-                                        TextVerticalAlignment = VerticalAlignment.Middle,
-                                        TextLinePosition = 1,
-                                        TextMargin = 0,
-                                        TextPadding = 4,
-                                        ClipText = false,
-                                        TextHorizontalAlignment = HorizontalAlignment.Left
-                                    });
-                        }
-
-                        for (int i = 0; i < series.Length; i++)
-                        {
-                            if (string.IsNullOrEmpty(fields[i + 3]))
+                            double x0 = s.Points[i].X;
+                            if (x0 > tmidnight / 2)
                             {
-                                continue;
+                                x0 -= tmidnight;
                             }

-                            // Convert time from hhmm to a time span
-                            int hhmm = int.Parse(fields[i + 3]);
-                            var span = new TimeSpan(0, hhmm / 100, (hhmm % 100), 0);
-                            double t = TimeSpanAxis.ToDouble(span);
-
-                            // Add the point to the line
-                            series[i].Points.Add(new DataPoint(t, x));
-
-                            // Add the point for the station
-                            stations.Points.Add(new DataPoint(t, x));
+                            double x1 = s.Points[i + 1].X;
+                            if (x1 > tmidnight / 2)
+                            {
+                                x1 -= tmidnight;
+                            }
+
+                            double y = s.Points[i].Y + (s.Points[i + 1].Y - s.Points[i].Y) / (x1 - x0) * (0 - x0);
+                            s.Points.Insert(i + 1, new DataPoint(x0 < x1 ? 0 : tmidnight, y));
+                            s.Points.Insert(i + 1, new DataPoint(double.NaN, y));
+                            s.Points.Insert(i + 1, new DataPoint(x0 < x1 ? tmidnight : 0, y));
+                            i += 3;
                         }
                     }
-
-                    // add points and NaN (to make a line break) when passing midnight
-                    double tmidnight = TimeSpanAxis.ToDouble(TimeSpan.FromHours(24));
-                    foreach (LineSeries s in model.Series)
-                    {
-                        for (int i = 0; i + 1 < s.Points.Count; i++)
-                        {
-                            if (Math.Abs(s.Points[i].X - s.Points[i + 1].X) > tmidnight / 2)
-                            {
-                                double x0 = s.Points[i].X;
-                                if (x0 > tmidnight / 2)
-                                {
-                                    x0 -= tmidnight;
-                                }
-
-                                double x1 = s.Points[i + 1].X;
-                                if (x1 > tmidnight / 2)
-                                {
-                                    x1 -= tmidnight;
-                                }
-
-                                double y = s.Points[i].Y + (s.Points[i + 1].Y - s.Points[i].Y) / (x1 - x0) * (0 - x0);
-                                s.Points.Insert(i + 1, new DataPoint(x0 < x1 ? 0 : tmidnight, y));
-                                s.Points.Insert(i + 1, new DataPoint(double.NaN, y));
-                                s.Points.Insert(i + 1, new DataPoint(x0 < x1 ? tmidnight : 0, y));
-                                i += 3;
-                            }
-                        }
-                    }
-
-                    model.Series.Add(stations);
                 }
+
+                model.Series.Add(stations);
             }

             return model;


Updated GameDB to use BindingList<> instead of List<>


Use ReferenceEquals not Equals for delegate ref equals (#1748)

* Use ReferenceEquals not Equals for delegate ref equals

* Missed a spot

--- src/System.IO.Pipelines.Extensions/Gate.cs
+++ src/System.IO.Pipelines.Extensions/Gate.cs
@@ -26,14 +26,14 @@
         /// <summary>
         /// Returns a boolean indicating if the gate is "open"
         /// </summary>
-        public bool IsCompleted => _gateState == _gateIsOpen;
+        public bool IsCompleted => ReferenceEquals(_gateState, _gateIsOpen);

         public void UnsafeOnCompleted(Action continuation) => OnCompleted(continuation);

         public void OnCompleted(Action continuation)
         {
             // If we're already completed, call the continuation immediately
-            if (_gateState == _gateIsOpen)
+            if (ReferenceEquals(_gateState, _gateIsOpen))
             {
                 continuation();
             }
@@ -41,7 +41,7 @@
             {
                 // Otherwise, if the current continuation is null, atomically store the new continuation in the field and return the old value
                 var previous = Interlocked.CompareExchange(ref _gateState, continuation, null);
-                if (previous == _gateIsOpen)
+                if (ReferenceEquals(previous, _gateIsOpen))
                 {
                     // It got completed in the time between the previous the method and the cmpexch.
                     // So call the continuation (the value of _continuation will remain _completed because cmpexch is atomic,
@@ -67,7 +67,7 @@
         {
             // Set the stored continuation value to a sentinel that indicates the state is completed, then call the previous value.
             var completion = Interlocked.Exchange(ref _gateState, _gateIsOpen);
-            if (completion != _gateIsOpen)
+            if (!ReferenceEquals(completion, _gateIsOpen))
             {
                 completion?.Invoke();
             }


Fixed an issue where the program would crash if all mods were verified at once.


Fix for embedded images in CSS files causing Talifun to crash when processing CSS file

--- src/Talifun.Web/Crusher/CssPathRewriter.cs
+++ src/Talifun.Web/Crusher/CssPathRewriter.cs
@@ -87,7 +87,9 @@
             foreach (Match match in matches)
             {
                 var path = match.Groups[1].Captures[0].Value;
-                if (path.StartsWith("http", StringComparison.InvariantCultureIgnoreCase)) continue;
+                if (path.StartsWith("http", StringComparison.InvariantCultureIgnoreCase) ||
+                    path.StartsWith("data", StringComparison.InvariantCultureIgnoreCase))
+                        continue;

                 var uri = new Uri(path, UriKind.RelativeOrAbsolute);
                 matchesHash.Add(uri);


Fixed the immediately posting OAuth-signed request that prevented HTTP headers from being modifiable.


websocket fix in transparent mode, #792

websocket fix in transparent mode, #792

--- src/Titanium.Web.Proxy/WebSocketHandler.cs
+++ src/Titanium.Web.Proxy/WebSocketHandler.cs
@@ -29,10 +29,7 @@
             await HeaderParser.ReadHeaders(serverConnection.Stream, response.Headers,
                 cancellationToken);

-            if (!args.IsTransparent)
-            {
-                await clientStream.WriteResponseAsync(response, cancellationToken);
-            }
+            await clientStream.WriteResponseAsync(response, cancellationToken);

             // If user requested call back then do it
             if (!args.HttpClient.Response.Locked)


Updated docs to 0.3.0-beta

Updated docs to 0.3.0-beta


Added version of DeleteChildren where you can set the startIndex, to skip the first one e.g


[Modify] Edit it

[Modify] Edit it

--- websocket-sharp/Server/WebSocketServiceManager.cs
+++ websocket-sharp/Server/WebSocketServiceManager.cs
@@ -114,7 +114,7 @@
     ///   <see langword="null"/> if not found.
     ///   </para>
     ///   <para>
-    ///   The host instance provides the function to access
+    ///   The service host instance provides the function to access
     ///   the information in the service.
     ///   </para>
     /// </value>


added a test for bug 1094411 (changeset 1387824)

--- Src/Workspaces/CoreTest/FindAllDeclarationsTests.cs
+++ Src/Workspaces/CoreTest/FindAllDeclarationsTests.cs
@@ -126,6 +126,29 @@
                     throw;
                 }
             });
+        }
+
+        [Fact(Skip = "1094411")]
+        public static void FindDeclarationsAsync_Metadata()
+        {
+            var solution = CreateSolution();
+            var csharpId = ProjectId.CreateNewId();
+            solution = solution
+                .AddProject(csharpId, "CSharp", "CSharp", LanguageNames.CSharp)
+                .AddMetadataReference(csharpId, MscorlibRef);
+
+            var vbId = ProjectId.CreateNewId();
+            solution = solution
+                .AddProject(vbId, "VB", "VB", LanguageNames.VisualBasic)
+                .AddMetadataReference(vbId, MscorlibRef);
+
+            var csharpResult = SymbolFinder.FindDeclarationsAsync(solution.GetProject(csharpId), "BackgroundColor", ignoreCase: false).Result;
+            Assert.True(csharpResult.Count() > 0);
+
+            // var rest = solution.GetProject(vbId).GetCompilationAsync().Result.GlobalNamespace.GetMembers("System").SelectMany(g => g.GetMembers("Console")).OfType<ITypeSymbol>().SelectMany(t => t.GetMembers("BackgroundColor")).ToList();
+
+            var vbResult = SymbolFinder.FindDeclarationsAsync(solution.GetProject(vbId), "BackgroundColor", ignoreCase: true).Result;
+            Assert.True(vbResult.Count() > 0);
         }

         #endregion


Typo on the update dupe count query

Typo on the update dupe count query

--- StackExchange.Exceptional/Stores/MySQLErrorStore.cs
+++ StackExchange.Exceptional/Stores/MySQLErrorStore.cs
@@ -201,7 +201,7 @@
                     {
                         // Update the count and move on
                         error.GUID = existingException.First().GUID;
-                        c.Execute("Update Exceptions set DupliateCount = DuplicateCount + @DuplicateCount where ID = @id", new {error.DuplicateCount, id = existingException.First().Id});
+                        c.Execute("Update Exceptions set DuplicateCount = DuplicateCount + @DuplicateCount where ID = @id", new {error.DuplicateCount, id = existingException.First().Id});
                     }
                     else
                     {


Making use of the sendtochat command to indicate the the user said yes to Abort.

--- Assets/Scripts/ComponentSolvers/Modded/NeedyQuizComponentSolver.cs
+++ Assets/Scripts/ComponentSolvers/Modded/NeedyQuizComponentSolver.cs
@@ -10,6 +10,7 @@
     {
         _yesButton = (MonoBehaviour)_yesButtonField.GetValue(bombComponent.GetComponent(_componentSolverType));
         _noButton = (MonoBehaviour)_noButtonField.GetValue(bombComponent.GetComponent(_componentSolverType));
+        _display = (TextMesh) _displayField.GetValue(bombComponent.GetComponent(_componentSolverType));
     }

     protected override IEnumerator RespondToCommandInternal(string inputCommand)
@@ -20,6 +21,11 @@
             inputCommand.Equals("press yes", StringComparison.InvariantCultureIgnoreCase))
         {
             yield return "yes";
+
+            if (_display.text.Equals("Abort?"))
+            {
+                yield return "sendtochat ABORT! ABORT!!! ABOOOOOOORT!!!!!";
+            }

             DoInteractionStart(_yesButton);
             yield return new WaitForSeconds(0.1f);
@@ -43,12 +49,15 @@
         _componentSolverType = ReflectionHelper.FindType("AdvancedVentingGas");
         _yesButtonField = _componentSolverType.GetField("YesButton", BindingFlags.Public | BindingFlags.Instance);
         _noButtonField = _componentSolverType.GetField("NoButton", BindingFlags.Public | BindingFlags.Instance);
+        _displayField = _componentSolverType.GetField("Display", BindingFlags.Public | BindingFlags.Instance);
     }

     private static Type _componentSolverType = null;
     private static FieldInfo _yesButtonField = null;
     private static FieldInfo _noButtonField = null;
+    private static FieldInfo _displayField = null;

     private MonoBehaviour _yesButton = null;
     private MonoBehaviour _noButton = null;
+    private TextMesh _display = null;
 }


Trying to fix problem with credential store.

--- Bonobo.Git.Server.Test/IntegrationTests/MsysgitIntegrationTests.cs
+++ Bonobo.Git.Server.Test/IntegrationTests/MsysgitIntegrationTests.cs
@@ -80,11 +80,23 @@
             {
                 Assert.Fail(string.Format("Please ensure that you have at least one git installation in '{0}'.", string.Join("', '", not_found.Select(n => Path.GetFullPath(n)))));
             }
+            EnsureCredentialHelperStore(installedgits.Last());
+        }
+
+        private void EnsureCredentialHelperStore(Tuple<string, MsysgitResources> tuple)
+        {
+            Directory.CreateDirectory(WorkingDirectory);
+            var git = tuple.Item1;
+            var res = RunGit(git, "config --get credential.helper", WorkingDirectory);
+
+            Assert.AreEqual("store --file=bonobo.randomstring.credentials.txt\r\n", res.Item1);
+            DeleteDirectory(WorkingDirectory);
         }

         [TestMethod, TestCategory(TestCategories.ClAndWebIntegrationTest)]
         public void RunGitTests()
         {
+
             foreach (var gitresource in installedgits)
             {

@@ -124,13 +136,12 @@
             foreach (var gitres in installedgits)
             {
                 Directory.CreateDirectory(WorkingDirectory);
-                string old_helper = null;
                 var git = gitres.Item1;
                 var resource = gitres.Item2;
                 try
                 {
                     Guid repo_id = CreateRepositoryOnWebInterface();
-                    old_helper = DisableCredentialHelper(git);
+                    RemoveStoredCredentials(git);
                     AllowAnonRepoClone(repo_id, false);
                     CloneRepoAnon(git, resource, false);
                     AllowAnonRepoClone(repo_id, true);
@@ -139,7 +150,6 @@
                 }
                 finally
                 {
-                    RestoreCredentialHelper(git, old_helper);
                     DeleteDirectory(WorkingDirectory);
                 }
             }
@@ -173,13 +183,12 @@
             var gitres = installedgits.Last();
             var git = gitres.Item1;
             var resource = gitres.Item2;
-            string old_helper = null;
             Directory.CreateDirectory(WorkingDirectory);

             try
             {
                 var repo_id = CreateRepositoryOnWebInterface();
-                old_helper = DisableCredentialHelper(git);
+                RemoveStoredCredentials(git);
                 AllowAnonRepoClone(repo_id, true);
                 CloneRepoAnon(git, resource, true);
                 CreateIdentity(git);
@@ -194,9 +203,6 @@
             }
             finally
             {
-                if (old_helper != null){
-                    RestoreCredentialHelper(git, old_helper);
-                }
                 DeleteDirectory(WorkingDirectory);
             }

@@ -257,27 +263,9 @@
             RunGitOnRepo(git, "commit -m \"Commit me!\"");
         }

-        private void RestoreCredentialHelper(string git, string old_helper)
-        {
-            if (old_helper != null)
-            {
-                var helper_location = string.Format("credential.{0}.helper", Url);
-                RunGit(git, "config " + helper_location + " " + old_helper, WorkingDirectory);
-            }
-        }
-
-        private string DisableCredentialHelper(string git)
-        {
-            var helper_location = string.Format("credential.{0}.helper", Url);
-            var result = RunGit(git, "config --get " + helper_location, WorkingDirectory);
-            RunGit(git, "config " + helper_location + " \"\"", WorkingDirectory);
-            var current_helper = result.Item1;
-            var last_newline = current_helper.LastIndexOf('\n');
-            if (last_newline != -1)
-            {
-                current_helper = current_helper.Substring(0, last_newline);
-            }
-            return current_helper;
+        private void RemoveStoredCredentials(string git)
+        {
+            File.Delete("Bonobo.randomstring.credentials.txt");
         }

         private void CloneRepoAnon(string git, MsysgitResources resource, bool success)
@@ -429,6 +417,7 @@

         private Tuple<string, string> RunGit(string git, string arguments, string workingDirectory, int timeout = 30000 /* milliseconds */)
         {
+            arguments = "-c credential.helper=\"store --file=bonobo.randomstring.credentials.txt\" " + arguments;
             Console.WriteLine("About to run '{0}' with args '{1}' in '{2}'", git, arguments, workingDirectory);
             Debug.WriteLine("About to run '{0}' with args '{1}' in '{2}'", git, arguments, workingDirectory);


added new sorting algorithm - Insertion Sort


using struct for VectorPacket in PacketTracer benchmark

--- tests/src/JIT/Performance/CodeQuality/HWIntrinsic/X86/PacketTracer/VectorPacket.cs
+++ tests/src/JIT/Performance/CodeQuality/HWIntrinsic/X86/PacketTracer/VectorPacket.cs
@@ -10,7 +10,7 @@
 using System.Runtime.CompilerServices;
 using System;

-internal class VectorPacket256
+internal struct VectorPacket256
 {
     public Vector256<float> Xs;
     public Vector256<float> Ys;


Turned off assembly saving.

Turned off assembly saving.

--- TinyReflectiveToolkit/Contracts/ContractProvider.cs
+++ TinyReflectiveToolkit/Contracts/ContractProvider.cs
@@ -265,7 +265,7 @@
             return CreateContractProxyFromObject<TContract>(obj);
         }

-        private TContract CreateContractProxyFromObject<TContract>(object actualObject, bool saveAssemblyForDebuggingPurposes = true)
+        private TContract CreateContractProxyFromObject<TContract>(object actualObject, bool saveAssemblyForDebuggingPurposes = false)
             where TContract : class
         {
             var contractType = typeof(TContract);


Add unit test

Add unit test

--- UnitTestUsefullFunctions/UnitTestFunctionsPrimes.cs
+++ UnitTestUsefullFunctions/UnitTestFunctionsPrimes.cs
@@ -363,7 +363,16 @@
       Assert.AreEqual(result, expected);
     }

-    /*
+    [TestMethod]
+    public void TestMethod_Pi_47()
+    {
+      const int source = 47;
+      const int expected = 15;
+      int result = FunctionsPrimes.Pi(source);
+      Assert.AreEqual(result, expected);
+    }
+
+    /* Primes between 2 and 4000
       2      3      5      7     11     13     17     19     23     29
      31     37     41     43     47     53     59     61     67     71
      73     79     83     89     97    101    103    107    109    113


Add unit test

Add unit test

--- UnitTestUsefullFunctions/UnitTestFunctionsPrimes.cs
+++ UnitTestUsefullFunctions/UnitTestFunctionsPrimes.cs
@@ -431,6 +431,15 @@
     {
       const int source = 79;
       const int expected = 23;
+      int result = FunctionsPrimes.Pi(source);
+      Assert.AreEqual(result, expected);
+    }
+
+    [TestMethod]
+    public void TestMethod_Pi_83()
+    {
+      const int source = 83;
+      const int expected = 24;
       int result = FunctionsPrimes.Pi(source);
       Assert.AreEqual(result, expected);
     }


Fix failed unit test

Fix failed unit test

--- UnitTestUsefullFunctions/UnitTestFunctionsString.cs
+++ UnitTestUsefullFunctions/UnitTestFunctionsString.cs
@@ -2218,7 +2218,7 @@
       char decimalSymbol = Convert.ToChar(Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator);
       string source = $"1234{decimalSymbol}567";
       const NumberStyles numberStyle = NumberStyles.AllowDecimalPoint;
-      const bool expected = false;
+      const bool expected = true;
       bool result = StringFunc.IsNumeric3(source, numberStyle);
       Assert.AreEqual(result, expected);
     }


Add TODO to write unit tests

Add TODO to write unit tests

--- UnitTestUsefullFunctions/UnitTestFunctionsString.cs
+++ UnitTestUsefullFunctions/UnitTestFunctionsString.cs
@@ -10349,5 +10349,8 @@
       Assert.AreEqual(result, expected);
     }
     #endregion IsInList
+    #region CheckInjection
+    // TODO write unit tests for CheckInjection method
+    #endregion CheckInjection
   }
 }


Slight modification to last revision in that the future modified date check only occurrs when LIST is used. MLSD date times should be the same as MDTM.

--- System.Net.FtpClient/FtpClient.cs
+++ System.Net.FtpClient/FtpClient.cs
@@ -1531,7 +1531,7 @@
                             // and the server supports the MDTM command, load the modified date.
                             // most servers do not support retrieving the modified date
                             // of a directory but we try any way.
-                            if ((item.Modified == DateTime.MinValue || item.Modified > DateTime.Now) && m_caps.HasFlag(FtpCapability.MDTM))
+                            if ((item.Modified == DateTime.MinValue || (listcmd.StartsWith("LIST") && item.Modified > DateTime.Now)) && m_caps.HasFlag(FtpCapability.MDTM))
                                 item.Modified = GetModifiedTime(item.FullName);
                         }


リファクタリング

リファクタリング

--- VendingMachine/VendingMachine/Rules/取扱硬貨.cs
+++ VendingMachine/VendingMachine/Rules/取扱硬貨.cs
@@ -1,10 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace VendingMachine.Rules
+namespace VendingMachine.Rules
 {
     public static class 取扱硬貨
     {
@@ -15,15 +9,11 @@
         /// <returns></returns>
         public static bool Is取扱対象硬貨(Money.Money money)
         {
-            return money == Money.MoneyKind.Yen10
-                   ||
-                   money == Money.MoneyKind.Yen50
-                   ||
-                   money == Money.MoneyKind.Yen100
-                   ||
-                   money == Money.MoneyKind.Yen500
-                   ||
-                   money == Money.MoneyKind.Yen1000;
+            return    money == Money.MoneyKind.Yen10
+                   || money == Money.MoneyKind.Yen50
+                   || money == Money.MoneyKind.Yen100
+                   || money == Money.MoneyKind.Yen500
+                   || money == Money.MoneyKind.Yen1000;
         }
     }
 }


Remove ToPdfPage extension for Image extension due to PdfSharp requirement that XGraphics.FromPdfPage requires a backing PdfDocument for the page. Alternative option was to create a new black PdfDocument. Not sure of the "value" for that option.

--- System/Drawing/ImageExtensions.cs
+++ System/Drawing/ImageExtensions.cs
@@ -10,26 +10,6 @@
   /// </summary>
   public static class ImageExtensions
   {
-    /// <summary>
-    /// Generates a PDF page from the image.
-    /// </summary>
-    /// <param name="image">The image to convert to a <see cref="PdfPage"/>.</param>
-    /// <returns>The <see cref="PdfPage"/> containing the image.</returns>
-    public static PdfPage ToPdfPage(this Image image)
-    {
-      if (image == null) return(new PdfPage());
-
-      PdfPage page = new PdfPage() {
-        Width = image.Width,
-        Height = image.Height
-      };
-      XGraphics xGraphics = XGraphics.FromPdfPage(page);
-      XImage xImage = XImage.FromGdiPlusImage(image);
-      xGraphics.DrawImage(xImage, 0, 0, image.Width, image.Height);
-
-      return (page);
-    }
-
     /// <summary>
     /// Generates a PDF page from the image.
     /// </summary>
@@ -51,10 +31,15 @@
     {
       PdfDocument document = new PdfDocument();
       foreach (var image in images) {
-        PdfPage page = ToPdfPage(image);
-        if (page != null) {
-          document.AddPage(page);
-        }
+        PdfPage page = new PdfPage() {
+          Width = image.Width,
+          Height = image.Height
+        };
+        document.AddPage(page);
+
+        XGraphics xGraphics = XGraphics.FromPdfPage(page);
+        XImage xImage = XImage.FromGdiPlusImage(image);
+        xGraphics.DrawImage(xImage, 0, 0, image.Width, image.Height);
       }
       return (document);
     }


version 1.0.11

version 1.0.11

--- StatusServer/Properties/AssemblyInfo.cs
+++ StatusServer/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("1.0.10.0")]
-[assembly: AssemblyFileVersion("1.0.10.0")]
+[assembly: AssemblyVersion("1.0.11.0")]
+[assembly: AssemblyFileVersion("1.0.11.0")]

 [assembly: InternalsVisibleTo("Tests")]


[sVsintegration] Adjust AutoLoad property to prevent new error that Chris reported

--- VisualStudio/ProjectPackage/XSharpProjectPackage.cs
+++ VisualStudio/ProjectPackage/XSharpProjectPackage.cs
@@ -86,7 +86,7 @@
     // [PackageRegistration(UseManagedResourcesOnly = true)] <-- Standard Package loading
     // ++ Async Package
     [PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
-    [ProvideAutoLoad(VSConstants.UICONTEXT.SolutionExists_string, PackageAutoLoadFlags.BackgroundLoad)]
+    [ProvideAutoLoad(VSConstants.UICONTEXT.SolutionExistsAndFullyLoaded_string, PackageAutoLoadFlags.BackgroundLoad)]
     // -- Async Package
     [DefaultRegistryRoot("Software\\Microsoft\\VisualStudio\\14.0")]
     [ProvideObject(typeof(XSharpGeneralPropertyPage))]


Correct MCC positioning

Correct MCC positioning

--- Voxalia/ServerGame/EntitySystem/BlockGroupEntity.cs
+++ Voxalia/ServerGame/EntitySystem/BlockGroupEntity.cs
@@ -55,6 +55,7 @@
             if (TraceMode == BGETraceMode.PERFECT)
             {
                 Shape = new MobileChunkShape(new Vector3i(xwidth, ywidth, zwidth), blocks); // TODO: Anything offset related needed here?
+                shapeOffs = Location.Zero;
                 SetMass(0);
             }
             else


WIP installer refactor, small change to AddStyleSheetToTemplate roll back method

[TFS Changeset #77026]

--- umbraco/cms/businesslogic/skinning/tasks/AddStyleSheetToTemplate.cs
+++ umbraco/cms/businesslogic/skinning/tasks/AddStyleSheetToTemplate.cs
@@ -71,9 +71,12 @@

             HtmlNode s = doc.DocumentNode.SelectSingleNode(string.Format("//link [@href = '{0}']", Value));

-            s.Remove();
+            if (s != null)
+            {
+                s.Remove();

-            doc.Save(IO.IOHelper.MapPath(SystemDirectories.Masterpages) + "/" + TargetFile);
+                doc.Save(IO.IOHelper.MapPath(SystemDirectories.Masterpages) + "/" + TargetFile);
+            }

             return TaskExecutionStatus.Completed;
         }


release

release

--- Terradue.Tep/Properties/AssemblyInfo.cs
+++ Terradue.Tep/Properties/AssemblyInfo.cs
@@ -4,7 +4,7 @@
 @{
     Terradue.Tep Software Package provides with all the functionalities specific to the TEP.

-    \xrefitem sw_version "Versions" "Software Package Version" 1.0.37
+    \xrefitem sw_version "Versions" "Software Package Version" 1.0.38

     \xrefitem sw_link "Links" "Software Package List" [Terradue.Tep](https://git.terradue.com/sugar/Terradue.Tep)

@@ -77,6 +77,6 @@
 [assembly: AssemblyLicenseUrl("")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
-[assembly: AssemblyVersion("1.0.37")]
-[assembly: AssemblyInformationalVersion("1.0.37")]
+[assembly: AssemblyVersion("1.0.38")]
+[assembly: AssemblyInformationalVersion("1.0.38")]
 [assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)]


Update Check2x1, Check1x2Top, Place2x1.

Update Check2x1, Check1x2Top, Place2x1.

--- Terraria_Server/WorldMod/WorldModify.cs
+++ Terraria_Server/WorldMod/WorldModify.cs
@@ -2206,51 +2206,43 @@
 			return Main.tile.At(x, y);
 		}

-		private static TileRef[,] GetTiles(int x, int y)
-		{
-			TileRef[,] tiles = new TileRef[3,3];
-			for (int modX = 0; modX < 3; modX++)
-			{
-				for (int modY = 0; modY < 3; modY++)
-				{
-					tiles[modX, modY] = GetTile(x - 1 + modX, y - 1 + modY);
-				}
-			}
-			return tiles;
-		}
-
 		public static void Check1x2Top(int x, int y, byte type)
 		{
 			if (WorldModify.destroyObject)
 			{
 				return;
 			}
-
-			TileRef[,] tiles = GetTiles(x, y);
-			if (tiles[1, 1].FrameY == 18)
-			{
-				tiles = GetTiles(x, --y);
-			}
-
+
 			bool flag = true;
-			if (tiles[1, 2].FrameY == 0 && tiles[1, 2].FrameY == 18 && tiles[1, 1].Type == type && tiles[1, 2].Type == type)
+
+			if (Main.tile.At(x, y).FrameY == 18)
+			{
+				y--;
+			}
+
+			if (Main.tile.At(x, y).FrameY == 0
+				&& Main.tile.At(x, y + 1).FrameY == 18
+				&& Main.tile.At(x, y).Type == type
+				&& Main.tile.At(x, y + 1).Type == type)
 			{
 				flag = false;
-
-				if (!tiles[1, 0].Active || !Main.tileSolid[(int)tiles[1, 0].Type] || Main.tileSolidTop[(int)tiles[1, 0].Type])
-				{
-					flag = true;
-				}
-			}
-
+			}
+
+			if (!Main.tile.At(x, y - 1).Active
+				|| !Main.tileSolid[(int)Main.tile.At(x, y - 1).Type]
+				|| Main.tileSolidTop[(int)Main.tile.At(x, y - 1).Type])
+			{
+				flag = true;
+			}
+
 			if (flag)
 			{
 				WorldModify.destroyObject = true;
-				if (tiles[1, 1].Type == type)
+				if (Main.tile.At(x, y).Type == type)
 				{
 					WorldModify.KillTile(x, y, false, false, false);
 				}
-                if (tiles[1, 2].Type == type)
+				if (Main.tile.At(x, y + 1).Type == type)
 				{
 					WorldModify.KillTile(x, y + 1, false, false, false);
 				}
@@ -2268,42 +2260,53 @@
 			{
 				return;
 			}
-
-			TileRef[,] tiles = GetTiles(x, y);
-			if (tiles[1,1].FrameX == 18)
-			{
-				tiles = GetTiles(--x, y);
-			}
-
+
 			bool flag = true;
-			if (tiles[1, 1].FrameX == 0 && tiles[2, 1].FrameX == 18 && tiles[1, 1].Type == type && tiles[2, 1].Type == type)
+
+			if (Main.tile.At(x, y).FrameX == 18)
+			{
+				x--;
+			}
+
+			if (Main.tile.At(x, y).FrameX == 0
+				&& Main.tile.At(x + 1, y).FrameX == 18
+				&& Main.tile.At(x, y).Type == type
+				&& Main.tile.At(x + 1, y).Type == type)
 			{
 				flag = false;
-				if(!tiles[1, 2].Active || !tiles[2, 2].Active)
+			}
+
+			if (type == 29 || type == 103)
+			{
+				if (!Main.tile.At(x, y + 1).Active || !Main.tileTable[(int)Main.tile.At(x, y + 1).Type])
 				{
 					flag = true;
 				}
-                else if (type == 29 || type == 103)
-				{
-					if(!Main.tileTable[(int)tiles[1, 2].Type] || !Main.tileTable[(int)tiles[2, 2].Type])
-					{
-						flag = true;
-					}
-				}
-				else if (type != 29 && (!Main.tileSolid[(int)tiles[1, 2].Type] || !Main.tileSolid[(int)tiles[2, 2].Type]))
+				if (!Main.tile.At(x + 1, y + 1).Active || !Main.tileTable[(int)Main.tile.At(x + 1, y + 1).Type])
 				{
 					flag = true;
 				}
 			}
-
+			else
+			{
+				if (!Main.tile.At(x, y + 1).Active || !Main.tileSolid[(int)Main.tile.At(x, y + 1).Type])
+				{
+					flag = true;
+				}
+				if (!Main.tile.At(x + 1, y + 1).Active || !Main.tileSolid[(int)Main.tile.At(x + 1, y + 1).Type])
+				{
+					flag = true;
+				}
+			}
+
 			if (flag)
 			{
 				WorldModify.destroyObject = true;
-                if (tiles[1, 1].Type == type)
+                if (Main.tile.At(x, y).Type == type)
 				{
 					WorldModify.KillTile(x, y, false, false, false);
 				}
-                if (tiles[2, 1].Type == type)
+                if (Main.tile.At(x + 1, y).Type == type)
 				{
 					WorldModify.KillTile(x + 1, y, false, false, false);
 				}
@@ -2331,30 +2334,41 @@

 		public static void Place2x1(int x, int y, int type)
 		{
-			TileRef[,] tiles = GetTiles(x, y);
-
 			bool flag = false;
-			if (type != 29 && tiles[1, 2].Active && tiles[2, 2].Active && Main.tileSolid[(int)tiles[1, 2].Type]
-				&& Main.tileSolid[(int)tiles[2, 2].Type] && !tiles[1, 1].Active && !tiles[2, 1].Active)
+			if (type != 29 && type != 103
+				&& Main.tile.At(x, y + 1).Active
+				&& Main.tile.At(x + 1, y + 1).Active
+				&& Main.tileSolid[(int)Main.tile.At(x, y + 1).Type]
+				&& Main.tileSolid[(int)Main.tile.At(x + 1, y + 1).Type]
+				&& !Main.tile.At(x, y).Active
+				&& !Main.tile.At(x + 1, y).Active)
 			{
 				flag = true;
 			}
-            else if (type == 29 && tiles[1, 2].Active && tiles[2, 2].Active && Main.tileTable[(int)tiles[1, 2].Type]
-				&& Main.tileTable[(int)tiles[2, 2].Type] && !tiles[1, 1].Active && !tiles[2, 1].Active)
-			{
-				flag = true;
-			}
-
+			else
+			{
+				if ((type == 29 || type == 103)
+					&& Main.tile.At(x, y + 1).Active
+					&& Main.tile.At(x + 1, y + 1).Active
+					&& Main.tileTable[(int)Main.tile.At(x, y + 1).Type]
+					&& Main.tileTable[(int)Main.tile.At(x + 1, y + 1).Type]
+					&& !Main.tile.At(x, y).Active
+					&& !Main.tile.At(x + 1, y).Active)
+				{
+					flag = true;
+				}
+			}
+
 			if (flag)
 			{
-				tiles[1, 1].SetActive (true);
-				tiles[1, 1].SetFrameY (0);
-				tiles[1, 1].SetFrameX (0);
-				tiles[1, 1].SetType ((byte)type);
-				tiles[2, 1].SetActive (true);
-				tiles[2, 1].SetFrameY (0);
-				tiles[2, 1].SetFrameX (18);
-				tiles[2, 1].SetType ((byte)type);
+				Main.tile.At(x, y).SetActive (true);
+				Main.tile.At(x, y).SetFrameY (0);
+				Main.tile.At(x, y).SetFrameX (0);
+				Main.tile.At(x, y).SetType ((byte)type);
+				Main.tile.At(x + 1, y).SetActive (true);
+				Main.tile.At(x + 1, y).SetFrameY (0);
+				Main.tile.At(x + 1, y).SetFrameX (18);
+				Main.tile.At(x + 1, y).SetType ((byte)type);
 			}
 		}


Fixes MergePullRequest with git:// protocol remote

--- TGS.Server/Instance/Repository.cs
+++ TGS.Server/Instance/Repository.cs
@@ -1012,6 +1012,7 @@
 							var prAPI = remoteUrl;
 							prAPI = prAPI.Replace("/.git", "");
 							prAPI = prAPI.Replace(".git", "");
+							prAPI = prAPI.Replace("git:", "https:");
 							prAPI = prAPI.Replace("github.com", "api.github.com/repos");
 							prAPI += "/pulls/" + PRNumberString + ".json";
 							string json;


--- Demos/CSharpGL.Demos/13SimplexNoise/SimplexNoiseRenderer.Static.cs
+++ Demos/CSharpGL.Demos/13SimplexNoise/SimplexNoiseRenderer.Static.cs
@@ -9,7 +9,7 @@
 {
     partial class SimplexNoiseRenderer
     {
-        static readonly IBufferable staticBufferable = new Sphere();
+        static readonly IBufferable staticBufferable = new Sphere(1, 180, 360);
         static readonly ShaderCode[] staticShaderCodes = new ShaderCode[]
         {
             new ShaderCode(File.ReadAllText(@"13SimplexNoise\SimplexNoise.vert"), ShaderType.VertexShader),
@@ -19,7 +19,9 @@
             new string[] { "in_Position", },
             new string[] { Sphere.strPosition, });

-        static readonly int[] perm = new int[256] {151,160,137,91,90,15,
+        static readonly int[] perm = new int[256]
+        {
+            151,160,137,91,90,15,
             131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,
             190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,
             88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166,


Исправление рендеринга зачёркнутого текста

--- DvachBrowser3/Views/Partial/Additional/RenderTextElementFactory.cs
+++ DvachBrowser3/Views/Partial/Additional/RenderTextElementFactory.cs
@@ -122,16 +122,20 @@
                 needBorder = true;
                 b.BorderThickness = new Thickness(b.BorderThickness.Left, 1.2, b.BorderThickness.Right, b.BorderThickness.Bottom);
             }
+
+            Border strikeBorder = null;
+
             if (command.Attributes.Attributes.ContainsKey(CommonTextRenderAttributes.Strikethrough))
             {
                 needGrid = true;
-                g.Children.Add(new Border()
+                strikeBorder = new Border()
                 {
                     Background = r.Foreground,
                     Height = 1.2,
                     HorizontalAlignment = HorizontalAlignment.Stretch,
-                    VerticalAlignment = VerticalAlignment.Center,
-                });
+                    VerticalAlignment = VerticalAlignment.Top,
+                };
+                g.Children.Add(strikeBorder);
             }
             if (command.Attributes.Attributes.ContainsKey(CommonTextRenderAttributes.Subscript) || command.Attributes.Attributes.ContainsKey(CommonTextRenderAttributes.Superscript))
             {
@@ -176,6 +180,13 @@
             r.Height = r.ActualHeight;
             r.Width = r.ActualWidth + endSpaces * spaceWidth;

+            if (strikeBorder != null)
+            {
+                var oh = r.ActualHeight;
+                const double koef = 0.6;
+                strikeBorder.Margin = new Thickness(0, koef * oh, 0, 0);
+            }
+
             if (needGrid)
             {
                 g.Height = result.Height;


Revert "iOS - trying to fix a spot where SetNeedsDisplay is needed"

This reverts commit 593f40eca20a4edd3f7bed345bb31851b35f4b5b.

--- Xamarin.Forms.Platform.iOS/VisualElementRenderer.cs
+++ Xamarin.Forms.Platform.iOS/VisualElementRenderer.cs
@@ -255,10 +255,7 @@
 		protected virtual void SetBlur(BlurEffectStyle blur)
 		{
 			if (_previousBlur == blur)
-			{
-				SetNeedsDisplay();
 				return;
-			}

 			_previousBlur = blur;


Change AuthContext

Change AuthContext

--- TokenBasedAuthentication/AuthContext.cs
+++ TokenBasedAuthentication/AuthContext.cs
@@ -6,6 +6,7 @@

 namespace TokenBasedAuthentication
 {
+    //
     public class AuthContext : IdentityDbContext<IdentityUser>
     {
         public AuthContext()


Print preview/settings options.

Print preview/settings options.

--- Tabster/Forms/MainForm.Library.cs
+++ Tabster/Forms/MainForm.Library.cs
@@ -6,13 +6,13 @@
 using System.Diagnostics;
 using System.IO;
 using System.Windows.Forms;
-using Tabster.Controls;
 using Tabster.Controls.Extensions;
 using Tabster.Core.Printing;
 using Tabster.Core.Types;
 using Tabster.Data;
 using Tabster.Data.Library;
 using Tabster.Data.Processing;
+using Tabster.Properties;

 #endregion

@@ -109,7 +109,7 @@

                     if (sfd.ShowDialog() != DialogResult.Cancel)
                     {
-                        //native TablatureDocument format
+                        //native file format
                         if (sfd.FilterIndex == 1)
                         {
                             File.Copy(SelectedLibraryItem.FileInfo.FullName, sfd.FileName);
@@ -154,17 +154,31 @@
             }
         }

+        private TablaturePrintDocumentSettings GetPrintSettings()
+        {
+            return new TablaturePrintDocumentSettings
+            {
+                Title = SelectedLibraryItem.Document.ToFriendlyString(),
+                PrintColor = Settings.Default.PrintColor,
+                DisplayTitle = true,
+                DisplayPrintTime = Settings.Default.PrintTimestamp,
+                DisplayPageNumbers = Settings.Default.PrintPageNumbers
+            };
+        }
+
         private void printbtn_Click(object sender, EventArgs e)
         {
-            var settings = new TablaturePrintDocumentSettings
-            {
-                Title = SelectedLibraryItem.Document.ToFriendlyString(),
-                DisplayTitle = true,
-                DisplayPrintTime = true,
-                DisplayPageNumbers = true,
-            };
-
-            PreviewEditor.Print(settings);
+            PreviewEditor.Print(GetPrintSettings());
+        }
+
+        private void printPreviewToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            PreviewEditor.PrintPreview(GetPrintSettings());
+        }
+
+        private void printSettingsToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            OpenPreferences("Printing");
         }

         private void tablibrary_SelectionChanged(object sender, EventArgs e)
@@ -195,14 +209,14 @@
                     var TablatureLibraryItem = Program.TablatureFileLibrary.Add(n.Tab);
                     Program.TablatureFileLibrary.Save();
                     UpdateLibraryItem(TablatureLibraryItem);
-                    PopoutTab(n.Tab, isReadOnly: false);
-                }
-            }
-        }
-
-        private void PopoutTab(TablatureDocument tab, bool isReadOnly = true, bool updateRecentFiles = true)
-        {
-            Program.TabbedViewer.LoadTablature(tab, isReadOnly);
+                    PopoutTab(n.Tab);
+                }
+            }
+        }
+
+        private void PopoutTab(TablatureDocument tab, bool updateRecentFiles = true)
+        {
+            Program.TabbedViewer.LoadTablature(tab);

             if (updateRecentFiles)
                 recentlyViewedMenuItem.Add(tab.FileInfo, tab.ToFriendlyString());
@@ -661,7 +675,6 @@

                 if (openedExternally)
                 {
-                    lblLibraryPreview.Text = "Tab is open in external viewer.";
                     lblLibraryPreview.Visible = true;
                 }

@@ -685,7 +698,6 @@
             {
                 previewToolStrip.Enabled = false;
                 lblpreviewtitle.Text = "";
-                lblLibraryPreview.Text = "";
             }
         }


Bua til AddTranslation

Bua til AddTranslation

--- TransApp/Controllers/VideoController.cs
+++ TransApp/Controllers/VideoController.cs
@@ -24,5 +24,12 @@
         {
             return View();
         }
+
+        public ActionResult AddTranslation()
+        {
+            var model = from t in repo.GetVideos()
+                        select t;
+            return View(model);
+        }
 	}
 }


Resolve #2 Implement suggestions of the custom properties in xaml file

--- Lib/CacheImage.xaml.cs
+++ Lib/CacheImage.xaml.cs
@@ -23,14 +23,10 @@
         #region Dependency Properties

         // URL
-        public static string GetUrl(DependencyObject obj)
-        {
-            return (string)obj.GetValue(UrlProperty);
-        }
-
-        public static void SetUrl(DependencyObject obj, string value)
-        {
-            obj.SetValue(UrlProperty, value);
+        public string Url
+        {
+            get { return base.GetValue(UrlProperty) as string; }
+            set { base.SetValue(UrlProperty, value); }
         }

         // Using a DependencyProperty as the backing store for Url.  This enables animation, styling, binding, etc...
@@ -39,14 +35,10 @@

         // Placeholder
-        public static string GetPlaceholder(DependencyObject obj)
-        {
-            return (string)obj.GetValue(PlaceholderProperty);
-        }
-
-        public static void SetPlaceholder(DependencyObject obj, string value)
-        {
-            obj.SetValue(PlaceholderProperty, value);
+        public string Placeholder
+        {
+            get { return base.GetValue(PlaceholderProperty) as string; }
+            set { base.SetValue(PlaceholderProperty, value); }
         }

         // Using a DependencyProperty as the backing store for Placeholder.  This enables animation, styling, binding, etc...
@@ -55,14 +47,10 @@

         // DecodePixelHeight
-        public static int GetDecodePixelHeight(DependencyObject obj)
-        {
-            return (int)obj.GetValue(DecodePixelHeightProperty);
-        }
-
-        public static void SetDecodePixelHeight(DependencyObject obj, int value)
-        {
-            obj.SetValue(DecodePixelHeightProperty, value);
+        public int DecodePixelHeight
+        {
+            get { return (int)base.GetValue(DecodePixelHeightProperty); }
+            set { base.SetValue(DecodePixelHeightProperty, value); }
         }

         // Using a DependencyProperty as the backing store for DecodePixelHeight.  This enables animation, styling, binding, etc...
@@ -71,14 +59,10 @@

         // DecodePixelWidth
-        public static int GetDecodePixelWidth(DependencyObject obj)
-        {
-            return (int)obj.GetValue(DecodePixelWidthProperty);
-        }
-
-        public static void SetDecodePixelWidth(DependencyObject obj, int value)
-        {
-            obj.SetValue(DecodePixelWidthProperty, value);
+        public int DecodePixelWidth
+        {
+            get { return (int)base.GetValue(DecodePixelWidthProperty); }
+            set { base.SetValue(DecodePixelWidthProperty, value); }
         }

         // Using a DependencyProperty as the backing store for DecodePixelWidth.  This enables animation, styling, binding, etc...
@@ -87,14 +71,10 @@

         // DecodePixelWIdth for Placeholder
-        public static int GetDecodePixelWidthPlaceholder(DependencyObject obj)
-        {
-            return (int)obj.GetValue(DecodePixelWidthPlaceholderProperty);
-        }
-
-        public static void SetDecodePixelWidthPlaceholder(DependencyObject obj, int value)
-        {
-            obj.SetValue(DecodePixelWidthPlaceholderProperty, value);
+        public int DecodePixelWidthPlaceholder
+        {
+            get { return (int)base.GetValue(DecodePixelWidthPlaceholderProperty); }
+            set { base.SetValue(DecodePixelWidthPlaceholderProperty, value); }
         }

         // Using a DependencyProperty as the backing store for DecodePixelWidthPlaceholder.  This enables animation, styling, binding, etc...
@@ -104,14 +84,10 @@

         // DecodePixelHeight for Placeholder
-        public static int GetDecodePixelHeightPlaceholder(DependencyObject obj)
-        {
-            return (int)obj.GetValue(DecodePixelHeightPlaceholderProperty);
-        }
-
-        public static void SetDecodePixelHeightPlaceholder(DependencyObject obj, int value)
-        {
-            obj.SetValue(DecodePixelHeightPlaceholderProperty, value);
+        public int DecodePixelHeightPlaceholder
+        {
+            get { return (int)base.GetValue(DecodePixelHeightPlaceholderProperty); }
+            set { base.SetValue(DecodePixelHeightPlaceholderProperty, value); }
         }

         // Using a DependencyProperty as the backing store for DecodePixelHeightPlaceholder.  This enables animation, styling, binding, etc...
@@ -120,14 +96,10 @@

         // Stretch
-        public static Stretch GetStretch(DependencyObject obj)
-        {
-            return (Stretch)obj.GetValue(StretchProperty);
-        }
-
-        public static void SetStretch(DependencyObject obj, Stretch value)
-        {
-            obj.SetValue(StretchProperty, value);
+        public Stretch Stretch
+        {
+            get { return (Stretch)base.GetValue(StretchProperty); }
+            set { base.SetValue(StretchProperty, value); }
         }

         // Using a DependencyProperty as the backing store for Stretch.  This enables animation, styling, binding, etc...
@@ -136,14 +108,10 @@

         // Stretch for placeholder
-        public static Stretch GetStretchPlaceholder(DependencyObject obj)
-        {
-            return (Stretch)obj.GetValue(StretchPlaceholderProperty);
-        }
-
-        public static void SetStretchPlaceholder(DependencyObject obj, Stretch value)
-        {
-            obj.SetValue(StretchPlaceholderProperty, value);
+        public Stretch StretchPlaceholder
+        {
+            get { return (Stretch)base.GetValue(StretchPlaceholderProperty); }
+            set { base.SetValue(StretchPlaceholderProperty, value); }
         }

         // Using a DependencyProperty as the backing store for StretchPlaceholder.  This enables animation, styling, binding, etc...


Removed all Console.WriteLine calls to make WACK compliant

--- Triangulation/Delaunay/Sweep/DTSweep.cs
+++ Triangulation/Delaunay/Sweep/DTSweep.cs
@@ -512,17 +512,17 @@
 				if (p == eq && op == ep) {
 					if (eq == tcx.EdgeEvent.ConstrainedEdge.Q
 						&& ep == tcx.EdgeEvent.ConstrainedEdge.P) {
-						if (tcx.IsDebugEnabled) Console.WriteLine("[FLIP] - constrained edge done"); // TODO: remove
+						//if (tcx.IsDebugEnabled) Console.WriteLine("[FLIP] - constrained edge done"); // TODO: remove
 						t.MarkConstrainedEdge(ep, eq);
 						ot.MarkConstrainedEdge(ep, eq);
 						Legalize(tcx, t);
 						Legalize(tcx, ot);
 					} else {
-						if (tcx.IsDebugEnabled) Console.WriteLine("[FLIP] - subedge done"); // TODO: remove
+						//if (tcx.IsDebugEnabled) Console.WriteLine("[FLIP] - subedge done"); // TODO: remove
 						// XXX: I think one of the triangles should be legalized here?
 					}
 				} else {
-					if (tcx.IsDebugEnabled) Console.WriteLine("[FLIP] - flipping and continuing with triangle still crossing edge"); // TODO: remove
+					//if (tcx.IsDebugEnabled) Console.WriteLine("[FLIP] - flipping and continuing with triangle still crossing edge"); // TODO: remove
 					Orientation o = TriangulationUtil.Orient2d(eq, op, ep);
 					t = NextFlipTriangle(tcx, o, t, ot, p, op);
 					FlipEdgeEvent(tcx, ep, eq, t, p);
@@ -608,7 +608,7 @@
 			}

 			if (tcx.IsDebugEnabled) {
-				Console.WriteLine("[FLIP:SCAN] - scan next point"); // TODO: remove
+				//Console.WriteLine("[FLIP:SCAN] - scan next point"); // TODO: remove
 				tcx.DTDebugContext.PrimaryTriangle = t;
 				tcx.DTDebugContext.SecondaryTriangle = ot;
 			}


Minor bugfix (that hopefully doesn't break anything)

--- VRGIN/SteamVR/Scripts/SteamVR_Render.cs
+++ VRGIN/SteamVR/Scripts/SteamVR_Render.cs
@@ -49,8 +49,9 @@
 	static private bool isQuitting;
 	void OnApplicationQuit()
 	{
-		isQuitting = true;
-		SteamVR.SafeDispose();
+        // Can cause issues with Honey Select
+		//isQuitting = true;
+		//SteamVR.SafeDispose();
 	}

 	static public void Add(SteamVR_Camera vrcam)