1155: expose ImageBinder

1155: expose ImageBinder

--- src/PixelFarm/PaintLab.Svg/SvgRenderVxDocBuilder.cs
+++ src/PixelFarm/PaintLab.Svg/SvgRenderVxDocBuilder.cs
@@ -17,7 +17,10 @@

         public SvgImageBinder(string imgsrc) : base(imgsrc)
         {
-
+        }
+        public SvgImageBinder(PixelFarm.CpuBlit.ActualBitmap actualImg) : base(null)
+        {
+            this.SetImage(actualImg);
         }
     }

@@ -370,7 +373,7 @@
             _controller = o;
         }
         public object GetController() { return _controller; }
-        internal LayoutFarm.ImageBinder ImageBinder
+        public LayoutFarm.ImageBinder ImageBinder
         {
             get
             {
@@ -582,6 +585,22 @@
                 case WellknownSvgElementName.Svg:
                     break;
                 case WellknownSvgElementName.Image:
+                    {
+                        if (_vxsPath == null)
+                        {
+                            //create rect path around img
+
+                            using (VectorToolBox.Borrow(out SimpleRect ss))
+                            {
+                                SvgImageSpec imgSpec = (SvgImageSpec)_visualSpec;
+                                ss.SetRect(0, imgSpec.Height.Number, imgSpec.Width.Number, 0);
+                                _vxsPath = new VertexStore();
+                                ss.MakeVxs(_vxsPath);
+                            }
+
+                        }
+                        goto case WellknownSvgElementName.Rect;
+                    }
                 case WellknownSvgElementName.Path:
                 case WellknownSvgElementName.Line:
                 case WellknownSvgElementName.Ellipse:
@@ -1104,7 +1123,7 @@
                                     //stroke width must > 0 and stroke-color must not be transparent color
                                     if (p.StrokeWidth > 0 && p.StrokeColor.A > 0)
                                     {
-                                        p.Draw(v1);
+                                        p.Draw(v1);

                                     }
                                 }


1338.2

--- src/PixelFarm/PaintLab.Svg/SvgRenderVxDocBuilder.cs
+++ src/PixelFarm/PaintLab.Svg/SvgRenderVxDocBuilder.cs
@@ -1513,7 +1513,7 @@
             VgVisualElement vgVisualRootElem = new VgVisualElement(WellknownSvgElementName.RootSvg, null, _vgVisualDoc);
             _vgVisualDoc.VgRootElem = vgVisualRootElem;//**

-            int childCount = rootElem.ChildCount;
+            int childCount = rootElem.ChildCount;
             for (int i = 0; i < childCount; ++i)
             {
                 //translate SvgElement to
@@ -1542,8 +1542,8 @@

             return _vgVisualDoc;
         }
-
-
+
+
         VgVisualElement CreateSvgVisualElement(VgVisualElement parentNode, SvgElement elem)
         {
             VgVisualElement vgVisElem = null;
@@ -1743,7 +1743,7 @@
             return vgVisElem;
         }

-        struct ReEvaluateArgs
+        struct ReEvaluateArgs : LayoutFarm.Css.IHasGetEmHeight
         {
             public readonly float containerW;
             public readonly float containerH;
@@ -1755,6 +1755,7 @@
                 this.containerH = containerH;
                 this.emHeight = emHeight;
             }
+            public float GetEmHeight() => emHeight;
         }
         VgVisualElement CreateEllipse(VgVisualElement parentNode, SvgEllipseSpec ellipseSpec)
         {
@@ -2141,34 +2142,7 @@

         static float ConvertToPx(LayoutFarm.Css.CssLength length, ref ReEvaluateArgs args)
         {
-
-            //Return zero if no length specified, zero specified
-            switch (length.UnitOrNames)
-            {
-                case LayoutFarm.Css.CssUnitOrNames.EmptyValue:
-                    return 0;
-                case LayoutFarm.Css.CssUnitOrNames.Percent:
-                    return (length.Number / 100f) * args.containerW;
-                case LayoutFarm.Css.CssUnitOrNames.Ems:
-                    return length.Number * args.emHeight;
-                case LayoutFarm.Css.CssUnitOrNames.Ex:
-                    return length.Number * (args.emHeight / 2);
-                case LayoutFarm.Css.CssUnitOrNames.Pixels:
-                    //atodo: check support for hi dpi
-                    return length.Number;
-                case LayoutFarm.Css.CssUnitOrNames.Milimeters:
-                    return length.Number * 3.779527559f; //3 pixels per millimeter
-                case LayoutFarm.Css.CssUnitOrNames.Centimeters:
-                    return length.Number * 37.795275591f; //37 pixels per centimeter
-                case LayoutFarm.Css.CssUnitOrNames.Inches:
-                    return length.Number * 96f; //96 pixels per inch
-                case LayoutFarm.Css.CssUnitOrNames.Points:
-                    return length.Number * (96f / 72f); // 1 point = 1/72 of inch
-                case LayoutFarm.Css.CssUnitOrNames.Picas:
-                    return length.Number * 16f; // 1 pica = 12 points
-                default:
-                    return 0;
-            }
+            return LayoutFarm.WebDom.Parser.CssValueParser.ConvertToPx(length, args.containerW, args);
         }

         VertexStore ParseSvgPathDefinitionToVxs(char[] buffer)
@@ -2324,10 +2298,9 @@
         {
             SvgDocBuilder docBuilder = new SvgDocBuilder();
             SvgParser svg = new SvgParser(docBuilder);
+            svg.ReadSvgFile(filename);
+            //
             VgVisualDocBuilder builder = new VgVisualDocBuilder();
-            //svg.ReadSvgFile("d:\\WImageTest\\lion.svg");
-            //svg.ReadSvgFile("d:\\WImageTest\\tiger001.svg");
-            svg.ReadSvgFile(filename);
             return builder.CreateVgVisualDoc(docBuilder.ResultDocument, null);
         }


832.2

--- src/PixelFarm/PaintLab.Svg/SvgRenderVxDocBuilder.cs
+++ src/PixelFarm/PaintLab.Svg/SvgRenderVxDocBuilder.cs
@@ -852,23 +852,23 @@
                 case WellknownSvgElementName.Text:
                     return CreateTextElem(parentNode, (SvgTextSpec)elem.ElemSpec);
                 case WellknownSvgElementName.Svg:
-                    renderE = new SvgRenderElement(WellknownSvgElementName.Svg, null);
+                    renderE = new SvgRenderElement(WellknownSvgElementName.Svg, (SvgVisualSpec)elem.ElemSpec);
                     break;
                 case WellknownSvgElementName.Rect:
-                    renderE = CreateRect(parentNode, (SvgRectSpec)elem.ElemSpec);
+                    renderE = CreateRect(parentNode, (SvgRectSpec)elem.ElemSpec);
                     break;
                 case WellknownSvgElementName.Image:
                     renderE = CreateImage(parentNode, (SvgImageSpec)elem.ElemSpec);
-
+
                     break;
                 case WellknownSvgElementName.Polyline:
-                    renderE = CreatePolyline(parentNode, (SvgPolylineSpec)elem.ElemSpec);
+                    renderE = CreatePolyline(parentNode, (SvgPolylineSpec)elem.ElemSpec);
                     break;
                 case WellknownSvgElementName.Polygon:
-                    renderE = CreatePolygon(parentNode, (SvgPolygonSpec)elem.ElemSpec);
+                    renderE = CreatePolygon(parentNode, (SvgPolygonSpec)elem.ElemSpec);
                     break;
                 case WellknownSvgElementName.Ellipse:
-                    renderE = CreateEllipse(parentNode, (SvgEllipseSpec)elem.ElemSpec);
+                    renderE = CreateEllipse(parentNode, (SvgEllipseSpec)elem.ElemSpec);
                     break;
                 case WellknownSvgElementName.Circle:
                     renderE = CreateCircle(parentNode, (SvgCircleSpec)elem.ElemSpec);


build fix

build fix

--- src/Serilog.Sinks.LiteDB/Sinks/LiteDB/LiteDBSink.cs
+++ src/Serilog.Sinks.LiteDB/Sinks/LiteDB/LiteDBSink.cs
@@ -34,7 +34,6 @@
         /// <param name="connectionString">The URL of a LiteDB database, or connection string name containing the URL.</param>
         /// <param name="formatProvider">Supplies culture-specific formatting information, or null.</param>
         /// <param name="collectionName">Name of the LiteDb collection to use for the log. Default is "log".</param>
-        /// <param name="collectionCreationOptions">Collection Creation Options for the log collection creation.</param>
         public LiteDBSink(
             string connectionString,
             IFormatProvider formatProvider = null,


AddUserSecrets refactoring

AddUserSecrets refactoring

--- src/ServiceBase/Configuration/ConfigurationSetup.cs
+++ src/ServiceBase/Configuration/ConfigurationSetup.cs
@@ -1,25 +1,22 @@
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.Extensions.Configuration;
+using System;
 using System.IO;

 namespace ServiceBase.Configuration
 {
     public static class ConfigurationSetup
     {
-        public static IConfigurationRoot Configure(IHostingEnvironment environment)
+        public static IConfigurationRoot Configure(IHostingEnvironment environment, Action<IConfigurationBuilder> configAction = null)
         {
             var builder = new ConfigurationBuilder()
                .SetBasePath(environment.ContentRootPath)
                .AddJsonFile(Path.Combine("Config", "config.json"), optional: false, reloadOnChange: true)
                .AddJsonFile(Path.Combine("Config", $"config.{environment.EnvironmentName}.json"), optional: true, reloadOnChange: true);
+
+            builder.AddEnvironmentVariables();

-            if (environment.IsDevelopment())
-            {
-                // For more details on using the user secret store see http://go.microsoft.com/fwlink/?LinkID=532709
-                builder.AddUserSecrets();
-            }
-
-            builder.AddEnvironmentVariables();
+            configAction?.Invoke(builder);

             return builder.Build();
         }


Remove custom error checking from System.Net.Requests, per #516 .

--- src/System.Net.Requests/tests/HttpWebRequestTest.cs
+++ src/System.Net.Requests/tests/HttpWebRequestTest.cs
@@ -246,15 +246,8 @@
             HttpWebRequest request = WebRequest.CreateHttp(remoteServer);
             request.Method = HttpMethod.Post.Method;
             request.Abort();
-            try
-            {
-                request.BeginGetRequestStream(null, null);
-                Assert.True(false);
-            }
-            catch (WebException ex)
-            {
-                Assert.Equal(WebExceptionStatus.RequestCanceled, ex.Status);
-            }
+            WebException ex = Assert.Throws<WebException>(() => request.BeginGetRequestStream(null, null));
+            Assert.Equal(WebExceptionStatus.RequestCanceled, ex.Status);
         }

         [Theory, MemberData("PostServers")]
@@ -300,15 +293,8 @@
             HttpWebRequest request = WebRequest.CreateHttp(remoteServer);
             request.Method = HttpMethod.Post.Method;
             request.Abort();
-            try
-            {
-                request.BeginGetResponse(null, null);
-                Assert.True(false);
-            }
-            catch (WebException ex)
-            {
-                Assert.Equal(WebExceptionStatus.RequestCanceled, ex.Status);
-            }
+            WebException ex = Assert.Throws<WebException>(() => request.BeginGetResponse(null, null));
+            Assert.Equal(WebExceptionStatus.RequestCanceled, ex.Status);
         }

         [Theory, MemberData("PostServers")]
@@ -392,15 +378,9 @@
         {
             string serverUrl = string.Format("http://www.{0}.com/", Guid.NewGuid().ToString());
             HttpWebRequest request = WebRequest.CreateHttp(serverUrl);
-            try
-            {
-                WebResponse response = request.GetResponseAsync().GetAwaiter().GetResult();
-                Assert.True(false);
-            }
-            catch (WebException ex)
-            {
-                Assert.Equal(WebExceptionStatus.NameResolutionFailure, ex.Status);
-            }
+            WebException ex = Assert.Throws<WebException>(() => request.GetResponseAsync().GetAwaiter().GetResult());
+            Assert.Equal(WebExceptionStatus.NameResolutionFailure, ex.Status);
+
         }

         public static object[][] StatusCodeServers = {
@@ -412,15 +392,10 @@
         public void GetResponseAsync_ResourceNotFound_ThrowsWebException(string remoteServer)
         {
             HttpWebRequest request = WebRequest.CreateHttp(remoteServer);
-            try
-            {
-                WebResponse response = request.GetResponseAsync().GetAwaiter().GetResult();
-                Assert.True(false);
-            }
-            catch (WebException ex)
-            {
-                Assert.Equal(WebExceptionStatus.ProtocolError, ex.Status);
-            }
+
+            WebException ex = Assert.Throws<WebException>(() => request.GetResponseAsync().GetAwaiter().GetResult());
+            Assert.Equal(WebExceptionStatus.ProtocolError, ex.Status);
+
         }

         [Theory, MemberData("GetServers")]


Added IsPathFullyQualified() method to Path class (dotnet/coreclr#12965)

Signed-off-by: dotnet-bot <03c4cb6107ae99956a7681f2c97ff7104809a2bd@microsoft.com>

--- src/System.Private.CoreLib/shared/System/IO/Path.cs
+++ src/System.Private.CoreLib/shared/System/IO/Path.cs
@@ -166,6 +166,30 @@
             return new string(pRandomFileName, 0, RandomFileNameLength);
         }

+        /// <summary>
+        /// Returns true if the path is fixed to a specific drive or UNC path. This method does no
+        /// validation of the path (URIs will be returned as relative as a result).
+        /// Returns false if the path specified is relative to the current drive or working directory.
+        /// </summary>
+        /// <remarks>
+        /// Handles paths that use the alternate directory separator.  It is a frequent mistake to
+        /// assume that rooted paths <see cref="Path.IsPathRooted(string)"/> are not relative.  This isn't the case.
+        /// "C:a" is drive relative- meaning that it will be resolved against the current directory
+        /// for C: (rooted, but relative). "C:\a" is rooted and not relative (the current directory
+        /// will not be used to modify the path).
+        /// </remarks>
+        /// <exception cref="ArgumentNullException">
+        /// Thrown if <paramref name="path"/> is null.
+        /// </exception>
+        public static bool IsPathFullyQualified(string path)
+        {
+            if (path == null)
+            {
+                throw new ArgumentNullException(nameof(path));
+            }
+            return !PathInternal.IsPartiallyQualified(path);
+        }
+
         // Tests if a path includes a file extension. The result is
         // true if the characters that follow the last directory
         // separator ('\\' or '/') or volume separator (':') in the path include


Removed incorrect region

Removed incorrect region

--- src/System.Web.Http/Routing/HttpMethodConstraint.cs
+++ src/System.Web.Http/Routing/HttpMethodConstraint.cs
@@ -73,13 +73,9 @@
             }
         }

-        #region IRouteConstraint Members
-
         bool IHttpRouteConstraint.Match(HttpRequestMessage request, IHttpRoute route, string parameterName, IDictionary<string, object> values, HttpRouteDirection routeDirection)
         {
             return Match(request, route, parameterName, values, routeDirection);
         }
-
-        #endregion
     }
 }


