Try/Catch prevent crash on error

Try/Catch prevent crash on error

--- src/MafiaAutoName/MainWindow.xaml.cs
+++ src/MafiaAutoName/MainWindow.xaml.cs
@@ -4,9 +4,11 @@
 using System.ComponentModel;
 using System.Drawing;
 using System.Drawing.Imaging;
+using System.Printing;
 using System.Runtime.InteropServices;
 using System.Windows;
 using System.Windows.Forms;
+using MessageBox = System.Windows.MessageBox;
 using Point = System.Drawing.Point;

 namespace MafiaAutoName
@@ -29,7 +31,7 @@
         private int _portraitVerticalMargins;
         private int _newImageHorizontalResolution;
         private int _newImageVerticalResolution;
-
+
         public string OutputImagePath
         {
             get { return _outputFilePath;  }
@@ -192,60 +194,67 @@

         private void GenerateButton_Click(object sender, RoutedEventArgs e)
         {
-            Bitmap image;
-            Graphics graphicImage;
-
-            if (InputImageRadioButton.IsChecked.GetValueOrDefault())
-            {
-                image = new Bitmap(_inputImagePath);
-                graphicImage = Graphics.FromImage(image);
-            }
-            else
-            {
-                image = new Bitmap(NewImageHorizontalResolution, NewImageVerticalResolution);
-                graphicImage = Graphics.FromImage(image);
-            }
-
-            int portraitWidth = ((image.Width - _imageLeftMargin - ImageRightMargin) -
-                                 (Columns - 1) * PortraitHorizontalMargins) / Columns;
-            int portraitHeight = ((image.Height - ImageTopMargin - ImageBottomMargin) -
-                                  (Rows - 1) * PortraitVerticalMargins) / Rows;
-
-            int columnIndex = 0;
-            int rowIndex = 0;
-
-            for (int i = 0; i < Names.Count; i++)
-            {
-                if (columnIndex + 1 > Columns)
+            try
+            {
+                Bitmap image;
+                Graphics graphicImage;
+
+                if (InputImageRadioButton.IsChecked.GetValueOrDefault())
                 {
-                    rowIndex++;
-                    columnIndex = 0;
+                    image = new Bitmap(_inputImagePath);
+                    graphicImage = Graphics.FromImage(image);
                 }
-
-                SizeF size = graphicImage.MeasureString(Names[i], new Font("Verdana", 20, System.Drawing.FontStyle.Bold));
-
-                int extraHorizontalMargin = 0;
-                if (rowIndex + 1 >= Rows)
+                else
                 {
-                    if (Rows * Columns - Names.Count != 1)
-                        extraHorizontalMargin = (Rows * Columns - Names.Count) * (portraitWidth + PortraitHorizontalMargins) / 2;
+                    image = new Bitmap(NewImageHorizontalResolution, NewImageVerticalResolution);
+                    graphicImage = Graphics.FromImage(image);
                 }

-                graphicImage.DrawString(Names[i], _displayFont,
-                        new SolidBrush(Color.AntiqueWhite),
-                        new Point(
-                            columnIndex * portraitWidth + _imageLeftMargin + (columnIndex * PortraitHorizontalMargins) +
-                            portraitWidth - (int)size.Width + extraHorizontalMargin,
-                            rowIndex * portraitHeight + ImageTopMargin + (rowIndex * PortraitVerticalMargins) + portraitHeight -
-                            (int)size.Height));
-
-                columnIndex++;
-            }
-
-            image.Save(_outputFilePath, ImageFormat.Png);
-
-            image.Dispose();
-            graphicImage.Dispose();
+                int portraitWidth = ((image.Width - _imageLeftMargin - ImageRightMargin) -
+                                     (Columns - 1) * PortraitHorizontalMargins) / Columns;
+                int portraitHeight = ((image.Height - ImageTopMargin - ImageBottomMargin) -
+                                      (Rows - 1) * PortraitVerticalMargins) / Rows;
+
+                int columnIndex = 0;
+                int rowIndex = 0;
+
+                for (int i = 0; i < Names.Count; i++)
+                {
+                    if (columnIndex + 1 > Columns)
+                    {
+                        rowIndex++;
+                        columnIndex = 0;
+                    }
+
+                    SizeF size = graphicImage.MeasureString(Names[i], new Font("Verdana", 20, System.Drawing.FontStyle.Bold));
+
+                    int extraHorizontalMargin = 0;
+                    if (rowIndex + 1 >= Rows)
+                    {
+                        if (Rows * Columns - Names.Count != 1)
+                            extraHorizontalMargin = (Rows * Columns - Names.Count) * (portraitWidth + PortraitHorizontalMargins) / 2;
+                    }
+
+                    graphicImage.DrawString(Names[i], _displayFont,
+                            new SolidBrush(Color.AntiqueWhite),
+                            new Point(
+                                columnIndex * portraitWidth + _imageLeftMargin + (columnIndex * PortraitHorizontalMargins) +
+                                portraitWidth - (int)size.Width + extraHorizontalMargin,
+                                rowIndex * portraitHeight + ImageTopMargin + (rowIndex * PortraitVerticalMargins) + portraitHeight -
+                                (int)size.Height));
+
+                    columnIndex++;
+                }
+
+                image.Save(_outputFilePath, ImageFormat.Png);
+
+                image.Dispose();
+                graphicImage.Dispose();
+            }
+            catch (Exception exception)
+            {
+                MessageBox.Show("Error encountered", "Error encountere", MessageBoxButton.OK);
+            }
         }

         private void RemoveButton_Click(object sender, RoutedEventArgs e)


clean code

clean code

--- src/MyLittleLispy.Runtime/Context.cs
+++ src/MyLittleLispy.Runtime/Context.cs
@@ -1,7 +1,6 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
-using System.Runtime.CompilerServices;

 namespace MyLittleLispy.Runtime
 {
@@ -16,24 +15,27 @@
             _definitions = new Dictionary<string, Func<Node[], Value>>
 			{
 				{"define", args => Define(args[0], args[1])},
-				{"quote", args => args[0].Quote(this)},
+
+            	{"quote", args => args[0].Quote(this)},
+                {"list", args => new Cons(args.Select(node => node.Eval(this)))},
+	            {"cons", args => new Cons(args[0].Eval(this), args[1].Eval(this))},
                 {"lambda", args => new Lambda(args[0], args[1])},
-                {"list", args => new Cons(args.Select(node => node.Eval(this)))},
+
 				{"+", args => args[0].Eval(this).Add(args[1].Eval(this)) },
 				{"-", args => args[0].Eval(this).Substract(args[1].Eval(this))},
 				{"*", args => args[0].Eval(this).Multiple(args[1].Eval(this))},
 				{"/", args => args[0].Eval(this).Divide(args[1].Eval(this))},
 				{"=", args => args[0].Eval(this).Equal(args[1].Eval(this))},
-				{"<", args => args[0].Eval(this).Lesser(args[1].Eval(this))},
+
+                {"<", args => args[0].Eval(this).Lesser(args[1].Eval(this))},
 				{">", args => args[0].Eval(this).Greater(args[1].Eval(this))},
-				{"and", args => args[0].Eval(this).And(args[1].Eval(this))},
+
+                {"and", args => args[0].Eval(this).And(args[1].Eval(this))},
 				{"or", args => args[0].Eval(this).Or(args[1].Eval(this))},
 				{"not", args => args[0].Eval(this).Not()},
-			    {"cond", Cond},
-                {"cons", args =>
-                {
-                    return new Cons(args[0].Eval(this), args[1].Eval(this));
-                }},
+
+                {"cond", Cond},
+
                 {"car", args => args[0].Eval(this).Car()},
                 {"cdr", args => args[0].Eval(this).Cdr()},
 			    {"eval", args => args[0].Eval(this).ToExpression().Eval(this)}
@@ -42,7 +44,7 @@

         private Value Cond(Node[] args)
         {
-            var clauses = args.Cast<Expression>();
+            var clauses = args.Cast<Expression>().ToArray();
             var last = clauses.Last();

             var checkElse = new Func<Expression, bool>(clause =>
@@ -50,7 +52,7 @@

             if (checkElse(last))
             {
-                clauses = clauses.Take(clauses.Count() - 1);
+                clauses = clauses.Take(clauses.Length - 1).ToArray();
             }
             else
             {
@@ -85,7 +87,7 @@

         public Value Lookup(string name)
         {
-            Value value = null;
+            Value value;
             if (HasLocalContext())
             {
                 value = LocalContext.Lookup(name);
@@ -127,13 +129,14 @@
                     lambda.Args.Quote(this).To<IEnumerable<Value>>().Select(value => value.To<string>()),
                     args != null ? args.ToArray() : new Node[] { });
             }
+
             throw new SymbolNotDefinedException();
         }

         public Value Define(Node definition, Node body)
         {
             var def = definition is Expression
-                ? definition.Quote(this).To<IEnumerable<Value>>().Select(value => value.To<string>())
+                ? definition.Quote(this).To<IEnumerable<Value>>().Select(value => value.To<string>()).ToArray()
                 : new[] { definition.Quote(this).To<string>() };

             var name = def.First();


Small fix

Small fix

--- src/Myra/Graphics2D/UI/ButtonBase.cs
+++ src/Myra/Graphics2D/UI/ButtonBase.cs
@@ -139,10 +139,8 @@
 				return;
 			}

-			var invokeClick = false;
 			if (!Toggleable)
 			{
-				invokeClick = IsPressed;
 				IsPressed = false;
 			}


WebServiceTarget - Remove override of ProxyType = NoProxy as it will turn off HttpClient-pooling (#4448)

--- src/NLog/Targets/WebServiceTarget.cs
+++ src/NLog/Targets/WebServiceTarget.cs
@@ -103,8 +103,9 @@

             Headers = new List<MethodCallParameter>();

-#if NETSTANDARD
-            // WebRequest.GetSystemWebProxy throws PlatformNotSupportedException on NetCore, when Proxy is not configured
+#if NETSTANDARD1_3 || NETSTANDARD1_5
+            // NetCore1 throws PlatformNotSupportedException on WebRequest.GetSystemWebProxy, when using DefaultWebProxy
+            // Net5 (or newer) will turn off Http-connection-pooling if not using DefaultWebProxy
             ProxyType = WebServiceProxyType.NoProxy;
 #endif
         }
@@ -151,6 +152,9 @@
         /// <summary>
         /// Gets or sets the proxy configuration when calling web service
         /// </summary>
+        /// <remarks>
+        /// Changing ProxyType on Net5 (or newer) will turn off Http-connection-pooling
+        /// </remarks>
         /// <docgen category='Web Service Options' order='10' />
         [DefaultValue("DefaultWebProxy")]
         public WebServiceProxyType ProxyType


Update Music.cs

Update Music.cs

--- src/NadekoBot/Modules/Music/Music.cs
+++ src/NadekoBot/Modules/Music/Music.cs
@@ -103,6 +103,10 @@
                     await ReplyErrorLocalized("song_not_found").ConfigureAwait(false);
                 return;
             }
+            if(mp.Paused)
+            {
+                mp.TogglePause();
+            }

             int index;
             try
@@ -129,12 +133,9 @@

                         if (Uri.IsWellFormedUriString(songInfo.Thumbnail, UriKind.Absolute))
                             embed.WithThumbnailUrl(songInfo.Thumbnail);
-
+
                         var queuedMessage = await mp.OutputTextChannel.EmbedAsync(embed).ConfigureAwait(false);
-                        if (mp.Stopped)
-                        {
-                            mp.TogglePause();
-                        }
+
                         queuedMessage?.DeleteAfter(10);
                     }
                     catch
@@ -170,7 +171,7 @@
         [RequireContext(ContextType.Guild)]
         public async Task Queue([Remainder] string query)
         {
-            var mp = await Service.GetOrCreatePlayer(Context);
+            var mp = await Service.GetOrCreatePlayer(Context).ConfigureAwait(false);
             mp.AutoDelete = true;
             var songInfo = await Service.ResolveSong(query, Context.User.ToString());
             try { await InternalQueue(mp, songInfo, false); } catch (QueueFullException) { return; }


Allow escaped percentage

Allow escaped percentage

--- src/OpenSage.Core/StringConverter.cs
+++ src/OpenSage.Core/StringConverter.cs
@@ -33,6 +33,12 @@
                         index++;
                         state = 0;
                     }
+                    // Percentage was escaped
+                    if(c == '%')
+                    {
+                        result += c;
+                        state = 0;
+                    }
                 }
             }


Include skudef in check

Include skudef in check

--- src/OpenSage.Game/Data/FileSystem.cs
+++ src/OpenSage.Game/Data/FileSystem.cs
@@ -41,10 +41,10 @@
                         _fileTable.Add(relativePath, new FileSystemEntry(this, relativePath, (uint) new FileInfo(file).Length, () => File.OpenRead(file)));
                     }
                 }
