using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using XboxOnePadReader;

namespace PadReaderTest
{
    class Program
    {
        static void Main(string[] args)
        {
            ControllerReader myController = ControllerReader.Instance;
            int x = 0;
            while (x < 5)
            {
                Thread.Sleep(1);
                ++x;
            }
            myController.CloseController();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using XboxOnePadReader;

namespace PadReaderTest
{
    class Program
    {
        static void Main(string[] args)
        {
            ControllerReader myController = ControllerReader.Instance;
            int x = 0;
            while (x < 5)
            {
                Thread.Sleep(1000);
                ++x;
            }
            myController.CloseController();
        }
    }
}

Fix Sleep of the test program

Fix Sleep of the test program


using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Test1 : MonoBehaviour {

	// Use this for initialization
	void Start () {

	}

	// Update is called once per frame
	void Update () {

	}
}

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Test1 : MonoBehaviour {

	// Use this for initialization
	void Start () {

	}

	// Update is called once per frame
	void Update () {
		Condole.Log("This log is added by Suzuki");
	}
}

Write Log message for test

Write Log message for test


namespace OpenKh.Game
{
    public class Global
    {
        public const int ResolutionWidth = 512;
        public const int ResolutionHeight = 416;
        public const int ResolutionRemixWidth = 684;
        public const float ResolutionReMixRatio = 0.925f;

        public const float ResolutionBoostRatio = 2;
    }
}

namespace OpenKh.Game
{
    public class Global
    {
        public const int ResolutionWidth = 512;
        public const int ResolutionHeight = 416;
        public const int ResolutionRemixWidth = 684;
        public const float ResolutionReMixRatio = 0.925f;
    }
}

Remove unused line of code

Remove unused line of code


// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using NUnit.Framework;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Difficulty;
using osu.Game.Rulesets.Taiko.Difficulty;
using osu.Game.Tests.Beatmaps;

namespace osu.Game.Rulesets.Taiko.Tests
{
    public class TaikoDifficultyCalculatorTest : DifficultyCalculatorTest
    {
        protected override string ResourceAssembly => "osu.Game.Rulesets.Taiko";

        [TestCase(2.9811338051242915d, "diffcalc-test")]
        [TestCase(2.9811338051242915d, "diffcalc-test-strong")]
        public void Test(double expected, string name)
            => base.Test(expected, name);

        protected override DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new TaikoDifficultyCalculator(new TaikoRuleset(), beatmap);

        protected override Ruleset CreateRuleset() => new TaikoRuleset();
    }
}

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using NUnit.Framework;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Difficulty;
using osu.Game.Rulesets.Taiko.Difficulty;
using osu.Game.Tests.Beatmaps;

namespace osu.Game.Rulesets.Taiko.Tests
{
    public class TaikoDifficultyCalculatorTest : DifficultyCalculatorTest
    {
        protected override string ResourceAssembly => "osu.Game.Rulesets.Taiko";

        [TestCase(2.2905937546434592d, "diffcalc-test")]
        [TestCase(2.2905937546434592d, "diffcalc-test-strong")]
        public void Test(double expected, string name)
            => base.Test(expected, name);

        protected override DifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new TaikoDifficultyCalculator(new TaikoRuleset(), beatmap);

        protected override Ruleset CreateRuleset() => new TaikoRuleset();
    }
}

Update expected SR in test

Update expected SR in test


using System;
using System.Drawing.Imaging;
using System.IO;
using NUnit.Framework;
using ValveResourceFormat;
using ValveResourceFormat.ResourceTypes;

namespace Tests
{
    public class TextureTests
    {
        [Test]
        public void Test()
        {
            var path = Path.Combine(TestContext.CurrentContext.TestDirectory, "Files", "Textures");
            var files = Directory.GetFiles(path, "*.vtex_c");

            foreach (var file in files)
            {
                var resource = new Resource();
                resource.Read(file);

                var bitmap = ((Texture)resource.Blocks[BlockType.DATA]).GenerateBitmap();

                using (var ms = new MemoryStream())
                {
                    bitmap.Save(ms, ImageFormat.Png);

                    using (var expected = new FileStream(Path.ChangeExtension(file, "png"), FileMode.Open, FileAccess.Read))
                    {
                        FileAssert.AreEqual(expected, ms);
                    }
                }
            }
        }
    }
}

using System;
using System.Drawing.Imaging;
using System.IO;
using NUnit.Framework;
using ValveResourceFormat;
using ValveResourceFormat.ResourceTypes;

namespace Tests
{
    public class TextureTests
    {
        [Test]
        [Ignore("Need a better way of testing images rather than comparing the files directly")]
        public void Test()
        {
            var path = Path.Combine(TestContext.CurrentContext.TestDirectory, "Files", "Textures");
            var files = Directory.GetFiles(path, "*.vtex_c");

            foreach (var file in files)
            {
                var resource = new Resource();
                resource.Read(file);

                var bitmap = ((Texture)resource.Blocks[BlockType.DATA]).GenerateBitmap();

                using (var ms = new MemoryStream())
                {
                    bitmap.Save(ms, ImageFormat.Png);

                    using (var expected = new FileStream(Path.ChangeExtension(file, "png"), FileMode.Open, FileAccess.Read))
                    {
                        FileAssert.AreEqual(expected, ms);
                    }
                }
            }
        }
    }
}

Disable text tests for now

Disable text tests for now


using System;
using Microsoft.AspNetCore.StaticFiles;
using Swashbuckle.AspNetCore.SwaggerUI;

namespace Microsoft.AspNetCore.Builder
{
    public static class SwaggerUIBuilderExtensions
    {
        public static IApplicationBuilder UseSwaggerUI(
            this IApplicationBuilder app,
            Action<SwaggerUIOptions> setupAction)
        {
            var options = new SwaggerUIOptions();
            setupAction?.Invoke(options);

            // Serve swagger-ui assets with the FileServer middleware, using a custom FileProvider
            // to inject parameters into "index.html"
            var fileServerOptions = new FileServerOptions
            {
                RequestPath = $"/{options.RoutePrefix}",
                FileProvider = new SwaggerUIFileProvider(options.IndexSettings.ToTemplateParameters()),
                EnableDefaultFiles = true, // serve index.html at /{options.RoutePrefix}/
            };
            fileServerOptions.StaticFileOptions.ContentTypeProvider = new FileExtensionContentTypeProvider();
            app.UseFileServer(fileServerOptions);

            return app;
        }
    }
}

using System;
using Microsoft.AspNetCore.StaticFiles;
using Swashbuckle.AspNetCore.SwaggerUI;

namespace Microsoft.AspNetCore.Builder
{
    public static class SwaggerUIBuilderExtensions
    {
        public static IApplicationBuilder UseSwaggerUI(
            this IApplicationBuilder app,
            Action<SwaggerUIOptions> setupAction)
        {
            var options = new SwaggerUIOptions();
            setupAction?.Invoke(options);

            // Serve swagger-ui assets with the FileServer middleware, using a custom FileProvider
            // to inject parameters into "index.html"
            var fileServerOptions = new FileServerOptions
            {
                RequestPath = string.IsNullOrWhiteSpace(options.RoutePrefix) ? string.Empty : $"/{options.RoutePrefix}",
                FileProvider = new SwaggerUIFileProvider(options.IndexSettings.ToTemplateParameters()),
                EnableDefaultFiles = true, // serve index.html at /{options.RoutePrefix}/
            };
            fileServerOptions.StaticFileOptions.ContentTypeProvider = new FileExtensionContentTypeProvider();
            app.UseFileServer(fileServerOptions);

            return app;
        }
    }
}

Support to map swagger UI to application root url

UseSwaggerUI will check for special case empty RoutePrefix and allow mapping swagger UI to application root url.


//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//

using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
{
    public class MarkedString
    {
        public string Language { get; set; }

        public string Value { get; set; }
    }

    public class Hover
    {
        public MarkedString[] Contents { get; set; }

        public Range? Range { get; set; }
    }

    public class HoverRequest
    {
        public static readonly
            RequestType<TextDocumentPositionParams, Hover, object, object> Type =
            RequestType<TextDocumentPositionParams, Hover, object, object>.Create("textDocument/hover");

    }
}

//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//

using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
{
    public class MarkedString
    {
        public string Language { get; set; }

        public string Value { get; set; }
    }

    public class Hover
    {
        public MarkedString[] Contents { get; set; }

        public Range? Range { get; set; }
    }

    public class HoverRequest
    {
        public static readonly
            RequestType<TextDocumentPositionParams, Hover, object, TextDocumentRegistrationOptions> Type =
            RequestType<TextDocumentPositionParams, Hover, object, TextDocumentRegistrationOptions>.Create("textDocument/hover");

    }
}

Add registration options for hover request


//#tool nuget:?package=NUnit.ConsoleRunner&version=3.4.0

var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");

// Define directories.
var buildDir = Directory("./src/Example/bin") + Directory(configuration);

Task("Clean")
    .Does(() =>
{
    CleanDirectory(buildDir);
});

Task("Restore-NuGet-Packages")
    .IsDependentOn("Clean")
    .Does(() =>
{
    NuGetRestore("./Live.Forms.iOS.sln");
});

Task("Build")
    .IsDependentOn("Restore-NuGet-Packages")
    .Does(() =>
{
    if(IsRunningOnWindows())
    {
      // Use MSBuild
      MSBuild("./Live.Forms.iOS.sln", settings =>
        settings.SetConfiguration(configuration));
    }
    else
    {
      // Use XBuild
      XBuild("./Live.Forms.iOS.sln", settings =>
        settings.SetConfiguration(configuration));
    }
});

Task("Default")
    .IsDependentOn("Build");

RunTarget(target);

//#tool nuget:?package=NUnit.ConsoleRunner&version=3.4.0

string target = Argument("target", "Default");
string configuration = Argument("configuration", "Release");

// Define directories.
var dirs = new[]
{
    Directory("./Live.Forms/bin") + Directory(configuration),
    Directory("./Live.Forms.iOS/bin") + Directory(configuration),
};
string sln = "./Live.Forms.iOS.sln";

Task("Clean")
    .Does(() =>
{
    foreach (var dir in dirs)
        CleanDirectory(dir);
});

Task("Restore-NuGet-Packages")
    .IsDependentOn("Clean")
    .Does(() =>
{
    NuGetRestore(sln);
});

Task("Build")
    .IsDependentOn("Restore-NuGet-Packages")
    .Does(() =>
{
    if(IsRunningOnWindows())
    {
      // Use MSBuild
      MSBuild(sln, settings =>
        settings
            .WithProperty("Platform", new[] { "iPhoneSimulator" })
            .SetConfiguration(configuration));
    }
    else
    {
      // Use XBuild
      XBuild(sln, settings =>
        settings
            .WithProperty("Platform", new[] { "iPhoneSimulator" })
            .SetConfiguration(configuration));
    }
});

Task("Default")
    .IsDependentOn("Build");

RunTarget(target);

Build Script - cleanup and filling out vars


using System.Data.Entity;
using Kandanda.Dal.DataTransferObjects;

namespace Kandanda.Dal
{
    public class KandandaDbContext : DbContext
    {
        public KandandaDbContext()
        {
            Database.SetInitializer(new SampleDataDbInitializer());
        }

        public DbSet<Tournament> Tournaments { get; set; }

        public DbSet<Participant> Participants { get; set; }

        public DbSet<Match> Matches { get; set; }

        public DbSet<Place> Places { get; set; }

        public DbSet<Phase> Phases { get; set; }

        public DbSet<TournamentParticipant> TournamentParticipants { get; set; }
    }
}

using System.Data.Entity;
using Kandanda.Dal.DataTransferObjects;

namespace Kandanda.Dal
{
    public class KandandaDbContext : DbContext
    {
        public KandandaDbContext()
        {
            // TODO fix SetInitializer for tests
            Database.SetInitializer(new DropCreateDatabaseAlways<KandandaDbContext>());
        }

        public DbSet<Tournament> Tournaments { get; set; }

        public DbSet<Participant> Participants { get; set; }

        public DbSet<Match> Matches { get; set; }

        public DbSet<Place> Places { get; set; }

        public DbSet<Phase> Phases { get; set; }

        public DbSet<TournamentParticipant> TournamentParticipants { get; set; }
    }
}

Fix tests, but not seeding Database anymore


namespace nuPickers.Shared.DotNetDataSource
{
    using nuPickers.Shared.Editor;
    using System;
    using System.Reflection;
    using System.Collections.Generic;
    using System.Linq;

    public class DotNetDataSource
    {
        public string AssemblyName { get; set; }

        public string ClassName { get; set; }

        public IEnumerable<DotNetDataSourceProperty> Properties { get; set; }

        public IEnumerable<EditorDataItem> GetEditorDataItems()
        {
            List<EditorDataItem> editorDataItems = new List<EditorDataItem>();

            object dotNetDataSource = Activator.CreateInstance(this.AssemblyName, this.ClassName).Unwrap();

            foreach (PropertyInfo propertyInfo in dotNetDataSource.GetType().GetProperties().Where(x => this.Properties.Select(y => y.Name).Contains(x.Name)))
            {
                if (propertyInfo.PropertyType == typeof(string))
                {
                    propertyInfo.SetValue(dotNetDataSource, this.Properties.Where(x => x.Name == propertyInfo.Name).Single().Value);
                }
                else
                {
                    // TODO: log unexpected property type
                }
            }

            return ((IDotNetDataSource)dotNetDataSource)
                        .GetEditorDataItems()
                        .Select(x => new EditorDataItem() { Key = x.Key, Label = x.Value });
        }
    }
}

namespace nuPickers.Shared.DotNetDataSource
{
    using nuPickers.Shared.Editor;
    using System;
    using System.Reflection;
    using System.Collections.Generic;
    using System.Linq;

    public class DotNetDataSource
    {
        public string AssemblyName { get; set; }

        public string ClassName { get; set; }

        public IEnumerable<DotNetDataSourceProperty> Properties { get; set; }

        public IEnumerable<EditorDataItem> GetEditorDataItems()
        {
            List<EditorDataItem> editorDataItems = new List<EditorDataItem>();

			object dotNetDataSource = Helper.GetAssembly(this.AssemblyName).CreateInstance(this.ClassName);

            foreach (PropertyInfo propertyInfo in dotNetDataSource.GetType().GetProperties().Where(x => this.Properties.Select(y => y.Name).Contains(x.Name)))
            {
                if (propertyInfo.PropertyType == typeof(string))
                {
                    propertyInfo.SetValue(dotNetDataSource, this.Properties.Where(x => x.Name == propertyInfo.Name).Single().Value);
                }
                else
                {
                    // TODO: log unexpected property type
                }
            }

            return ((IDotNetDataSource)dotNetDataSource)
                        .GetEditorDataItems()
                        .Select(x => new EditorDataItem() { Key = x.Key, Label = x.Value });
        }
    }
}

Use Helper to create instance from assembly

Activator takes a full path to the assembly and we only have the
assembly file name.


namespace Certify.Models.Shared
{
    public class RenewalStatusReport
    {
        public string InstanceId { get; set; }
        public string MachineName { get; set; }
        public ManagedSite ManagedSite { get; set; }
        public string PrimaryContactEmail { get; set; }
        public string AppVersion { get; set; }
    }
}

using System;

namespace Certify.Models.Shared
{
    public class RenewalStatusReport
    {
        public string InstanceId { get; set; }
        public string MachineName { get; set; }
        public ManagedSite ManagedSite { get; set; }
        public string PrimaryContactEmail { get; set; }
        public string AppVersion { get; set; }
        public DateTime? DateReported { get; set; }
    }
}

Add date to status report

Add date to status report


using System;
using SFA.DAS.CommitmentsV2.Types;

namespace SFA.DAS.CommitmentsV2.Api.Types.Responses
{
    public sealed class GetDraftApprenticeshipResponse
    {
        public long Id { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public string Email { get; set; }
        public string Uln { get; set; }
        public string CourseCode { get; set; }
        public DeliveryModel DeliveryModel { get; set; }
        public string TrainingCourseName { get; set; }
        public string TrainingCourseVersion { get; set; }
        public string TrainingCourseOption { get; set; }
        public bool TrainingCourseVersionConfirmed { get; set; }
        public string StandardUId { get; set; }
        public int? Cost { get; set; }
        public DateTime? StartDate { get; set; }
        public DateTime? EndDate { get; set; }
        public DateTime? DateOfBirth { get; set; }
        public string Reference { get; set; }
        public Guid? ReservationId { get; set; }
        public bool IsContinuation { get; set; }
        public DateTime? OriginalStartDate { get; set; }
        public bool HasStandardOptions { get; set; }
        public int? EmploymentPrice { get; set; }
        public DateTime? EmploymentEndDate { get; set; }
    }
}

using System;
using SFA.DAS.CommitmentsV2.Types;

namespace SFA.DAS.CommitmentsV2.Api.Types.Responses
{
    public sealed class GetDraftApprenticeshipResponse
    {
        public long Id { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public string Email { get; set; }
        public string Uln { get; set; }
        public string CourseCode { get; set; }
        public DeliveryModel DeliveryModel { get; set; }
        public string TrainingCourseName { get; set; }
        public string TrainingCourseVersion { get; set; }
        public string TrainingCourseOption { get; set; }
        public bool TrainingCourseVersionConfirmed { get; set; }
        public string StandardUId { get; set; }
        public int? Cost { get; set; }
        public DateTime? StartDate { get; set; }
        public DateTime? EndDate { get; set; }
        public DateTime? DateOfBirth { get; set; }
        public string Reference { get; set; }
        public Guid? ReservationId { get; set; }
        public bool IsContinuation { get; set; }
        public DateTime? OriginalStartDate { get; set; }
        public bool HasStandardOptions { get; set; }
        public int? EmploymentPrice { get; set; }
        public DateTime? EmploymentEndDate { get; set; }
        public bool? HasPriorLearning { get; set; }
    }
}

Add `HasPriorLearning` to draft response


using Autofac;
using Autofac.Integration.WebApi;
using FortuneTellerService4.Models;
using Pivotal.Discovery.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.Http;
using System.Web.Routing;

namespace FortuneTellerService4
{
    public class WebApiApplication : System.Web.HttpApplication
    {
        private IDiscoveryClient _client;

        protected void Application_Start()
        {

            GlobalConfiguration.Configure(WebApiConfig.Register);

            var config = GlobalConfiguration.Configuration;

            // Build application configuration
            ServerConfig.RegisterConfig("development");

            // Create IOC container builder
            var builder = new ContainerBuilder();

            // Register your Web API controllers.
            builder.RegisterApiControllers(Assembly.GetExecutingAssembly());

            // Register IDiscoveryClient, etc.
            builder.RegisterDiscoveryClient(ServerConfig.Configuration);

            // Initialize and Register FortuneContext
            builder.RegisterInstance(SampleData.InitializeFortunes()).SingleInstance();

            // Register FortuneRepository
            builder.RegisterType<FortuneRepository>().As<IFortuneRepository>().SingleInstance();

            var container = builder.Build();
            config.DependencyResolver = new AutofacWebApiDependencyResolver(container);

            // Start the Discovery client background thread
            _client = container.Resolve<IDiscoveryClient>();
        }
    }
}

using Autofac;
using Autofac.Integration.WebApi;
using FortuneTellerService4.Models;
using Pivotal.Discovery.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.Http;
using System.Web.Routing;

namespace FortuneTellerService4
{
    public class WebApiApplication : System.Web.HttpApplication
    {
        private IDiscoveryClient _client;

        protected void Application_Start()
        {

            GlobalConfiguration.Configure(WebApiConfig.Register);

            var config = GlobalConfiguration.Configuration;

            // Build application configuration
            ServerConfig.RegisterConfig("development");

            // Create IOC container builder
            var builder = new ContainerBuilder();

            // Register your Web API controllers.
            builder.RegisterApiControllers(Assembly.GetExecutingAssembly());

            // Register IDiscoveryClient, etc.
            builder.RegisterDiscoveryClient(ServerConfig.Configuration);

            // Initialize and Register FortuneContext
            builder.RegisterInstance(SampleData.InitializeFortunes()).SingleInstance();

            // Register FortuneRepository
            builder.RegisterType<FortuneRepository>().As<IFortuneRepository>().SingleInstance();

            var container = builder.Build();
            config.DependencyResolver = new AutofacWebApiDependencyResolver(container);

            // Start the Discovery client background thread
            _client = container.Resolve<IDiscoveryClient>();
        }

        protected void Application_End()
        {
            // Unregister current app with Service Discovery server
            _client.ShutdownAsync();
        }
    }
}

Fix FortuneTeller for .NET4 not unregistering from eureka on app shutdown


using System;
using Xunit;

namespace Stunts.Tests
{
    public class StuntNamingTests
    {
        [Theory]
        [InlineData("StuntFactoryIDisposableIServiceProvider" + StuntNaming.DefaultSuffix, typeof(StuntFactory), typeof(IServiceProvider), typeof(IDisposable))]
        public void GetNameOrdersTypes(string expectedName, Type baseType, params Type[] implementedInterfaces)
            => Assert.Equal(expectedName, StuntNaming.GetName(baseType, implementedInterfaces));

        [Theory]
        [InlineData(StuntNaming.DefaultNamespace + ".StuntFactoryIDisposableIServiceProvider" + StuntNaming.DefaultSuffix, typeof(StuntFactory), typeof(IServiceProvider), typeof(IDisposable))]
        public void GetFullNameOrdersTypes(string expectedName, Type baseType, params Type[] implementedInterfaces)
            => Assert.Equal(expectedName, StuntNaming.GetFullName(baseType, implementedInterfaces));
    }
}

using System;
using System.Collections.Generic;
using Xunit;

namespace Stunts.Tests
{
    public class StuntNamingTests
    {
        [Theory]
        [InlineData("StuntFactoryIDisposableIServiceProvider" + StuntNaming.DefaultSuffix, typeof(StuntFactory), typeof(IServiceProvider), typeof(IDisposable))]
        [InlineData("IEnumerableOfIDisposableIServiceProvider" + StuntNaming.DefaultSuffix, typeof(IEnumerable<IDisposable>), typeof(IServiceProvider))]
        public void GetNameOrdersTypes(string expectedName, Type baseType, params Type[] implementedInterfaces)
            => Assert.Equal(expectedName, StuntNaming.GetName(baseType, implementedInterfaces));

        [Theory]
        [InlineData(StuntNaming.DefaultNamespace + ".StuntFactoryIDisposableIServiceProvider" + StuntNaming.DefaultSuffix, typeof(StuntFactory), typeof(IServiceProvider), typeof(IDisposable))]
        [InlineData(StuntNaming.DefaultNamespace + ".IEnumerableOfIDisposableIServiceProvider" + StuntNaming.DefaultSuffix, typeof(IEnumerable<IDisposable>), typeof(IServiceProvider))]
        public void GetFullNameOrdersTypes(string expectedName, Type baseType, params Type[] implementedInterfaces)
            => Assert.Equal(expectedName, StuntNaming.GetFullName(baseType, implementedInterfaces));
    }
}

Add extra test for generic type for naming


using System;
using System.Diagnostics.Eventing.Reader;
using System.Net;
using System.Net.Http;
using Cogito.Net.Http;
using Microsoft.Diagnostics.Tracing;
using Microsoft.Diagnostics.Tracing.Session;
using Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Utility;
using Microsoft.Samples.Eventing;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Cogito.Tests.Net.Http
{

    [TestClass]
    public class HttpMessageEventSourceTests
    {

        [TestMethod]
        public void Test_EventSource()
        {
            EventSourceAnalyzer.InspectAll(HttpMessageEventSource.Current);
        }

        [TestMethod]
        public void Test_Request()
        {
            using (var session = new TraceEventSession("MyRealTimeSession"))
            {
                session.Source.Dynamic.All += data => Console.WriteLine("GOT Event " + data);
                session.EnableProvider(TraceEventProviders.GetEventSourceGuidFromName("Cogito-Net-Http-Messages"));

                HttpMessageEventSource.Current.Request(new HttpRequestMessage(HttpMethod.Get, new Uri("http://www.tempuri.com"))
                {

                });

                session.Source.Process();
            }
        }

        [TestMethod]
        public void Test_Response()
        {
            HttpMessageEventSource.Current.Response(new HttpResponseMessage(HttpStatusCode.OK));
        }

    }

}

using System;
using System.Diagnostics.Eventing.Reader;
using System.Net;
using System.Net.Http;
using Cogito.Net.Http;
using Microsoft.Diagnostics.Tracing;
using Microsoft.Diagnostics.Tracing.Session;
using Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Utility;
using Microsoft.Samples.Eventing;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Cogito.Tests.Net.Http
{

    [TestClass]
    public class HttpMessageEventSourceTests
    {

        [TestMethod]
        public void Test_EventSource()
        {
            EventSourceAnalyzer.InspectAll(HttpMessageEventSource.Current);
        }

        //[TestMethod]
        //public void Test_Request()
        //{
        //    using (var session = new TraceEventSession("MyRealTimeSession"))
        //    {
        //        session.Source.Dynamic.All += data => Console.WriteLine("GOT Event " + data);
        //        session.EnableProvider(TraceEventProviders.GetEventSourceGuidFromName("Cogito-Net-Http-Messages"));

        //        HttpMessageEventSource.Current.Request(new HttpRequestMessage(HttpMethod.Get, new Uri("http://www.tempuri.com"))
        //        {

        //        });

        //        session.Source.Process();
        //    }
        //}

        //[TestMethod]
        //public void Test_Response()
        //{
        //    HttpMessageEventSource.Current.Response(new HttpResponseMessage(HttpStatusCode.OK));
        //}

    }

}

Disable broken test session thing.

Disable broken test session thing.


#region Using

using System.Collections.Generic;
using System.Windows.Input;
using PuppyFramework.Services;

#endregion

namespace PuppyFramework.MenuService
{
    public class MenuItem : MenuItemBase
    {
        #region Fields

        private ObservableSortedList<MenuItemBase> _children;
        private string _title;

        #endregion

        #region Properties

        public object CommandParamter { get; set; }

        public CommandBinding CommandBinding { get; set; }

        public ObservableSortedList<MenuItemBase> Children
        {
            get { return _children; }
            private set { SetProperty(ref _children, value); }
        }

        public string Title
        {
            get { return _title; }
            protected set { SetProperty(ref _title, value); }
        }

        #endregion

        #region Constructors

        public MenuItem(string title, double weight)
            : base(weight)
        {
            Title = title;
            Children = new ObservableSortedList<MenuItemBase>();
            HiddenFlag = false;
        }

        #endregion

        #region Methods

        public void AddChild(MenuItemBase child, IComparer<MenuItemBase> menuItemComparer = null)
        {
            Children.Add(child);
            if (menuItemComparer != null)
            {
                Children.Sort(menuItemComparer);
            }
        }

        public bool RemoveChild(MenuItemBase child)
        {
            return Children.Remove(child);
        }

        #endregion
    }
}

#region Using

using System.Collections.Generic;
using System.Windows.Input;
using PuppyFramework.Services;

#endregion

namespace PuppyFramework.MenuService
{
    public class MenuItem : MenuItemBase
    {
        #region Fields

        private ObservableSortedList<MenuItemBase> _children;
        private string _title;

        #endregion

        #region Properties

        public object CommandParameter { get; set; }

        public CommandBinding CommandBinding { get; set; }

        public ObservableSortedList<MenuItemBase> Children
        {
            get { return _children; }
            private set { SetProperty(ref _children, value); }
        }

        public string Title
        {
            get { return _title; }
            protected set { SetProperty(ref _title, value); }
        }

        #endregion

        #region Constructors

        public MenuItem(string title, double weight)
            : base(weight)
        {
            Title = title;
            Children = new ObservableSortedList<MenuItemBase>();
            HiddenFlag = false;
        }

        #endregion

        #region Methods

        public void AddChild(MenuItemBase child, IComparer<MenuItemBase> menuItemComparer = null)
        {
            Children.Add(child);
            if (menuItemComparer != null)
            {
                Children.Sort(menuItemComparer);
            }
        }

        public bool RemoveChild(MenuItemBase child)
        {
            return Children.Remove(child);
        }

        #endregion
    }
}

Fix bug - command parameter is always null.


using FluentEmail.Core.Interfaces;
using FluentEmail.Smtp;
using Microsoft.Extensions.DependencyInjection.Extensions;
using System;
using System.Net;
using System.Net.Mail;

namespace Microsoft.Extensions.DependencyInjection
{
    public static class FluentEmailSmtpBuilderExtensions
    {
        public static FluentEmailServicesBuilder AddSmtpSender(this FluentEmailServicesBuilder builder, SmtpClient smtpClient)
        {
            builder.Services.TryAdd(ServiceDescriptor.Scoped<ISender>(x => new SmtpSender(smtpClient)));
            return builder;
        }

        public static FluentEmailServicesBuilder AddSmtpSender(this FluentEmailServicesBuilder builder, string host, int port) => AddSmtpSender(builder, new SmtpClient(host, port));

        public static FluentEmailServicesBuilder AddSmtpSender(this FluentEmailServicesBuilder builder, string host, int port, string username, string password) => AddSmtpSender(builder,
             new SmtpClient(host, port) { EnableSsl = true, Credentials = new NetworkCredential (username, password) });

        public static FluentEmailServicesBuilder AddSmtpSender(this FluentEmailServicesBuilder builder, Func<SmtpClient> clientFactory)
        {
            builder.Services.TryAdd(ServiceDescriptor.Scoped<ISender>(x => new SmtpSender(clientFactory)));
            return builder;
        }
    }
}

using FluentEmail.Core.Interfaces;
using FluentEmail.Smtp;
using Microsoft.Extensions.DependencyInjection.Extensions;
using System;
using System.Net;
using System.Net.Mail;

namespace Microsoft.Extensions.DependencyInjection
{
    public static class FluentEmailSmtpBuilderExtensions
    {
        public static FluentEmailServicesBuilder AddSmtpSender(this FluentEmailServicesBuilder builder, SmtpClient smtpClient)
        {
            builder.Services.TryAdd(ServiceDescriptor.Singleton<ISender>(x => new SmtpSender(smtpClient)));
            return builder;
        }

        public static FluentEmailServicesBuilder AddSmtpSender(this FluentEmailServicesBuilder builder, string host, int port) => AddSmtpSender(builder, () => new SmtpClient(host, port));

        public static FluentEmailServicesBuilder AddSmtpSender(this FluentEmailServicesBuilder builder, string host, int port, string username, string password) => AddSmtpSender(builder,
             () => new SmtpClient(host, port) { EnableSsl = true, Credentials = new NetworkCredential (username, password) });

        public static FluentEmailServicesBuilder AddSmtpSender(this FluentEmailServicesBuilder builder, Func<SmtpClient> clientFactory)
        {
            builder.Services.TryAdd(ServiceDescriptor.Scoped<ISender>(x => new SmtpSender(clientFactory)));
            return builder;
        }
    }
}

Fix AddSmtpSender extension methods to property add service

Resolves "An asynchronous call is already in progress." error message due to SmtpClient being instantiated during startup and reused, irrespective of it being defined as a Scoped service.


using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using MirrorSharp.Advanced;
using SharpLab.Server.Common;

namespace SharpLab.Server.MirrorSharp {
    [UsedImplicitly(ImplicitUseKindFlags.InstantiatedNoFixedConstructorSignature)]
    public class SetOptionsFromClient : ISetOptionsFromClientExtension {
        private const string Optimize = "x-optimize";
        private const string Target = "x-target";

        private readonly IDictionary<string, ILanguageAdapter> _languages;

        public SetOptionsFromClient(IReadOnlyList<ILanguageAdapter> languages) {
            _languages = languages.ToDictionary(l => l.LanguageName);
        }

        public bool TrySetOption(IWorkSession session, string name, string value) {
            switch (name) {
                case Optimize:
                    _languages[session.LanguageName].SetOptimize(session, value);
                    return true;
                case Target:
                    session.SetTargetName(value);
                    _languages[session.LanguageName].SetOptionsForTarget(session, value);
                    return true;
                default:
                    return false;
            }
        }
    }
}

using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using MirrorSharp.Advanced;
using SharpLab.Server.Common;

namespace SharpLab.Server.MirrorSharp {
    [UsedImplicitly(ImplicitUseKindFlags.InstantiatedNoFixedConstructorSignature)]
    public class SetOptionsFromClient : ISetOptionsFromClientExtension {
        private const string Optimize = "x-optimize";
        private const string Target = "x-target";
        private const string ContainerExperimentSeed = "x-container-experiment-seed";

        private readonly IDictionary<string, ILanguageAdapter> _languages;

        public SetOptionsFromClient(IReadOnlyList<ILanguageAdapter> languages) {
            _languages = languages.ToDictionary(l => l.LanguageName);
        }

        public bool TrySetOption(IWorkSession session, string name, string value) {
            switch (name) {
                case Optimize:
                    _languages[session.LanguageName].SetOptimize(session, value);
                    return true;
                case Target:
                    session.SetTargetName(value);
                    _languages[session.LanguageName].SetOptionsForTarget(session, value);
                    return true;
                case ContainerExperimentSeed:
                    // not supported in .NET Framework
                    return true;
                default:
                    return false;
            }
        }
    }
}

[gh-620] Fix x-container-experiment-seed failure in .NET Framework branches


                GC Handicapping System

                New GC Handicapping System comes into effect 3 April, 2017

                Positions Vacant

                ACA would like your help! Positions Vacant

Remove 'Positions Vacant' sticky note

Remove 'Positions Vacant' sticky note


using System;

namespace GitIStage
{
    internal sealed class ConsoleCommand
    {
        private readonly Action _handler;
        private readonly ConsoleKey _key;
        public readonly string Description;
        private readonly ConsoleModifiers _modifiers;

        public ConsoleCommand(Action handler, ConsoleKey key, string description)
        {
            _handler = handler;
            _key = key;
            Description = description;
            _modifiers = 0;
        }

        public ConsoleCommand(Action handler, ConsoleKey key, ConsoleModifiers modifiers, string description)
        {
            _handler = handler;
            _key = key;
            _modifiers = modifiers;

            Description = description;
        }

        public void Execute()
        {
            _handler();
        }

        public bool MatchesKey(ConsoleKeyInfo keyInfo)
        {
            return _key == keyInfo.Key && _modifiers == keyInfo.Modifiers;
        }

        public string GetCommandShortcut()
        {
            string key = _key.ToString().Replace("Arrow", "");
            if (_modifiers != 0)
            {
                return $"{_modifiers.ToString().Replace("Control", "Ctrl")} + {key.ToString()}";
            }
            else
                return key.ToString();
        }
    }
}

using System;

namespace GitIStage
{
    internal sealed class ConsoleCommand
    {
        private readonly Action _handler;
        private readonly ConsoleKey _key;
        public readonly string Description;
        private readonly ConsoleModifiers _modifiers;

        public ConsoleCommand(Action handler, ConsoleKey key, string description)
        {
            _handler = handler;
            _key = key;
            Description = description;
            _modifiers = 0;
        }

        public ConsoleCommand(Action handler, ConsoleKey key, ConsoleModifiers modifiers, string description)
        {
            _handler = handler;
            _key = key;
            _modifiers = modifiers;

            Description = description;
        }

        public void Execute()
        {
            _handler();
        }

        public bool MatchesKey(ConsoleKeyInfo keyInfo)
        {
            return _key == keyInfo.Key && _modifiers == keyInfo.Modifiers;
        }

        public string GetCommandShortcut()
        {
            string key = _key.ToString().Replace("Arrow", "");
            if (key.StartsWith("D") && key.Length == 2)
                key = key.Replace("D", "");

            if (_modifiers != 0)
                return $"{_modifiers.ToString().Replace("Control", "Ctrl")} + {key.ToString()}";
            else
                return key.ToString();
        }
    }
}

Fix showing digits - show '1' instead of 'D1'


using Hyperledger.Indy.PoolApi;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.IO;
using System.Threading.Tasks;

namespace Hyperledger.Indy.Test.PoolTests
{
    [TestClass]
    public class CreatePoolTest : IndyIntegrationTestBase
    {
        [TestMethod]
        public async Task TestCreatePoolWorksForNullConfig()
        {
            var file = File.Create("testCreatePoolWorks.txn");
            PoolUtils.WriteTransactions(file, 1);

            await Pool.CreatePoolLedgerConfigAsync("testCreatePoolWorks", null);
        }

        [TestMethod]
        public async Task TestCreatePoolWorksForConfigJSON()
        {
            var genesisTxnFile = PoolUtils.CreateGenesisTxnFile("genesis.txn");
            var path = Path.GetFullPath(genesisTxnFile.Name).Replace('\\', '/');

            var configJson = string.Format("{{\"genesis_txn\":\"{0}\"}}", path);

            await Pool.CreatePoolLedgerConfigAsync("testCreatePoolWorks", configJson);
        }

        [TestMethod]
        public async Task TestCreatePoolWorksForTwice()
        {

            var genesisTxnFile = PoolUtils.CreateGenesisTxnFile("genesis.txn");
            var path = Path.GetFullPath(genesisTxnFile.Name).Replace('\\', '/');

            var configJson = string.Format("{{\"genesis_txn\":\"{0}\"}}", path);

            await Pool.CreatePoolLedgerConfigAsync("pool1", configJson);

            var ex = await Assert.ThrowsExceptionAsync<PoolLedgerConfigExistsException>(() =>
                Pool.CreatePoolLedgerConfigAsync("pool1", configJson)
            );;
        }
    }
}

using Hyperledger.Indy.PoolApi;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.IO;
using System.Threading.Tasks;

namespace Hyperledger.Indy.Test.PoolTests
{
    [TestClass]
    public class CreatePoolTest : IndyIntegrationTestBase
    {
        [TestMethod]
        public async Task TestCreatePoolWorksForNullConfig()
        {
            string poolConfigName = "testCreatePoolWorks";
            var file = File.Create(string.Format("{0}.txn", poolConfigName));
            PoolUtils.WriteTransactions(file, 1);

            await Pool.CreatePoolLedgerConfigAsync(poolConfigName, null);
        }

        [TestMethod]
        public async Task TestCreatePoolWorksForConfigJSON()
        {
            var genesisTxnFile = PoolUtils.CreateGenesisTxnFile("genesis.txn");
            var path = Path.GetFullPath(genesisTxnFile.Name).Replace('\\', '/');

            var configJson = string.Format("{{\"genesis_txn\":\"{0}\"}}", path);

            await Pool.CreatePoolLedgerConfigAsync("testCreatePoolWorks", configJson);
        }

        [TestMethod]
        public async Task TestCreatePoolWorksForTwice()
        {

            var genesisTxnFile = PoolUtils.CreateGenesisTxnFile("genesis.txn");
            var path = Path.GetFullPath(genesisTxnFile.Name).Replace('\\', '/');

            var configJson = string.Format("{{\"genesis_txn\":\"{0}\"}}", path);

            await Pool.CreatePoolLedgerConfigAsync("pool1", configJson);

            var ex = await Assert.ThrowsExceptionAsync<PoolLedgerConfigExistsException>(() =>
                Pool.CreatePoolLedgerConfigAsync("pool1", configJson)
            );;
        }
    }
}

Create Pool Tests work.  removed obsolete tests

Signed-off-by: matt raffel <a1c361500f8f28827fe56351c610aa9d1ba26ce8@evernym.com>


using Auth0.Core.Serialization;
using Newtonsoft.Json;
using System;
using System.Net.Http;
using System.Threading.Tasks;

namespace Auth0.Core
{
    /// <summary>
    /// Error information captured from a failed API request.
    /// </summary>
    [JsonConverter(typeof(ApiErrorConverter))]
    public class ApiError
    {
        /// <summary>
        /// Description of the failing HTTP Status Code.
        /// </summary>
        [JsonProperty("error")]
        public string Error { get; set; }

        /// <summary>
        /// Error code returned by the API.
        /// </summary>
        [JsonProperty("errorCode")]
        public string ErrorCode { get; set; }

        /// <summary>
        /// Description of the error.
        /// </summary>
        [JsonProperty("message")]
        public string Message { get; set; }

        /// <summary>
        /// Parse a <see cref="HttpResponseMessage"/> into an <see cref="ApiError"/> asynchronously.
        /// </summary>
        /// <param name="response"><see cref="HttpResponseMessage"/> to parse.</param>
        /// <returns><see cref="Task"/> representing the operation and associated <see cref="ApiError"/> on
        /// successful completion.</returns>
        public static async Task<ApiError> Parse(HttpResponseMessage response)
        {
            if (response == null || response.Content == null)
                return null;

            var content = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
            if (String.IsNullOrEmpty(content))
                return null;

            try
            {
                return JsonConvert.DeserializeObject<ApiError>(content);
            }
            catch (JsonSerializationException)
            {
                return new ApiError
                {
                    Error = content,
                    Message = content
                };
            }
        }
    }
}

using Auth0.Core.Serialization;
using Newtonsoft.Json;
using System;
using System.Net.Http;
using System.Threading.Tasks;

namespace Auth0.Core
{
    /// <summary>
    /// Error information captured from a failed API request.
    /// </summary>
    [JsonConverter(typeof(ApiErrorConverter))]
    public class ApiError
    {
        /// <summary>
        /// Description of the failing HTTP Status Code.
        /// </summary>
        [JsonProperty("error")]
        public string Error { get; set; }

        /// <summary>
        /// Error code returned by the API.
        /// </summary>
        [JsonProperty("errorCode")]
        public string ErrorCode { get; set; }

        /// <summary>
        /// Description of the error.
        /// </summary>
        [JsonProperty("message")]
        public string Message { get; set; }

        /// <summary>
        /// Parse a <see cref="HttpResponseMessage"/> into an <see cref="ApiError"/> asynchronously.
        /// </summary>
        /// <param name="response"><see cref="HttpResponseMessage"/> to parse.</param>
        /// <returns><see cref="Task"/> representing the operation and associated <see cref="ApiError"/> on
        /// successful completion.</returns>
        public static async Task<ApiError> Parse(HttpResponseMessage response)
        {
            if (response == null || response.Content == null)
                return null;

            var content = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
            if (String.IsNullOrEmpty(content))
                return null;

            try
            {
                return JsonConvert.DeserializeObject<ApiError>(content);
            }
            catch (JsonException)
            {
                return new ApiError
                {
                    Error = content,
                    Message = content
                };
            }
        }
    }
}

Handle other kinds of deserialization exceptions


using FluentMigrator.Runner.Generators.Generic;

namespace FluentMigrator.Runner.Generators.MySql
{
    public class MySqlQuoter : GenericQuoter
    {
        public override string OpenQuote { get { return "`"; } }

        public override string CloseQuote { get { return "`"; } }

        public override string QuoteValue(object value)
        {
            return base.QuoteValue(value).Replace(@"\", @"\\");
        }

        public override string FromTimeSpan(System.TimeSpan value)
        {
            return System.String.Format("{0}{1}:{2}:{3}.{4}{0}"
                , ValueQuote
                , value.Hours + (value.Days * 24)
                , value.Minutes
                , value.Seconds
                , value.Milliseconds);
        }
    }
}

using FluentMigrator.Runner.Generators.Generic;

namespace FluentMigrator.Runner.Generators.MySql
{
    public class MySqlQuoter : GenericQuoter
    {
        public override string OpenQuote { get { return "`"; } }

        public override string CloseQuote { get { return "`"; } }

        public override string QuoteValue(object value)
        {
            return base.QuoteValue(value).Replace(@"\", @"\\");
        }

        public override string FromTimeSpan(System.TimeSpan value)
        {
            return System.String.Format("{0}{1:00}:{2:00}:{3:00}{0}"
                , ValueQuote
                , value.Hours + (value.Days * 24)
                , value.Minutes
                , value.Seconds);
        }
    }
}

Fix MySql do not support Milliseconds

Fix MySql do not support Milliseconds


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Schema;

namespace Codge.Generator.Presentations.Xsd
{
    public static class XmlSchemaExtensions
    {
        public static bool IsEmptyType(this XmlSchemaComplexType type)
        {
            return type.ContentModel == null && type.Attributes.Count == 0 && type.ContentType.ToString() == "Empty";
        }

        public static IEnumerable<XmlSchemaEnumerationFacet> GetEnumerationFacets(this XmlSchemaSimpleType simpleType)
        {
            if (simpleType.Content != null)
            {
                var restriction = simpleType.Content as XmlSchemaSimpleTypeRestriction;
                if (restriction != null && restriction.Facets != null && restriction.Facets.Count > 0)
                {
                    foreach (var facet in restriction.Facets)
                    {
                        var item = facet as XmlSchemaEnumerationFacet;
                        if (item == null)
                            yield break;

                        yield return item;
                    }
                }
            }
            yield break;
        }

        public static bool IsEnumeration(this XmlSchemaSimpleType simpleType)
        {
            return GetEnumerationFacets(simpleType).Any();
        }
    }
}

using System.Collections.Generic;
using System.Linq;
using System.Xml.Schema;

namespace Codge.Generator.Presentations.Xsd
{
    public static class XmlSchemaExtensions
    {
        public static bool IsEmptyType(this XmlSchemaComplexType type)
        {
            return type.ContentModel == null && type.Attributes.Count == 0 && type.ContentType.ToString() == "Empty";
        }

        public static IEnumerable<XmlSchemaEnumerationFacet> GetEnumerationFacets(this XmlSchemaSimpleType simpleType)
        {
            if (simpleType.Content != null)
            {
                var restriction = simpleType.Content as XmlSchemaSimpleTypeRestriction;
                if (restriction != null && restriction.Facets != null && restriction.Facets.Count > 0)
                {
                    foreach (var facet in restriction.Facets)
                    {
                        var item = facet as XmlSchemaEnumerationFacet;
                        if (item != null)
                            yield return item;
                    }
                }
            }
            yield break;
        }

        public static bool IsEnumeration(this XmlSchemaSimpleType simpleType)
        {
            return GetEnumerationFacets(simpleType).Any();
        }
    }
}

Fix for treating enum types as primitives due non-enumeration facets


@model ICollection<AuthenticationClientData>

@if (Model.Count > 0)
{
    using (Html.BeginForm("ExternalLogin", "Account", new { ReturnUrl = ViewBag.ReturnUrl }))
    {
    	@Html.AntiForgeryToken()

Use another service to log in.

        @foreach (AuthenticationClientData p in Model)
        {
            <button type="submit" class="btn" id="@p.AuthenticationClient.ProviderName" name="provider" value="@p.AuthenticationClient.ProviderName" title="Log in using your @p.DisplayName account">@p.DisplayName</button>
        }

    }
}

@model ICollection<Microsoft.Web.WebPages.OAuth.AuthenticationClientData>

@if (Model.Count > 0)
{
    using (Html.BeginForm("ExternalLogin", "Account", new { ReturnUrl = ViewBag.ReturnUrl }))
    {
    	@Html.AntiForgeryToken()

Use another service to log in.

        @foreach (var p in Model)
        {
            <button type="submit" class="btn" id="@p.AuthenticationClient.ProviderName" name="provider" value="@p.AuthenticationClient.ProviderName" title="Log in using your @p.DisplayName account">@p.DisplayName</button>
        }

    }
}

Fix external logins partial for running in mono 3.2.x


using System;
using Eto.Drawing;
using Eto.Forms;
using MonoMac.AppKit;
using SD = System.Drawing;

namespace Eto.Platform.Mac.Forms
{
	public class FormHandler : MacWindow<MyWindow, Form>, IDisposable, IForm
	{
		protected override bool DisposeControl { get { return false; } }

		public FormHandler()
		{
			Control = new MyWindow(new SD.Rectangle(0,0,200,200),
				NSWindowStyle.Resizable | NSWindowStyle.Closable | NSWindowStyle.Miniaturizable | NSWindowStyle.Titled,
				NSBackingStore.Buffered, false);
			ConfigureWindow ();
		}

		public void Show ()
		{
			if (!Control.IsVisible)
				Widget.OnShown (EventArgs.Empty);
			if (this.WindowState == WindowState.Minimized)
				Control.MakeKeyWindow ();
			else
				Control.MakeKeyAndOrderFront (ApplicationHandler.Instance.AppDelegate);
		}
	}
}

using System;
using Eto.Forms;
using MonoMac.AppKit;
using SD = System.Drawing;

namespace Eto.Platform.Mac.Forms
{
	public class FormHandler : MacWindow<MyWindow, Form>, IForm
	{
		protected override bool DisposeControl { get { return false; } }

		public FormHandler()
		{
			Control = new MyWindow(new SD.Rectangle(0, 0, 200, 200),
			                       NSWindowStyle.Resizable | NSWindowStyle.Closable | NSWindowStyle.Miniaturizable | NSWindowStyle.Titled,
			                       NSBackingStore.Buffered, false);
			ConfigureWindow();
		}

		public void Show()
		{
			if (WindowState == WindowState.Minimized)
				Control.MakeKeyWindow();
			else
				Control.MakeKeyAndOrderFront(ApplicationHandler.Instance.AppDelegate);
			if (!Control.IsVisible)
				Widget.OnShown(EventArgs.Empty);
		}
	}
}

Mac: Call Form.OnShown after window is shown (to be consistent with dialog)


// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using NUnit.Framework;
using osu.Game.Rulesets.Osu.Mods;

namespace osu.Game.Rulesets.Osu.Tests.Mods
{
    public class TestSceneOsuModAimAssist : OsuModTestScene
    {
        [Test]
        public void TestAimAssist()
        {
            var mod = new OsuModAimAssist();

            CreateModTest(new ModTestData
            {
                Autoplay = false,
                Mod = mod,
            });
        }
    }
}

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using NUnit.Framework;
using osu.Game.Rulesets.Osu.Mods;

namespace osu.Game.Rulesets.Osu.Tests.Mods
{
    public class TestSceneOsuModAimAssist : OsuModTestScene
    {
        [TestCase(0.1f)]
        [TestCase(0.5f)]
        [TestCase(1)]
        public void TestAimAssist(float strength)
        {
            CreateModTest(new ModTestData
            {
                Mod = new OsuModAimAssist
                {
                    AssistStrength = { Value = strength },
                },
                PassCondition = () => true,
                Autoplay = false,
            });
        }
    }
}

Add testing of different strengths

Add testing of different strengths


using davClassLibrary.Common;
using davClassLibrary.DataAccess;
using UniversalSoundBoard.DataAccess;
using Windows.Networking.Connectivity;

namespace UniversalSoundboard.Common
{
    public class GeneralMethods : IGeneralMethods
    {
        public bool IsNetworkAvailable()
        {
            var connection = NetworkInformation.GetInternetConnectionProfile();
            var networkCostType = connection.GetConnectionCost().NetworkCostType;
            return !(networkCostType != NetworkCostType.Unrestricted && networkCostType != NetworkCostType.Unknown);
        }

        public DavEnvironment GetEnvironment()
        {
            return FileManager.Environment;
        }
    }
}

using davClassLibrary.Common;
using davClassLibrary.DataAccess;
using UniversalSoundBoard.DataAccess;
using Windows.Networking.Connectivity;

namespace UniversalSoundboard.Common
{
    public class GeneralMethods : IGeneralMethods
    {
        public bool IsNetworkAvailable()
        {
            var connection = NetworkInformation.GetInternetConnectionProfile();
            if (connection == null) return false;
            var networkCostType = connection.GetConnectionCost().NetworkCostType;
            return !(networkCostType != NetworkCostType.Unrestricted && networkCostType != NetworkCostType.Unknown);
        }

        public DavEnvironment GetEnvironment()
        {
            return FileManager.Environment;
        }
    }
}

Check for null in IsNetworkAvailable implementation


using JoinRpg.Web.CheckIn;
using JoinRpg.Web.ProjectCommon;
using JoinRpg.Web.ProjectMasterTools.ResponsibleMaster;
using JoinRpg.Web.ProjectMasterTools.Subscribe;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;

namespace JoinRpg.Blazor.Client.ApiClients;

public static class HttpClientRegistration
{
    private static WebAssemblyHostBuilder AddHttpClient<TClient, TImplementation>(
        this WebAssemblyHostBuilder builder)

        where TClient : class
        where TImplementation : class, TClient
    {
        _ = builder.Services.AddHttpClient<TClient, TImplementation>(
            client => client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress));
        return builder;
    }

    public static WebAssemblyHostBuilder AddHttpClients(this WebAssemblyHostBuilder builder)
    {
        return builder
                .AddHttpClient<IGameSubscribeClient, GameSubscribeClient>()
                .AddHttpClient<ICharacterGroupsClient, CharacterGroupsClient>()
                .AddHttpClient<ICheckInClient, CheckInClient>()
                .AddHttpClient<IResponsibleMasterRuleClient, ApiClients.ResponsibleMasterRuleClient>();
    }
}

using JoinRpg.Web.CheckIn;
using JoinRpg.Web.ProjectCommon;
using JoinRpg.Web.ProjectMasterTools.ResponsibleMaster;
using JoinRpg.Web.ProjectMasterTools.Subscribe;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;

namespace JoinRpg.Blazor.Client.ApiClients;

public static class HttpClientRegistration
{
    private static WebAssemblyHostBuilder AddHttpClient<TClient, TImplementation>(
        this WebAssemblyHostBuilder builder)

        where TClient : class
        where TImplementation : class, TClient
    {
        _ = builder.Services.AddHttpClient<TClient, TImplementation>(
            client => client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress));
        return builder;
    }

    public static WebAssemblyHostBuilder AddHttpClients(this WebAssemblyHostBuilder builder)
    {
        return builder
                .AddHttpClient<IGameSubscribeClient, GameSubscribeClient>()
                .AddHttpClient<ICharacterGroupsClient, CharacterGroupsClient>()
                .AddHttpClient<ICheckInClient, CheckInClient>()
                .AddHttpClient<IResponsibleMasterRuleClient, ResponsibleMasterRuleClient>();
    }
}

Fix namespace in httpclient registration


// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Platform;

namespace osu.Game.Screens.Play
{
    internal class ScreenSuspensionHandler : Component
    {
        private readonly GameplayClockContainer gameplayClockContainer;
        private Bindable<bool> isPaused;

        [Resolved]
        private GameHost host { get; set; }

        public ScreenSuspensionHandler(GameplayClockContainer gameplayClockContainer)
        {
            this.gameplayClockContainer = gameplayClockContainer;
        }

        protected override void LoadComplete()
        {
            base.LoadComplete();

            isPaused = gameplayClockContainer.IsPaused.GetBoundCopy();
            isPaused.BindValueChanged(paused => host.AllowScreenSuspension.Value = paused.NewValue, true);
        }

        protected override void Dispose(bool isDisposing)
        {
            base.Dispose(isDisposing);

            isPaused?.UnbindAll();

            if (host != null)
                host.AllowScreenSuspension.Value = true;
        }
    }
}

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Platform;

namespace osu.Game.Screens.Play
{
    /// <summary>
    /// Ensures screen is not suspended / dimmed while gameplay is active.
    /// </summary>
    public class ScreenSuspensionHandler : Component
    {
        private readonly GameplayClockContainer gameplayClockContainer;
        private Bindable<bool> isPaused;

        [Resolved]
        private GameHost host { get; set; }

        public ScreenSuspensionHandler([NotNull] GameplayClockContainer gameplayClockContainer)
        {
            this.gameplayClockContainer = gameplayClockContainer ?? throw new ArgumentNullException(nameof(gameplayClockContainer));
        }

        protected override void LoadComplete()
        {
            base.LoadComplete();

            isPaused = gameplayClockContainer.IsPaused.GetBoundCopy();
            isPaused.BindValueChanged(paused => host.AllowScreenSuspension.Value = paused.NewValue, true);
        }

        protected override void Dispose(bool isDisposing)
        {
            base.Dispose(isDisposing);

            isPaused?.UnbindAll();

            if (host != null)
                host.AllowScreenSuspension.Value = true;
        }
    }
}

Add null check and xmldoc

Add null check and xmldoc


using System;
using System.Threading;

namespace Bumblebee.Extensions
{
    public static class Debugging
    {
        public static T DebugPrint<T>(this T obj)
        {
            Console.WriteLine(obj.ToString());
            return obj;
        }

        public static T DebugPrint<T>(this T obj, string message)
        {
            Console.WriteLine(message);
            return obj;
        }

        public static T DebugPrint<T>(this T obj, Func<T, object> func)
        {
            Console.WriteLine(func.Invoke(obj));
            return obj;
        }

        public static T Pause<T>(this T block, int seconds)
        {
            if (seconds > 0) Thread.Sleep(1000 * seconds);
            return block;
        }
    }
}

using System;
using System.Threading;

namespace Bumblebee.Extensions
{
    public static class Debugging
    {
        public static T DebugPrint<T>(this T obj)
        {
            Console.WriteLine(obj.ToString());
            return obj;
        }

        public static T DebugPrint<T>(this T obj, string message)
        {
            Console.WriteLine(message);
            return obj;
        }

        public static T DebugPrint<T>(this T obj, Func<T, object> func)
        {
            Console.WriteLine(func.Invoke(obj));
            return obj;
        }

        public static T PlaySound<T>(this T obj, int pause = 0)
        {
            System.Media.SystemSounds.Exclamation.Play();
            return obj.Pause(pause);
        }

        public static T Pause<T>(this T block, int seconds)
        {
            if (seconds > 0) Thread.Sleep(1000 * seconds);
            return block;
        }
    }
}

Add PlaySound as a debugging 'tool'

Add PlaySound as a debugging 'tool'


using System.Runtime.Remoting.Messaging;

namespace Criteo.Profiling.Tracing
{
    internal static class TraceContext
    {
        private const string TraceCallContextKey = "crto_trace";

        public static Trace Get()
        {
            return CallContext.LogicalGetData(TraceCallContextKey) as Trace;
        }

        public static void Set(Trace trace)
        {
            CallContext.LogicalSetData(TraceCallContextKey, trace);
        }

        public static void Clear()
        {
            CallContext.FreeNamedDataSlot(TraceCallContextKey);
        }
    }
}

using System;
using System.Runtime.Remoting.Messaging;

namespace Criteo.Profiling.Tracing
{
    internal static class TraceContext
    {
        private const string TraceCallContextKey = "crto_trace";

        private static readonly bool IsRunningOnMono = (Type.GetType("Mono.Runtime") != null);

        public static Trace Get()
        {
            if (IsRunningOnMono) return null;

            return CallContext.LogicalGetData(TraceCallContextKey) as Trace;
        }

        public static void Set(Trace trace)
        {
            if (IsRunningOnMono) return;

            CallContext.LogicalSetData(TraceCallContextKey, trace);
        }

        public static void Clear()
        {
            if (IsRunningOnMono) return;

            CallContext.FreeNamedDataSlot(TraceCallContextKey);
        }
    }
}

Add check for Mono for LogicalCallContext

Some projects are running an outdated Mono version which does not implement LogicalCallContext.

Change-Id: I07d90a8cd3c909c17bbd9e856816ce625379512f


using System.Collections.Generic;
using System.Collections.Immutable;
using Octokit;
using NSubstitute;
using NUnit.Framework;
using GitHub.Extensions;

public class ApiExceptionExtensionsTests
{
    public class TheIsGitHubApiExceptionMethod
    {
        [TestCase("Not-GitHub-Request-Id", false)]
        [TestCase("X-GitHub-Request-Id", true)]
        [TestCase("x-github-request-id", true)]
        public void NoGitHubRequestId(string key, bool expect)
        {
            var ex = CreateApiException(new Dictionary<string, string> { { key, "ANYTHING" } });

            var result = ApiExceptionExtensions.IsGitHubApiException(ex);

            Assert.That(result, Is.EqualTo(expect));
        }

        static ApiException CreateApiException(Dictionary<string, string> headers)
        {
            var response = Substitute.For<IResponse>();
            response.Headers.Returns(headers.ToImmutableDictionary());
            var ex = new ApiException(response);
            return ex;
        }
    }
}

using System.Collections.Generic;
using System.Collections.Immutable;
using Octokit;
using NSubstitute;
using NUnit.Framework;
using GitHub.Extensions;

public class ApiExceptionExtensionsTests
{
    public class TheIsGitHubApiExceptionMethod
    {
        [TestCase("Not-GitHub-Request-Id", false)]
        [TestCase("X-GitHub-Request-Id", true)]
        [TestCase("x-github-request-id", true)]
        public void NoGitHubRequestId(string key, bool expect)
        {
            var ex = CreateApiException(new Dictionary<string, string> { { key, "ANYTHING" } });

            var result = ApiExceptionExtensions.IsGitHubApiException(ex);

            Assert.That(result, Is.EqualTo(expect));
        }

        [Test]
        public void NoResponse()
        {
            var ex = new ApiException();

            var result = ApiExceptionExtensions.IsGitHubApiException(ex);

            Assert.That(result, Is.EqualTo(false));
        }

        static ApiException CreateApiException(Dictionary<string, string> headers)
        {
            var response = Substitute.For<IResponse>();
            response.Headers.Returns(headers.ToImmutableDictionary());
            var ex = new ApiException(response);
            return ex;
        }
    }
}

Add test when IResponse not set

Add test when IResponse not set


// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using Android.App;
using Android.Content.PM;
using Android.OS;
using Android.Views;
using osu.Framework.Android;

namespace osu.Android
{
    [Activity(Theme = "@android:style/Theme.NoTitleBar", MainLauncher = true, ScreenOrientation = ScreenOrientation.FullSensor, SupportsPictureInPicture = false, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize, HardwareAccelerated = false)]
    public class OsuGameActivity : AndroidGameActivity
    {
        protected override Framework.Game CreateGame() => new OsuGameAndroid();

        protected override void OnCreate(Bundle savedInstanceState)
        {
            // The default current directory on android is '/'.
            // On some devices '/' maps to the app data directory. On others it maps to the root of the internal storage.
            // In order to have a consistent current directory on all devices the full path of the app data directory is set as the current directory.
            System.Environment.CurrentDirectory = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);

            base.OnCreate(savedInstanceState);

            Window.AddFlags(WindowManagerFlags.Fullscreen);
            Window.AddFlags(WindowManagerFlags.KeepScreenOn);
        }
    }
}

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using Android.App;
using Android.Content.PM;
using Android.OS;
using Android.Views;
using osu.Framework.Android;

namespace osu.Android
{
    [Activity(Theme = "@android:style/Theme.NoTitleBar", MainLauncher = true, ScreenOrientation = ScreenOrientation.FullUser, SupportsPictureInPicture = false, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize, HardwareAccelerated = false)]
    public class OsuGameActivity : AndroidGameActivity
    {
        protected override Framework.Game CreateGame() => new OsuGameAndroid();

        protected override void OnCreate(Bundle savedInstanceState)
        {
            // The default current directory on android is '/'.
            // On some devices '/' maps to the app data directory. On others it maps to the root of the internal storage.
            // In order to have a consistent current directory on all devices the full path of the app data directory is set as the current directory.
            System.Environment.CurrentDirectory = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);

            base.OnCreate(savedInstanceState);

            Window.AddFlags(WindowManagerFlags.Fullscreen);
            Window.AddFlags(WindowManagerFlags.KeepScreenOn);
        }
    }
}

Allow rotation lock on Android to function properly

According to Google's documentation, fullSensor will ignore rotation
locking preferences, while fullUser will obey them.

Signed-off-by: tytydraco <1a6917f7786c6ba900af5d5dbd13cb4a5214f8a7@gmail.com>


using Gtk;
using Mono.Addins;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Gui.Components;

namespace MonoDevelop.AddinMaker.AddinBrowser
{
	class AddinBrowserWidget : VBox
	{
		ExtensibleTreeView treeView;

		public AddinBrowserWidget (AddinRegistry registry)
		{
			Registry = registry;

			Build ();

			foreach (var addin in registry.GetAddins ()) {
				treeView.AddChild (addin);
			}
		}

		void Build ()
		{
			//TODO: make extensible?
			treeView = new ExtensibleTreeView (
				new NodeBuilder[] {
					new AddinNodeBuilder (),
					new ExtensionFolderNodeBuilder (),
					new ExtensionNodeBuilder (),
					new ExtensionPointNodeBuilder (),
					new ExtensionPointFolderNodeBuilder (),
					new DependencyFolderNodeBuilder (),
					new DependencyNodeBuilder (),
				},
				new TreePadOption[0]
			);
			treeView.Tree.Selection.Mode = SelectionMode.Single;

			PackStart (treeView, true, true, 0);
			ShowAll ();
		}

		public void SetToolbar (DocumentToolbar toolbar)
		{
		}

		public AddinRegistry Registry {
			get; private set;
		}
	}
}

using Gtk;
using Mono.Addins;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Gui.Components;

namespace MonoDevelop.AddinMaker.AddinBrowser
{
	class AddinBrowserWidget : HPaned
	{
		ExtensibleTreeView treeView;

		public AddinBrowserWidget (AddinRegistry registry)
		{
			Registry = registry;

			Build ();

			foreach (var addin in registry.GetAddins ()) {
				treeView.AddChild (addin);
			}
		}

		void Build ()
		{
			//TODO: make extensible?
			treeView = new ExtensibleTreeView (
				new NodeBuilder[] {
					new AddinNodeBuilder (),
					new ExtensionFolderNodeBuilder (),
					new ExtensionNodeBuilder (),
					new ExtensionPointNodeBuilder (),
					new ExtensionPointFolderNodeBuilder (),
					new DependencyFolderNodeBuilder (),
					new DependencyNodeBuilder (),
				},
				new TreePadOption[0]
			);
			treeView.Tree.Selection.Mode = SelectionMode.Single;
			treeView.WidthRequest = 300;

			Pack1 (treeView, false, false);
			SetDetail (null);

			ShowAll ();
		}

		void SetDetail (Widget detail)
		{
			var child2 = Child2;
			if (child2 != null) {
				Remove (child2);
			}

			detail = detail ?? new Label ();
			detail.WidthRequest = 300;
			detail.Show ();

			Pack2 (detail, true, false);
		}

		public void SetToolbar (DocumentToolbar toolbar)
		{
		}

		public AddinRegistry Registry {
			get; private set;
		}
	}
}

Add detail panel, currently empty

[Browser] Add detail panel, currently empty


using System;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using TirkxDownloader.Framework;

namespace TirkxDownloader.Models
{
    public class DetailProvider
    {
        public async Task GetFileDetail(DownloadInfo detail, CancellationToken ct)
        {
            try
            {
                var request = (HttpWebRequest)HttpWebRequest.Create(detail.DownloadLink);
                request.Method = "HEAD";
                var response = await request.GetResponseAsync(ct);
                detail.FileSize = response.ContentLength;
            }
            catch (OperationCanceledException) { }
        }

        public bool FillCredential(string doamin)
        {
            throw new NotImplementedException();
        }
    }
}

using System;
using System.IO;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using TirkxDownloader.Framework;
using TirkxDownloader.Models;

namespace TirkxDownloader.Models
{
    public class DetailProvider
    {
        private AuthorizationManager _authenticationManager;

        public DetailProvider(AuthorizationManager authenticationManager)
        {
            _authenticationManager = authenticationManager;
        }

        public async Task GetFileDetail(DownloadInfo detail, CancellationToken ct)
        {
            try
            {
                var request = (HttpWebRequest)HttpWebRequest.Create(detail.DownloadLink);
                request.Method = "HEAD";
                var response = await request.GetResponseAsync(ct);
                detail.FileSize = response.ContentLength;
                response.Close();
            }
            catch (OperationCanceledException) { }
        }

        public async Task FillCredential(HttpWebRequest request)
        {
            string targetDomain = "";
            string domain = request.Host;
            AuthorizationInfo authorizationInfo = _authenticationManager.GetCredential(domain);

            using (StreamReader str = new StreamReader("Target domain.dat", Encoding.UTF8))
            {
                string storedDomian;

                while ((storedDomian = await str.ReadLineAsync()) != null)
                {
                    if (storedDomian.Like(domain))
                    {
                        targetDomain = storedDomian;

                        // if it isn't wildcards, it done
                        if (!storedDomian.Contains("*"))
                        {
                            break;
                        }
                    }
                }
            }

            AuthorizationInfo credential = _authenticationManager.GetCredential(targetDomain);

            if (credential != null)
            {
                var netCredential = new NetworkCredential(credential.Username, credential.Password, domain);
                request.Credentials = netCredential;
            }
            else
            {
                // if no credential was found, try to use default credential
                request.UseDefaultCredentials = true;
            }
        }
    }
}

Fix download didn't start by close response in getFileDetail, implement FillCredential method


// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System.Linq;
using NUnit.Framework;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics.Containers;
using osu.Framework.Screens;
using osu.Framework.Testing;
using osu.Game.Screens.Play.HUD;
using osu.Game.Skinning;
using osu.Game.Tests.Visual;
using osuTK;

namespace osu.Game.Rulesets.Catch.Tests
{
    [TestFixture]
    public class TestSceneCatchPlayerLegacySkin : LegacySkinPlayerTestScene
    {
        protected override Ruleset CreatePlayerRuleset() => new CatchRuleset();

        [Test]
        [Ignore("HUD components broken, remove when fixed.")]
        public void TestLegacyHUDComboCounterHidden([Values] bool withModifiedSkin)
        {
            if (withModifiedSkin)
            {
                AddStep("change component scale", () => Player.ChildrenOfType<LegacyScoreCounter>().First().Scale = new Vector2(2f));
                AddStep("update target", () => Player.ChildrenOfType<SkinnableTargetContainer>().ForEach(LegacySkin.UpdateDrawableTarget));
                AddStep("exit player", () => Player.Exit());
                CreateTest(null);
            }

            AddAssert("legacy HUD combo counter hidden", () =>
            {
                return Player.ChildrenOfType<LegacyComboCounter>().All(c => !c.ChildrenOfType<Container>().Single().IsPresent);
            });
        }
    }
}

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System.Linq;
using NUnit.Framework;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics.Containers;
using osu.Framework.Screens;
using osu.Framework.Testing;
using osu.Game.Screens.Play.HUD;
using osu.Game.Skinning;
using osu.Game.Tests.Visual;
using osuTK;

namespace osu.Game.Rulesets.Catch.Tests
{
    [TestFixture]
    public class TestSceneCatchPlayerLegacySkin : LegacySkinPlayerTestScene
    {
        protected override Ruleset CreatePlayerRuleset() => new CatchRuleset();

        [Test]
        public void TestLegacyHUDComboCounterHidden([Values] bool withModifiedSkin)
        {
            if (withModifiedSkin)
            {
                AddStep("change component scale", () => Player.ChildrenOfType<LegacyScoreCounter>().First().Scale = new Vector2(2f));
                AddStep("update target", () => Player.ChildrenOfType<SkinnableTargetContainer>().ForEach(LegacySkin.UpdateDrawableTarget));
                AddStep("exit player", () => Player.Exit());
                CreateTest(null);
            }

            AddAssert("legacy HUD combo counter hidden", () =>
            {
                return Player.ChildrenOfType<LegacyComboCounter>().All(c => !c.ChildrenOfType<Container>().Single().IsPresent);
            });
        }
    }
}

Remove the ignore attribute once again

Remove the ignore attribute once again


<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
<script>
    var data = (function ($) {
        var getData = (function() {
            $.ajax({
                method: "GET",
                url: "GetMammals",
                dataType: "json",
                success: function (response) {
                    print(response);
                },
                failure: function (response) {
                    alert(response.d);
                }
            });
        });

        function print(data) {
            document.write(
                data.Dog.Name + ": " + data.Dog.Type + " / " +
                data.Cat.Name + ": " + data.Cat.Type
                );
        }

        return {
            getData: getData
        }
    })(jQuery);
</script>

<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
</head>
<body>
    <div>
        <script>
            data.getData();
        </script>
    </div>
</body>
</html>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
<script>
    var data = (function ($) {
        var getData = (function() {
            $.ajax({
                method: "GET",
                url: "@Url.Action("GetMammals", "Home")",
                dataType: "json",
                success: function (response) {
                    print(response);
                },
                failure: function (response) {
                    alert(response.d);
                }
            });
        });

        function print(data) {
            document.write(
                data.Dog.Name + ": " + data.Dog.Type + " / " +
                data.Cat.Name + ": " + data.Cat.Type
                );
        }

        return {
            getData: getData
        }
    })(jQuery);
</script>

<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
</head>
<body>
    <div>
        <script>
            data.getData();
        </script>
    </div>
</body>
</html>

Fix 404 error when calling GetMammals, incorrect route


using ServiceStack.ServiceHost;

namespace License.Manager.Core.Model
{
    [Route("/customers", "POST")]
    [Route("/customers/{Id}", "PUT, DELETE")]
    [Route("/customers/{Id}", "GET, OPTIONS")]
    public class Customer : EntityBase
    {
        public string Name { get; set; }
        public string Company { get; set; }
        public string Email { get; set; }
    }
}

using ServiceStack.ServiceHost;

namespace License.Manager.Core.Model
{
    [Route("/customers", "POST")]
    [Route("/customers/{Id}", "PUT, DELETE")]
    [Route("/customers/{Id}", "GET, OPTIONS")]
    public class Customer : EntityBase, IReturn<Customer>
    {
        public string Name { get; set; }
        public string Company { get; set; }
        public string Email { get; set; }
    }
}

Add response DTO marker interface for service documentation


/*****************************************************************************
 *
 * ReoGrid - .NET Spreadsheet Control
 *
 * https://reogrid.net/
 *
 * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
 * PURPOSE.
 *
 * Author: Jing Lu <jingwood at unvell.com>
 *
 * Copyright (c) 2012-2021 Jing Lu <jingwood at unvell.com>
 * Copyright (c) 2012-2016 unvell.com, all rights reserved.
 *
 ****************************************************************************/

#if PRINT

#if WPF

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Windows.Xps;
using System.Windows.Xps.Packaging;

using unvell.ReoGrid.Print;

namespace unvell.ReoGrid.Print
{
	partial class PrintSession
	{
		internal void Init() { }

		public void Dispose() { }

		/// <summary>
		/// Start output document to printer.
		/// </summary>
		public void Print()
		{
			throw new NotImplementedException("WPF Print is not implemented yet. Try use Windows Form version to print document as XPS file.");
		}
	}
}

namespace unvell.ReoGrid
{
	partial class Worksheet
	{
	}
}

#endif // WPF

#endif // PRINT

/*****************************************************************************
 *
 * ReoGrid - .NET Spreadsheet Control
 *
 * https://reogrid.net/
 *
 * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
 * PURPOSE.
 *
 * Author: Jing Lu <jingwood at unvell.com>
 *
 * Copyright (c) 2012-2021 Jing Lu <jingwood at unvell.com>
 * Copyright (c) 2012-2016 unvell.com, all rights reserved.
 *
 ****************************************************************************/

#if PRINT

#if WPF

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using unvell.ReoGrid.Print;

namespace unvell.ReoGrid.Print
{
	partial class PrintSession
	{
		internal void Init() { }

		public void Dispose() { }

		/// <summary>
		/// Start output document to printer.
		/// </summary>
		public void Print()
		{
			throw new NotImplementedException("WPF Print is not implemented yet. Try use Windows Form version to print document as XPS file.");
		}
	}
}

namespace unvell.ReoGrid
{
	partial class Worksheet
	{
	}
}

#endif // WPF

#endif // PRINT

Fix compiling error on .net451

Fix compiling error on .net451


namespace TraktApiSharp.Objects.Get.Shows
{
    using Newtonsoft.Json;

    /// <summary>
    /// The air time of a Trakt show.
    /// </summary>
    public class TraktShowAirs
    {
        /// <summary>
        /// The day of week on which the show airs.
        /// </summary>
        [JsonProperty(PropertyName = "day")]
        public string Day { get; set; }

        /// <summary>
        /// The time of day at which the show airs.
        /// </summary>
        [JsonProperty(PropertyName = "time")]
        public string Time { get; set; }

        /// <summary>
        /// The time zone id (Olson) for the location in which the show airs.
        /// </summary>
        [JsonProperty(PropertyName = "timezone")]
        public string TimeZoneId { get; set; }
    }
}

namespace TraktApiSharp.Objects.Get.Shows
{
    using Newtonsoft.Json;

    /// The air time of a Trakt show.
    public class TraktShowAirs
    {
        /// Gets or sets the day of week on which the show airs.
        [JsonProperty(PropertyName = "day")]
        public string Day { get; set; }

        /// Gets or sets the time of day at which the show airs.
        [JsonProperty(PropertyName = "time")]
        public string Time { get; set; }

        /// Gets or sets the time zone id (Olson) for the location in which the show airs.
        [JsonProperty(PropertyName = "timezone")]
        public string TimeZoneId { get; set; }
    }
}

Add documentation for show airs.

Add documentation for show airs.


using LanguageExt;
using static LanguageExt.Prelude;
using System;
using System.Reactive.Linq;
using System.Threading;

using Xunit;

namespace LanguageExtTests
{
    public class DelayTests
    {
        [Fact]
        public void DelayTest1()
        {
            var span = TimeSpan.FromMilliseconds(500);
            var till = DateTime.Now.Add(span);
            var v = 0;

            delay(() => 1, span).Subscribe(x => v = x);

            while( DateTime.Now < till.AddMilliseconds(20) )
            {
                Assert.True(v == 0);
                Thread.Sleep(1);
            }

            while (DateTime.Now < till.AddMilliseconds(100))
            {
                Thread.Sleep(1);
            }

            Assert.True(v == 1);
        }
    }
}

using LanguageExt;
using static LanguageExt.Prelude;
using System;
using System.Reactive.Linq;
using System.Threading;

using Xunit;

namespace LanguageExtTests
{
    public class DelayTests
    {
 #if !CI
        [Fact]
        public void DelayTest1()
        {
            var span = TimeSpan.FromMilliseconds(500);
            var till = DateTime.Now.Add(span);
            var v = 0;

            delay(() => 1, span).Subscribe(x => v = x);

            while( DateTime.Now < till )
            {
                Assert.True(v == 0);
                Thread.Sleep(1);
            }

            while (DateTime.Now < till.AddMilliseconds(100))
            {
                Thread.Sleep(1);
            }

            Assert.True(v == 1);
        }
#endif
    }
}

Remove delay test for CI for now

Remove delay test for CI for now


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace OS2Indberetning
{
    public class WebApiApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {

            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            //// Turns off self reference looping when serializing models in API controlllers
            //GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;

            //// Set JSON serialization in WEB API to use camelCase (javascript) instead of PascalCase (C#)
            //GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
        }
    }
}

using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using System.Web.Http.ExceptionHandling;
using System.Web.Http.Controllers;
using System.Net.Http.Headers;
using System.Diagnostics;
using ActionFilterAttribute = System.Web.Http.Filters.ActionFilterAttribute;

namespace OS2Indberetning
{
    public class WebApiApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

#if DEBUG
            GlobalConfiguration.Configuration.Services.Add(typeof(IExceptionLogger), new DebugExceptionLogger());
            GlobalConfiguration.Configuration.Filters.Add(new AddAcceptCharsetHeaderActionFilter());
#endif