clear save icon from statusbar on failed render

--- src/Typewriter/Generation/Controllers/EventQueue.cs
+++ src/Typewriter/Generation/Controllers/EventQueue.cs
@@ -36,58 +36,46 @@
                 {
                     var action = _queue.Dequeue();
                     Thread.Sleep(100);
+
+                    object icon;
+                    PrepareStatusbar(out icon);
+
                     try
                     {
-
-                        object icon;
-
-                        PrepareStatusbar(out icon);
-
                         var stopwatch = Stopwatch.StartNew();
                         action();

                         while (_queue.Count > 0)
                         {
                             action = _queue.Dequeue();
-
                             action();
-
                         }

                         stopwatch.Stop();

                         Log.Debug("Queue flushed in {0} ms", stopwatch.ElapsedMilliseconds);
-
-                        ClearStatusbar(icon);
                     }
                     catch (Exception ex)
                     {
                         Log.Error("Error processing queue: " + ex.Message + "\n" + ex.StackTrace);
                     }
-
-
+
+                    ClearStatusbar(icon);
                 }
                 catch (InvalidOperationException ex)
                 {
                     Log.Debug("Queue Closed: " + ex.Message);
                 }
-
-
-
             } while (!(_queue.Closed));
-
         }

         public void Enqueue(Action action)
         {
-
             _queue.Enqueue(action);
-
         }

         private void PrepareStatusbar(out object icon)
         {
-
             icon = (short) InteropConstants.SBAI_Save;

             try
@@ -99,8 +87,6 @@

                 _statusBar.SetText("Rendering template...");
                 _statusBar.Animation(1, ref icon);
-
-
             }
             catch (Exception exception)
             {
@@ -112,13 +98,9 @@
         {
             try
             {
-
                 _statusBar.Animation(0, ref icon);
-
                 _statusBar.SetText("Rendering complete");
-
                 _statusBar.FreezeOutput(0);
-
             }
             catch (Exception exception)
             {


fixing tests

fixing tests

--- src/Umbraco.Tests/Web/Mvc/SurfaceControllerTests.cs
+++ src/Umbraco.Tests/Web/Mvc/SurfaceControllerTests.cs
@@ -77,42 +77,15 @@

             Assert.IsNotNull(ctrl.UmbracoContext);
         }
-
-        [Test]
-        public void Umbraco_Helper_Not_Null()
-        {
-            var globalSettings = TestObjects.GetGlobalSettings();
-            var umbracoContext = UmbracoContext.EnsureContext(
-                Current.UmbracoContextAccessor,
-                new Mock<HttpContextBase>().Object,
-                Mock.Of<IPublishedSnapshotService>(),
-                new Mock<WebSecurity>(null, null, globalSettings).Object,
-                TestObjects.GetUmbracoSettings(),
-                Enumerable.Empty<IUrlProvider>(),
-                globalSettings,
-                new TestVariationContextAccessor(),
-                true);
-
-            var controller = new TestSurfaceController(umbracoContext);
-            Composition.Register(_ => umbracoContext);
-
-            Assert.IsNotNull(controller.Umbraco);
-        }
-
+
         [Test]
         public void Can_Lookup_Content()
         {
             var publishedSnapshot = new Mock<IPublishedSnapshot>();
             publishedSnapshot.Setup(x => x.Members).Returns(Mock.Of<IPublishedMemberCache>());
-            var contentCache = new Mock<IPublishedContentCache>();
             var content = new Mock<IPublishedContent>();
             content.Setup(x => x.Id).Returns(2);
-            contentCache.Setup(x => x.GetById(It.IsAny<int>())).Returns(content.Object);
-            var mediaCache = new Mock<IPublishedMediaCache>();
-            publishedSnapshot.Setup(x => x.Content).Returns(contentCache.Object);
-            publishedSnapshot.Setup(x => x.Media).Returns(mediaCache.Object);
             var publishedSnapshotService = new Mock<IPublishedSnapshotService>();
-            publishedSnapshotService.Setup(x => x.CreatePublishedSnapshot(It.IsAny<string>())).Returns(publishedSnapshot.Object);
             var globalSettings = TestObjects.GetGlobalSettings();

             var umbracoContext = UmbracoContext.EnsureContext(
@@ -131,13 +104,14 @@
                 Mock.Of<ITagQuery>(),
                 Mock.Of<ICultureDictionaryFactory>(),
                 Mock.Of<IUmbracoComponentRenderer>(),
-                Mock.Of<IPublishedContentQuery>(),
+                Mock.Of<IPublishedContentQuery>(query => query.Content(2) == content.Object),
                 new MembershipHelper(new TestUmbracoContextAccessor(umbracoContext), Mock.Of<MembershipProvider>(), Mock.Of<RoleProvider>(), Mock.Of<IMemberService>(), Mock.Of<IMemberTypeService>(), Mock.Of<IUserService>(), Mock.Of<IPublicAccessService>(), Mock.Of<AppCaches>(), Mock.Of<ILogger>()));

             var ctrl = new TestSurfaceController(umbracoContext, helper);
             var result = ctrl.GetContent(2) as PublishedContentResult;

             Assert.IsNotNull(result);
+            Assert.IsNotNull(result.Content);
             Assert.AreEqual(2, result.Content.Id);
         }


U4-1441 - improve logging

U4-1441 - improve logging

--- src/Umbraco.Web/Routing/LookupByNotFoundHandlers.cs
+++ src/Umbraco.Web/Routing/LookupByNotFoundHandlers.cs
@@ -39,9 +39,8 @@

 		void HandlePageNotFound(PublishedContentRequest docRequest)
         {
-			LogHelper.Debug<LookupByNotFoundHandlers>("Running for url='{0}'.", () => docRequest.Uri.AbsolutePath);
-
 			var url = NotFoundHandlerHelper.GetLegacyUrlForNotFoundHandlers();
+            LogHelper.Debug<LookupByNotFoundHandlers>("Running for legacy url='{0}'.", () => url);

             foreach (var handler in GetNotFoundHandlers())
             {


Add tests

Add tests

--- src/Workspaces/CoreTest/DependentTypeFinderTests.cs
+++ src/Workspaces/CoreTest/DependentTypeFinderTests.cs
@@ -431,6 +431,8 @@
 interface IC3 : IB3 { }

 interface ID1 : IC1 { }
+
+interface IOther { }
 ", MscorlibRef);

             // get symbols for types
@@ -443,16 +445,71 @@
                 rootType, solution, transitive: false);

             Assert.NotEmpty(immediateDerived);
+            AssertEx.SetEqual(immediateDerived.Select(d => d.Name),
+                new[] { "IB1", "IB2", "IB3", "IC2" });
             Assert.True(immediateDerived.All(d => d.Interfaces.Contains(rootType)));

             var transitiveDerived = await SymbolFinder.FindDerivedInterfacesAsync(
                 rootType, solution, transitive: true);

             Assert.NotEmpty(transitiveDerived);
+            AssertEx.SetEqual(transitiveDerived.Select(d => d.Name),
+                new[] { "IB1", "IB2", "IB3", "IC1", "IC2", "IC3", "ID1" });
             Assert.True(transitiveDerived.All(d => d.AllInterfaces.Contains(rootType)), "All results must transitively derive from the type");
             Assert.True(transitiveDerived.Any(d => !d.Interfaces.Contains(rootType)), "At least one result must not immediately derive from the type");

             Assert.True(transitiveDerived.Count() > immediateDerived.Count());
         }
+
+        [Fact]
+        public async Task ImplementingSourceTypes()
+        {
+            var solution = new AdhocWorkspace().CurrentSolution;
+
+            // create a normal assembly with a type derived from the portable abstract base
+            solution = AddProjectWithMetadataReferences(solution, "NormalProject", LanguageNames.CSharp, @"
+interface IA { }
+
+class B1 : IA { }
+class B2 : IA { }
+class B3 : IEquatable<B3>, IA { }
+
+class C1 : B1 { }
+class C2 : B2, IA { }
+class C3 : B3 { }
+
+struct S1 : IA { }
+
+class D1 : C1 { }
+
+class OtherClass { }
+struct OtherStruct { }
+", MscorlibRef);
+
+            // get symbols for types
+            var compilation = await GetNormalProject(solution).GetCompilationAsync();
+            var rootType = compilation.GetTypeByMetadataName("IA");
+
+            Assert.NotNull(rootType);
+
+            var immediateImpls = await SymbolFinder.FindImplementationsAsync(
+                rootType, solution, transitive: false);
+
+            Assert.NotEmpty(immediateImpls);
+            Assert.True(immediateImpls.All(d => d.Interfaces.Contains(rootType)));
+            AssertEx.SetEqual(immediateImpls.Select(d => d.Name),
+                new[] { "B1", "B2", "B3", "C2", "S1" });
+
+            var transitiveImpls = await SymbolFinder.FindImplementationsAsync(
+                rootType, solution, transitive: true);
+
+            Assert.NotEmpty(transitiveImpls);
+            AssertEx.SetEqual(transitiveImpls.Select(d => d.Name),
+                new[] { "B1", "B2", "B3", "C1", "C2", "C3", "D1", "S1" });
+            Assert.True(transitiveImpls.All(d => d.AllInterfaces.Contains(rootType)), "All results must transitively derive from the type");
+            Assert.True(transitiveImpls.Any(d => !d.Interfaces.Contains(rootType)), "At least one result must not immediately derive from the type");
+
+            Assert.True(transitiveImpls.Count() > immediateImpls.Count());
+        }
     }
 }


Added up/down arrows for column sorting and changed ".on" to ".live" as this is necessary when converting the grid behavior to use AJAX.  Again, found Mike Brind's article immensely helpful.

--- playground/RazorTests/Views/ViewBook/Index.cshtml
+++ playground/RazorTests/Views/ViewBook/Index.cshtml
@@ -19,12 +19,10 @@
                         .Select(author => new SelectListItem {
                             Value = author.AuthorId.ToString(),
                             Text = author.AuthorName
-                         });
-
-    var grid = new WebGrid(books);
+                         });
+
+    var grid = new WebGrid(books, ajaxUpdateContainerId: "grid", ajaxUpdateCallback: "setArrows");
 }
-
-

 <!DOCTYPE html>