+
+                // Then load .big files
+                SkudefReader.Read(rootDirectory, path => AddBigArchive(path));
             }
-
-            // Then load .big files
-            SkudefReader.Read(rootDirectory, path => AddBigArchive(path));
         }

         private void AddBigArchive(string path)


Use Path.GetFullPath on the solution file path.

--- src/ProjectReferenceGraph/Program.cs
+++ src/ProjectReferenceGraph/Program.cs
@@ -17,7 +17,7 @@
                 return;
             }

-            var solutionFilePath = args[0];
+            var solutionFilePath = Path.GetFullPath(args[0]);
             if (!File.Exists(solutionFilePath))
             {
                 Console.Error.WriteLine("Solution file not found: " + solutionFilePath);


Fix comment.

Fix comment.

--- src/QbXml/Objects/Types/FLOATTYPE.cs
+++ src/QbXml/Objects/Types/FLOATTYPE.cs
@@ -42,7 +42,7 @@
         /// <summary>
         /// A string representation of the decimal.
         /// </summary>
-        /// <returns>Decimal in G format.</returns>
+        /// <returns>Decimal in 10.5 format.</returns>
         public override string ToString()
         {
             return _value.ToString("0.#####", CultureInfo.InvariantCulture);


Update src/Take.Blip.Builder/FlowManager.cs

Co-Authored-By: nickbom <d38161afe125f7fd79e29e26a98e39ae9741086e@hotmail.com>

--- src/Take.Blip.Builder/FlowManager.cs
+++ src/Take.Blip.Builder/FlowManager.cs
@@ -297,7 +297,7 @@
             // Execute all state actions
             foreach (var stateAction in actions.OrderBy(a => a.Order))
             {
-                var isValidAction = await EvaluateConditionCollectionAsync(stateAction.Conditions, lazyInput, context, cancellationToken);
+                 var isValidAction = await EvaluateConditionsAsync(stateAction.Conditions, lazyInput, context, cancellationToken);
                 if (isValidAction)
                 {
                     var action = _actionProvider.Get(stateAction.Type);
@@ -500,4 +500,4 @@
             }
         }
     }
-}+}


added Test case for issue #270 (#271)

added Test case for issue #270 (#271)

--- src/Tests/HelpCenter/ArticleTests.cs
+++ src/Tests/HelpCenter/ArticleTests.cs
@@ -246,5 +246,17 @@
             });
         }

+        [Test]
+        public async Task CanGetSecondPageUisngGetByPageUrl()
+        {
+            int pageSize = 3;
+
+            var res = await api.HelpCenter.Articles.GetArticlesAsync(perPage: pageSize);
+            Assert.That(res.PageSize, Is.EqualTo(pageSize));
+
+            var resp = await api.HelpCenter.Articles.GetByPageUrlAsync<GroupArticleResponse>(res.NextPage, pageSize);
+            Assert.That(resp.Page, Is.EqualTo(2));
+
+        }
     }
 }


Fix .webmanifest 404

Fix .webmanifest 404

Fix the .webmanifest 404'ing in Azure.