            //// Turns off self reference looping when serializing models in API controlllers
            //GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;

            //// Set JSON serialization in WEB API to use camelCase (javascript) instead of PascalCase (C#)
            //GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
        }
    }

#if DEBUG
    public class AddAcceptCharsetHeaderActionFilter : ActionFilterAttribute
    {
        public override void OnActionExecuting(HttpActionContext actionContext)
        {
            // Inject "Accept-Charset" header into the client request,
            // since apparently this is required when running on Mono
            // See: https://github.com/OData/odata.net/issues/165
            actionContext.Request.Headers.AcceptCharset.Add(new StringWithQualityHeaderValue("UTF-8"));
            base.OnActionExecuting(actionContext);
        }
    }

    public class DebugExceptionLogger : ExceptionLogger
    {
        public override void Log(ExceptionLoggerContext context)
        {
            Debug.WriteLine(context.Exception);
        }
    }
#endif
}

Add debug logging and injection of "Accept-Charset" header that is required when running on Mono


// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System.Diagnostics;
using System.Threading;

#nullable enable

namespace osu.Framework.Threading
{
    /// <summary>
    /// A synchronisation context which posts all continuations to a scheduler instance.
    /// </summary>
    internal class GameThreadSynchronizationContext : SynchronizationContext
    {
        private readonly Scheduler scheduler;