@@ -34,14 +32,32 @@
         <title>Inline Editing with the WebGrid</title>
         <link rel="stylesheet" href="~/Styles/StyleSheet.css" type="text/css" />

+

+

-        @grid.GetHtml(
-            tableStyle : "table",
-            alternatingRowStyle : "alternate",
-            selectedRowStyle: "selected",
-            headerStyle : "header",
-            columns : grid.Columns(
-                grid.Column("",
-                            style: "col1",
-                            format: @<text>
-                                        <button class="edit-book display-mode" id="@item.BookId">Edit</button>
-                                        <button class="save-book edit-mode" id="@item.BookId">Save</button>
-                                    </text>),
-                grid.Column("Title",
-                            style: "col2",
-                            format: @<text>
-                                        @item.Title
-                                        @Html.TextBox("Title", (string)item.Title, new {@class="edit-mode", size = 45})
-                                    </text>),
-                grid.Column("AuthorName",
-                            header : "Author",
-                            style: "col3",
-                            format: @<text>
-                                        @item.AuthorName
-                                        @Html.DropDownList("AuthorId", new SelectList(authors, "Value", "Text", @item.AuthorId), new {@class="edit-mode"})
-                                    </text>),
-                grid.Column("Category",
-                            style: "col4",
-                            format: @<text>
-                                        @item.Category
-                                        @Html.DropDownList("CategoryId", new SelectList(categories, "Value", "Text", @item.CategoryId), new {@class="edit-mode"})
-                                    </text>),
-                grid.Column("ISBN",
-                            style: "col5",
-                            format: @<text>
-                                        @item.ISBN
-                                        @Html.TextBox("ISBN", (string)item.ISBN, new {@class="edit-mode", size = 20})
-                                    </text>),
-                grid.Column("Hardback",
-                            style: "col6",
-                            format: @<text>
-                                        @Html.CheckBox("hardback-display", (bool)item.Hardback, new {disabled="disabled"})
-                                        @Html.CheckBox("Hardback", (bool)item.Hardback, new {@class="edit-mode"})
-                                    </text>)
-             )
-        )
+

+            @grid.GetHtml(
+                tableStyle : "table",
+                alternatingRowStyle : "alternate",
+                selectedRowStyle: "selected",
+                headerStyle : "header",
+                columns : grid.Columns(
+                    grid.Column("",
+                                style: "col1",
+                                format: @<text>
+                                            <button class="edit-book display-mode" id="@item.BookId">Edit</button>
+                                            <button class="save-book edit-mode" id="@item.BookId">Save</button>
+                                        </text>),
+                    grid.Column("Title",
+                                style: "col2",
+                                format: @<text>
+                                            @item.Title
+                                            @Html.TextBox("Title", (string)item.Title, new {@class="edit-mode", size = 45})
+                                        </text>),
+                    grid.Column("AuthorName",
+                                header : "Author",
+                                style: "col3",
+                                format: @<text>
+                                            @item.AuthorName
+                                            @Html.DropDownList("AuthorId", new SelectList(authors, "Value", "Text", @item.AuthorId), new {@class="edit-mode"})
+                                        </text>),
+                    grid.Column("Category",
+                                style: "col4",
+                                format: @<text>
+                                            @item.Category
+                                            @Html.DropDownList("CategoryId", new SelectList(categories, "Value", "Text", @item.CategoryId), new {@class="edit-mode"})
+                                        </text>),
+                    grid.Column("ISBN",
+                                style: "col5",
+                                format: @<text>
+                                            @item.ISBN
+                                            @Html.TextBox("ISBN", (string)item.ISBN, new {@class="edit-mode", size = 20})
+                                        </text>),
+                    grid.Column("Hardback",
+                                style: "col6",
+                                format: @<text>
+                                            @Html.CheckBox("hardback-display", (bool)item.Hardback, new {disabled="disabled"})
+                                            @Html.CheckBox("Hardback", (bool)item.Hardback, new {@class="edit-mode"})
+                                        </text>)
+                 )
+            )
+
+            @Html.Hidden("dir", grid.SortDirection)
+            @Html.Hidden("col", grid.SortColumn)
+

+


Add various clarifications to the web page

--- ForumScorer/index.cshtml
+++ ForumScorer/index.cshtml
@@ -14,9 +14,9 @@
     <title>Forum Scorer</title>

-
Forum Scorer

+
MSDN Forum Scorer for the Web Apps team

-
This week's leaderboard (the week ends on Friday)

+
This week's leaderboard (the week ends on Friday)

         @foreach (var user in data.OrderByDescending(u=>u.WeekScore))
         {
@@ -26,7 +26,7 @@
         }

-
Last week's leaderboard

+
Last week's leaderboard

         @foreach (var user in data.OrderByDescending(u => u.PreviousWeekScore))
         {
@@ -36,9 +36,16 @@
         }

-
Scoring notes

+
Notes

-    Click on a user's name to see their activity detail on MSDN. Points are give as follows:
+

+
This counts activity in all MSDN forums; not just Web Apps

+
Click on a user's name to see their activity detail on MSDN

+
Counts are updated every hour using a WebJob

+
Sources are on https://github.com/davidebbo/ForumScorer if you want to make a pull request

+

+
+    Points are given as follows:

20 points for quickly answering a question


add docs to taskmessage

add docs to taskmessage

--- Framework/TaskMessage.cs
+++ Framework/TaskMessage.cs
@@ -17,11 +17,25 @@
     using System.Runtime.Serialization;
     using DurableTask.History;

+    /// <summary>
+    /// Wire level transport object for task messages containing events and orchestration instance information
+    /// </summary>
     [DataContract]
     public class TaskMessage
     {
+        /// <summary>
+        /// Even information for this taks message
+        /// </summary>
         [DataMember] public HistoryEvent Event;
+
+        /// <summary>
+        /// Sequence number for ordering of messages in history tracking
+        /// </summary>
         [DataMember] public long SequenceNumber;
+
+        /// <summary>
+        /// The orchestration instance information
+        /// </summary>
         [DataMember] public OrchestrationInstance OrchestrationInstance;
     }
 }


Creeper now has a ChangeState method.

Creeper now has a ChangeState method.

--- Game/Entities/Creeper.cs
+++ Game/Entities/Creeper.cs
@@ -15,6 +15,11 @@
 			this._world = world;
 		}

+		public void ChangeState(State<Creeper> newState)
+		{
+			_stateMachine.ChangeState(newState);
+		}
+
 		public override void Update(double elapsed)
 		{
 			_stateMachine.Update(elapsed);


added recognition of java process failure

--- processing/AnalyzeResultsAndWriteOutputProcess.cs
+++ processing/AnalyzeResultsAndWriteOutputProcess.cs
@@ -41,9 +41,12 @@

             OnProgress("Analyse starten...");
             var distillery = GetDistilleryTool();
-            distillery.RunDistillery(jobFile, wi => { WorkItem = wi; }, OnProgress, OnProgress, OnError);
-
-            if (Project.Configuration.ShowResult)
+            var state = distillery.RunDistillery(jobFile, wi => { WorkItem = wi; }, OnProgress, OnProgress, OnError);
+            if (!state)
+            {
+                OnError("Der Java-Prozess wurde mit einem Fehler beendet.");
+            }
+            else if (Project.Configuration.ShowResult)
             {
                 var resultFileToShow = Path.Combine(Project.GetOutputDir(),
                     Project.Configuration.VisualizeResult


Add a no-op NameAcquired handler to silence the warnings

--- glib/GLib.cs
+++ glib/GLib.cs
@@ -24,6 +24,11 @@
 		{
 			sessionConnection.Iterate ();
 			return true;
+		}
+
+		static void HandleNameAcquired (string name)
+		{
+			//do nothing
 		}

 		static Connection systemConnection = null;
@@ -56,6 +61,7 @@
 				if (systemBus == null) {
 					systemBus = SystemConnection.GetObject<Bus>("org.freedesktop.DBus", new ObjectPath("/org/freedesktop/DBus"));
 					systemBus.Hello ();
+					systemBus.NameAcquired += HandleNameAcquired;
 				}

 				return systemBus;
@@ -70,6 +76,7 @@
 				if (sessionBus == null) {
 					sessionBus = SessionConnection.GetObject<Bus>("org.freedesktop.DBus", new ObjectPath("/org/freedesktop/DBus"));
 					sessionBus.Hello ();
+					sessionBus.NameAcquired += HandleNameAcquired;
 				}

 				return sessionBus;


Add link to MemoryStream.CopyToAsync source link.

--- test/AWTY.Http.IntegrationTests/DumbMemoryStream.cs
+++ test/AWTY.Http.IntegrationTests/DumbMemoryStream.cs
@@ -6,9 +6,10 @@
     ///     A non-optimised version of <see cref="MemoryStream"/> for use in tests.
     /// </summary>
     /// <remarks>
-    ///     <see cref="MemoryStream"/> performs a bunch of optimisations unless subclassed.
+    ///     <see cref="MemoryStream"/>'s CopyToAsync performs a bunch of optimisations unless subclassed.
+    ///     https://github.com/Microsoft/referencesource/blob/master/mscorlib/system/io/memorystream.cs#L450
     ///
-    ///     Unfortunately, these optimisations break the tests.
+    ///     Unfortunately, these optimisations break some of our tests.
     ///     Although you obviously wouldn't use a MemoryStream in real life, it's the simplest options for these tests.
     /// </remarks>
     public sealed class DumbMemoryStream


Try to use font that would work on Linux and macOS.

--- tests/Magick.NET.Tests/Shared/Coders/TheSvgCoder.cs
+++ tests/Magick.NET.Tests/Shared/Coders/TheSvgCoder.cs
@@ -104,8 +104,8 @@
             var svg = @"<?xml version=""1.0"" encoding=""utf-8""?>
 <svg version=""1.1"" xmlns=""http://www.w3.org/2000/svg"" xmlns:xlink=""http://www.w3.org/1999/xlink"" viewBox=""0 0 220 80"">
 <style type=""text/css"">
-  .st0{font-family:'Tahoma';font-size:40}
-  .st1{font-family:""Courier"";font-size:40}
+  .st0{font-family:'Courier New';font-size:40}
+  .st1{font-family:""Arial"";font-size:40}
 </style>
 <g id=""changable-text"">
   <text transform=""matrix(1 0 0 1 1 35)"" class=""st0"">FONT TEST</text>
@@ -115,8 +115,11 @@
             var bytes = Encoding.UTF8.GetBytes(svg);
             using (var image = new MagickImage(bytes))
             {
-                ColorAssert.AreEqual(MagickColors.Black, image, 133, 55);
-                ColorAssert.AreEqual(MagickColors.Black, image, 124, 20);
+                Assert.AreEqual(220, image.Width);
+                Assert.AreEqual(80, image.Height);
+
+                ColorAssert.AreEqual(MagickColors.Black, image, 93, 12);
+                ColorAssert.AreEqual(MagickColors.Black, image, 107, 41);
             }
         }


自動でMeshFilterをアタッチするコンテキストメニューの実装

自動でMeshFilterをアタッチするコンテキストメニューの実装


Update Weeks Index View

Update Weeks Index View

--- ACStalkMarket/ACStalkMarket/Views/Weeks/Index.cshtml
+++ ACStalkMarket/ACStalkMarket/Views/Weeks/Index.cshtml
@@ -6,3 +6,18 @@

Index

+@Html.ActionLink("Add Week", "New", "Weeks", new { @class = "btn btn-primary" })
+
+

+

+

+            Fecha de Inicio
+            Fecha de Venta
+            Patrón
+            Estado
+            Eliminar
+

+

+
+

+


Fixed possible overflow (closes #61)

Fixed possible overflow (closes #61)

--- AngleSharp/Css/ValueConverters/ListValueConverter.cs
+++ AngleSharp/Css/ValueConverters/ListValueConverter.cs
@@ -49,7 +49,7 @@

         public Int32 MaxArgs
         {
-            get { return Int32.MaxValue; }
+            get { return 65536; }
         }
     }
 }


Remove Entries for Location.

Remove Entries for Location.

--- App2Night/App2Night/Page/SubPages/EditProfilePage.cs
+++ App2Night/App2Night/Page/SubPages/EditProfilePage.cs
@@ -11,7 +11,6 @@
     public class EditProfilePage : FreshBaseContentPage
     {
         #region Nodes
-
         readonly InputContainer<Entry> _nameEntry = new InputContainer<Entry>
         {
             Input = {Placeholder = AppResources.Username},
@@ -54,41 +53,6 @@
             Text = "\uf00c",
             ButtonLabel = {FontFamily = "FontAwesome", FontSize = 50},
         };
-
-        private InputContainer<Entry> _cityNameEntry = new InputContainer<Entry>
-        {
-            Input = {Placeholder = AppResources.Cityname},
-            IconCode = "\uf279",
-            ValidationVisible = true
-        };
-
-        private InputContainer<Entry> _streetEntry = new InputContainer<Entry>
-        {
-            Input = {Placeholder = AppResources.StrName},
-            ValidationVisible = true,
-            IconCode = "\uf0f3"
-        };
-
-        private InputContainer<Entry> _numberEntry = new InputContainer<Entry>
-        {
-            Input = {Keyboard = Keyboard.Numeric, Placeholder = AppResources.HNumber},
-            ValidationVisible = true
-        };
-
-        private InputContainer<Entry> _locationEntry = new InputContainer<Entry>
-        {
-            Input = {Placeholder = AppResources.Location},
-            IconCode = "\uf015",
-            ValidationVisible = true,
-            Margin = new Thickness(5, 0)
-        };
-
-        InputContainer<Entry> _zipCodetEntry = new InputContainer<Entry>
-        {
-            Input = {Keyboard = Keyboard.Numeric, Placeholder = AppResources.Zipcode},
-            ValidationVisible = true
-        };
-
         #endregion

         /// <summary>
@@ -100,7 +64,7 @@
             Title = AppResources.EditProfile;
             // bind to view model
             SetBindings();
-            // set Content with two grids. first one contains all information about the user. last one has a cancel and ok btn.
+            // set entries to stackLayout
             var inputColumns = CreateInputColumns();
             Grid.SetRowSpan(inputColumns, 2);
             Grid.SetColumnSpan(inputColumns, 2);
@@ -145,32 +109,6 @@
                     _emailEntry,
                     _ageEntry,
                     _genderPicker,
-                    new Grid
-                    {
-                        ColumnDefinitions = new ColumnDefinitionCollection
-                        {
-                            new ColumnDefinition {Width = new GridLength(3, GridUnitType.Star)},
-                            new ColumnDefinition {Width = new GridLength(1, GridUnitType.Star)}
-                        },
-                        Children =
-                        {
-                            {_streetEntry, 0, 0},
-                            {_numberEntry, 1, 0},
-                        }
-                    },
-                    new Grid
-                    {
-                        ColumnDefinitions = new ColumnDefinitionCollection
-                        {
-                            new ColumnDefinition {Width = new GridLength(2, GridUnitType.Star)},
-                            new ColumnDefinition {Width = new GridLength(1, GridUnitType.Star)}
-                        },
-                        Children =
-                        {
-                            {_addressEntry, 0, 0},
-                            {_zipCodetEntry, 1, 0},
-                        }
-                    },
                 }
             };
         }