--- src/API/Startup.cs
+++ src/API/Startup.cs
@@ -4,6 +4,7 @@
 namespace MartinCostello.Api
 {
     using System;
+    using System.IO;
     using Extensions;
     using Microsoft.AspNetCore.Builder;
     using Microsoft.AspNetCore.CookiePolicy;
@@ -12,6 +13,7 @@
     using Microsoft.AspNetCore.Http;
     using Microsoft.AspNetCore.HttpOverrides;
     using Microsoft.AspNetCore.Mvc;
+    using Microsoft.AspNetCore.StaticFiles;
     using Microsoft.Extensions.Configuration;
     using Microsoft.Extensions.DependencyInjection;
     using Microsoft.Extensions.Options;
@@ -88,18 +90,7 @@
             app.UseHsts()
                .UseHttpsRedirection();

-            app.UseStaticFiles(
-                new StaticFileOptions()
-                {
-                    OnPrepareResponse = (context) =>
-                    {
-                        var headers = context.Context.Response.GetTypedHeaders();
-                        headers.CacheControl = new CacheControlHeaderValue()
-                        {
-                            MaxAge = TimeSpan.FromDays(7)
-                        };
-                    }
-                });
+            app.UseStaticFiles(CreateStaticFileOptions());

             app.UseForwardedHeaders(
                 new ForwardedHeadersOptions()
@@ -262,6 +253,56 @@
             => HostingEnvironment.IsDevelopment() ? CookieSecurePolicy.SameAsRequest : CookieSecurePolicy.Always;

         /// <summary>
+        /// Configures the options for serving static content.
+        /// </summary>
+        /// <returns>
+        /// The <see cref="StaticFileOptions"/> to use.
+        /// </returns>
+        private StaticFileOptions CreateStaticFileOptions()
+        {
+            var provider = new FileExtensionContentTypeProvider();
+            provider.Mappings[".webmanifest"] = "application/manifest+json";
+
+            return new StaticFileOptions()
+            {
+                ContentTypeProvider = provider,
+                DefaultContentType = "application/json",
+                OnPrepareResponse = SetCacheHeaders,
+                ServeUnknownFileTypes = true,
+            };
+        }
+
+        /// <summary>
+        /// Sets the cache headers for static files.
+        /// </summary>
+        /// <param name="context">The static file response context to set the headers for.</param>
+        private void SetCacheHeaders(StaticFileResponseContext context)
+        {
+            var maxAge = TimeSpan.FromDays(7);
+
+            if (context.File.Exists && HostingEnvironment.IsProduction())
+            {
+                string extension = Path.GetExtension(context.File.PhysicalPath);
+
+                // These files are served with a content hash in the URL so can be cached for longer
+                bool isScriptOrStyle =
+                    string.Equals(extension, ".css", StringComparison.OrdinalIgnoreCase) ||
+                    string.Equals(extension, ".js", StringComparison.OrdinalIgnoreCase);
+
+                if (isScriptOrStyle)
+                {
+                    maxAge = TimeSpan.FromDays(365);
+                }
+            }
+
+            var headers = context.Context.Response.GetTypedHeaders();
+            headers.CacheControl = new CacheControlHeaderValue()
+            {
+                MaxAge = maxAge,
+            };
+        }
+
+        /// <summary>
         /// Handles the application being stopped.
         /// </summary>
         private void OnApplicationStopped()


log jobs information

log jobs information

--- src/Api/Startup.cs
+++ src/Api/Startup.cs
@@ -158,7 +158,8 @@
                     return false;
                 }

-                if(context.Contains(typeof(IpRateLimitMiddleware).FullName) && e.Level == LogEventLevel.Information)
+                if(e.Level == LogEventLevel.Information &&
+                    (context.Contains(typeof(IpRateLimitMiddleware).FullName) || context.StartsWith("\"Bit.Api.Jobs")))
                 {
                     return true;
                 }


MousePositionEventArgs contains Vector2 instead of ints for positions

--- smithNgine/Input/MousePositionEventArgs.cs
+++ smithNgine/Input/MousePositionEventArgs.cs
@@ -6,22 +6,19 @@
 // ***************************************************************************

 using System;
+using Microsoft.Xna.Framework;

 namespace Codesmith.SmithNgine.Input
 {
     public class MousePositionEventArgs : EventArgs
     {
-        public int X;
-        public int Y;
-        public int oldX;
-        public int oldY;
+        public Vector2 oldPosition;
+        public Vector2 newPosition;

         public MousePositionEventArgs(int oldX, int oldY, int newX, int newY)
         {
-            this.X = newX;
-            this.Y = newY;
-            this.oldX = oldX;
-            this.oldY = oldY;
+            oldPosition = new Vector2(oldX, newX);
+            newPosition = new Vector2(newX, newY);
         }

         private MousePositionEventArgs() { }


Remove some test code

Remove some test code

--- source/Craft.Net.Client/MinecraftClient.cs
+++ source/Craft.Net.Client/MinecraftClient.cs
@@ -119,7 +119,6 @@
                         try
                         {
                             // Write packet
-                            Console.WriteLine("-> " + packet.GetType().Name);
                             NetworkManager.WritePacket(packet, PacketDirection.Serverbound);
                             if (packet is DisconnectPacket)
                                 return;
@@ -134,7 +133,6 @@
                     try
                     {
                         var packet = NetworkManager.ReadPacket(PacketDirection.Clientbound);
-                        Console.WriteLine("<- " + packet.GetType().Name);
                         HandlePacket(packet);
                         if (packet is DisconnectPacket)
                         {


Whitespace in log file names replaced with underscore (simpler to select in linux terminal).

--- source/Mechanical3.NET45/MVVM/WpfHelper.cs
+++ source/Mechanical3.NET45/MVVM/WpfHelper.cs
@@ -214,14 +214,14 @@

         private static string GetNewLogFileNameWithoutExtension()
         {
-            return "log " + DateTime.UtcNow.ToString("yyyy-MM-dd HH-mm", CultureInfo.InvariantCulture);
+            return "log_" + DateTime.UtcNow.ToString("yyyy-MM-dd_HH-mm", CultureInfo.InvariantCulture);
         }

         private static DateTime ParseLogFileName( FilePath logFile )
         {
             return DateTime.ParseExact(
-                logFile.NameWithoutExtension.Substring(startIndex: "log ".Length),
-                "yyyy-MM-dd HH-mm",
+                logFile.NameWithoutExtension.Replace(' ', '_').Substring(startIndex: "log_".Length),
+                "yyyy-MM-dd_HH-mm",
                 CultureInfo.InvariantCulture,
                 DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal);
         }


Release 6.1

Release 6.1

--- source/Playnite/Properties/AssemblyInfo.cs
+++ source/Playnite/Properties/AssemblyInfo.cs
@@ -35,7 +35,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("6.0.0.*")]
+[assembly: AssemblyVersion("6.1.0.*")]
 [assembly: InternalsVisibleTo("Playnite.Tests")]

 [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "Playnite")]


Extended with args to catcher

Extended with args to catcher

git-tfs-id: [http://quagmire.cuemon.dk:8080/tfs/MuchMoreCollection]$/MUCHMORE/Main/Source/DnxCore/Cuemon Framework Core/src;C5600

--- Cuemon.Core/Disposable.cs
+++ Cuemon.Core/Disposable.cs
@@ -21,123 +21,130 @@
         {
             Validator.ThrowIfNull(initializer, nameof(initializer));
             Validator.ThrowIfNull(tester, nameof(tester));
-            var factory = FuncFactory.Create(tester, null);
-            return SafeInvokeCore(factory, initializer, catcher);
-        }
-
-        /// <summary>
-        /// Provides a generic way to abide the rule description of CA2000 (Dispose objects before losing scope).
-        /// </summary>
-        /// <typeparam name="T">The type of the parameter of the function delegate <paramref name="tester"/>.</typeparam>
-        /// <typeparam name="TResult">The type of the return value of the function delegate <paramref name="initializer"/>.</typeparam>
-        /// <param name="initializer">The function delegate that initializes an object implementing the <see cref="IDisposable"/> interface.</param>
-        /// <param name="tester">The function delegate that is used to ensure that operations performed on <typeparamref name="TResult"/> abides CA2000.</param>
-        /// <param name="arg">The parameter of the function delegate <paramref name="tester"/>.</param>
-        /// <param name="catcher">The delegate that will handle any exceptions might thrown by <paramref name="tester"/>.</param>
-        /// <returns>The return value of the function delegate <paramref name="initializer"/> if the operations succeeded; otherwise null if the operation failed.</returns>
-        public static TResult SafeInvoke<T, TResult>(Func<TResult> initializer, Func<TResult, T, TResult> tester, T arg, Action<Exception> catcher = null) where TResult : class, IDisposable
-        {
-            Validator.ThrowIfNull(initializer, nameof(initializer));
-            Validator.ThrowIfNull(tester, nameof(tester));
-            var factory = FuncFactory.Create(tester, null, arg);
-            return SafeInvokeCore(factory, initializer, catcher);
-        }
-
-        /// <summary>
-        /// Provides a generic way to abide the rule description of CA2000 (Dispose objects before losing scope).
-        /// </summary>
-        /// <typeparam name="T1">The type of the first parameter of the function delegate <paramref name="tester"/>.</typeparam>
-        /// <typeparam name="T2">The type of the second parameter of the function delegate <paramref name="tester"/>.</typeparam>
-        /// <typeparam name="TResult">The type of the return value of the function delegate <paramref name="initializer"/>.</typeparam>
-        /// <param name="initializer">The function delegate that initializes an object implementing the <see cref="IDisposable"/> interface.</param>
-        /// <param name="tester">The function delegate that is used to ensure that operations performed on <typeparamref name="TResult"/> abides CA2000.</param>
-        /// <param name="arg1">The first parameter of the function delegate <paramref name="tester"/>.</param>
-        /// <param name="arg2">The second parameter of the function delegate <paramref name="tester"/>.</param>
-        /// <param name="catcher">The delegate that will handle any exceptions might thrown by <paramref name="tester"/>.</param>
-        /// <returns>The return value of the function delegate <paramref name="initializer"/> if the operations succeeded; otherwise null if the operation failed.</returns>
-        public static TResult SafeInvoke<T1, T2, TResult>(Func<TResult> initializer, Func<TResult, T1, T2, TResult> tester, T1 arg1, T2 arg2, Action<Exception> catcher = null) where TResult : class, IDisposable
-        {
-            Validator.ThrowIfNull(initializer, nameof(initializer));
-            Validator.ThrowIfNull(tester, nameof(tester));
-            var factory = FuncFactory.Create(tester, null, arg1, arg2);
-            return SafeInvokeCore(factory, initializer, catcher);
-        }
-
-        /// <summary>
-        /// Provides a generic way to abide the rule description of CA2000 (Dispose objects before losing scope).
-        /// </summary>
-        /// <typeparam name="T1">The type of the first parameter of the function delegate <paramref name="tester"/>.</typeparam>
-        /// <typeparam name="T2">The type of the second parameter of the function delegate <paramref name="tester"/>.</typeparam>
-        /// <typeparam name="T3">The type of the third parameter of the function delegate <paramref name="tester"/>.</typeparam>
-        /// <typeparam name="TResult">The type of the return value of the function delegate <paramref name="initializer"/>.</typeparam>
-        /// <param name="initializer">The function delegate that initializes an object implementing the <see cref="IDisposable"/> interface.</param>
-        /// <param name="tester">The function delegate that is used to ensure that operations performed on <typeparamref name="TResult"/> abides CA2000.</param>
-        /// <param name="arg1">The first parameter of the function delegate <paramref name="tester"/>.</param>
-        /// <param name="arg2">The second parameter of the function delegate <paramref name="tester"/>.</param>
-        /// <param name="arg3">The third parameter of the function delegate <paramref name="tester"/>.</param>
-        /// <param name="catcher">The delegate that will handle any exceptions might thrown by <paramref name="tester"/>.</param>
-        /// <returns>The return value of the function delegate <paramref name="initializer"/> if the operations succeeded; otherwise null if the operation failed.</returns>
-        public static TResult SafeInvoke<T1, T2, T3, TResult>(Func<TResult> initializer, Func<TResult, T1, T2, T3, TResult> tester, T1 arg1, T2 arg2, T3 arg3, Action<Exception> catcher = null) where TResult : class, IDisposable
-        {
-            Validator.ThrowIfNull(initializer, nameof(initializer));
-            Validator.ThrowIfNull(tester, nameof(tester));
-            var factory = FuncFactory.Create(tester, null, arg1, arg2, arg3);
-            return SafeInvokeCore(factory, initializer, catcher);
-        }
-
-        /// <summary>
-        /// Provides a generic way to abide the rule description of CA2000 (Dispose objects before losing scope).
-        /// </summary>
-        /// <typeparam name="T1">The type of the first parameter of the function delegate <paramref name="tester"/>.</typeparam>
-        /// <typeparam name="T2">The type of the second parameter of the function delegate <paramref name="tester"/>.</typeparam>
-        /// <typeparam name="T3">The type of the third parameter of the function delegate <paramref name="tester"/>.</typeparam>
-        /// <typeparam name="T4">The type of the fourth parameter of the function delegate <paramref name="tester"/>.</typeparam>
-        /// <typeparam name="TResult">The type of the return value of the function delegate <paramref name="initializer"/>.</typeparam>
-        /// <param name="initializer">The function delegate that initializes an object implementing the <see cref="IDisposable"/> interface.</param>
-        /// <param name="tester">The function delegate that is used to ensure that operations performed on <typeparamref name="TResult"/> abides CA2000.</param>
-        /// <param name="arg1">The first parameter of the function delegate <paramref name="tester"/>.</param>
-        /// <param name="arg2">The second parameter of the function delegate <paramref name="tester"/>.</param>
-        /// <param name="arg3">The third parameter of the function delegate <paramref name="tester"/>.</param>
-        /// <param name="arg4">The fourth parameter of the function delegate <paramref name="tester"/>.</param>
-        /// <param name="catcher">The delegate that will handle any exceptions might thrown by <paramref name="tester"/>.</param>
-        /// <returns>The return value of the function delegate <paramref name="initializer"/> if the operations succeeded; otherwise null if the operation failed.</returns>
-        public static TResult SafeInvoke<T1, T2, T3, T4, TResult>(Func<TResult> initializer, Func<TResult, T1, T2, T3, T4, TResult> tester, T1 arg1, T2 arg2, T3 arg3, T4 arg4, Action<Exception> catcher = null) where TResult : class, IDisposable
-        {
-            Validator.ThrowIfNull(initializer, nameof(initializer));
-            Validator.ThrowIfNull(tester, nameof(tester));
-            var factory = FuncFactory.Create(tester, null, arg1, arg2, arg3, arg4);
-            return SafeInvokeCore(factory, initializer, catcher);
-        }
-
-        /// <summary>
-        /// Provides a generic way to abide the rule description of CA2000 (Dispose objects before losing scope).
-        /// </summary>
-        /// <typeparam name="T1">The type of the first parameter of the function delegate <paramref name="tester"/>.</typeparam>
-        /// <typeparam name="T2">The type of the second parameter of the function delegate <paramref name="tester"/>.</typeparam>
-        /// <typeparam name="T3">The type of the third parameter of the function delegate <paramref name="tester"/>.</typeparam>
-        /// <typeparam name="T4">The type of the fourth parameter of the function delegate <paramref name="tester"/>.</typeparam>
-        /// <typeparam name="T5">The type of the fifth parameter of the function delegate <paramref name="tester"/>.</typeparam>
-        /// <typeparam name="TResult">The type of the return value of the function delegate <paramref name="initializer"/>.</typeparam>
-        /// <param name="initializer">The function delegate that initializes an object implementing the <see cref="IDisposable"/> interface.</param>
-        /// <param name="tester">The function delegate that is used to ensure that operations performed on <typeparamref name="TResult"/> abides CA2000.</param>
-        /// <param name="arg1">The first parameter of the function delegate <paramref name="tester"/>.</param>
-        /// <param name="arg2">The second parameter of the function delegate <paramref name="tester"/>.</param>
-        /// <param name="arg3">The third parameter of the function delegate <paramref name="tester"/>.</param>
-        /// <param name="arg4">The fourth parameter of the function delegate <paramref name="tester"/>.</param>
-        /// <param name="arg5">The fifth parameter of the function delegate <paramref name="tester"/>.</param>
-        /// <param name="catcher">The delegate that will handle any exceptions might thrown by <paramref name="tester"/>.</param>
-        /// <returns>The return value of the function delegate <paramref name="initializer"/> if the operations succeeded; otherwise null if the operation failed.</returns>
-        public static TResult SafeInvoke<T1, T2, T3, T4, T5, TResult>(Func<TResult> initializer, Func<TResult, T1, T2, T3, T4, T5, TResult> tester, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, Action<Exception> catcher = null) where TResult : class, IDisposable
-        {
-            Validator.ThrowIfNull(initializer, nameof(initializer));
-            Validator.ThrowIfNull(tester, nameof(tester));
-            var factory = FuncFactory.Create(tester, null, arg1, arg2, arg3, arg4, arg5);
-            return SafeInvokeCore(factory, initializer, catcher);
-        }
-
-        private static TResult SafeInvokeCore<TTuple, TResult>(FuncFactory<TTuple, TResult> testerFactory, Func<TResult> initializer, Action<Exception> catcher = null)
+            var f1 = FuncFactory.Create(tester, default);
+            var f2 = ActionFactory.Create(catcher, default);
+            return SafeInvokeCore(f1, initializer, f2);
+        }
+
+        /// <summary>
+        /// Provides a generic way to abide the rule description of CA2000 (Dispose objects before losing scope).
+        /// </summary>
+        /// <typeparam name="T">The type of the parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</typeparam>
+        /// <typeparam name="TResult">The type of the return value of the function delegate <paramref name="initializer"/>.</typeparam>
+        /// <param name="initializer">The function delegate that initializes an object implementing the <see cref="IDisposable"/> interface.</param>
+        /// <param name="tester">The function delegate that is used to ensure that operations performed on <typeparamref name="TResult"/> abides CA2000.</param>
+        /// <param name="arg">The parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</param>
+        /// <param name="catcher">The delegate that will handle any exceptions might thrown by <paramref name="tester"/>.</param>
+        /// <returns>The return value of the function delegate <paramref name="initializer"/> if the operations succeeded; otherwise null if the operation failed.</returns>
+        public static TResult SafeInvoke<T, TResult>(Func<TResult> initializer, Func<TResult, T, TResult> tester, T arg, Action<Exception, T> catcher = null) where TResult : class, IDisposable
+        {
+            Validator.ThrowIfNull(initializer, nameof(initializer));
+            Validator.ThrowIfNull(tester, nameof(tester));
+            var f1 = FuncFactory.Create(tester, null, arg);
+            var f2 = ActionFactory.Create(catcher, null, arg);
+            return SafeInvokeCore(f1, initializer, f2);
+        }
+
+        /// <summary>
+        /// Provides a generic way to abide the rule description of CA2000 (Dispose objects before losing scope).
+        /// </summary>
+        /// <typeparam name="T1">The type of the first parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</typeparam>
+        /// <typeparam name="T2">The type of the second parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</typeparam>
+        /// <typeparam name="TResult">The type of the return value of the function delegate <paramref name="initializer"/>.</typeparam>
+        /// <param name="initializer">The function delegate that initializes an object implementing the <see cref="IDisposable"/> interface.</param>
+        /// <param name="tester">The function delegate that is used to ensure that operations performed on <typeparamref name="TResult"/> abides CA2000.</param>
+        /// <param name="arg1">The first parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</param>
+        /// <param name="arg2">The second parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</param>
+        /// <param name="catcher">The delegate that will handle any exceptions might thrown by <paramref name="tester"/>.</param>
+        /// <returns>The return value of the function delegate <paramref name="initializer"/> if the operations succeeded; otherwise null if the operation failed.</returns>
+        public static TResult SafeInvoke<T1, T2, TResult>(Func<TResult> initializer, Func<TResult, T1, T2, TResult> tester, T1 arg1, T2 arg2, Action<Exception, T1, T2> catcher = null) where TResult : class, IDisposable
+        {
+            Validator.ThrowIfNull(initializer, nameof(initializer));
+            Validator.ThrowIfNull(tester, nameof(tester));
+            var f1 = FuncFactory.Create(tester, null, arg1, arg2);
+            var f2 = ActionFactory.Create(catcher, null, arg1, arg2);
+            return SafeInvokeCore(f1, initializer, f2);
+        }
+
+        /// <summary>
+        /// Provides a generic way to abide the rule description of CA2000 (Dispose objects before losing scope).
+        /// </summary>
+        /// <typeparam name="T1">The type of the first parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</typeparam>
+        /// <typeparam name="T2">The type of the second parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</typeparam>
+        /// <typeparam name="T3">The type of the third parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</typeparam>
+        /// <typeparam name="TResult">The type of the return value of the function delegate <paramref name="initializer"/>.</typeparam>
+        /// <param name="initializer">The function delegate that initializes an object implementing the <see cref="IDisposable"/> interface.</param>
+        /// <param name="tester">The function delegate that is used to ensure that operations performed on <typeparamref name="TResult"/> abides CA2000.</param>
+        /// <param name="arg1">The first parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</param>
+        /// <param name="arg2">The second parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</param>
+        /// <param name="arg3">The third parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</param>
+        /// <param name="catcher">The delegate that will handle any exceptions might thrown by <paramref name="tester"/>.</param>
+        /// <returns>The return value of the function delegate <paramref name="initializer"/> if the operations succeeded; otherwise null if the operation failed.</returns>
+        public static TResult SafeInvoke<T1, T2, T3, TResult>(Func<TResult> initializer, Func<TResult, T1, T2, T3, TResult> tester, T1 arg1, T2 arg2, T3 arg3, Action<Exception, T1, T2, T3> catcher = null) where TResult : class, IDisposable
+        {
+            Validator.ThrowIfNull(initializer, nameof(initializer));
+            Validator.ThrowIfNull(tester, nameof(tester));
+            var f1 = FuncFactory.Create(tester, null, arg1, arg2, arg3);
+            var f2 = ActionFactory.Create(catcher, null, arg1, arg2, arg3);
+            return SafeInvokeCore(f1, initializer, f2);
+        }
+
+        /// <summary>
+        /// Provides a generic way to abide the rule description of CA2000 (Dispose objects before losing scope).
+        /// </summary>
+        /// <typeparam name="T1">The type of the first parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</typeparam>
+        /// <typeparam name="T2">The type of the second parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</typeparam>
+        /// <typeparam name="T3">The type of the third parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</typeparam>
+        /// <typeparam name="T4">The type of the fourth parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</typeparam>
+        /// <typeparam name="TResult">The type of the return value of the function delegate <paramref name="initializer"/>.</typeparam>
+        /// <param name="initializer">The function delegate that initializes an object implementing the <see cref="IDisposable"/> interface.</param>
+        /// <param name="tester">The function delegate that is used to ensure that operations performed on <typeparamref name="TResult"/> abides CA2000.</param>
+        /// <param name="arg1">The first parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</param>
+        /// <param name="arg2">The second parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</param>
+        /// <param name="arg3">The third parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</param>
+        /// <param name="arg4">The fourth parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</param>
+        /// <param name="catcher">The delegate that will handle any exceptions might thrown by <paramref name="tester"/>.</param>
+        /// <returns>The return value of the function delegate <paramref name="initializer"/> if the operations succeeded; otherwise null if the operation failed.</returns>
+        public static TResult SafeInvoke<T1, T2, T3, T4, TResult>(Func<TResult> initializer, Func<TResult, T1, T2, T3, T4, TResult> tester, T1 arg1, T2 arg2, T3 arg3, T4 arg4, Action<Exception, T1, T2, T3, T4> catcher = null) where TResult : class, IDisposable
+        {
+            Validator.ThrowIfNull(initializer, nameof(initializer));
+            Validator.ThrowIfNull(tester, nameof(tester));
+            var f1 = FuncFactory.Create(tester, null, arg1, arg2, arg3, arg4);
+            var f2 = ActionFactory.Create(catcher, null, arg1, arg2, arg3, arg4);
+            return SafeInvokeCore(f1, initializer, f2);
+        }
+
+        /// <summary>
+        /// Provides a generic way to abide the rule description of CA2000 (Dispose objects before losing scope).
+        /// </summary>
+        /// <typeparam name="T1">The type of the first parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</typeparam>
+        /// <typeparam name="T2">The type of the second parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</typeparam>
+        /// <typeparam name="T3">The type of the third parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</typeparam>
+        /// <typeparam name="T4">The type of the fourth parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</typeparam>
+        /// <typeparam name="T5">The type of the fifth parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</typeparam>
+        /// <typeparam name="TResult">The type of the return value of the function delegate <paramref name="initializer"/>.</typeparam>
+        /// <param name="initializer">The function delegate that initializes an object implementing the <see cref="IDisposable"/> interface.</param>
+        /// <param name="tester">The function delegate that is used to ensure that operations performed on <typeparamref name="TResult"/> abides CA2000.</param>
+        /// <param name="arg1">The first parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</param>
+        /// <param name="arg2">The second parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</param>
+        /// <param name="arg3">The third parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</param>
+        /// <param name="arg4">The fourth parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</param>
+        /// <param name="arg5">The fifth parameter of the function delegate <paramref name="tester"/> and delegate <paramref name="catcher"/>.</param>
+        /// <param name="catcher">The delegate that will handle any exceptions might thrown by <paramref name="tester"/>.</param>
+        /// <returns>The return value of the function delegate <paramref name="initializer"/> if the operations succeeded; otherwise null if the operation failed.</returns>
+        public static TResult SafeInvoke<T1, T2, T3, T4, T5, TResult>(Func<TResult> initializer, Func<TResult, T1, T2, T3, T4, T5, TResult> tester, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, Action<Exception, T1, T2, T3, T4, T5> catcher = null) where TResult : class, IDisposable
+        {
+            Validator.ThrowIfNull(initializer, nameof(initializer));
+            Validator.ThrowIfNull(tester, nameof(tester));
+            var f1 = FuncFactory.Create(tester, null, arg1, arg2, arg3, arg4, arg5);
+            var f2 = ActionFactory.Create(catcher, null, arg1, arg2, arg3, arg4, arg5);
+            return SafeInvokeCore(f1, initializer, f2);
+        }
+
+        private static TResult SafeInvokeCore<TTester, TResult, TCatcher>(FuncFactory<TTester, TResult> testerFactory, Func<TResult> initializer, ActionFactory<TCatcher> catcherFactory)
             where TResult : class, IDisposable
-            where TTuple : Template<TResult>
+            where TTester : Template<TResult>
+            where TCatcher : Template<Exception>
         {
             TResult result = null;
             try
@@ -149,13 +156,14 @@
             }
             catch (Exception e)
             {
-                if (catcher == null)
+                if (!catcherFactory.HasDelegate)
                 {
                     throw;
                 }
                 else
                 {
-                    catcher(e);
+                    catcherFactory.GenericArguments.Arg1 = e;
+                    catcherFactory.ExecuteMethod();
                 }
             }
             finally


Don't use community.csharpsqlite in Unix

--- DataStorage/SQLiteUnix.cs
+++ DataStorage/SQLiteUnix.cs
@@ -31,14 +31,8 @@
 using System.Linq.Expressions;
 using System.Threading;

-#if USE_CSHARP_SQLITE
-using Community.CsharpSqlite;
-using Sqlite3DatabaseHandle = Community.CsharpSqlite.Sqlite3.sqlite3;
-using Sqlite3Statement = Community.CsharpSqlite.Sqlite3.Vdbe;
-#else
 using Sqlite3DatabaseHandle = System.IntPtr;
 using Sqlite3Statement = System.IntPtr;
-#endif

 using MatterHackers.MatterControl.DataStorage;


Set state with event

Set state with event

--- Diplomata/Models/Quest.cs
+++ Diplomata/Models/Quest.cs
@@ -186,7 +186,10 @@
       {
         Initialized = true;
         if (ArrayHelper.Contains(QuestState.GetIDs(questStates), stateId))
+        {
           currentStateId = stateId;
+          DiplomataManager.EventController.SendQuestStateChange(this);
+        }
       }
       else
       {


Addds regex bypass support for fixes#4 +semver:minor

--- TfvcBranchPolicy.CheckinPolicy/Policies/LockBranchPolicy.cs
+++ TfvcBranchPolicy.CheckinPolicy/Policies/LockBranchPolicy.cs
@@ -69,14 +69,13 @@
             }
             else if (IsLocked && IsByPassEnabled)
             {
-
                 if ((pendingCheckin.PendingChanges.Comment != null) && (BypassString != null))
                 {
-                    if (!pendingCheckin.PendingChanges.Comment.Contains(BypassString))
+
+                    if (!System.Text.RegularExpressions.Regex.Match(pendingCheckin.PendingChanges.Comment, BypassString).Success)
                     {
                         lockedWithUnmatchedBypass = true;
                     }
-
                 }
                 else
                 {


Added new extension method.

Added new extension method.

--- XOMNI.SDK/XOMNI.SDK.Public/Extensions/ValidatorExtension.cs
+++ XOMNI.SDK/XOMNI.SDK.Public/Extensions/ValidatorExtension.cs
@@ -16,6 +16,16 @@
             }
             return item;
         }
+
+        public static Parameter<Nullable<double>> IsNotNull(this Parameter<Nullable<double>> item)
+        {
+            if(!item.Value.HasValue)
+            {
+                throw new ArgumentException(string.Format("{0} can not be null.", item.ArgName));
+            }
+            return item;
+        }
+
         public static Parameter<string> IsNotNullOrEmpty(this Parameter<string> item)
         {
             if (string.IsNullOrEmpty(item.Value))


Ram.Reset() no longer clears previously loaded cartridges.

--- Sega/Mappers/Ram.cs
+++ Sega/Mappers/Ram.cs
@@ -44,10 +44,7 @@
 		/// Resets the mapper to its default state.
 		/// </summary>
 		public void Reset() {
-
-			// Clear cartridge RAM.
-			this.Memory = new byte[0x10000];
-
+			// Do nothing...
 		}

 		/// <summary>
@@ -62,7 +59,7 @@
 		/// Creates an instance of the <see cref="Ram"/> mapper.
 		/// </summary>
 		public Ram() {
-			this.Reset();
+			this.Memory = new byte[0x10000];
 		}

 		#endregion


Debugging convenience code

Debugging convenience code

--- src/Catel.Fody/ModuleWeaver.cs
+++ src/Catel.Fody/ModuleWeaver.cs
@@ -142,7 +142,10 @@
                 LogError(ex.Message);

 #if DEBUG
-                Debugger.Launch();
+                if (!Debugger.IsAttached)
+                {
+                    Debugger.Launch();
+                }
 #endif
             }
         }


Support texture scales and offsets for stored materials.

Signed-off-by: TheSniperFan <db7563122c08a03c83ae47e44bdc9bc661a824b1@gmail.com>

--- Assets/Plugins/OpenUnityTools/unityserializer-ng/Serialization/StoreMaterials.cs
+++ Assets/Plugins/OpenUnityTools/unityserializer-ng/Serialization/StoreMaterials.cs
@@ -84,7 +84,7 @@
     /// </summary>
     public class StoredValue {
         public MaterialProperty property;
-        public object value;
+        public object[] value;
     }

     static StoreMaterials() {
@@ -135,19 +135,26 @@
             output.Add(o);
             switch (p.type) {
                 case MaterialProperty.PropertyType.Color:
-                    o.value = m.GetColor(p.name);
+                    o.value = new object[1];
+                    o.value[0] = m.GetColor(p.name);
                     break;
                 case MaterialProperty.PropertyType.Float:
-                    o.value = m.GetFloat(p.name);
+                    o.value = new object[1];
+                    o.value[0] = m.GetFloat(p.name);
                     break;
                 case MaterialProperty.PropertyType.Range:
-                    o.value = m.GetFloat(p.name);
+                    o.value = new object[1];
+                    o.value[0] = m.GetFloat(p.name);
                     break;
                 case MaterialProperty.PropertyType.TexEnv:
-                    o.value = m.GetTexture(p.name);
+                    o.value = new object[3];
+                    o.value[0] = m.GetTexture(p.name);
+                    o.value[1] = m.GetTextureOffset(p.name);
+                    o.value[2] = m.GetTextureScale(p.name);
                     break;
                 case MaterialProperty.PropertyType.Vector:
-                    o.value = m.GetVector(p.name);
+                    o.value = new object[1];
+                    o.value[0] = m.GetVector(p.name);
                     break;
                 default:
                     Debug.LogError("Unsupported type: " + p.type.ToString());
@@ -166,19 +173,22 @@
         foreach (var v in values) {
             switch (v.property.type) {
                 case MaterialProperty.PropertyType.Color:
-                    m.SetColor(v.property.name, (Color)v.value);
+                    m.SetColor(v.property.name, (Color)v.value[0]);
+                    Debug.Log(v.property.name);
                     break;
                 case MaterialProperty.PropertyType.Float:
-                    m.SetFloat(v.property.name, (float)v.value);
+                    m.SetFloat(v.property.name, (float)v.value[0]);
                     break;
                 case MaterialProperty.PropertyType.Range:
-                    m.SetFloat(v.property.name, (float)v.value);
+                    m.SetFloat(v.property.name, (float)v.value[0]);
                     break;
                 case MaterialProperty.PropertyType.TexEnv:
-                    m.SetTexture(v.property.name, (Texture)v.value);
+                    m.SetTexture(v.property.name, (Texture)v.value[0]);
+                    m.SetTextureOffset(v.property.name, (Vector2)v.value[1]);
+                    m.SetTextureScale(v.property.name, (Vector2)v.value[2]);
                     break;
                 case MaterialProperty.PropertyType.Vector:
-                    m.SetVector(v.property.name, (Vector4)v.value);
+                    m.SetVector(v.property.name, (Vector4)v.value[0]);
                     break;
                 default:
                     Debug.LogError("Unsupported type: " + v.property.type.ToString());


add TODO

add TODO

--- Assets/Scripts/HarryPotterUnity/Cards/Transfiguration/Items/PhilosophersStone.cs
+++ Assets/Scripts/HarryPotterUnity/Cards/Transfiguration/Items/PhilosophersStone.cs
@@ -11,6 +11,7 @@
             return Player.CanUseActions(2) && Player.IsLocalPlayer;
         }

+        //TODO: Test This
         public override void OnInPlayAction(List<BaseCard> targets = null)
         {
             var allCards = Player.Discard.GetHealableCards();


Compare also DueDate in InitialGoogleTaskEntityMatcher

--- CalDavSynchronizer/Implementation/GoogleTasks/InitialGoogleTasktEntityMatcher.cs
+++ CalDavSynchronizer/Implementation/GoogleTasks/InitialGoogleTasktEntityMatcher.cs
@@ -33,8 +33,20 @@

     protected override bool AreEqual (TaskItemWrapper atypeEntity, Task btypeEntity)
     {
-      return atypeEntity.Inner.Subject == btypeEntity.Title;
-      // TODO: check also date
+      if (atypeEntity.Inner.Subject == btypeEntity.Title)
+      {
+        DateTime dateNull = new DateTime (4501, 1, 1, 0, 0, 0);
+
+        if (btypeEntity.Due == null)
+        {
+          return atypeEntity.Inner.DueDate == dateNull;
+        }
+        else
+        {
+          return atypeEntity.Inner.DueDate == btypeEntity.Due.Value.Date;
+        }
+      }
+      return false;
     }

     protected override string GetAtypePropertyValue (TaskItemWrapper atypeEntity)


removed indicator height

removed indicator height

--- DHSegmentedControlSample/DHSegmentedControlSample/Controls/DHSegmentedControl.cs
+++ DHSegmentedControlSample/DHSegmentedControlSample/Controls/DHSegmentedControl.cs
@@ -307,7 +307,7 @@
 					{
 						stringWidth = _segmentWidth - LabelPaddingInset.Right - LabelPaddingInset.Left;

-						newRect = new CGRect((_segmentWidth * idx) + (_segmentWidth - stringWidth) / 2, 0, stringWidth, oldRect.Height - SelectionIndicatorHeight - LabelPaddingInset.Top - LabelPaddingInset.Bottom);
+						newRect = new CGRect((_segmentWidth * idx) + (_segmentWidth - stringWidth) / 2, 0, stringWidth, oldRect.Height - LabelPaddingInset.Top - LabelPaddingInset.Bottom);
 						rectDiv = new CGRect((_segmentWidth * idx) + (VerticalDividerWidth / 2), SelectionIndicatorHeight * 2, VerticalDividerWidth, Frame.Size.Height - (SelectionIndicatorHeight * 4));
 						rectFull = new CGRect(_segmentWidth * idx, 0, _segmentWidth, oldRect.Height - SelectionIndicatorHeight);
 					}
@@ -743,12 +743,6 @@
 			SelectionIndicatorStripLayer.Dispose();
 			SelectionIndicatorArrowLayer.Dispose();

-			foreach (var view in Subviews)
-			{
-				view.RemoveFromSuperview();
-				view.Dispose();
-			}
-
 			base.Dispose(disposing);
 		}


Don't open dropdown if empty (refs #20)

Don't open dropdown if empty (refs #20)

--- DotNetKit.Wpf.AutoCompleteComboBox/Windows/Controls/AutoCompleteComboBox.xaml.cs
+++ DotNetKit.Wpf.AutoCompleteComboBox/Windows/Controls/AutoCompleteComboBox.xaml.cs
@@ -186,9 +186,10 @@
                 var maxCount = SettingOrDefault.MaxSuggestionCount;
                 var count = CountWithMax(ItemsSource?.Cast<object>() ?? Enumerable.Empty<object>(), filter, maxCount);

-                if (count > maxCount) return;
-
-                OpenDropDown(filter);
+                if (0 < count && count <= maxCount)
+                {
+                    OpenDropDown(filter);
+                }
             }
         }


Removed using

Removed using

--- src/Core2D.Avalonia/Program.cs
+++ src/Core2D.Avalonia/Program.cs
@@ -1,7 +1,6 @@
 // Copyright (c) Wiesław Šoltés. All rights reserved.
 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
 using System;
-using System.Threading;
 using Autofac;
 using Avalonia;
 using Avalonia.Logging.Serilog;


Enable logging

Enable logging

--- src/Core2D.Perspex/App.xaml.cs
+++ src/Core2D.Perspex/App.xaml.cs
@@ -17,6 +17,7 @@
 using Perspex;
 using Perspex.Controls;
 using Perspex.Diagnostics;
+using Perspex.Logging.Serilog;
 using Perspex.Markup.Xaml;
 #if SKIA_WIN
 using Perspex.Win32;
@@ -30,6 +31,7 @@
 using Serializer.Newtonsoft;
 using Serializer.ProtoBuf;
 using Serializer.Xaml;
+using Serilog;
 using System;
 using System.Linq;
 using System.Reflection;
@@ -79,6 +81,8 @@
             InitializeSubsystems((int)Environment.OSVersion.Platform);
 #endif
             InitializeComponent();
+            InitializeLogging();
+
         }

         /// <summary>
@@ -87,6 +91,19 @@
         private void InitializeComponent()
         {
             PerspexXamlLoader.Load(this);
+        }
+
+        /// <summary>
+        /// Initialize the Serilog logger.
+        /// </summary>
+        private void InitializeLogging()
+        {
+#if DEBUG
+            SerilogLogger.Initialize(new LoggerConfiguration()
+                .MinimumLevel.Warning()
+                .WriteTo.Trace(outputTemplate: "{Area}: {Message}")
+                .CreateLogger());
+#endif
         }

         /// <summary>


Fix #2325: Switching sessions doesn't stop debugging

Stop debugging when broker switching is complete.

--- src/Debugger/Impl/AD7Engine.cs
+++ src/Debugger/Impl/AD7Engine.cs
@@ -8,6 +8,7 @@
 using System.Threading;
 using System.Threading.Tasks;
 using Microsoft.Common.Core;
+using Microsoft.R.Components.InteractiveWorkflow;
 using Microsoft.R.Debugger.PortSupplier;
 using Microsoft.R.ExecutionTracing;
 using Microsoft.R.Host.Client;
@@ -43,6 +44,9 @@
         internal AD7Thread MainThread { get; private set; }

         [Import]
+        private IRInteractiveWorkflowProvider WorkflowProvider { get; set; }
+
+        [Import]
         internal IDebugGridViewProvider GridViewProvider { get; set; }

         public AD7Engine() {
@@ -62,6 +66,9 @@
             Tracer.Browse -= Tracer_Browse;
             Session.AfterRequest -= Session_AfterRequest;
             Session.Disconnected -= Session_Disconnected;
+
+            var sessionProvider = WorkflowProvider.GetOrCreate().RSessions;
+            sessionProvider.BrokerChanged -= SessionProvider_BrokerChanged;

             _events = null;
             _program = null;
@@ -165,6 +172,9 @@
             AD7ProgramCreateEvent.Send(this);
             Send(new AD7LoadCompleteEvent(), AD7LoadCompleteEvent.IID);

+            var sessionProvider = WorkflowProvider.GetOrCreate().RSessions;
+            sessionProvider.BrokerChanged += SessionProvider_BrokerChanged;
+
             // Register event handlers after notifying VS that debug engine has loaded. This order is important because
             // we may get a Browse event immediately, and we want to raise a breakpoint notification in response to that
             // to pause the debugger - but it will be ignored unless the engine has reported its creation.
@@ -601,5 +611,10 @@
             IsConnected = false;
             DestroyProgram();
         }
+
+        private void SessionProvider_BrokerChanged(object sender, EventArgs e) {
+            IsConnected = false;
+            Task.Run(() => DestroyProgram()).DoNotWait();
+        }
     }
 }


Fixed integration test

Fixed integration test

--- Tests.Integration.Presentation.Web/Organizations/V2/OrganizationUserApiV2Test.cs
+++ Tests.Integration.Presentation.Web/Organizations/V2/OrganizationUserApiV2Test.cs
@@ -229,7 +229,7 @@

         private async Task<User> CreateUser(OrganizationDTO organization)
         {
-            var userAndGetToken = await HttpApi.CreateUserAndLogin(CreateEmail(), OrganizationRole.User, organization.Id, false);
+            var userAndGetToken = await HttpApi.CreateUserAndLogin(CreateEmail(), OrganizationRole.User, organization.Id, false, name: A<string>(), lastName: A<string>());
             var user = DatabaseAccess.MapFromEntitySet<User, User>(x => x.AsQueryable().ById(userAndGetToken.userId));
             return user;
         }


Map path of index.

Map path of index.

--- src/DotJEM.Web.Host/WebHost.cs
+++ src/DotJEM.Web.Host/WebHost.cs
@@ -212,18 +212,16 @@

         protected virtual IStorageIndex CreateIndex(Analyzer analyzer = null)
         {
-
             IndexStorageConfiguration storage = Configuration.Index.Storage;
             if (storage == null)
                 return new LuceneStorageIndex();
-
-
+
             switch (storage.Type)
             {
                 case IndexStorageType.File:
-                    return new LuceneStorageIndex(new LuceneFileIndexStorage(storage.Path), analyzer: analyzer);
+                    return new LuceneStorageIndex(new LuceneFileIndexStorage(HostingEnvironment.MapPath(storage.Path)), analyzer: analyzer);
                 case IndexStorageType.CachedMemory:
-                    return new LuceneStorageIndex(new LuceneCachedMemmoryIndexStorage(storage.Path), analyzer: analyzer);
+                    return new LuceneStorageIndex(new LuceneCachedMemmoryIndexStorage(HostingEnvironment.MapPath(storage.Path)), analyzer: analyzer);
                 case IndexStorageType.Memory:
                     return new LuceneStorageIndex(analyzer: analyzer);
                 default:


try another relative Swagger endpoint workaround

ref #131

--- src/FilterLists.Api/Startup.cs
+++ src/FilterLists.Api/Startup.cs
@@ -40,25 +40,30 @@

         public void Configure(IApplicationBuilder app, IHostingEnvironment env)
         {
+            app.UseSwagger(UseLowercaseControllerNameInSwaggerHack);
             if (env.IsDevelopment())
             {
                 app.UseDeveloperExceptionPage();
+                app.UseSwaggerUI(c =>
+                {
+                    c.SwaggerEndpoint("/swagger/v1/swagger.json", "FilterLists API V1");
+                    c.RoutePrefix = "docs";
+                });
             }
             else
             {
                 app.UseExceptionHandler("/Error");
                 app.UseHsts();
+                app.UseSwaggerUI(c =>
+                {
+                    c.SwaggerEndpoint("/api/swagger/v1/swagger.json", "FilterLists API V1");
+                    c.RoutePrefix = "docs";
+                });
             }

             app.UseForwardedHeaders(new ForwardedHeadersOptions
             {
                 ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
-            });
-            app.UseSwagger(UseLowercaseControllerNameInSwaggerHack);
-            app.UseSwaggerUI(c =>
-            {
-                c.SwaggerEndpoint("/swagger/v1/swagger.json", "FilterLists API V1");
-                c.RoutePrefix = "docs";
             });
             app.UseHttpsRedirection();
             app.UseStaticFiles();


+ not implemented Get

+ not implemented Get

--- src/FluentHttp/Execute.Sync.cs
+++ src/FluentHttp/Execute.Sync.cs
@@ -30,7 +30,7 @@
             switch (request.Method.ToUpperInvariant())
             {
                 case "GET":
-                    response = null;
+                    response = Get(this, request);
                     break;
                 case "POST":
                 case "PUT":
@@ -42,5 +42,10 @@
             // convert resonse to FluentHttpResponse and return response.
             return ToFluentHttpResponse(response);
         }
+
+        private static HttpWebResponse Get(FluentHttpRequest fluentHttpRequest, HttpWebRequest request)
+        {
+            throw new NotImplementedException();
+        }
     }
 }


read and write

read and write

--- SnakeCSharp/Game.cs
+++ SnakeCSharp/Game.cs
@@ -52,7 +52,7 @@

         static void Main()
         {
-
+
             bgrMusic.Play();
             MainMenue.LoadingGame();
             MainMenue.SplashScreen();
@@ -63,7 +63,7 @@
                 Console.BackgroundColor = ConsoleColor.Black;
                 return;
             }
-
+
         }
         public static void Exit()
         {
@@ -311,52 +311,50 @@

         static string[] ReadFromFile()
         {
-            string[] highScores = {
-                                      "00012350 John Doe 27.01.2015",
-                                      "00002250 John Doe 27.01.2015",
-                                      "00000550 John Doe 27.01.2015",
-                                      "00000350 John Doe 27.01.2015",
-                                      "00000300 John Doe 27.01.2015",
-                                  };
-
-			//string fileName = @"..\..\highscores.txt";
-            //StreamReader reader = new StreamReader(fileName);
-            //SortedDictionary<string, string> scores = new SortedDictionary<stringstring>();
-            //string splittedLine = "";
-
-            //using (reader)
+            string fileName = @"..\..\highscores.txt";
+            StreamReader reader = new StreamReader(fileName);
+            SortedDictionary<int, string> highScores = new SortedDictionary<int, string>();
+            string splittedLine = "";
+
+            using (reader)
+            {
+                int lineNumber = 0;
+                string line = reader.ReadLine();
+
+                while (line != null)
+                {
+                    splittedLine = line.Split(new char[] { ' ' }, 2);
+                    highScores.Add(Int16.Parse(splittedLine[0]), splittedLine[1]);
+                    lineNumber++;
+                    line = reader.ReadLine();
+                }
+            }
+            return highScores;
+        }
+
+        static void WriteToFile(int highScore, string userName)
+        {
+            DateTime now = DateTime.Now;
+            SortedDictionary<int, string> highScores = ReadFromFile();
+            //string template = "{0:00000000} {1,-8} {2:dd.MM.yyyy}";
+            //string newResult = String.Format(template, highScore, userName, now.Date);
+
+            string template = "{0,-8} {1:dd.MM.yyyy}";
+            string newResult = String.Format(template, userName, now.Date);
+
+            //if (String.Compare(newResult, highScores[4]) > 0)
             //{
-            //    int lineNumber = 0;
-            //    string line = reader.ReadLine();
-            //    while (line != null)
-            //    {
-            //        splittedLine = line.Split(new char[] { ' ' }, 2);
-            //        scores.Add(Int16.Parse(splittedLine[0]), splittedLine[1]);
-            //        lineNumber++;
-            //        line = reader.ReadLine();
-            //    }
+            //    highScores[4] = newResult;
             //}
-            //return scores;
-
-			return highScores;
-        }
-
-        static void WriteToFile(int highScore, string userName)
-        {
-            DateTime now = DateTime.Now;
-            string[] highScores = ReadFromFile();
-            string template = "{0:00000000} {1,-8} {2:dd.MM.yyyy}";
-            string newResult = String.Format(template, highScore, userName, now.Date);
-            if (String.Compare(newResult, highScores[4]) > 0)
-            {
-                highScores[4] = newResult;
-            }
+
+            highScores.Add(highScore, newResult);
+
             using (StreamWriter writer = new StreamWriter("../../highscores.txt"))
             {
                 foreach (string score in highScores)
                 {
                     writer.WriteLine(score);
-
+                    Console.WriteLine(score);
                 }
             }
         }
@@ -427,7 +425,7 @@
                 if (gameOver)
                 {
                     SoundPlayer gameOverSound = new System.Media.SoundPlayer(@"..\\..\\gameOverSound.wav");
-                    gameOverSound.Play();
+                    gameOverSound.Play();
                     Console.SetCursorPosition(0, 0);
                     Console.ForegroundColor = ConsoleColor.White;
                     Console.WriteLine("Game over".PadRight(Console.WindowWidth));


Better localized date format support

Better localized date format support

--- src/Hanselman/Helpers/Utils.cs
+++ src/Hanselman/Helpers/Utils.cs
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Globalization;
 using System.Text;
+using System.Text.RegularExpressions;
 using Humanizer;

 // avagadavagam cheered 1000 March 8, 2019
@@ -16,11 +17,18 @@
                 return date.Humanize();
             else
             {
-                var time = date.ToShortTimeString();
-                var monthDay = CultureInfo.CurrentCulture.DateTimeFormat.MonthDayPattern.Replace("MMMM", "MMM");
-                // Twitter: 10:56 AM · Mar 7, 2019
-                return $"{time} · {date.ToString($"{monthDay}, yyyy")}";
+                return date.ToHumanizeDate();
             }
+        }
+
+        public static string ToHumanizeDate(this DateTime date, CultureInfo culture = null)
+        {
+            if (culture == null)
+                culture = CultureInfo.CurrentCulture;
+
+            var regex = new Regex("dddd[,]{0,1}");
+            var shortDatePattern = regex.Replace(culture.DateTimeFormat.LongDatePattern.Replace("MMMM", "MMM"), "").Trim();
+            return date.ToString($"{culture.DateTimeFormat.ShortTimePattern} · {shortDatePattern}", culture);
         }
     }
 }