        public int TotalTasksRun => scheduler.TotalTasksRun;

        public GameThreadSynchronizationContext(GameThread gameThread)
        {
            scheduler = new GameThreadScheduler(gameThread);
        }

        public override void Send(SendOrPostCallback d, object? state)
        {
            var del = scheduler.Add(() => d(state));

            Debug.Assert(del != null);

            while (del.State == ScheduledDelegate.RunState.Waiting)
            {
                if (scheduler.IsMainThread)
                    scheduler.Update();
                else
                    Thread.Sleep(1);
            }
        }

        public override void Post(SendOrPostCallback d, object? state) => scheduler.Add(() => d(state));

        public void RunWork() => scheduler.Update();
    }
}

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System.Diagnostics;
using System.Threading;

#nullable enable

namespace osu.Framework.Threading
{
    /// <summary>
    /// A synchronisation context which posts all continuations to an isolated scheduler instance.
    /// </summary>
    /// <remarks>
    /// This implementation roughly follows the expectations set out for winforms/WPF as per
    /// https://docs.microsoft.com/en-us/archive/msdn-magazine/2011/february/msdn-magazine-parallel-computing-it-s-all-about-the-synchronizationcontext.
    /// - Calls to <see cref="Post"/> are guaranteed to run asynchronously.
    /// - Calls to <see cref="Send"/> will run inline when they can.
    /// - Order of execution is guaranteed (in our case, it is guaranteed over <see cref="Send"/> and <see cref="Post"/> calls alike).
    /// - To enforce the above, calling <see cref="Send"/> will flush any pending work until the newly queued item has been completed.
    /// </remarks>
    internal class GameThreadSynchronizationContext : SynchronizationContext
    {
        private readonly Scheduler scheduler;

        public int TotalTasksRun => scheduler.TotalTasksRun;

        public GameThreadSynchronizationContext(GameThread gameThread)
        {
            scheduler = new GameThreadScheduler(gameThread);
        }

        public override void Send(SendOrPostCallback callback, object? state)
        {
            var scheduledDelegate = scheduler.Add(() => callback(state));

            Debug.Assert(scheduledDelegate != null);

            while (scheduledDelegate.State == ScheduledDelegate.RunState.Waiting)
            {
                if (scheduler.IsMainThread)
                    scheduler.Update();
                else
                    Thread.Sleep(1);
            }
        }

        public override void Post(SendOrPostCallback callback, object? state) => scheduler.Add(() => callback(state));

        public void RunWork() => scheduler.Update();
    }
}

Add xmldoc describing `SynchronizationContext` behaviour