Refactor Label Creation

Refactor Label Creation

--- Application/MatchGenerator/Core/UI/CourtView.xaml.cs
+++ Application/MatchGenerator/Core/UI/CourtView.xaml.cs
@@ -42,26 +42,30 @@
 			// Labels
 			if (matchInfomation == null)
 			{
-				Court1Player1NameLabel.Content = "";
-				Court1Player1DescriptionLabel.Content = "";
-				Court1Player2NameLabel.Content = "";
-				Court1Player2DescriptionLabel.Content = "";
-				Court2Player1NameLabel.Content = "";
-				Court2Player1DescriptionLabel.Content = "";
-				Court2Player2NameLabel.Content = "";
-				Court2Player2DescriptionLabel.Content = "";
+				CreatePlayerLabel(Court1Player1NameLabel, Court1Player1DescriptionLabel);
+				CreatePlayerLabel(Court1Player2NameLabel, Court1Player2DescriptionLabel);
+				CreatePlayerLabel(Court2Player1NameLabel, Court2Player1DescriptionLabel);
+				CreatePlayerLabel(Court2Player2NameLabel, Court2Player2DescriptionLabel);
 			}
 			else
 			{
-				Court1Player1NameLabel.Content = matchInfomation.Team1.player1.Name;
-				Court1Player1DescriptionLabel.Content = matchInfomation.Team1.player1.Description;
-				Court1Player2NameLabel.Content = matchInfomation.Team1.player2.Name;
-				Court1Player2DescriptionLabel.Content = matchInfomation.Team1.player2.Description;
-				Court2Player1NameLabel.Content = matchInfomation.Team2.player1.Name;
-				Court2Player1DescriptionLabel.Content = matchInfomation.Team2.player1.Description;
-				Court2Player2NameLabel.Content = matchInfomation.Team2.player2.Name;
-				Court2Player2DescriptionLabel.Content = matchInfomation.Team2.player2.Description;
+				CreatePlayerLabel(Court1Player1NameLabel, Court1Player1DescriptionLabel, matchInfomation.Team1.player1);
+				CreatePlayerLabel(Court1Player2NameLabel, Court1Player2DescriptionLabel, matchInfomation.Team1.player2);
+				CreatePlayerLabel(Court2Player1NameLabel, Court2Player1DescriptionLabel, matchInfomation.Team2.player1);
+				CreatePlayerLabel(Court2Player2NameLabel, Court2Player2DescriptionLabel, matchInfomation.Team2.player2);
 			}
+		}
+
+		private void CreatePlayerLabel(Label nameLabel, Label descriptionLabel)
+		{
+			nameLabel.Content = "";
+			descriptionLabel.Content = "";
+		}
+
+		private void CreatePlayerLabel(Label nameLabel, Label descriptionLabel, Person player)
+		{
+			nameLabel.Content = player.Name;
+			descriptionLabel.Content = player.Description;
 		}

 		private void CourtLayoutGrid_SizeChanged(object sender, SizeChangedEventArgs e)


refs #31 Add an interface method

refs #31 Add an interface method

--- Application/MatchGenerator/FileIO/IMemberImporter.cs
+++ Application/MatchGenerator/FileIO/IMemberImporter.cs
@@ -3,6 +3,7 @@
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using MatchGenerator.Model;

 namespace MatchGenerator.FileIO
 {
@@ -11,5 +12,11 @@
 	/// </summary>
 	public interface IMemberImporter
 	{
+		/// <summary>
+		/// メンバー情報を指定したファイルより読み込む
+		/// </summary>
+		/// <param name="FileName">読み込むファイルの, パス(絶対パスまたは相対パス)および拡張子を含むファイル名</param>
+		/// <returns>読み込んだメンバー情報</returns>
+		IList<IPerson> Import(string FileName);
 	}
 }


Clarified SittingProcessor uses

Clarified SittingProcessor uses

--- Arges.KinectRemote.BodyProcessor/SittingProcessor.cs
+++ Arges.KinectRemote.BodyProcessor/SittingProcessor.cs
@@ -5,6 +5,10 @@

 namespace Arges.KinectRemote.BodyProcessor
 {
+    /// <summary>
+    /// Sample body processor. This case would right now be much better
+    /// handled by a gesture recognizer.
+    /// </summary>
     public class SittingProcessor: ABodyProcessor
     {
         /// <summary>


Copying config and rigidbody files manually is not longer necessary

--- Assets/Paradigms/SearchAndFind/Editor/BuildHelper.cs
+++ Assets/Paradigms/SearchAndFind/Editor/BuildHelper.cs
@@ -10,6 +10,14 @@
 {
     public class ScriptBatch
     {
+
+        static string executableName = "SearchAndFind";
+        static string dataFolderName = executableName + "_Data";
+
+        static string sep = "/";
+        static string assets = "Assets";
+        static string path = "";
+
         [MenuItem("BeMoBI/Compile SearchAndFind")]
         public static void Build_SearchAndFind()
         {
@@ -28,37 +36,56 @@
             paradigm.ClearConfiguration();

             GameObject.DestroyImmediate(paradigm.InstanceDefinition);
-
-            // Get filename.
-            string path = EditorUtility.SaveFolderPanel("Choose Location of Built Game", System.Environment.CurrentDirectory, "");
+
+            path = EditorUtility.SaveFolderPanel("Choose Location of Built Game", System.Environment.CurrentDirectory, "");
             string[] levels = new string[] { "Assets/Paradigms/SearchAndFind.unity" };
-
-            var executableName = "SearchAndFind";
-            var dataFolderName = executableName + "_Data";
-            var targetExecutable = path + "/" + executableName + ".exe";
-
-            // Build player.
+
+            var targetExecutable = path + sep + executableName + ".exe";
+
             BuildPipeline.BuildPlayer(levels, targetExecutable, BuildTarget.StandaloneWindows64, BuildOptions.None);

             var nlogConfigFile = "NLog.config";
-            var configFileName = "SearchAndFind_Config.json";
+
             var appConfigFileName = "AppConfig.json";
-            var rigidBodyFileName = "6_upperBody.rb";
-
-            var sep = Path.DirectorySeparatorChar;
-            var assets = "Assets";
-
+
+            var phasespaceConfigName = "phasespace.json";
+
             // Copy a file from the project folder to the build folder, alongside the built game.
-            FileUtil.CopyFileOrDirectory(assets + sep + nlogConfigFile, path + sep + dataFolderName + sep + nlogConfigFile);
-            FileUtil.CopyFileOrDirectory(assets + sep + configFileName, path + sep + dataFolderName + sep + configFileName);
+            copy(nlogConfigFile);

-            FileUtil.CopyFileOrDirectory(assets + sep + appConfigFileName, path + sep + dataFolderName + sep + appConfigFileName);
-            FileUtil.CopyFileOrDirectory(assets + sep + rigidBodyFileName, path + sep + dataFolderName + sep + rigidBodyFileName);
+            copy(appConfigFileName);
+
+            copy(phasespaceConfigName);
+
+            var rigidBodyfiles = Directory.GetFiles(assets, "*.rb");
+
+            foreach (var item in rigidBodyfiles)
+            {
+                var fileName = Path.GetFileName(item);
+                copy(fileName);
+            }
+
+            var configFiles = Directory.GetFiles(assets, "*_Config.json");
+
+            foreach (var item in configFiles)
+            {
+                var fileName = Path.GetFileName(item);
+                copy(fileName);
+            }
+
             // open the target directory
             Process.Start(path);
-
         }

+        static void copy(string fileName)
+        {
+            var source = assets + sep + fileName;
+
+            var target = path + sep + dataFolderName + sep + fileName;
+
+            if(!File.Exists(target))
+                FileUtil.CopyFileOrDirectory(source,target);
+        }
     }

     static class ExtensionHelper


Remove unused constants for condition names

--- Assets/Paradigms/SearchAndFind/ParadigmController.cs
+++ Assets/Paradigms/SearchAndFind/ParadigmController.cs
@@ -24,13 +24,6 @@
     {
         public const string STD_CONFIG_NAME = "SearchAndFind_Config.json";

-        private const string COND_MOCAP = "mocap";
-        private const string COND_MOCAP_ROT = "mocap_rot";
-        private const string COND_DESKTOP = "desktop";
-        private const string COND_MONOSCOP = "monoscop";
-        private const string COND_STANDING = "standing";
-        private const string COND_SITTING = "sitting";
-
         private static Logger appLog = LogManager.GetLogger("App");

         private static Logger statistic = LogManager.GetLogger("Statistics");
@@ -131,8 +124,6 @@
             fading.StartFadeIn();

             marker.LogAlsoToFile = Config.logMarkerToFile;
-
-
         }

         private void First_GetTheSubjectName()


Remove hack for attached personnel

Remove hack for attached personnel

--- Battery-Commander.Web/Models/Reports/Red1_Perstat.cs
+++ Battery-Commander.Web/Models/Reports/Red1_Perstat.cs
@@ -20,20 +20,7 @@
         };

         [Display(Name = "Personnel Attached")]
-        public Row Attached
-        {
-            get
-            {
-                // HACK: Still need to figure out how to count attached folks
-
-                if(DateTime.Now < new DateTime(2018, 07, 28))
-                {
-                    return new Row { Enlisted = 1 };
-                }
-
-                return new Row { };
-            }
-        }
+        public Row Attached => new Row { };

         [Display(Name = "Personnel Detached")]
         public Row Detached => new Row


Simplify some code as suggested in review. (#22104)

Fixes #20029

--- src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_PatternSwitchStatement.cs
+++ src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_PatternSwitchStatement.cs
@@ -264,11 +264,7 @@
                 var inputConstant = byType.Expression.ConstantValue;

                 // three-valued: true if input known null, false if input known non-null, null if not known.
-                bool? inputIsNull = null;
-                if (inputConstant != null)
-                {
-                    inputIsNull = inputConstant.IsNull;
-                }
+                bool? inputIsNull = inputConstant?.IsNull;

                 var defaultLabel = _factory.GenerateLabel("byTypeDefault");


Fix redundant case (IDE0004)

Fix redundant case (IDE0004)

--- src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/Maintainability/CodeMetricsAnalyzer.cs
+++ src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/Maintainability/CodeMetricsAnalyzer.cs
@@ -312,7 +312,7 @@

                         CA1505RuleId => 10,

-                        CA1506RuleId => symbolKind == SymbolKind.NamedType ? 95 : (uint)40,
+                        CA1506RuleId => symbolKind == SymbolKind.NamedType ? 95 : 40,

                         _ => throw new NotImplementedException(),
                     };


update removeroleassignment comparison to case insensitive

--- src/ResourceManager/Resources/Commands.Resources/Models.Authorization/AuthorizationClient.cs
+++ src/ResourceManager/Resources/Commands.Resources/Models.Authorization/AuthorizationClient.cs
@@ -476,7 +476,7 @@
             // but an edge case can have multiple role assignments to the same role or multiple role assignments to different roles, with same name.
             // The FilterRoleAssignments takes care of paging internally
             IEnumerable<PSRoleAssignment> roleAssignments = FilterRoleAssignments(options, currentSubscription: subscriptionId)
-                                                .Where(ra => ra.Scope == options.Scope.TrimEnd('/'));
+                                                .Where(ra => ra.Scope.Equals(options.Scope.TrimEnd('/'), StringComparison.OrdinalIgnoreCase));

             if (roleAssignments == null || !roleAssignments.Any())
             {


Update Assets/MixedRealityToolkit/Interfaces/SpatialAwareness/IMixedRealitySpatialAwarenessSystem.cs

Co-Authored-By: Kurtis <601750f99a611216e3b3536e5835b26dc3c9b459@microsoft.com>

--- Assets/MixedRealityToolkit/Interfaces/SpatialAwareness/IMixedRealitySpatialAwarenessSystem.cs
+++ Assets/MixedRealityToolkit/Interfaces/SpatialAwareness/IMixedRealitySpatialAwarenessSystem.cs
@@ -122,7 +122,7 @@
         void SuspendObserver<T>(string name) where T : IMixedRealitySpatialAwarenessObserver;

         /// <summary>
-        /// Clears all registered observer's observations.
+        /// Clears all registered observers' observations.
         /// </summary>
         void ClearObservations();


Delete OptionsRunoffCoefficientSlider.cs

--- UI/OptionsRunoffCoefficientSlider.cs
+++ UI/OptionsRunoffCoefficientSlider.cs
@@ -1,37 +0,0 @@
-using ColossalFramework.UI;
-using ICities;
-using System.Collections.Generic;
-using UnityEngine;
-using System;
-
-namespace Rainfall.UI
-{
-    class OptionsRunoffCoefficientSlider : OptionsItemBase
-    {
-        public float value
-        {
-            get { return (float)m_value;  }
-            set { m_value = value; }
-        }
-        public float min = 0f;
-        public float max = 1f;
-        public float step = 1f;
-        public UISlider slider;
-        public override void Create(UIHelperBase helper)
-        {
-            slider = helper.AddSlider(readableName, min, max, step, value, IgnoredFunction) as UISlider;
-            slider.enabled = enabled;
-            slider.name = uniqueName;
-            slider.width += 100;
-            slider.tooltip = value.ToString();
-            slider.eventValueChanged += new PropertyChangedEventHandler<float>(delegate (UIComponent component, float newValue)
-            {
-                value = newValue;
-                slider.tooltip = value.ToString();
-                slider.RefreshTooltip();
-                ModSettings.setRunoffCoefficient(uniqueName, value);
-
-            });
-        }
-    }
-}


changed the CreateDocument method to use application/json rather than form-urlencoded on put

--- LoveSeat/CouchDatabase.cs
+++ LoveSeat/CouchDatabase.cs
@@ -37,7 +37,7 @@
             if (jobj.Value<object>("_rev") == null)
                 jobj.Remove("_rev");
             var resp = GetRequest(databaseBaseUri + "/" + id)
-                .Put().Form()
+                .Put().Json()
                 .Data(jobj.ToString(Formatting.None))
                 .GetCouchResponse();
             return


Also catch exception when cannot find end of bold

--- src/XText/XTextParser.cs
+++ src/XText/XTextParser.cs
@@ -95,7 +95,14 @@
                 }
                 else if (boldStart != -1 && boldStart <= italicStart)
                 {
-                    str = ParseNextInline(str, boldDelimiter, boldStart, inlines, s => new XBold(s));
+                    try
+                    {
+                        str = ParseNextInline(str, boldDelimiter, boldStart, inlines, s => new XBold(s));
+                    }
+                    catch (ArgumentOutOfRangeException)
+                    {
+                        // No end found
+                    }
                     formattedInlineMatch = true;
                 }
                 else if (italicStart != -1)


Set copy/paste property setters to private

--- Mappy/Models/CoreModel.cs
+++ Mappy/Models/CoreModel.cs
@@ -196,7 +196,7 @@
                 return this.canCopy;
             }

-            set
+            private set
             {
                 this.SetField(ref this.canCopy, value, "CanCopy");
             }
@@ -217,7 +217,7 @@
                 return this.canCut;
             }