Remove unused callbacks

Remove unused callbacks

--- Source/QIRC/QIRC.cs
+++ Source/QIRC/QIRC.cs
@@ -116,7 +116,6 @@

             /// Add delegates
             client.ChannelListRecieved += ChannelListRecieved;
-            client.ChannelMessageRecieved += ChannelMessageRecieved;
             client.ChannelTopicReceived += ChannelTopicReceived;
             client.ConnectionComplete += ConnectionComplete;
             client.ModeChanged += ModeChanged;
@@ -132,7 +131,6 @@
             client.ServerInfoRecieved += ServerInfoRecieved;
             client.UserJoinedChannel += UserJoinedChannel;
             client.UserKicked += UserKicked;
-            client.UserMessageRecieved += UserMessageRecieved;
             client.UserPartedChannel += UserPartedChannel;
             client.UserQuit += UserQuit;
             client.WhoIsReceived += WhoIsReceived;


Removed use of type.AssemblyQualifiedName

--- AppBrix/AppBrixExtensions.cs
+++ AppBrix/AppBrixExtensions.cs
@@ -62,7 +62,7 @@
             var constructor = type.GetConstructor(Type.EmptyTypes);
             if (constructor == null)
                 throw new DefaultConstructorMissingException(
-                    "Unable to find constructor for type " + type.AssemblyQualifiedName);
+                    "Unable to find constructor for type " + type.GetAssemblyQualifiedName());

             return constructor.Invoke(null);
         }