-            set
+            private set
             {
                 this.SetField(ref this.canCut, value, "CanCut");
             }


make line ending normalization a single pass operation instead of two-pass

--- MarkdownSharp/Markdown.cs
+++ MarkdownSharp/Markdown.cs
@@ -290,6 +290,7 @@
         }

         private static Regex _blankLines = new Regex(@"^[ ]+$", RegexOptions.Multiline | RegexOptions.Compiled);
+        private static Regex _lineEndings = new Regex(@"\r\n?", RegexOptions.Compiled);

         /// <summary>
         /// Transforms the provided Markdown-formatted text to HTML;
@@ -307,12 +308,9 @@

             Setup();

-            // Standardize line endings
+            // standardize line endings from DOS (CR LF) / Mac (CR) to UNIX (LF)
             if (text.Contains("\r"))
-            {
-                text = text.Replace("\r\n", "\n");    // DOS to Unix
-                text = text.Replace("\r", "\n");      // Mac to Unix
-            }
+                text = _lineEndings.Replace(text, "\n");

             // Make sure $text ends with a couple of newlines:
             text += "\n\n";


Update PlainTextOutputSpeech.cs

Update PlainTextOutputSpeech.cs

--- AlexaSkillsKit.Lib/UI/PlainTextOutputSpeech.cs
+++ AlexaSkillsKit.Lib/UI/PlainTextOutputSpeech.cs
@@ -15,5 +15,13 @@
             get;
             set;
         }
+
+        public static implicit operator SpeechOutput(string spokenText)
+        {
+            return new PlainTextOutputSpeech()
+            {
+                Text = spokenText
+            };
+        }
     }
-}+}


Provide Absolute path

Provide Absolute path

--- Anlab.Mvc/Views/Templates/_OrderCreated.cshtml
+++ Anlab.Mvc/Views/Templates/_OrderCreated.cshtml
@@ -1,7 +1,10 @@
-@model Order
+@model Order
 @{
     var order = Model.GetOrderDetails();
-    var image = Url.Content("~/Images/anlab170.png");
+    var protocol = Context.Request.Scheme;
+    var host = Context.Request.Host;
+    var path = $"{protocol}://{host}";
+    var image = $"{path}/{Url.Content("~/Images/anlab170.png")}" ;
 }
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" style="background:#f3f3f3!important">


Fix bug in Type are Assignable

Fix bug in Type are Assignable

--- Model/Types/TypeHelper.cs
+++ Model/Types/TypeHelper.cs
@@ -403,10 +403,15 @@
 			{
 				var class1 = type1 as ClassDefinition;

-				if (TypesAreEquivalent(class1.Base, type2)) return true;
-
-				if (class1.Base.ResolvedType is ClassDefinition &&
-					Type1DerivesFromType2(class1.Base.ResolvedType as ClassDefinition, type2)) return true;
+                if (class1.Base != null)
+                {
+
+                    if (TypesAreEquivalent(class1.Base, type2)) return true;
+
+
+                    if (class1.Base.ResolvedType is ClassDefinition &&
+                        Type1DerivesFromType2(class1.Base.ResolvedType as ClassDefinition, type2)) return true;
+                }
 			}

 			return false;


fix(TextureLoader): fix wrong alpha value for 24 bit TGA

Changed from 1 to 255 the defaut value for 24 bit TGA textures.

--- Assets/AsImpL/Scripts/Loaders/TextureLoader.cs
+++ Assets/AsImpL/Scripts/Loaders/TextureLoader.cs
@@ -189,7 +189,7 @@
                                 int idx;
                                 if (vflip) idx = length - row * width + col;
                                 else idx = length - ((height - row + 1) * width) + col;
-                                pulledColors[idx] = new Color32(blue, green, red, 1);
+                                pulledColors[idx] = new Color32(blue, green, red, 255);
                             }
                         }
                     }


Fixed dialog input causing an exception if no Event System is present.

--- Assets/Fungus/Narrative/Scripts/DialogInput.cs
+++ Assets/Fungus/Narrative/Scripts/DialogInput.cs
@@ -83,7 +83,20 @@
 		protected virtual void Update()
 		{
             if (currentStandaloneInputModule == null)
+            {
+                if (EventSystem.current == null)
+                {
+                    // Auto spawn an Event System from the prefab
+                    GameObject prefab = Resources.Load<GameObject>("EventSystem");
+                    if (prefab != null)
+                    {
+                        GameObject go = Instantiate(prefab) as GameObject;
+                        go.name = "EventSystem";
+                    }
+                }
+
                 currentStandaloneInputModule = EventSystem.current.GetComponent<StandaloneInputModule>();
+            }

             if (Input.GetButtonDown(currentStandaloneInputModule.submitButton) ||
                 (cancelEnabled && Input.GetButton(currentStandaloneInputModule.cancelButton)))


prevent readme during builds

prevent readme during builds

--- Assets/HappyFunTimes/Scripts/HFTReadmeUtils.cs
+++ Assets/HappyFunTimes/Scripts/HFTReadmeUtils.cs
@@ -9,6 +9,7 @@
     public class HFTReadmeUtils {

         const string kLastScene = "happyFunTimesReadmeSceneHash";
+        const string kWasNotEditor = "happyFunTimesReadmeWasNotEditor";

         #if UNITY_EDITOR
         static Regex m_tickRE = new Regex("`(.*?)`", RegexOptions.CultureInvariant | RegexOptions.Singleline);
@@ -253,11 +254,25 @@
             PlayerPrefs.SetString(kLastScene, GetSceneHash());
         }

-        static bool ShouldShowReadme()
-        {
-            if (Application.isPlaying)
-            {
+        static bool ShouldShowReadme(bool force)
+        {
+            bool wasEditor = PlayerPrefs.GetInt(kWasNotEditor, 0) > 0;
+            bool badState =
+                UnityEditor.BuildPipeline.isBuildingPlayer ||
+                Application.isPlaying ||
+                UnityEditor.EditorApplication.isPlaying ||
+                UnityEditor.EditorApplication.isUpdating ||
+                UnityEditor.EditorApplication.isCompiling ||
+                UnityEditor.EditorApplication.isPlayingOrWillChangePlaymode;
+            if (wasEditor || badState)
+            {
+                PlayerPrefs.SetInt(kWasNotEditor, badState ? 1 : 0);
                 return false;
+            }
+
+            if (force)
+            {
+                return true;
             }

             bool isSameScene = IsSameSceneAsLastTime();
@@ -272,7 +287,7 @@

         static public void ShowReadme(string name, string text, bool richText, bool markdownish, Component component, bool force)
         {
-            if (!force && !ShouldShowReadme())
+            if (!ShouldShowReadme(force))
             {
                 return;
             }


XmlEnumAttribute属性の指定をXmlEnumに簡略化

XmlEnumAttribute属性の指定をXmlEnumに簡略化

--- MusicXMLUtils/musicxml.cs
+++ MusicXMLUtils/musicxml.cs
@@ -171,10 +171,10 @@

         curved,

-        [XmlEnumAttribute("double-straight")]
+        [XmlEnum("double-straight")]
         doublestraight,

-        [XmlEnumAttribute("double-curved")]
+        [XmlEnum("double-curved")]
         doublecurved,
     }

@@ -268,16 +268,16 @@

         heavy,

-        [XmlEnumAttribute("light-light")]
+        [XmlEnum("light-light")]
         lightlight,

-        [XmlEnumAttribute("light-heavy")]
+        [XmlEnum("light-heavy")]
         lightheavy,

-        [XmlEnumAttribute("heavy-light")]
+        [XmlEnum("heavy-light")]
         heavylight,

-        [XmlEnumAttribute("heavy-heavy")]
+        [XmlEnum("heavy-heavy")]
         heavyheavy,

         tick,
@@ -595,7 +595,7 @@

         square,

-        [XmlEnumAttribute("")]
+        [XmlEnum("")]
         Item,
     }

@@ -887,91 +887,91 @@

         flat,

-        [XmlEnumAttribute("double-sharp")]
+        [XmlEnum("double-sharp")]
         doublesharp,

-        [XmlEnumAttribute("sharp-sharp")]
+        [XmlEnum("sharp-sharp")]
         sharpsharp,

-        [XmlEnumAttribute("flat-flat")]
+        [XmlEnum("flat-flat")]
         flatflat,

-        [XmlEnumAttribute("natural-sharp")]
+        [XmlEnum("natural-sharp")]
         naturalsharp,

-        [XmlEnumAttribute("natural-flat")]
+        [XmlEnum("natural-flat")]
         naturalflat,

-        [XmlEnumAttribute("quarter-flat")]
+        [XmlEnum("quarter-flat")]
         quarterflat,

-        [XmlEnumAttribute("quarter-sharp")]
+        [XmlEnum("quarter-sharp")]
         quartersharp,

-        [XmlEnumAttribute("three-quarters-flat")]
+        [XmlEnum("three-quarters-flat")]
         threequartersflat,

-        [XmlEnumAttribute("three-quarters-sharp")]
+        [XmlEnum("three-quarters-sharp")]
         threequarterssharp,

-        [XmlEnumAttribute("sharp-down")]
+        [XmlEnum("sharp-down")]
         sharpdown,

-        [XmlEnumAttribute("sharp-up")]
+        [XmlEnum("sharp-up")]
         sharpup,

-        [XmlEnumAttribute("natural-down")]
+        [XmlEnum("natural-down")]
         naturaldown,

-        [XmlEnumAttribute("natural-up")]
+        [XmlEnum("natural-up")]
         naturalup,

-        [XmlEnumAttribute("flat-down")]
+        [XmlEnum("flat-down")]
         flatdown,

-        [XmlEnumAttribute("flat-up")]
+        [XmlEnum("flat-up")]
         flatup,

-        [XmlEnumAttribute("triple-sharp")]
+        [XmlEnum("triple-sharp")]
         triplesharp,

-        [XmlEnumAttribute("triple-flat")]
+        [XmlEnum("triple-flat")]
         tripleflat,

-        [XmlEnumAttribute("slash-quarter-sharp")]
+        [XmlEnum("slash-quarter-sharp")]
         slashquartersharp,

-        [XmlEnumAttribute("slash-sharp")]
+        [XmlEnum("slash-sharp")]
         slashsharp,

-        [XmlEnumAttribute("slash-flat")]
+        [XmlEnum("slash-flat")]
         slashflat,

-        [XmlEnumAttribute("double-slash-flat")]
+        [XmlEnum("double-slash-flat")]
         doubleslashflat,

-        [XmlEnumAttribute("sharp-1")]
+        [XmlEnum("sharp-1")]
         sharp1,

-        [XmlEnumAttribute("sharp-2")]
+        [XmlEnum("sharp-2")]
         sharp2,

-        [XmlEnumAttribute("sharp-3")]
+        [XmlEnum("sharp-3")]
         sharp3,

-        [XmlEnumAttribute("sharp-5")]
+        [XmlEnum("sharp-5")]
         sharp5,

-        [XmlEnumAttribute("flat-1")]
+        [XmlEnum("flat-1")]
         flat1,

-        [XmlEnumAttribute("flat-2")]
+        [XmlEnum("flat-2")]
         flat2,

-        [XmlEnumAttribute("flat-3")]
+        [XmlEnum("flat-3")]
         flat3,

-        [XmlEnumAttribute("flat-4")]
+        [XmlEnum("flat-4")]
         flat4,

         sori,
@@ -1396,7 +1396,7 @@

         diminished,

-        [XmlEnumAttribute("half-diminished")]
+        [XmlEnum("half-diminished")]
         halfdiminished,
     }

@@ -1584,61 +1584,61 @@

         dominant,

-        [XmlEnumAttribute("major-seventh")]
+        [XmlEnum("major-seventh")]
         majorseventh,

-        [XmlEnumAttribute("minor-seventh")]
+        [XmlEnum("minor-seventh")]
         minorseventh,

-        [XmlEnumAttribute("diminished-seventh")]
+        [XmlEnum("diminished-seventh")]
         diminishedseventh,

-        [XmlEnumAttribute("augmented-seventh")]
+        [XmlEnum("augmented-seventh")]
         augmentedseventh,

-        [XmlEnumAttribute("half-diminished")]
+        [XmlEnum("half-diminished")]
         halfdiminished,

-        [XmlEnumAttribute("major-minor")]
+        [XmlEnum("major-minor")]
         majorminor,

-        [XmlEnumAttribute("major-sixth")]
+        [XmlEnum("major-sixth")]
         majorsixth,

-        [XmlEnumAttribute("minor-sixth")]
+        [XmlEnum("minor-sixth")]
         minorsixth,

-        [XmlEnumAttribute("dominant-ninth")]
+        [XmlEnum("dominant-ninth")]
         dominantninth,

-        [XmlEnumAttribute("major-ninth")]
+        [XmlEnum("major-ninth")]
         majorninth,

-        [XmlEnumAttribute("minor-ninth")]
+        [XmlEnum("minor-ninth")]
         minorninth,

-        [XmlEnumAttribute("dominant-11th")]
+        [XmlEnum("dominant-11th")]
         dominant11th,

-        [XmlEnumAttribute("major-11th")]
+        [XmlEnum("major-11th")]
         major11th,

-        [XmlEnumAttribute("minor-11th")]
+        [XmlEnum("minor-11th")]
         minor11th,

-        [XmlEnumAttribute("dominant-13th")]
+        [XmlEnum("dominant-13th")]
         dominant13th,

-        [XmlEnumAttribute("major-13th")]
+        [XmlEnum("major-13th")]
         major13th,

-        [XmlEnumAttribute("minor-13th")]
+        [XmlEnum("minor-13th")]
         minor13th,

-        [XmlEnumAttribute("suspended-second")]
+        [XmlEnum("suspended-second")]
         suspendedsecond,

-        [XmlEnumAttribute("suspended-fourth")]
+        [XmlEnum("suspended-fourth")]
         suspendedfourth,

         Neapolitan,
@@ -1833,25 +1833,25 @@
     [XmlType(TypeName = "note-type-value")]
     public enum NoteTypeValue
     {
-        [XmlEnumAttribute("1024th")]
+        [XmlEnum("1024th")]
         Item1024th,

-        [XmlEnumAttribute("512th")]
+        [XmlEnum("512th")]
         Item512th,

-        [XmlEnumAttribute("256th")]
+        [XmlEnum("256th")]
         Item256th,

-        [XmlEnumAttribute("128th")]
+        [XmlEnum("128th")]
         Item128th,

-        [XmlEnumAttribute("64th")]
+        [XmlEnum("64th")]
         Item64th,

-        [XmlEnumAttribute("32nd")]
+        [XmlEnum("32nd")]
         Item32nd,

-        [XmlEnumAttribute("16th")]
+        [XmlEnum("16th")]
         Item16th,

         eighth,
@@ -2278,12 +2278,12 @@

         cut,

-        [XmlEnumAttribute("single-number")]
+        [XmlEnum("single-number")]
         singlenumber,

         note,

-        [XmlEnumAttribute("dotted-note")]
+        [XmlEnum("dotted-note")]
         dottednote,

         normal,
@@ -2350,14 +2350,14 @@
     [XmlType(IncludeInSchema = false)]
     public enum ItemsChoiceType9
     {
-        [XmlEnumAttribute("beat-type")]
+        [XmlEnum("beat-type")]
         beattype,

         beats,

         interchangeable,

-        [XmlEnumAttribute("senza-misura")]
+        [XmlEnum("senza-misura")]
         senzamisura,
     }

@@ -2407,7 +2407,7 @@

         right,

-        [XmlEnumAttribute("before-barline")]
+        [XmlEnum("before-barline")]
         beforebarline,
     }

@@ -2453,13 +2453,13 @@

         fifths,

-        [XmlEnumAttribute("key-accidental")]
+        [XmlEnum("key-accidental")]
         keyaccidental,

-        [XmlEnumAttribute("key-alter")]
+        [XmlEnum("key-alter")]
         keyalter,

-        [XmlEnumAttribute("key-step")]
+        [XmlEnum("key-step")]
         keystep,

         mode,
@@ -2708,10 +2708,10 @@

         cup,

-        [XmlEnumAttribute("harmon-no-stem")]
+        [XmlEnum("harmon-no-stem")]
         harmonnostem,

-        [XmlEnumAttribute("harmon-stem")]
+        [XmlEnum("harmon-stem")]
         harmonstem,

         bucket,
@@ -2724,10 +2724,10 @@

         practice,

-        [XmlEnumAttribute("stop-mute")]
+        [XmlEnum("stop-mute")]
         stopmute,

-        [XmlEnumAttribute("stop-hand")]
+        [XmlEnum("stop-hand")]
         stophand,

         echo,
@@ -2756,17 +2756,17 @@
     {
         high,

-        [XmlEnumAttribute("medium-high")]
+        [XmlEnum("medium-high")]
         mediumhigh,

         medium,

-        [XmlEnumAttribute("medium-low")]
+        [XmlEnum("medium-low")]
         mediumlow,

         low,

-        [XmlEnumAttribute("very-low")]
+        [XmlEnum("very-low")]
         verylow,
     }

@@ -2812,10 +2812,10 @@
     [XmlType(TypeName = "stick-type")]
     public enum StickType
     {
-        [XmlEnumAttribute("bass drum")]
+        [XmlEnum("bass drum")]
         bassdrum,

-        [XmlEnumAttribute("double bass drum")]
+        [XmlEnum("double bass drum")]
         doublebassdrum,

         timpani,
@@ -2887,7 +2887,7 @@
     {
         bow,

-        [XmlEnumAttribute("chime hammer")]
+        [XmlEnum("chime hammer")]
         chimehammer,

         coin,
@@ -2898,35 +2898,35 @@

         fist,

-        [XmlEnumAttribute("guiro scraper")]
+        [XmlEnum("guiro scraper")]
         guiroscraper,

         hammer,

         hand,

-        [XmlEnumAttribute("jazz stick")]
+        [XmlEnum("jazz stick")]
         jazzstick,

-        [XmlEnumAttribute("knitting needle")]
+        [XmlEnum("knitting needle")]
         knittingneedle,

-        [XmlEnumAttribute("metal hammer")]
+        [XmlEnum("metal hammer")]
         metalhammer,

-        [XmlEnumAttribute("snare stick")]
+        [XmlEnum("snare stick")]
         snarestick,

-        [XmlEnumAttribute("spoon mallet")]
+        [XmlEnum("spoon mallet")]
         spoonmallet,

-        [XmlEnumAttribute("triangle beater")]
+        [XmlEnum("triangle beater")]
         trianglebeater,

-        [XmlEnumAttribute("triangle beater plain")]
+        [XmlEnum("triangle beater plain")]
         trianglebeaterplain,

-        [XmlEnumAttribute("wire brush")]
+        [XmlEnum("wire brush")]
         wirebrush,
     }

@@ -2964,41 +2964,41 @@
     {
         anvil,

-        [XmlEnumAttribute("auto horn")]
+        [XmlEnum("auto horn")]
         autohorn,

-        [XmlEnumAttribute("bird whistle")]
+        [XmlEnum("bird whistle")]
         birdwhistle,

         cannon,

-        [XmlEnumAttribute("duck call")]
+        [XmlEnum("duck call")]
         duckcall,

-        [XmlEnumAttribute("gun shot")]
+        [XmlEnum("gun shot")]
         gunshot,

-        [XmlEnumAttribute("klaxon horn")]
+        [XmlEnum("klaxon horn")]
         klaxonhorn,

-        [XmlEnumAttribute("lions roar")]
+        [XmlEnum("lions roar")]
         lionsroar,

-        [XmlEnumAttribute("police whistle")]
+        [XmlEnum("police whistle")]
         policewhistle,

         siren,

-        [XmlEnumAttribute("slide whistle")]
+        [XmlEnum("slide whistle")]
         slidewhistle,

-        [XmlEnumAttribute("thunder sheet")]
+        [XmlEnum("thunder sheet")]
         thundersheet,

-        [XmlEnumAttribute("wind machine")]
+        [XmlEnum("wind machine")]
         windmachine,

-        [XmlEnumAttribute("wind whistle")]
+        [XmlEnum("wind whistle")]
         windwhistle,
     }

@@ -3007,7 +3007,7 @@
     [XmlType("glass")]
     public enum Glass
     {
-        [XmlEnumAttribute("wind chimes")]
+        [XmlEnum("wind chimes")]
         windchimes,
     }

@@ -3016,32 +3016,32 @@
     [XmlType("membrane")]
     public enum Membrane
     {
-        [XmlEnumAttribute("bass drum")]
+        [XmlEnum("bass drum")]
         bassdrum,

-        [XmlEnumAttribute("bass drum on side")]
+        [XmlEnum("bass drum on side")]
         bassdrumonside,

         bongos,

-        [XmlEnumAttribute("conga drum")]
+        [XmlEnum("conga drum")]
         congadrum,

-        [XmlEnumAttribute("goblet drum")]
+        [XmlEnum("goblet drum")]
         gobletdrum,

-        [XmlEnumAttribute("military drum")]
+        [XmlEnum("military drum")]
         militarydrum,

-        [XmlEnumAttribute("snare drum")]
+        [XmlEnum("snare drum")]
         snaredrum,

-        [XmlEnumAttribute("snare drum snares off")]
+        [XmlEnum("snare drum snares off")]
         snaredrumsnaresoff,

         tambourine,

-        [XmlEnumAttribute("tenor drum")]
+        [XmlEnum("tenor drum")]
         tenordrum,

         timbales,
@@ -3058,60 +3058,60 @@

         bell,

-        [XmlEnumAttribute("bell plate")]
+        [XmlEnum("bell plate")]
         bellplate,

-        [XmlEnumAttribute("brake drum")]
+        [XmlEnum("brake drum")]
         brakedrum,

-        [XmlEnumAttribute("Chinese cymbal")]
+        [XmlEnum("Chinese cymbal")]
         Chinesecymbal,

         cowbell,

-        [XmlEnumAttribute("crash cymbals")]
+        [XmlEnum("crash cymbals")]
         crashcymbals,

         crotale,

-        [XmlEnumAttribute("cymbal tongs")]
+        [XmlEnum("cymbal tongs")]
         cymbaltongs,

-        [XmlEnumAttribute("domed gong")]
+        [XmlEnum("domed gong")]
         domedgong,

-        [XmlEnumAttribute("finger cymbals")]
+        [XmlEnum("finger cymbals")]
         fingercymbals,

         flexatone,

         gong,

-        [XmlEnumAttribute("hi-hat")]
+        [XmlEnum("hi-hat")]
         hihat,

-        [XmlEnumAttribute("high-hat cymbals")]
+        [XmlEnum("high-hat cymbals")]
         highhatcymbals,

         handbell,

         sistrum,

-        [XmlEnumAttribute("sizzle cymbal")]
+        [XmlEnum("sizzle cymbal")]
         sizzlecymbal,

-        [XmlEnumAttribute("sleigh bells")]
+        [XmlEnum("sleigh bells")]
         sleighbells,

-        [XmlEnumAttribute("suspended cymbal")]
+        [XmlEnum("suspended cymbal")]
         suspendedcymbal,

-        [XmlEnumAttribute("tam tam")]
+        [XmlEnum("tam tam")]
         tamtam,

         triangle,

-        [XmlEnumAttribute("Vietnamese hat")]
+        [XmlEnum("Vietnamese hat")]
         Vietnamesehat,
     }

@@ -3128,7 +3128,7 @@

         marimba,

-        [XmlEnumAttribute("tubular chimes")]
+        [XmlEnum("tubular chimes")]
         tubularchimes,

         vibraphone,
@@ -3145,10 +3145,10 @@

         rim,

-        [XmlEnumAttribute("cymbal bell")]
+        [XmlEnum("cymbal bell")]
         cymbalbell,

-        [XmlEnumAttribute("cymbal edge")]
+        [XmlEnum("cymbal edge")]
         cymbaledge,
     }

@@ -3157,7 +3157,7 @@
     [XmlType("wood")]
     public enum Wood
     {
-        [XmlEnumAttribute("board clapper")]
+        [XmlEnum("board clapper")]
         boardclapper,

         cabasa,
@@ -3168,7 +3168,7 @@

         guiro,

-        [XmlEnumAttribute("log drum")]
+        [XmlEnum("log drum")]
         logdrum,

         maraca,
@@ -3177,18 +3177,18 @@

         ratchet,

-        [XmlEnumAttribute("sandpaper blocks")]
+        [XmlEnum("sandpaper blocks")]
         sandpaperblocks,

-        [XmlEnumAttribute("slit drum")]
+        [XmlEnum("slit drum")]
         slitdrum,

-        [XmlEnumAttribute("temple block")]
+        [XmlEnum("temple block")]
         templeblock,

         vibraslap,

-        [XmlEnumAttribute("wood block")]
+        [XmlEnum("wood block")]
         woodblock,
     }

@@ -3422,10 +3422,10 @@

         end,

-        [XmlEnumAttribute("forward hook")]
+        [XmlEnum("forward hook")]
         forwardhook,

-        [XmlEnumAttribute("backward hook")]
+        [XmlEnum("backward hook")]
         backwardhook,
     }

@@ -3956,7 +3956,7 @@

         mp,

-        [XmlEnumAttribute("other-dynamics")]
+        [XmlEnum("other-dynamics")]
         otherdynamics,

         p,
@@ -4005,7 +4005,7 @@
     [XmlType(IncludeInSchema = false)]
     public enum ItemsChoiceType7
     {
-        [XmlEnumAttribute("accordion-registration")]
+        [XmlEnum("accordion-registration")]
         accordionregistration,

         bracket,
@@ -4014,7 +4014,7 @@

         damp,

-        [XmlEnumAttribute("damp-all")]
+        [XmlEnum("damp-all")]
         dampall,

         dashes,
@@ -4023,24 +4023,24 @@

         eyeglasses,

-        [XmlEnumAttribute("harp-pedals")]
+        [XmlEnum("harp-pedals")]
         harppedals,

         image,

         metronome,

-        [XmlEnumAttribute("octave-shift")]
+        [XmlEnum("octave-shift")]
         octaveshift,

-        [XmlEnumAttribute("other-direction")]
+        [XmlEnum("other-direction")]
         otherdirection,

         pedal,

         percussion,

-        [XmlEnumAttribute("principal-voice")]
+        [XmlEnum("principal-voice")]
         principalvoice,

         rehearsal,
@@ -4049,7 +4049,7 @@

         segno,

-        [XmlEnumAttribute("string-mute")]
+        [XmlEnum("string-mute")]
         stringmute,

         wedge,
@@ -4624,7 +4624,7 @@
     [XmlType(TypeName = "breath-mark-value")]
     public enum BreathMarkValue
     {
-        [XmlEnumAttribute("")]
+        [XmlEnum("")]
         Item,

         comma,
@@ -4704,19 +4704,19 @@
     {
         accent,

-        [XmlEnumAttribute("breath-mark")]
+        [XmlEnum("breath-mark")]
         breathmark,

         caesura,

-        [XmlEnumAttribute("detached-legato")]
+        [XmlEnum("detached-legato")]
         detachedlegato,

         doit,

         falloff,

-        [XmlEnumAttribute("other-articulation")]
+        [XmlEnum("other-articulation")]
         otherarticulation,

         plop,
@@ -4731,7 +4731,7 @@

         stress,

-        [XmlEnumAttribute("strong-accent")]
+        [XmlEnum("strong-accent")]
         strongaccent,

         tenuto,
@@ -4818,16 +4818,16 @@

         southwest,

-        [XmlEnumAttribute("left right")]
+        [XmlEnum("left right")]
         leftright,

-        [XmlEnumAttribute("up down")]
+        [XmlEnum("up down")]
         updown,

-        [XmlEnumAttribute("northwest southeast")]
+        [XmlEnum("northwest southeast")]
         northwestsoutheast,

-        [XmlEnumAttribute("northeast southwest")]
+        [XmlEnum("northeast southwest")]
         northeastsouthwest,

         other,
@@ -4914,7 +4914,7 @@
     [XmlType(IncludeInSchema = false)]
     public enum ItemChoiceType1
     {
-        [XmlEnumAttribute("pre-bend")]
+        [XmlEnum("pre-bend")]
         prebend,

         release,
@@ -4977,24 +4977,24 @@

         gyro,

-        [XmlEnumAttribute("hand martellato")]
+        [XmlEnum("hand martellato")]
         handmartellato,

-        [XmlEnumAttribute("mallet lift")]
+        [XmlEnum("mallet lift")]
         malletlift,

-        [XmlEnumAttribute("mallet table")]
+        [XmlEnum("mallet table")]
         mallettable,

         martellato,

-        [XmlEnumAttribute("martellato lift")]
+        [XmlEnum("martellato lift")]
         martellatolift,

-        [XmlEnumAttribute("muted martellato")]
+        [XmlEnum("muted martellato")]
         mutedmartellato,

-        [XmlEnumAttribute("pluck lift")]
+        [XmlEnum("pluck lift")]
         plucklift,

         swing,
@@ -5052,13 +5052,13 @@
     [XmlType(IncludeInSchema = false)]
     public enum Item1ChoiceType
     {
-        [XmlEnumAttribute("base-pitch")]
+        [XmlEnum("base-pitch")]
         basepitch,

-        [XmlEnumAttribute("sounding-pitch")]
+        [XmlEnum("sounding-pitch")]
         soundingpitch,

-        [XmlEnumAttribute("touching-pitch")]
+        [XmlEnum("touching-pitch")]
         touchingpitch,
     }

@@ -5137,10 +5137,10 @@

         bend,

-        [XmlEnumAttribute("double-tongue")]
+        [XmlEnum("double-tongue")]
         doubletongue,

-        [XmlEnumAttribute("down-bow")]
+        [XmlEnum("down-bow")]
         downbow,

         fingering,
@@ -5149,7 +5149,7 @@

         fret,

-        [XmlEnumAttribute("hammer-on")]
+        [XmlEnum("hammer-on")]
         hammeron,

         handbell,
@@ -5160,18 +5160,18 @@

         hole,

-        [XmlEnumAttribute("open-string")]
+        [XmlEnum("open-string")]
         openstring,

-        [XmlEnumAttribute("other-technical")]
+        [XmlEnum("other-technical")]
         othertechnical,

         pluck,

-        [XmlEnumAttribute("pull-off")]
+        [XmlEnum("pull-off")]
         pulloff,

-        [XmlEnumAttribute("snap-pizzicato")]
+        [XmlEnum("snap-pizzicato")]
         snappizzicato,

         stopped,
@@ -5180,15 +5180,15 @@

         tap,

-        [XmlEnumAttribute("thumb-position")]
+        [XmlEnum("thumb-position")]
         thumbposition,

         toe,

-        [XmlEnumAttribute("triple-tongue")]
+        [XmlEnum("triple-tongue")]
         tripletongue,

-        [XmlEnumAttribute("up-bow")]
+        [XmlEnum("up-bow")]
         upbow,
     }

@@ -5416,21 +5416,21 @@
     [XmlType(IncludeInSchema = false)]
     public enum ItemsChoiceType2
     {
-        [XmlEnumAttribute("delayed-inverted-turn")]
+        [XmlEnum("delayed-inverted-turn")]
         delayedinvertedturn,

-        [XmlEnumAttribute("delayed-turn")]
+        [XmlEnum("delayed-turn")]
         delayedturn,

-        [XmlEnumAttribute("inverted-mordent")]
+        [XmlEnum("inverted-mordent")]
         invertedmordent,

-        [XmlEnumAttribute("inverted-turn")]
+        [XmlEnum("inverted-turn")]
         invertedturn,

         mordent,

-        [XmlEnumAttribute("other-ornament")]
+        [XmlEnum("other-ornament")]
         otherornament,

         schleifer,
@@ -5439,15 +5439,15 @@

         tremolo,

-        [XmlEnumAttribute("trill-mark")]
+        [XmlEnum("trill-mark")]
         trillmark,

         turn,

-        [XmlEnumAttribute("vertical-turn")]
+        [XmlEnum("vertical-turn")]
         verticalturn,

-        [XmlEnumAttribute("wavy-line")]
+        [XmlEnum("wavy-line")]
         wavyline,
     }

@@ -6125,31 +6125,31 @@

         x,

-        [XmlEnumAttribute("circle-x")]
+        [XmlEnum("circle-x")]
         circlex,

-        [XmlEnumAttribute("inverted triangle")]
+        [XmlEnum("inverted triangle")]
         invertedtriangle,

-        [XmlEnumAttribute("arrow down")]
+        [XmlEnum("arrow down")]
         arrowdown,

-        [XmlEnumAttribute("arrow up")]
+        [XmlEnum("arrow up")]
         arrowup,

         slashed,

-        [XmlEnumAttribute("back slashed")]
+        [XmlEnum("back slashed")]
         backslashed,

         normal,

         cluster,

-        [XmlEnumAttribute("circle dot")]
+        [XmlEnum("circle dot")]
         circledot,

-        [XmlEnumAttribute("left triangle")]
+        [XmlEnum("left triangle")]
         lefttriangle,

         rectangle,
@@ -6164,7 +6164,7 @@

         fa,

-        [XmlEnumAttribute("fa up")]
+        [XmlEnum("fa up")]
         faup,

         so,
@@ -6741,10 +6741,10 @@
     {
         encoder,

-        [XmlEnumAttribute("encoding-date")]
+        [XmlEnum("encoding-date")]
         encodingdate,

-        [XmlEnumAttribute("encoding-description")]
+        [XmlEnum("encoding-description")]
         encodingdescription,

         software,


Do not kill off threads so quickly, let them sleep longer, and if after a few seconds, they still have nothing to do, then kill them.

--- Aurora/AuroraDotNetEngine/MaintenanceThread.cs
+++ Aurora/AuroraDotNetEngine/MaintenanceThread.cs
@@ -24,6 +24,7 @@
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
+//#define Debug

 using System;
 using System.Collections;
@@ -56,6 +57,7 @@
         public bool RunInMainProcessingThread = false;
         public bool m_Started = false;

+        private const int EMPTY_WORK_KILL_THREAD_TIME = 250;
         private Queue<QueueItemStruct> ScriptEvents = new Queue<QueueItemStruct> ();
         private int ScriptEventCount = 0;
         private int m_CheckingEvents = 0;
@@ -112,7 +114,7 @@
             info.priority = ThreadPriority.Normal;
             info.Threads = 1;
             info.MaxSleepTime = Engine.Config.GetInt ("SleepTime", 100);
-            info.SleepIncrementTime = Engine.Config.GetInt ("SleepIncrementTime", 10);
+            info.SleepIncrementTime = Engine.Config.GetInt ("SleepIncrementTime", 1);
             cmdThreadpool = new AuroraThreadPool (info);
             scriptChangeThreadpool = new AuroraThreadPool (info);

@@ -122,7 +124,7 @@
             sinfo.priority = ThreadPriority.Normal;
             sinfo.Threads = MaxScriptThreads;
             sinfo.MaxSleepTime = Engine.Config.GetInt ("SleepTime", 100);
-            sinfo.SleepIncrementTime = Engine.Config.GetInt ("SleepIncrementTime", 10);
+            sinfo.SleepIncrementTime = Engine.Config.GetInt ("SleepIncrementTime", 1);
             scriptThreadpool = new AuroraThreadPool (sinfo);

             AppDomain.CurrentDomain.AssemblyResolve += m_ScriptEngine.AssemblyResolver.OnAssemblyResolve;
@@ -420,6 +422,9 @@

                 ScriptEvents.Enqueue (QIS);
                 ScriptEventCount++;
+#if Debug
+                m_log.Warn (ScriptEventCount + ", " + QIS.functionName);
+#endif
             }

             if (Interlocked.Read (ref m_numWorkers) < ScriptEventCount + (SleepingScriptEventCount / 2) )
@@ -445,6 +450,9 @@
                     return;
                 ScriptEvents.Enqueue (QIS);
                 ScriptEventCount++;
+#if Debug
+                m_log.Warn (ScriptEventCount + ", " + QIS.functionName);
+#endif
             }

             if (Interlocked.Read (ref m_numWorkers) < ScriptEventCount + (SleepingScriptEventCount / 2))
@@ -456,6 +464,7 @@

         public void loop()
         {
+            int numberOfEmptyWork = 0;
             while (!m_ScriptEngine.ConsoleDisabled && !m_ScriptEngine.Disabled)
             {
                 QueueItemStruct QIS = null;
@@ -533,20 +542,35 @@
                     timeToSleep = (int)(NextSleepersTest - DateTime.Now).TotalMilliseconds;
                 if (timeToSleep < 5)
                     timeToSleep = 5;
-                //m_log.Warn (timeToSleep);
-
-                if (Interlocked.Read (ref m_numWorkers) > (ScriptEventCount + (SleepingScriptEventCount / 2)) ||
+
+                if (SleepingScriptEventCount == 0 && ScriptEventCount == 0)
+                {
+                    numberOfEmptyWork++;
+                    if (numberOfEmptyWork > EMPTY_WORK_KILL_THREAD_TIME) //Don't break immediately
+                    {
+                        Interlocked.Decrement (ref m_numWorkers);
+                        break; //No more events, end
+                    }
+                    else
+                        timeToSleep += 10;
+                }
+                else if (Interlocked.Read (ref m_numWorkers) > (ScriptEventCount + (SleepingScriptEventCount / 2)) ||
                     Interlocked.Read (ref m_numWorkers) > MaxScriptThreads)
                 {
-                    Interlocked.Decrement (ref m_numWorkers);
-                    break; //Too many threads, kill some off
-                }
-
-                if (SleepingScriptEventCount == 0 && ScriptEventCount == 0)
-                {
-                    Interlocked.Decrement (ref m_numWorkers);
-                    break; //No more events, end
-                }
+                    numberOfEmptyWork++;
+                    if (numberOfEmptyWork > EMPTY_WORK_KILL_THREAD_TIME) //Don't break immediately
+                    {
+                        Interlocked.Decrement (ref m_numWorkers);
+                        break; //Too many threads, kill some off
+                    }
+                    else
+                        timeToSleep += 5;
+                }
+                else
+                    numberOfEmptyWork = 0;
+#if Debug
+                m_log.Warn (timeToSleep);
+#endif
                 Thread.Sleep (timeToSleep);
             }
         }


Fixed restarting an edited app not working properly

--- Neustart/Forms/Details.cs
+++ Neustart/Forms/Details.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Drawing;
+using System.Threading.Tasks;
 using System.Windows.Forms;

 namespace Neustart.Forms
@@ -188,7 +189,12 @@
                     if (res == DialogResult.Yes)
                     {
                         curApp.Stop();
-                        curApp.Start();
+
+                        Task.Run(async () =>
+                        {
+                            await Task.Delay(1000);
+                            curApp.Start();
+                        });
                     }
                 }
             }


Refactored code

Refactored code

--- Bookling/Bookling.Controller/LibraryManager.cs
+++ Bookling/Bookling.Controller/LibraryManager.cs
@@ -56,8 +56,7 @@
 		public int MaxId
 		{
 			get {
-				int max = 0;
-
+				int max = 0;
 				try {
 					SqliteCommand command = Connection.CreateCommand ();
 					command.CommandText = "SELECT COALESCE(MAX(BookID)+1, 0) FROM Books";
@@ -232,9 +231,11 @@
 				using (SqliteCommand command = new SqliteCommand (Connection)) {
 					command.CommandText =
 						"UPDATE Books SET " +
-						"BookTitle = title, BookAuthor = author, " +
-						"BookPublishedYear = year, BookPath = path " +
-						"WHERE BookID = id;";
+						"BookTitle = :title, " +
+						"BookAuthor = :author, " +
+						"BookPublishedYear = :year, " +
+						"BookPath = :path " +
+						"WHERE BookID = :id;";
 					command.Parameters.AddWithValue (":title", book.Title);
 					command.Parameters.AddWithValue (":author", book.Author);
 					command.Parameters.AddWithValue (":genre", book.Genre);


Load debug overlays on demand rather than on startup

Avoids potentially initialising a texture atlas that would otherwise never be required. Also reduces startup overhead for normal users.

--- osu.Framework/Game.cs
+++ osu.Framework/Game.cs
@@ -83,19 +83,6 @@
             });
         }

-        private void addDebugTools()
-        {
-            LoadComponentAsync(drawVisualiser = new DrawVisualiser
-            {
-                Depth = float.MinValue / 2,
-            }, AddInternal);
-
-            LoadComponentAsync(logOverlay = new LogOverlay
-            {
-                Depth = float.MinValue / 2,
-            }, AddInternal);
-        }
-
         /// <summary>
         /// As Load is run post host creation, you can override this method to alter properties of the host before it makes itself visible to the user.
         /// </summary>
@@ -187,8 +174,6 @@
             }, AddInternal);

             FrameStatistics.BindValueChanged(e => performanceOverlay.State = e.NewValue, true);