(LpkOpener): added FormatCatalog.LookupGame call.

--- ArcFormats/Lucifen/ArcLPK.cs
+++ ArcFormats/Lucifen/ArcLPK.cs
@@ -2,7 +2,7 @@
 //! \date       Mon Feb 16 17:21:47 2015
 //! \brief      Lucifen Easy Game System archive implementation.
 //
-// Copyright (C) 2015-2016 by morkt
+// Copyright (C) 2015-2017 by morkt
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to
@@ -132,7 +132,7 @@
                     return arc;
             }
             catch { /* unknown encryption, ignore parse errors */ }
-            var new_scheme = QueryEncryptionScheme();
+            var new_scheme = QueryEncryptionScheme (file.Name);
             if (new_scheme == CurrentScheme && !CurrentScheme.ImportGameInit)
                 return null;
             CurrentScheme = new_scheme;
@@ -354,14 +354,21 @@
             return new GUI.WidgetLPK();
         }

-        EncryptionScheme QueryEncryptionScheme ()
+        EncryptionScheme QueryEncryptionScheme (string arc_name)
         {
             CurrentFileMap.Clear();
+            string title = FormatCatalog.Instance.LookupGame (arc_name);
+            Dictionary<string, Key> file_map;
+            if (!string.IsNullOrEmpty (title) && KnownSchemes.ContainsKey (title))
+            {
+                if (KnownKeys.TryGetValue (title, out file_map))
+                    CurrentFileMap = new Dictionary<string, Key> (file_map);
+                return KnownSchemes[title];
+            }
             var options = Query<LuciOptions> (arcStrings.ArcEncryptedNotice);
             if (null == options)
                 return DefaultScheme;
-            string title = options.Scheme;
-            Dictionary<string, Key> file_map;
+            title = options.Scheme;
             if (KnownKeys.TryGetValue (title, out file_map))
                 CurrentFileMap = new Dictionary<string, Key> (file_map);
             return KnownSchemes[title];


Added new mouse constraint options

Added new mouse constraint options

--- System/GameState.cs
+++ System/GameState.cs
@@ -8,6 +8,8 @@
 using VorliasEngine2D.System.Utility;
 using VorliasEngine2D.System.Internal;
 using VorliasEngine2D.Events;
+using SFML.System;
+using SFML.Window;

 namespace VorliasEngine2D.System
 {
@@ -27,6 +29,15 @@
             get => viewEventQueue;
         }

+        Vector2f mouseDelta = new Vector2f();
+        /// <summary>
+        /// Returns the delta if the mouse constraint is set to center
+        /// </summary>
+        public Vector2f MouseCenterDelta
+        {
+            get => mouseDelta;
+        }
+
         public Music BackgroundMusic
         {
             get;
@@ -46,21 +57,59 @@
             get => exclusiveView;
         }

+        public enum MouseConstraintType
+        {
+            /// <summary>
+            /// The mouse behaves normally
+            /// </summary>
+            Normal,
+
+            /// <summary>
+            /// The mouse is constrained to the window
+            /// </summary>
+            ConstrainedWindow,
+
+            /// <summary>
+            /// The mouse is constrained to the center
+            /// </summary>
+            ConstrainedCenter,
+        }
+
+        MouseConstraintType mouseConstraint = MouseConstraintType.Normal;
+        public MouseConstraintType MouseConstraint
+        {
+            get
+            {
+                return mouseConstraint;
+            }
+            set
+            {
+                bool constrainToWindow = MouseConstraintType.ConstrainedWindow == value;
+
+
+                if (StateManager.ActiveState == this)
+                    Application.Window.SetMouseCursorGrabbed(constrainToWindow);
+
+                mouseGrabbed = constrainToWindow;
+
+                mouseConstraint = value;
+            }
+        }
+
         /// <summary>
         /// Whether or not the mouse is locked in this GameState
         /// </summary>
+        [Obsolete("Use '.MouseConstraint = MouseConstraintType.ConstrainedWindow' instead.")]
         public bool MouseGrabbed
         {
             set
             {
-                if(StateManager.ActiveState == this)
-                    Application.Window.SetMouseCursorGrabbed(value);
-
-                mouseGrabbed = value;
-            }
+                MouseConstraint = value ? MouseConstraintType.ConstrainedWindow : MouseConstraintType.Normal;
+            }
+
             get
             {
-                return mouseGrabbed;
+                return MouseConstraint == MouseConstraintType.ConstrainedWindow;
             }
         }