-
-            addDebugTools();
         }

         protected readonly Bindable<FrameStatisticsMode> FrameStatistics = new Bindable<FrameStatisticsMode>();
@@ -216,10 +201,27 @@
                     return true;

                 case FrameworkAction.ToggleDrawVisualiser:
+
+                    if (drawVisualiser == null)
+                    {
+                        LoadComponentAsync(drawVisualiser = new DrawVisualiser
+                        {
+                            Depth = float.MinValue / 2,
+                        }, AddInternal);
+                    }
+
                     drawVisualiser.ToggleVisibility();
                     return true;

                 case FrameworkAction.ToggleLogOverlay:
+                    if (logOverlay == null)
+                    {
+                        LoadComponentAsync(logOverlay = new LogOverlay
+                        {
+                            Depth = float.MinValue / 2,
+                        }, AddInternal);
+                    }
+
                     logOverlay.ToggleVisibility();
                     return true;


Refactor OptionsDisplayControl.TestConnection()

--- CalDavSynchronizer/Ui/OptionsDisplayControl.cs
+++ CalDavSynchronizer/Ui/OptionsDisplayControl.cs
@@ -194,59 +194,45 @@
           return;
         }

-        var uri = new Uri (_calenderUrlTextBox.Text);
+        var enteredUri = new Uri (_calenderUrlTextBox.Text);
         var webDavClient = CreateWebDavClient();

-        Uri autoDiscoveredUri = null;
-        Uri effectiveUri = uri;
-
-        if (ConnectionTester.RequiresAutoDiscovery (uri))
-        {
-          autoDiscoveredUri = await DoAutoDiscovery(ConnectionTester.GetAutoDiscoverUrl(uri), webDavClient);
-          if (autoDiscoveredUri != null)
-          {
-            effectiveUri = autoDiscoveredUri;
-            _calenderUrlTextBox.Text = autoDiscoveredUri.ToString();
-          }
+        Uri autoDiscoveredUrl;
+
+        if (ConnectionTester.RequiresAutoDiscovery (enteredUri))
+        {
+          autoDiscoveredUrl = await DoAutoDiscovery (ConnectionTester.GetAutoDiscoverUrl (enteredUri), webDavClient);
+          if (autoDiscoveredUrl == null)
+            return;
         }
         else
         {
-          var result = await ConnectionTester.TestConnection (uri, webDavClient);
+          var result = await ConnectionTester.TestConnection (enteredUri, webDavClient);
           if (result.ResourceType != ResourceType.None)
           {
+            if (ShouldAutomaticallyFixSettings)
+              AutomaticallyFixSettings (result);
+
             DisplayTestReport (result);
             return;
           }
           else
           {
-            autoDiscoveredUri = await DoAutoDiscovery(uri, webDavClient);
-            if (autoDiscoveredUri != null)
-            {
-              effectiveUri = autoDiscoveredUri;
-              _calenderUrlTextBox.Text = autoDiscoveredUri.ToString();
-            }
-            else
-            {
-              // another try to get calendar uri with well-known url
-              autoDiscoveredUri = await DoAutoDiscovery(ConnectionTester.GetAutoDiscoverUrl(uri), webDavClient);
-              if (autoDiscoveredUri != null)
-              {
-                effectiveUri = autoDiscoveredUri;
-                _calenderUrlTextBox.Text = autoDiscoveredUri.ToString();
-              }
-            }
-          }
-        }
-
-        if (effectiveUri != uri)
-        {
-          var finalResult = await ConnectionTester.TestConnection(effectiveUri, webDavClient);
-
-          if (bool.Parse(ConfigurationManager.AppSettings["automaticallyFixSettings"]))
-            AutomaticallyFixSettings(finalResult);
-
-          DisplayTestReport(finalResult);
-        }
+            autoDiscoveredUrl = await DoAutoDiscovery (enteredUri, webDavClient) ??
+                                await DoAutoDiscovery (ConnectionTester.GetAutoDiscoverUrl (enteredUri), webDavClient);
+            if (autoDiscoveredUrl == null)
+              return;
+          }
+        }
+
+        _calenderUrlTextBox.Text = autoDiscoveredUrl.ToString();
+
+        var finalResult = await ConnectionTester.TestConnection (autoDiscoveredUrl, webDavClient);
+
+        if (ShouldAutomaticallyFixSettings)
+          AutomaticallyFixSettings (finalResult);
+
+        DisplayTestReport (finalResult);
       }
       catch (Exception x)
       {
@@ -256,6 +242,11 @@
       {
         _testConnectionButton.Enabled = true;
       }
+    }
+
+    private static bool ShouldAutomaticallyFixSettings
+    {
+      get { return bool.Parse (ConfigurationManager.AppSettings["automaticallyFixSettings"]); }
     }

     private void AutomaticallyFixSettings (TestResult result)