@@ -133,6 +182,31 @@

         }

+        internal void BeforeUpdate()
+        {
+            var window = Application.Window;
+            var size = window.Size.ToFloat();
+            var mousePosition = Mouse.GetPosition(window).ToFloat();
+
+            if (mouseConstraint == MouseConstraintType.ConstrainedCenter)
+            {
+                mouseDelta = mousePosition - (size / 2);
+            }
+            else
+                mouseDelta = new Vector2f();
+        }
+
+        internal void AfterUpdate()
+        {
+            if (mouseConstraint == MouseConstraintType.ConstrainedCenter)
+            {
+                var window = Application.Window;
+                var size = new Vector2i((int) window.Size.X, (int) window.Size.Y);
+
+                Mouse.SetPosition(size / 2, window);
+            }
+        }
+
         public virtual void Update()
         {


fix delimiter framing

fix delimiter framing

--- src/core/Akka.Streams/Dsl/Framing.cs
+++ src/core/Akka.Streams/Dsl/Framing.cs
@@ -231,7 +231,7 @@

                 public override void OnPush()
                 {
-                    _buffer += Grab(_stage._in);
+                    _buffer += Grab(_stage.Inlet);
                     DoParse();
                 }

@@ -239,7 +239,7 @@
                 {
                     if (_buffer.IsEmpty)
                         CompleteStage();
-                    else if (IsAvailable(_stage._out))
+                    else if (IsAvailable(_stage.Outlet))
                         DoParse();

                     // else swallow the termination and wait for pull
@@ -249,11 +249,11 @@

                 private void TryPull()
                 {
-                    if (IsClosed(_stage._in))
+                    if (IsClosed(_stage.Inlet))
                     {
                         if (_stage._allowTruncation)
                         {
-                            Push(_stage._out, _buffer);
+                            Push(_stage.Outlet, _buffer);
                             CompleteStage();
                         }
                         else
@@ -262,7 +262,7 @@
                                     "Stream finished but there was a truncated final frame in the buffer"));
                     }
                     else
-                        Pull(_stage._in);
+                        Pull(_stage.Inlet);
                 }

                 private void DoParse()
@@ -300,9 +300,9 @@
                             var parsedFrame = _buffer.Slice(0, possibleMatchPosition).Compact();
                             _buffer = _buffer.Slice(possibleMatchPosition + _stage._separatorBytes.Count).Compact();
                             _nextPossibleMatch = 0;
-                            Push(_stage._out, parsedFrame);
-
-                            if (IsClosed(_stage._in) && _buffer.IsEmpty)
+                            Push(_stage.Outlet, parsedFrame);
+
+                            if (IsClosed(_stage.Inlet) && _buffer.IsEmpty)
                                 CompleteStage();
                         }
                         else
@@ -328,15 +328,7 @@
                 _separatorBytes = separatorBytes;
                 _maximumLineBytes = maximumLineBytes;
                 _allowTruncation = allowTruncation;
-
-                Shape = new FlowShape<ByteString, ByteString>(_in, _out);
-            }
-
-            private readonly Inlet<ByteString> _in = new Inlet<ByteString>("DelimiterFraming.in");
-
-            private readonly Outlet<ByteString> _out = new Outlet<ByteString>("DelimiterFraming.in");
-
-            public override FlowShape<ByteString, ByteString> Shape { get; }
+            }

             protected override Attributes InitialAttributes { get; } = DefaultAttributes.DelimiterFraming;