using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace HelloSignNet.Core
{
    public class HSSendSignatureRequestData
    {
        public string Title { get; set; }
        public string Subject { get; set; }
        public string Message { get; set; }
        public string SigningRedirectUrl { get; set; }
        public List<HSSigner> Signers { get; set; }
        public List<string> CcEmailAddresses { get; set; }
        public List<FileInfo> Files { get; set; }
        public List<string> FileUrls { get; set; }
        public int TestMode { get; set; } // true=1, false=0

        public bool IsValid
        {
            get
            {
                if (Files == null && FileUrls == null)
                {
                    return false;
                }

                if (Files != null && FileUrls == null)
                {
                    if (!Files.Any())
                        return true;
                }

                if (Files == null && FileUrls != null)
                {
                    if (!FileUrls.Any())
                        return false;
                }

                if (Signers == null || Signers.Count == 0)
                    return false;

                if (Signers.Any(s => string.IsNullOrEmpty(s.Name) || string.IsNullOrEmpty(s.EmailAddress)))
                    return false;

                return true;
            }
        }
    }
}

using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace HelloSignNet.Core
{
    public class HSSendSignatureRequestData
    {
        public string Title { get; set; }
        public string Subject { get; set; }
        public string Message { get; set; }
        public string SigningRedirectUrl { get; set; }
        public List<HSSigner> Signers { get; set; }
        public List<string> CcEmailAddresses { get; set; }
        public List<FileInfo> Files { get; set; }
        public List<string> FileUrls { get; set; }
        public int TestMode { get; set; } // true=1, false=0, default=0
        public int UseTextTags { get; set; } // true=1, false=0, default=0
        public int HideTextTags { get; set; } // true=1, false=0, default=0

        public bool IsValid
        {
            get
            {
                if (Files == null && FileUrls == null)
                {
                    return false;
                }

                // API does not accept both files param in a request
                if (Files != null && FileUrls != null && Files.Any() && FileUrls.Any())
                    return false;

                if (Files != null && FileUrls == null)
                {
                    if (!Files.Any())
                        return false;
                }

                if (Files == null && FileUrls != null)
                {
                    if (!FileUrls.Any())
                        return false;
                }

                if (Signers == null || Signers.Count == 0)
                    return false;

                if (Signers.Any(s => string.IsNullOrEmpty(s.Name) || string.IsNullOrEmpty(s.EmailAddress)))
                    return false;

                return true;
            }
        }
    }
}

Add TextTags properties to request data

Add TextTags properties to request data

* HSSendSignatureRequestData now support the use of
  [TextTags](https://www.hellosign.com/api/textTagsWalkthrough)
  in API call


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Downlitor
{
    public partial class ItemInfoControl : UserControl
    {
        public ItemInfoControl(DlcItem dlc)
        {
            InitializeComponent();

            var manager = ItemManager.Instance;
            for (int i = 0; i < ItemManager.NumEntries; i++) {
                var item = manager.GetItem(i);
                comboItems.Items.Add((item == null) ? "Invalid" : item);
            }
            comboItems.SelectedIndex = dlc.Index;
            comboItems.AutoCompleteMode = AutoCompleteMode.Suggest;
            comboItems.AutoCompleteSource = AutoCompleteSource.ListItems;

            comboItems.SelectedIndexChanged += delegate {
                if ((string)comboItems.SelectedItem == "Invalid")
                    return;

                dlc.Index = (ushort)comboItems.SelectedIndex;
            };
        }
    }
}

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Downlitor
{
    public partial class ItemInfoControl : UserControl
    {
        public ItemInfoControl(DlcItem dlc)
        {
            InitializeComponent();

            var manager = ItemManager.Instance;
            for (int i = 0; i < ItemManager.NumEntries; i++) {
                var item = manager.GetItem(i);
                comboItems.Items.Add((item == null) ? "Invalid" : item + " (" + i.ToString("D3") + ")");
            }
            comboItems.SelectedIndex = dlc.Index;
            comboItems.AutoCompleteMode = AutoCompleteMode.Suggest;
            comboItems.AutoCompleteSource = AutoCompleteSource.ListItems;

            comboItems.SelectedIndexChanged += delegate {
                if ((string)comboItems.SelectedItem == "Invalid")
                    return;

                dlc.Index = (ushort)comboItems.SelectedIndex;
            };
        }
    }
}

Downlitor: Add item index for multiple items with same name


using RethinkDb.DatumConverters;

namespace RethinkDb.Newtonsoft.Configuration
{
    public class NewtonSerializer : AggregateDatumConverterFactory
    {
        public NewtonSerializer() : base(
            PrimitiveDatumConverterFactory.Instance,
            TupleDatumConverterFactory.Instance,
            AnonymousTypeDatumConverterFactory.Instance,
            BoundEnumDatumConverterFactory.Instance,
            NullableDatumConverterFactory.Instance,
            NamedValueDictionaryDatumConverterFactory.Instance,
            NewtonsoftDatumConverterFactory.Instance
        )
        {
        }
    }
}

using RethinkDb.DatumConverters;

namespace RethinkDb.Newtonsoft.Configuration
{
    public class NewtonSerializer : AggregateDatumConverterFactory
    {
        public NewtonSerializer() : base(
            PrimitiveDatumConverterFactory.Instance,
            TupleDatumConverterFactory.Instance,
            AnonymousTypeDatumConverterFactory.Instance,
            BoundEnumDatumConverterFactory.Instance,
            NullableDatumConverterFactory.Instance,
            NamedValueDictionaryDatumConverterFactory.Instance,
            CompoundIndexDatumConverterFactory.Instance,
            NewtonsoftDatumConverterFactory.Instance
        )
        {
        }
    }
}

Add support for compound index keys to newtonsoft


using System;
using System.Configuration;
using System.Linq;

namespace NBi.NUnit.Runtime
{
    public class NBiSection : ConfigurationSection
    {
        // Create a "remoteOnly" attribute.
        [ConfigurationProperty("testSuite", IsRequired = true)]
        public string TestSuiteFilename
        {
            get
            {
                return (string)this["testSuite"];
            }
            set
            {
                this["testSuite"] = value;
            }
        }

        // Create a "remoteOnly" attribute.
        [ConfigurationProperty("enableAutoCategories", IsRequired = false, DefaultValue=true)]
        public bool EnableAutoCategories
        {
            get
            {
                return (bool)this["enableAutoCategories"];
            }
            set
            {
                this["enableAutoCategories"] = value;
            }
        }

        // Create a "remoteOnly" attribute.
        [ConfigurationProperty("allowDtdProcessing", IsRequired = false, DefaultValue = false)]
        public bool AllowDtdProcessing
        {
            get
            {
                return (bool)this["allowDtdProcessing"];
            }
            set
            {
                this["allowDtdProcessing"] = value;
            }
        }
    }
}

using System;
using System.Configuration;
using System.Linq;

namespace NBi.NUnit.Runtime
{
    public class NBiSection : ConfigurationSection
    {
        // Create a "remoteOnly" attribute.
        [ConfigurationProperty("testSuite", IsRequired = true)]
        public string TestSuiteFilename
        {
            get
            {
                return (string)this["testSuite"];
            }
            set
            {
                this["testSuite"] = value;
            }
        }

        // Create a "remoteOnly" attribute.
        [ConfigurationProperty("settings", IsRequired = false)]
        public string SettingsFilename
        {
            get
            {
                return (string)this["settings"];
            }
            set
            {
                this["settings"] = value;
            }
        }

        // Create a "remoteOnly" attribute.
        [ConfigurationProperty("enableAutoCategories", IsRequired = false, DefaultValue=true)]
        public bool EnableAutoCategories
        {
            get
            {
                return (bool)this["enableAutoCategories"];
            }
            set
            {
                this["enableAutoCategories"] = value;
            }
        }

        // Create a "remoteOnly" attribute.
        [ConfigurationProperty("allowDtdProcessing", IsRequired = false, DefaultValue = false)]
        public bool AllowDtdProcessing
        {
            get
            {
                return (bool)this["allowDtdProcessing"];
            }
            set
            {
                this["allowDtdProcessing"] = value;
            }
        }
    }
}

Add placeholder in config file to load settings from an external file


using Common;
using System;

namespace Crayon
{
    internal class UsageDisplayWorker
    {
        private static readonly string USAGE = Util.JoinLines(
            "Usage:",
            "  crayon BUILD-FILE -target BUILD-TARGET-NAME [OPTIONS...]",
            "",
            "Flags:",
            "",
            "  -target            When a build file is specified, selects the",
            "                     target within that build file to build.",
            "",
            "  -vm                Output a standalone VM for a platform.",
            "",
            "  -vmdir             Directory to output the VM to (when -vm is",
            "                     specified).",
            "",
            "  -genDefaultProj    Generate a default boilerplate project to",
            "                     the current directory.",
            "",
            "  -genDefaultProjES  Generates a default project with ES locale.",
            "",
            "  -genDefaultProjJP  Generates a default project with JP locale.",
            "");

        public void DoWorkImpl()
        {
            Console.WriteLine(USAGE);
        }
    }
}

using Common;
using System;

namespace Crayon
{
    internal class UsageDisplayWorker
    {
        private static readonly string USAGE = Util.JoinLines(
            "Crayon version " + VersionInfo.VersionString,
            "",
            "To export:",
            "  crayon BUILD-FILE -target BUILD-TARGET-NAME [OPTIONS...]",
            "",
            "To run:",
            "  crayon BUILD-FILE [args...]",
            "",
            "Flags:",
            "",
            "  -target            When a build file is specified, selects the",
            "                     target within that build file to build.",
            "",
            "  -vm                Output a standalone VM for a platform.",
            "",
            "  -vmdir             Directory to output the VM to (when -vm is",
            "                     specified).",
            "",
            "  -genDefaultProj    Generate a default boilerplate project to",
            "                     the current directory.",
            "",
            "  -genDefaultProjES  Generates a default project with ES locale.",
            "",
            "  -genDefaultProjJP  Generates a default project with JP locale.",
            "",
            "  -showLibDepTree    Shows a dependency tree of the build.",
            "",
            "  -showLibStack      Stack traces will include libraries. By",
            "                     default, stack traces are truncated to only",
            "                     show user code.",
            "");

        public void DoWorkImpl()
        {
            Console.WriteLine(USAGE);
        }
    }
}

Update usage notes when crayon.exe is invoked without arguments.


using System.IO;
using System.Text.Json;

namespace AsmResolver.DotNet.Config.Json
{
    /// <summary>
    /// Represents the root object of a runtime configuration, stored in a *.runtimeconfig.json file.
    /// </summary>
    public class RuntimeConfiguration
    {
        private static readonly JsonSerializerOptions JsonSerializerOptions = new()
        {
            PropertyNamingPolicy = JsonNamingPolicy.CamelCase
        };

        /// <summary>
        /// Parses runtime configuration from a JSON file.
        /// </summary>
        /// <param name="path">The path to the runtime configuration file.</param>
        /// <returns>The parsed runtime configuration.</returns>
        public static RuntimeConfiguration FromFile(string path)
        {
            return FromJson(File.ReadAllText(path));
        }

        /// <summary>
        /// Parses runtime configuration from a JSON string.
        /// </summary>
        /// <param name="json">The raw json string configuration file.</param>
        /// <returns>The parsed runtime configuration.</returns>
        public static RuntimeConfiguration FromJson(string json)
        {
            return JsonSerializer.Deserialize<RuntimeConfiguration>(json, JsonSerializerOptions);
        }

        /// <summary>
        /// Gets or sets the runtime options.
        /// </summary>
        public RuntimeOptions RuntimeOptions
        {
            get;
            set;
        }
    }
}

using System.IO;
using System.Text.Json;

namespace AsmResolver.DotNet.Config.Json
{
    /// <summary>
    /// Represents the root object of a runtime configuration, stored in a *.runtimeconfig.json file.
    /// </summary>
    public class RuntimeConfiguration
    {
        private static readonly JsonSerializerOptions JsonSerializerOptions = new()
        {
            PropertyNamingPolicy = JsonNamingPolicy.CamelCase
        };

        /// <summary>
        /// Parses runtime configuration from a JSON file.
        /// </summary>
        /// <param name="path">The path to the runtime configuration file.</param>
        /// <returns>The parsed runtime configuration.</returns>
        public static RuntimeConfiguration FromFile(string path)
        {
            return FromJson(File.ReadAllText(path));
        }

        /// <summary>
        /// Parses runtime configuration from a JSON string.
        /// </summary>
        /// <param name="json">The raw json string configuration file.</param>
        /// <returns>The parsed runtime configuration.</returns>
        public static RuntimeConfiguration FromJson(string json)
        {
            return JsonSerializer.Deserialize<RuntimeConfiguration>(json, JsonSerializerOptions);
        }

        /// <summary>
        /// Gets or sets the runtime options.
        /// </summary>
        public RuntimeOptions RuntimeOptions
        {
            get;
            set;
        }

        /// <summary>
        /// Serializes the configuration to a JSON string.
        /// </summary>
        /// <returns>The JSON string.</returns>
        public string ToJson()
        {
            return JsonSerializer.Serialize(this, JsonSerializerOptions);
        }

        /// <summary>
        /// Writes the configuration to a file.
        /// </summary>
        /// <param name="path">The path to the JSON output file.</param>
        public void Write(string path)
        {
            File.WriteAllText(path, ToJson());
        }
    }
}

Add json serialization for runtime configuration.


using System;
using System.Reflection;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("Autofac.Integration.SignalR")]
[assembly: AssemblyDescription("Autofac ASP.NET SignalR Integration")]
[assembly: ComVisible(false)]
[assembly: CLSCompliant(false)]

using System;
using System.Reflection;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("Autofac.Integration.SignalR")]
[assembly: ComVisible(false)]
[assembly: CLSCompliant(false)]

Build script now writes the package name and version into the AssemblyDescription attibute. This allows the package information to be seen in Visual Studio avoiding confusion with the assembly version that remains at the major.


// 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.Threading;
using NUnit.Framework;
using osu.Framework.Audio;

namespace osu.Framework.Tests.Audio
{
    [TestFixture]
    public class AudioCollectionManagerTest
    {
        [Test]
        public void TestDisposalWhileItemsAreAddedDoesNotThrowInvalidOperationException()
        {
            var manager = new TestAudioCollectionManager();

            var threadExecutionFinished = new ManualResetEventSlim();
            var updateLoopStarted = new ManualResetEventSlim();

            // add a huge amount of items to the queue
            for (int i = 0; i < 10000; i++)
                manager.AddItem(new TestingAdjustableAudioComponent());

            // in a separate thread start processing the queue
            var thread = new Thread(() =>
            {
                while (!manager.IsDisposed)
                {
                    manager.Update();
                    updateLoopStarted.Set();
                }

                threadExecutionFinished.Set();
            });

            thread.Start();

            Assert.IsTrue(updateLoopStarted.Wait(10000));

            Assert.DoesNotThrow(() => manager.Dispose());

            Assert.IsTrue(threadExecutionFinished.Wait(10000));
        }

        private class TestAudioCollectionManager : AudioCollectionManager<AdjustableAudioComponent>
        {
            public new bool IsDisposed => base.IsDisposed;
        }

        private class TestingAdjustableAudioComponent : AdjustableAudioComponent
        {
        }
    }
}

// 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.Threading;
using NUnit.Framework;
using osu.Framework.Audio;

namespace osu.Framework.Tests.Audio
{
    [TestFixture]
    public class AudioCollectionManagerTest
    {
        [Test]
        public void TestDisposalWhileItemsAreAddedDoesNotThrowInvalidOperationException()
        {
            var manager = new TestAudioCollectionManager();

            var threadExecutionFinished = new ManualResetEventSlim();
            var updateLoopStarted = new ManualResetEventSlim();

            // add a huge amount of items to the queue
            for (int i = 0; i < 10000; i++)
                manager.AddItem(new TestingAdjustableAudioComponent());

            // in a separate thread start processing the queue
            var thread = new Thread(() =>
            {
                while (!manager.IsDisposed)
                {
                    updateLoopStarted.Set();
                    manager.Update();
                }

                threadExecutionFinished.Set();
            });

            thread.Start();

            Assert.IsTrue(updateLoopStarted.Wait(10000));

            Assert.DoesNotThrow(() => manager.Dispose());

            Assert.IsTrue(threadExecutionFinished.Wait(10000));
        }

        private class TestAudioCollectionManager : AudioCollectionManager<AdjustableAudioComponent>
        {
            public new bool IsDisposed => base.IsDisposed;
        }

        private class TestingAdjustableAudioComponent : AdjustableAudioComponent
        {
        }
    }
}

Fix test event ordering to correctly test fail case


// 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.

#nullable disable

using System.Linq;
using NUnit.Framework;
using osu.Game.Rulesets.Osu;
using osu.Game.Rulesets.Osu.Mods;
using osu.Game.Rulesets.UI;

namespace osu.Game.Tests.Visual.UserInterface
{
    public class TestSceneModIcon : OsuTestScene
    {
        [Test]
        public void TestChangeModType()
        {
            ModIcon icon = null;

            AddStep("create mod icon", () => Child = icon = new ModIcon(new OsuModDoubleTime()));
            AddStep("change mod", () => icon.Mod = new OsuModEasy());
        }

        [Test]
        public void TestInterfaceModType()
        {
            ModIcon icon = null;

            var ruleset = new OsuRuleset();

            AddStep("create mod icon", () => Child = icon = new ModIcon(ruleset.AllMods.First(m => m.Acronym == "DT")));
            AddStep("change mod", () => icon.Mod = ruleset.AllMods.First(m => m.Acronym == "EZ"));
        }
    }
}

// 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.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Osu;
using osu.Game.Rulesets.Osu.Mods;
using osu.Game.Rulesets.UI;

namespace osu.Game.Tests.Visual.UserInterface
{
    public class TestSceneModIcon : OsuTestScene
    {
        [Test]
        public void TestShowAllMods()
        {
            AddStep("create mod icons", () =>
            {
                Child = new FillFlowContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Direction = FillDirection.Full,
                    ChildrenEnumerable = Ruleset.Value.CreateInstance().CreateAllMods().Select(m => new ModIcon(m)),
                };
            });
        }

        [Test]
        public void TestChangeModType()
        {
            ModIcon icon = null!;

            AddStep("create mod icon", () => Child = icon = new ModIcon(new OsuModDoubleTime()));
            AddStep("change mod", () => icon.Mod = new OsuModEasy());
        }

        [Test]
        public void TestInterfaceModType()
        {
            ModIcon icon = null!;

            var ruleset = new OsuRuleset();

            AddStep("create mod icon", () => Child = icon = new ModIcon(ruleset.AllMods.First(m => m.Acronym == "DT")));
            AddStep("change mod", () => icon.Mod = ruleset.AllMods.First(m => m.Acronym == "EZ"));
        }
    }
}

Add test showing all mod icons for reference


using System.IO;
using System.Text;
using Moq;
using Xunit;

namespace AppHarbor.Tests
{
	public class ApplicationConfigurationTest
	{
		[Fact]
		public void ShouldReturnApplicationIdIfConfigurationFileExists()
		{
			var fileSystem = new Mock<IFileSystem>();
			var applicationName = "bar";

			var configurationFile = Path.GetFullPath(".appharbor");
			var stream = new MemoryStream(Encoding.Default.GetBytes(applicationName));

			fileSystem.Setup(x => x.OpenRead(configurationFile)).Returns(stream);

			var applicationConfiguration = new ApplicationConfiguration(fileSystem.Object);
			Assert.Equal(applicationName, applicationConfiguration.GetApplicationId());
		}
	}
}

using System.IO;
using System.Text;
using Moq;
using Xunit;

namespace AppHarbor.Tests
{
	public class ApplicationConfigurationTest
	{
		public static string ConfigurationFile = Path.GetFullPath(".appharbor");

		[Fact]
		public void ShouldReturnApplicationIdIfConfigurationFileExists()
		{
			var fileSystem = new Mock<IFileSystem>();
			var applicationName = "bar";

			var configurationFile = ConfigurationFile;
			var stream = new MemoryStream(Encoding.Default.GetBytes(applicationName));

			fileSystem.Setup(x => x.OpenRead(configurationFile)).Returns(stream);

			var applicationConfiguration = new ApplicationConfiguration(fileSystem.Object);
			Assert.Equal(applicationName, applicationConfiguration.GetApplicationId());
		}

		[Fact]
		public void ShouldThrowIfApplicationFileDoesNotExist()
		{
			var fileSystem = new InMemoryFileSystem();
			var applicationConfiguration = new ApplicationConfiguration(fileSystem);

			Assert.Throws<ApplicationConfigurationException>(() => applicationConfiguration.GetApplicationId());
		}
	}
}

Verify that an ApplicationConfigurationException is thrown if no configuration file exists


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

namespace Create.CSP.GitHub.Reporting.Entities
{
    public class AuthorizationToken
    {
        /// <summary>
        /// Captures when the token expires
        /// </summary>
        public DateTime ExpiresOn { get; set; }

        /// <summary>
        /// Access token
        /// </summary>
        public string AccessToken { get; private set; }

        /// <summary>
        /// Constructor for getting an authorization token
        /// </summary>
        /// <param name="access_Token">access token</param>
        /// <param name="expires_in">number of seconds the token is valid for</param>
        public AuthorizationToken(string access_Token, long expires_in)
        {
            this.AccessToken = access_Token;
            this.ExpiresOn = DateTime.UtcNow.AddSeconds(expires_in);
        }

        public AuthorizationToken(string accessToken, DateTime expiresOn)
        {
            this.AccessToken = accessToken;
            this.ExpiresOn = expiresOn.ToLocalTime();
        }

        /// <summary>
        /// Returns true if the authorization token is near expiracy.
        /// </summary>
        /// <returnsTtrue if the authorization token is near expiracy. False otherwise.</returns>
        public bool IsNearExpiracy()
        {
            //// if token is expiring in the next minute or expired, return true
            return DateTime.UtcNow > this.ExpiresOn.AddMinutes(-1);
        }
    }
}

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

namespace Create.CSP.GitHub.Reporting.Entities
{
    public class AuthorizationToken
    {
        /// <summary>
        /// Captures when the token expires
        /// </summary>
        public DateTime ExpiresOn { get; set; }

        /// <summary>
        /// Access token
        /// </summary>
        public string AccessToken { get; private set; }

        /// <summary>
        /// Constructor for getting an authorization token
        /// </summary>
        /// <param name="access_Token">access token</param>
        /// <param name="expires_in">number of seconds the token is valid for</param>
        public AuthorizationToken(string access_Token, long expires_in)
        {
            this.AccessToken = access_Token;
            this.ExpiresOn = DateTime.UtcNow.AddSeconds(expires_in);
        }

        public AuthorizationToken(string accessToken, DateTime expiresOn)
        {
            this.AccessToken = accessToken;
            this.ExpiresOn = expiresOn.ToLocalTime();
        }

        /// <summary>
        /// Returns true if the authorization token is near expiracy.
        /// </summary>
        /// <returnsTtrue if the authorization token is near expiracy. False otherwise.</returns>
        public bool IsNearExpiracy()
        {
            //// if token is expiring in the next minute or expired, return true
            return DateTime.UtcNow.ToLocalTime() > this.ExpiresOn.AddMinutes(-1);
        }
    }
}

Test IsNearExpiracy while converted ToLocalTime


using System.Threading.Tasks;
using Microsoft.AspNet.SignalR;
using System.Collections.Generic;
using WaveDev.ModelR.Models;
using System;
using System.Globalization;

namespace WaveDev.ModelR.Server
{
    public class ModelRHub : Hub
    {
        #region Private Fields

        private IList<SceneInfoModel> _scenes;

        #endregion

        #region Constructor

        public ModelRHub()
        {
            _scenes = new List<SceneInfoModel>
            {
                new SceneInfoModel { Id = Guid.NewGuid(), Name = "Scene 1", Description = "The first default scene at the server." },
                new SceneInfoModel { Id = Guid.NewGuid(), Name = "Scene 2", Description = "Just another scene." }
            };
        }

        #endregion

        #region Public Overrides

        public override Task OnConnected()
        {
            Console.WriteLine(string.Format(CultureInfo.CurrentUICulture, "Client '{0}' connected.", Context.ConnectionId));

            return base.OnConnected();
        }

        public override Task OnDisconnected(bool stopCalled)
        {
            Console.WriteLine(string.Format(CultureInfo.CurrentUICulture, "Client '{0}' disconnected.", Context.ConnectionId));

            return base.OnDisconnected(stopCalled);
        }

        #endregion

        #region Public Hub Methods

        public IEnumerable<SceneInfoModel> GetAvailableScenes()
        {
            return _scenes;
        }

        [Authorize]
        public void JoinSceneGroup(Guid sceneId)
        {

        }

        #endregion

    }
}

using System.Threading.Tasks;
using Microsoft.AspNet.SignalR;
using System.Collections.Generic;
using System;
using System.Globalization;
using WaveDev.ModelR.Shared.Models;

namespace WaveDev.ModelR.Server
{
    public class ModelRHub : Hub
    {
        #region Private Fields

        private IList<SceneInfoModel> _scenes;

        #endregion

        #region Constructor

        public ModelRHub()
        {
            _scenes = new List<SceneInfoModel>
            {
                new SceneInfoModel { Id = Guid.NewGuid(), Name = "Scene 1", Description = "The first default scene at the server." },
                new SceneInfoModel { Id = Guid.NewGuid(), Name = "Scene 2", Description = "Just another scene." }
            };
        }

        #endregion

        #region Public Overrides

        public override Task OnConnected()
        {
            Console.WriteLine(string.Format(CultureInfo.CurrentUICulture, "Client '{0}' connected.", Context.ConnectionId));

            return base.OnConnected();
        }

        public override Task OnDisconnected(bool stopCalled)
        {
            Console.WriteLine(string.Format(CultureInfo.CurrentUICulture, "Client '{0}' disconnected.", Context.ConnectionId));

            return base.OnDisconnected(stopCalled);
        }

        #endregion

        #region Public Hub Methods

        public IEnumerable<SceneInfoModel> GetAvailableScenes()
        {
            return _scenes;
        }

        [Authorize]
        public void JoinSceneGroup(Guid sceneId)
        {

        }

        [Authorize]
        public void CreateSceneObject()
        {

        }

        #endregion

    }
}

Add shared project for models for client-server communication.


using Alensia.Core.Locomotion;
using Alensia.Core.Sensor;
using UnityEngine;
using UnityEngine.Assertions;
using Zenject;

namespace Alensia.Core.Character
{
    public class Humanoid : Character<IBinocularVision, ILeggedLocomotion>, IHumanoid
    {
        public override Transform Head { get; }

        public override IBinocularVision Vision { get; }

        public override ILeggedLocomotion Locomotion { get; }

        public Humanoid(
            [InjectOptional] Race race,
            [InjectOptional] Sex sex,
            [InjectOptional] IBinocularVision vision,
            [InjectOptional] ILeggedLocomotion locomotion,
            Animator animator,
            Transform transform) : base(race, sex, animator, transform)
        {
            Assert.IsNotNull(vision, "vision != null");
            Assert.IsNotNull(locomotion, "locomotion != null");

            Head = GetBodyPart(HumanBodyBones.Head);

            Vision = vision;
            Locomotion = locomotion;
        }

        public Transform GetBodyPart(HumanBodyBones bone) => Animator.GetBoneTransform(bone);
    }
}

using Alensia.Core.Locomotion;
using Alensia.Core.Sensor;
using UnityEngine;
using UnityEngine.Assertions;
using Zenject;

namespace Alensia.Core.Character
{
    public class Humanoid : Character<IBinocularVision, ILeggedLocomotion>, IHumanoid
    {
        public override Transform Head { get; }

        public override IBinocularVision Vision { get; }

        public override ILeggedLocomotion Locomotion { get; }

        public Humanoid(
            [InjectOptional] Race race,
            [InjectOptional] Sex sex,
            IBinocularVision vision,
            ILeggedLocomotion locomotion,
            Animator animator,
            Transform transform) : base(race, sex, animator, transform)
        {
            Assert.IsNotNull(vision, "vision != null");
            Assert.IsNotNull(locomotion, "locomotion != null");

            Head = GetBodyPart(HumanBodyBones.Head);

            Vision = vision;
            Locomotion = locomotion;
        }

        public Transform GetBodyPart(HumanBodyBones bone) => Animator.GetBoneTransform(bone);
    }
}

Make vision and locomotion required on humanoids


//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.18033
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
[assembly: AssemblyConfiguration("Release built on 2013-02-22 14:39")]
[assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")]

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.18033
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
[assembly: AssemblyConfiguration("Release built on 2013-02-28 02:03")]
[assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")]

Build script now creates individual zip file packages to align with the NuGet packages and semantic versioning.


using UniRx;
using UnityEngine;
using UnityEngine.UI;

public class TogglePlayPresenter : MonoBehaviour
{
    [SerializeField]
    Button togglePlayButton;
    [SerializeField]
    Sprite iconPlay;
    [SerializeField]
    Sprite iconPause;

    NotesEditorModel model;

    void Awake()
    {
        model = NotesEditorModel.Instance;
        model.OnLoadedMusicObservable.First().Subscribe(_ => Init());
    }

    void Init()
    {
        togglePlayButton.OnClickAsObservable()
            .Subscribe(_ => model.IsPlaying.Value = !model.IsPlaying.Value);

        model.IsPlaying.DistinctUntilChanged().Subscribe(playing =>
        {
            var playButtonImage = togglePlayButton.GetComponent<Image>();

            if (playing)
            {
                model.Audio.Play();
                playButtonImage.sprite = iconPause;

            }
            else
            {
                model.Audio.Pause();
                playButtonImage.sprite = iconPlay;
            }
        });
    }
}

using UniRx;
using UniRx.Triggers;
using UnityEngine;
using UnityEngine.UI;

public class TogglePlayPresenter : MonoBehaviour
{
    [SerializeField]
    Button togglePlayButton;
    [SerializeField]
    Sprite iconPlay;
    [SerializeField]
    Sprite iconPause;

    NotesEditorModel model;

    void Awake()
    {
        model = NotesEditorModel.Instance;
        model.OnLoadedMusicObservable.First().Subscribe(_ => Init());
    }

    void Init()
    {
        this.UpdateAsObservable()
            .Where(_ => Input.GetKeyDown(KeyCode.Space))
            .Merge(togglePlayButton.OnClickAsObservable())
            .Subscribe(_ => model.IsPlaying.Value = !model.IsPlaying.Value);

        model.IsPlaying.DistinctUntilChanged().Subscribe(playing =>
        {
            var playButtonImage = togglePlayButton.GetComponent<Image>();

            if (playing)
            {
                model.Audio.Play();
                playButtonImage.sprite = iconPause;

            }
            else
            {
                model.Audio.Pause();
                playButtonImage.sprite = iconPlay;
            }
        });
    }
}

Add toggle play by keyboard input

Add toggle play by keyboard input


namespace PusherClient
{
    public enum ConnectionState
    {
        Initialized,
        Connecting,
        Connected,
        Unavailable,
        Disconnected,
        WaitingToReconnect
    }
}

namespace PusherClient
{
    public enum ConnectionState
    {
        Initialized,
        Connecting,
        Connected,
        Disconnected,
        WaitingToReconnect
    }
}

Remove unused `Unavailable` connection state


using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using System.Web.UI;
using AjaxControlToolkit;

// Dependency Attribute for assemblies
[assembly: DependencyAttribute("System.Web,", LoadHint.Always)]
[assembly: DependencyAttribute("System.Web.Ajax,", LoadHint.Always)]
[assembly: DependencyAttribute("System.Web.Extensions,", LoadHint.Always)]

[assembly: SecurityPermission(SecurityAction.RequestMinimum, Execution = true)]

[assembly: TagPrefix("AjaxControlToolkit", "asp")]

[assembly: AllowPartiallyTrustedCallers]
[assembly: ComVisible(false)]
[assembly: System.CLSCompliant(true)]
[assembly: AssemblyVersion("3.0.31106.*")]
[assembly: AssemblyFileVersion("3.0.31106.0")]
[assembly: NeutralResourcesLanguage("en-US")]

[assembly: ScriptCombine(ExcludeScripts = "Slider.SliderBehavior_resource.js")]

// CDN Path
// http[s]://ajax.microsoft.com/ajax/beta/0910/extended/*

using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using System.Web.UI;
using AjaxControlToolkit;

// Dependency Attribute for assemblies
[assembly: DependencyAttribute("System.Web,", LoadHint.Always)]
[assembly: DependencyAttribute("System.Web.Ajax,", LoadHint.Always)]
[assembly: DependencyAttribute("System.Web.Extensions,", LoadHint.Always)]

[assembly: SecurityPermission(SecurityAction.RequestMinimum, Execution = true)]

[assembly: TagPrefix("AjaxControlToolkit", "asp")]

[assembly: AllowPartiallyTrustedCallers]
[assembly: ComVisible(false)]
[assembly: System.CLSCompliant(true)]
[assembly: AssemblyVersion("3.0.31106.*")]
[assembly: AssemblyFileVersion("3.0.31106.0")]
[assembly: NeutralResourcesLanguage("en-US")]

[assembly: ScriptCombine(ExcludeScripts = "Slider.SliderBehavior_resource.js,Seadragon.Seadragon.Config.js")]

// CDN Path
// http[s]://ajax.microsoft.com/ajax/beta/0910/extended/*

Exclude Seadragon.config.js from combining because it does substitution.

--HG--
extra : convert_revision : svn%3Ae6b3c636-de15-0940-aca3-4844ac488b3a%4013


// 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 Microsoft.EntityFrameworkCore;
using osu.Framework.Platform;
using osu.Game.Database;

namespace osu.Game.Scoring
{
    public class ScoreStore : MutableDatabaseBackedStoreWithFileIncludes<ScoreInfo, ScoreFileInfo>
    {
        public ScoreStore(IDatabaseContextFactory factory, Storage storage)
            : base(factory, storage)
        {
        }

        protected override IQueryable<ScoreInfo> AddIncludesForConsumption(IQueryable<ScoreInfo> query)
            => base.AddIncludesForConsumption(query)
                   .Include(s => s.Beatmap)
                   .Include(s => s.Ruleset);
    }
}

// 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 Microsoft.EntityFrameworkCore;
using osu.Framework.Platform;
using osu.Game.Database;

namespace osu.Game.Scoring
{
    public class ScoreStore : MutableDatabaseBackedStoreWithFileIncludes<ScoreInfo, ScoreFileInfo>
    {
        public ScoreStore(IDatabaseContextFactory factory, Storage storage)
            : base(factory, storage)
        {
        }

        protected override IQueryable<ScoreInfo> AddIncludesForConsumption(IQueryable<ScoreInfo> query)
            => base.AddIncludesForConsumption(query)
                   .Include(s => s.Beatmap)
                   .Include(s => s.Beatmap).ThenInclude(b => b.Metadata)
                   .Include(s => s.Beatmap).ThenInclude(b => b.BeatmapSet).ThenInclude(s => s.Metadata)
                   .Include(s => s.Ruleset);
    }
}

Fix crash on local score display

Fix crash on local score display


using System;
using System.Threading;
using WebScriptHook.Framework;
using WebScriptHook.Framework.BuiltinPlugins;
using WebScriptHook.Terminal.Plugins;

namespace WebScriptHook.Terminal
{
    class Program
    {
        static WebScriptHookComponent wshComponent;

        static void Main(string[] args)
        {
            string componentName = "testbench"; //Guid.NewGuid().ToString();
            wshComponent = new WebScriptHookComponent(componentName, new RemoteSettings("ws", "localhost", "25555", "/componentws"));
            // Register custom plugins
            wshComponent.PluginManager.RegisterPlugin(new Echo());
            wshComponent.PluginManager.RegisterPlugin(new PluginList());
            wshComponent.PluginManager.RegisterPlugin(new PrintToScreen());
            // Start WSH component
            wshComponent.Start();

            // Print all registered plugins
            Console.WriteLine("Registered plugins on \"" + wshComponent.Name + "\":");
            var pluginIDs = wshComponent.PluginManager.PluginIDs;
            foreach (var pluginID in pluginIDs)
            {
                Console.WriteLine(pluginID);
            }

            // TODO: Use a timer instead of Sleep
            while (true)
            {
                wshComponent.Update();
                Thread.Sleep(20);
            }
        }
    }
}

using System;
using System.Threading;
using WebScriptHook.Framework;
using WebScriptHook.Framework.BuiltinPlugins;
using WebScriptHook.Terminal.Plugins;

namespace WebScriptHook.Terminal
{
    class Program
    {
        static WebScriptHookComponent wshComponent;

        static void Main(string[] args)
        {
            string componentName = Guid.NewGuid().ToString();
            wshComponent = new WebScriptHookComponent(componentName, new RemoteSettings("ws", "localhost", "25555", "/componentws"));
            // Register custom plugins
            wshComponent.PluginManager.RegisterPlugin(new Echo());
            wshComponent.PluginManager.RegisterPlugin(new PluginList());
            wshComponent.PluginManager.RegisterPlugin(new PrintToScreen());
            // Start WSH component
            wshComponent.Start();

            // Print all registered plugins
            Console.WriteLine("Registered plugins on \"" + wshComponent.Name + "\":");
            var pluginIDs = wshComponent.PluginManager.PluginIDs;
            foreach (var pluginID in pluginIDs)
            {
                Console.WriteLine(pluginID);
            }

            // TODO: Use a timer instead of Sleep
            while (true)
            {
                wshComponent.Update();
                Thread.Sleep(20);
            }
        }
    }
}

Use GUID for component name

Use GUID for component name


using Dapper;
using RapidCore.Migration;
using RapidCore.PostgreSql.Internal;
using System.Threading.Tasks;

namespace RapidCore.PostgreSql.Migration.Internal
{
    public static class PostgreSqlSchemaCreator
    {
        public static async Task CreateSchemaIfNotExists(IMigrationContext context)
        {
            var db = ((PostgreSqlMigrationContext)context).ConnectionProvider.Default(); ;
            await db.ExecuteAsync($@"CREATE TABLE IF NOT EXISTS {PostgreSqlConstants.MigrationInfoTableName} (
                                    id serial not null
                                    constraint migrationinfo_pkey
                                    primary key,
                                    Name varchar(255) unique,
                                    MigrationCompleted boolean,
                                    TotalMigrationTimeInMs int8,
                                    CompletedAtUtc timestamp
                                    );");

            await db.ExecuteAsync($@"CREATE TABLE IF NOT EXISTS {PostgreSqlConstants.CompletedStepsTableName} (
                                        StepName varchar(255),
                                        MigrationInfoId integer references {
                    PostgreSqlConstants.MigrationInfoTableName
                } (id),
                                        unique (StepName, MigrationInfoId)
                                    );");
        }

    }
}

using Dapper;
using RapidCore.Migration;
using RapidCore.PostgreSql.Internal;
using System.Threading.Tasks;

namespace RapidCore.PostgreSql.Migration.Internal
{
    public static class PostgreSqlSchemaCreator
    {
        public static async Task CreateSchemaIfNotExists(IMigrationContext context)
        {
            var db = ((PostgreSqlMigrationContext)context).ConnectionProvider.Default(); ;
            await db.ExecuteAsync($@"CREATE TABLE IF NOT EXISTS {PostgreSqlConstants.MigrationInfoTableName} (
                                    id serial not null
                                    constraint migrationinfo_pkey
                                    primary key,
                                    Name varchar(255) unique,
                                    MigrationCompleted boolean,
                                    TotalMigrationTimeInMs int8,
                                    CompletedAtUtc timestamp
                                    );");

            await db.ExecuteAsync($@"CREATE TABLE IF NOT EXISTS {PostgreSqlConstants.CompletedStepsTableName} (
                                        StepName varchar(255),
                                        MigrationInfoId integer references {
                    PostgreSqlConstants.MigrationInfoTableName
                } (id),
                                        PRIMARY KEY (StepName, MigrationInfoId)
                                    );");
        }

    }
}

Add primary key to completed steps db table


using System.Windows;
using System.Windows.Controls;

namespace BindingTest.Control
{
    public partial class CheckboxControl : UserControl
    {
        public bool Checked
        {
            get { return (bool)GetValue(CheckboxProperty); }
            set
            {
                SetValue(CheckboxProperty, value);
                _CheckBox.IsChecked = value;
            }
        }

        public static readonly DependencyProperty CheckboxProperty = DependencyProperty.Register(
            "Checked",
            typeof(bool),
            typeof(CheckboxControl),
            new PropertyMetadata(new PropertyChangedCallback(CheckboxControl.StateChanged)));

        private static void StateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            (d as CheckboxControl).Checked = (bool)e.NewValue;
        }

        public CheckboxControl()
        {
            InitializeComponent();
        }

        private void _CheckBox_Checked(object sender, RoutedEventArgs e)
        {
            this.Checked = (bool)(sender as CheckBox).IsChecked;
        }

        private void _CheckBox_Unchecked(object sender, RoutedEventArgs e)
        {
            this.Checked = (bool)(sender as CheckBox).IsChecked;
        }
    }
}

using System.Windows;
using System.Windows.Controls;

namespace BindingTest.Control
{
    public partial class CheckboxControl : UserControl
    {
        public bool Checked
        {
            get { return (bool)GetValue(CheckboxProperty); }
            set
            {
                SetValue(CheckboxProperty, value);
                _CheckBox.IsChecked = value;
            }
        }

        public static readonly DependencyProperty CheckboxProperty = DependencyProperty.Register(
            "Checked",
            typeof(bool),
            typeof(CheckboxControl),
            new PropertyMetadata(false, new PropertyChangedCallback(CheckboxControl.StateChanged)));

        private static void StateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            (d as CheckboxControl).Checked = (bool)e.NewValue;
        }

        public CheckboxControl()
        {
            InitializeComponent();
        }

        private void _CheckBox_Checked(object sender, RoutedEventArgs e)
        {
            this.Checked = (bool)(sender as CheckBox).IsChecked;
        }

        private void _CheckBox_Unchecked(object sender, RoutedEventArgs e)
        {
            this.Checked = (bool)(sender as CheckBox).IsChecked;
        }
    }
}

Set default value to PropertyMetadata

Set default value to PropertyMetadata


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace TribalWars.Controls
{
    /// <summary>
    /// Adds addings time functionality to the TimeConverterControl
    /// </summary>
    public partial class TimeConverterCalculatorControl : UserControl
    {
        #region Constructors
        public TimeConverterCalculatorControl()
        {
            InitializeComponent();
        }
        #endregion

        #region Event Handlers
        /// <summary>
        /// Adds the time to the original date value
        /// </summary>
        private void AddTime_Click(object sender, EventArgs e)
        {
            if (ToAdd.Value.Hour == 0 && ToAdd.Value.Minute == 0 && ToAdd.Value.Second == 0)
            {
                MessageBox.Show("Specify the time in the right box (format: HH:MM:SS (hours, minutes, seconds)) to be added to the time in the box left." + Environment.NewLine + "This can be handy when you need to calculate the time to send your troops.");
            }
            else
            {
                TimeSpan span = new TimeSpan(ToAdd.Value.Hour, ToAdd.Value.Minute, ToAdd.Value.Second);
                TimeConverter.Value = TimeConverter.Value.Add(span);
            }
        }
        #endregion
    }
}

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace TribalWars.Controls
{
    /// <summary>
    /// Adds addings time functionality to the TimeConverterControl
    /// </summary>
    public partial class TimeConverterCalculatorControl : UserControl
    {
        #region Constructors
        public TimeConverterCalculatorControl()
        {
            InitializeComponent();
        }
        #endregion

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            TimeConverter.Value = DateTime.Today;
        }

        #region Event Handlers
        /// <summary>
        /// Adds the time to the original date value
        /// </summary>
        private void AddTime_Click(object sender, EventArgs e)
        {
            if (ToAdd.Value.Hour == 0 && ToAdd.Value.Minute == 0 && ToAdd.Value.Second == 0)
            {
                MessageBox.Show("Specify the time in the right box (format: HH:MM:SS (hours, minutes, seconds)) to be added to the time in the box left." + Environment.NewLine + "This can be handy when you need to calculate the time to send your troops.");
            }
            else
            {
                var span = new TimeSpan(ToAdd.Value.Hour, ToAdd.Value.Minute, ToAdd.Value.Second);
                TimeConverter.Value = TimeConverter.Value.Add(span);
            }
        }
        #endregion
    }
}

Set today as default value

TImeConverterControl: Set today as default value


// 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.Graphics;
using osu.Framework.Graphics.Containers;
using osuTK;
using osuTK.Graphics;
using osu.Framework.Graphics.Shapes;

namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{
    public class RingPiece : CircularContainer
    {
        public RingPiece()
        {
            Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2);

            Anchor = Anchor.Centre;
            Origin = Anchor.Centre;

            Masking = true;
            BorderThickness = 10;
            BorderColour = Color4.White;

            Child = new Box
            {
                AlwaysPresent = true,
                Alpha = 0,
                RelativeSizeAxes = Axes.Both
            };
        }
    }
}

// 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.Graphics;
using osu.Framework.Graphics.Containers;
using osuTK;
using osuTK.Graphics;
using osu.Framework.Graphics.Shapes;

namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{
    public class RingPiece : CircularContainer
    {
        public RingPiece()
        {
            Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2);

            Anchor = Anchor.Centre;
            Origin = Anchor.Centre;

            Masking = true;
            BorderThickness = 9; // roughly matches slider borders and makes stacked circles distinctly visible from each other.
            BorderColour = Color4.White;

            Child = new Box
            {
                AlwaysPresent = true,
                Alpha = 0,
                RelativeSizeAxes = Axes.Both
            };
        }
    }
}

Make stacked hitcircles more visible when using default skin


using System.IO;
using System.Linq;
using OmniSharp.Cake.Configuration;

namespace OmniSharp.Cake.Services
{
    internal static class ScriptGenerationToolResolver
    {
        public static string GetExecutablePath(string rootPath, ICakeConfiguration configuration)
        {
            var toolPath = GetToolPath(rootPath, configuration);

            if (!Directory.Exists(toolPath))
            {
                return string.Empty;
            }

            var bakeryPath = GetLatestBakeryPath(toolPath);

            if (bakeryPath == null)
            {
                return string.Empty;
            }

            return Path.Combine(toolPath, bakeryPath, "tools", "Cake.Bakery.exe");
        }

        private static string GetToolPath(string rootPath, ICakeConfiguration configuration)
        {
            var toolPath = configuration.GetValue(Constants.Paths.Tools);
            return Path.Combine(rootPath, !string.IsNullOrWhiteSpace(toolPath) ? toolPath : "tools");
        }

        private static string GetLatestBakeryPath(string toolPath)
        {
            var directories = Directory.GetDirectories(toolPath, "cake.bakery*", SearchOption.TopDirectoryOnly);

            // TODO: Sort by semantic version?
            return directories.OrderByDescending(x => x).FirstOrDefault();
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using OmniSharp.Cake.Configuration;

namespace OmniSharp.Cake.Services
{
    internal static class ScriptGenerationToolResolver
    {
        public static string GetExecutablePath(string rootPath, ICakeConfiguration configuration)
        {
            var toolPath = GetToolPath(rootPath, configuration);

            if (!Directory.Exists(toolPath))
            {
                return string.Empty;
            }

            var bakeryPath = GetLatestBakeryPath(toolPath);

            if (bakeryPath == null)
            {
                return string.Empty;
            }

            return Path.Combine(toolPath, bakeryPath, "tools", "Cake.Bakery.exe");
        }

        private static string GetToolPath(string rootPath, ICakeConfiguration configuration)
        {
            var toolPath = configuration.GetValue(Constants.Paths.Tools);
            return Path.Combine(rootPath, !string.IsNullOrWhiteSpace(toolPath) ? toolPath : "tools");
        }

        private static string GetLatestBakeryPath(string toolPath)
        {
            var directories = GetBakeryPaths(toolPath);

            // TODO: Sort by semantic version?
            return directories.OrderByDescending(x => x).FirstOrDefault();
        }

        private static IEnumerable<string> GetBakeryPaths(string toolPath)
        {
            foreach (var directory in Directory.EnumerateDirectories(toolPath))
            {
                var topDirectory = directory.Split(Path.DirectorySeparatorChar).Last();
                if (topDirectory.StartsWith("cake.bakery", StringComparison.OrdinalIgnoreCase))
                {
                    yield return topDirectory;
                }
            }
        }

    }
}

Make Cake Bakery resolution case insensitive


using System;
using PortableRazor;

namespace PortableCongress
{
	public class PoliticianController
	{
		IHybridWebView webView;
	    IDataAccess dataAccess;

		public PoliticianController (IHybridWebView webView, IDataAccess dataAccess)
		{
			this.webView = webView;
			this.dataAccess = dataAccess;
		}

		public void ShowPoliticianList() {
			var list = dataAccess.LoadAllPoliticans ();

			var template = new PoliticianList () { Model = list };
			var page = template.GenerateString ();

			webView.LoadHtmlString (page);
		}

		public Politician ShowPoliticianView(int id) {
			var politician = dataAccess.LoadPolitician (id);

			var template = new PoliticianView () { Model = politician };
			var page = template.GenerateString ();

			webView.LoadHtmlString (page);
			return politician;
		}

		public async void ShowRecentVotes(int id) {
			//var votes = dataAccess.LoadRecentVotes (id);
			var votes = await WebAccess.GetRecentVotesAsync (id);

			var template = new RecentVotesList () { Model = votes };
			var page = template.GenerateString ();

			webView.LoadHtmlString (page);
		}
	}
}

using System;
using PortableRazor;

namespace PortableCongress
{
	public class PoliticianController
	{
		IHybridWebView webView;
	    IDataAccess dataAccess;

		public PoliticianController (IHybridWebView webView, IDataAccess dataAccess)
		{
			this.webView = webView;
			this.dataAccess = dataAccess;
		}

		public void ShowPoliticianList() {
			var list = dataAccess.LoadAllPoliticans ();

			var template = new PoliticianList () { Model = list };
			var page = template.GenerateString ();

			webView.LoadHtmlString (page);
		}

		public Politician ShowPoliticianView(int id) {
			var politician = dataAccess.LoadPolitician (id);

			var template = new PoliticianView () { Model = politician };
			var page = template.GenerateString ();

			webView.LoadHtmlString (page);
			return politician;
		}

		public async void ShowRecentVotes(int id) {
			webView.EvaluateJavascript ("$.mobile.loading( 'show', {\n  text: 'Loading Recent Votes ...',\n  " +
				"textVisible: 'false',\n  theme: 'b',\n  textonly: 'false' });");

			var votes = await WebAccess.GetRecentVotesAsync (id);

			var template = new RecentVotesList () { Model = votes };
			var page = template.GenerateString ();

			webView.LoadHtmlString (page);
		}
	}
}

Add jQuery mobile loader widget

Add jQuery mobile loader widget


using System.Reflection;

#if XAMMAC2
[assembly: AssemblyTitle("Eto.Forms - Xamarin.Mac v2.0 Platform")]
[assembly: AssemblyDescription("OS X Platform for the Eto.Forms UI Framework using Xamarin.Mac v2.0")]
#elif XAMMAC
[assembly: AssemblyTitle("Eto.Forms - Xamarin.Mac Platform")]
[assembly: AssemblyDescription("OS X Platform for the Eto.Forms UI Framework using Xamarin.Mac")]
#elif Mac64
[assembly: AssemblyTitle("Eto.Forms - MonoMac Platform")]
[assembly: AssemblyDescription("OS X Platform for the Eto.Forms UI Framework using the open-source MonoMac")]
#else
[assembly: AssemblyTitle("Eto.Forms - MonoMac 64-bit Platform")]
[assembly: AssemblyDescription("OS X Platform for the Eto.Forms UI Framework using the open-source MonoMac with 64-bit mono")]
#endif

using System.Reflection;

#if XAMMAC2
[assembly: AssemblyTitle("Eto.Forms - Xamarin.Mac v2.0 Platform")]
[assembly: AssemblyDescription("OS X Platform for the Eto.Forms UI Framework using Xamarin.Mac v2.0")]
#elif XAMMAC
[assembly: AssemblyTitle("Eto.Forms - Xamarin.Mac Platform")]
[assembly: AssemblyDescription("OS X Platform for the Eto.Forms UI Framework using Xamarin.Mac")]
#elif Mac64
[assembly: AssemblyTitle("Eto.Forms - MonoMac 64-bit Platform")]
[assembly: AssemblyDescription("OS X Platform for the Eto.Forms UI Framework using the open-source MonoMac with 64-bit mono")]
#else
[assembly: AssemblyTitle("Eto.Forms - MonoMac Platform")]
[assembly: AssemblyDescription("OS X Platform for the Eto.Forms UI Framework using the open-source MonoMac")]
#endif

Fix naming of MonoMac vs MonoMac 64-bit platform


using System.Linq;
using System.Text.RegularExpressions;

namespace Inscribe.Text
{
    public static class TweetTextCounter
    {
        public static int Count(string input)
        {
            // URL is MAX 20 Chars (if URL has HTTPS scheme, URL is MAX 21 Chars)
            int prevIndex = 0;
            int totalCount = 0;
            foreach (var m in RegularExpressions.UrlRegex.Matches(input).OfType<Match>())
            {
                totalCount += m.Index - prevIndex;
                prevIndex = m.Index + m.Groups[0].Value.Length;

                bool isHasHttpsScheme = m.Groups[0].Value.Contains("https");

                if (m.Groups[0].Value.Length < TwitterDefine.UrlMaxLength + ((isHasHttpsScheme) ? 1 : 0))
                    totalCount += m.Groups[0].Value.Length;
                else
                    totalCount += TwitterDefine.UrlMaxLength + ((isHasHttpsScheme) ? 1 : 0);
            }
            totalCount += input.Length - prevIndex;
            return totalCount;
        }
    }
}

using System.Linq;
using System.Text.RegularExpressions;

namespace Inscribe.Text
{
    public static class TweetTextCounter
    {
        public static int Count(string input)
        {
            // Input maybe contains CRLF as a new line, but twitter converts CRLF to LF.
            // It means CRLF should be treat as one charator.
            string inputCRLFProcessed = input.Replace(System.Environment.NewLine, "\n");

            // URL is MAX 20 Chars (if URL has HTTPS scheme, URL is MAX 21 Chars)
            int prevIndex = 0;
            int totalCount = 0;
            foreach (var m in RegularExpressions.UrlRegex.Matches(inputCRLFProcessed).OfType<Match>())
            {
                totalCount += m.Index - prevIndex;
                prevIndex = m.Index + m.Groups[0].Value.Length;

                bool isHasHttpsScheme = m.Groups[0].Value.Contains("https");

                if (m.Groups[0].Value.Length < TwitterDefine.UrlMaxLength + ((isHasHttpsScheme) ? 1 : 0))
                    totalCount += m.Groups[0].Value.Length;
                else
                    totalCount += TwitterDefine.UrlMaxLength + ((isHasHttpsScheme) ? 1 : 0);
            }
            totalCount += inputCRLFProcessed.Length - prevIndex;
            return totalCount;
        }
    }
}

Fix issue of wrong counting characters if a text contains newline

Fix it by replacing CRLF to LF.

Because WPF text control recognize CRLF as a new line, the new line has
two characters (\r\n). But twitter converts CRLF to LF so that one new
lines should be treated as "one" character.

Some people insist using @"\n" instead of "\n" at specifying LF.
However, @"\n" doesn't work well in the test. Thus "\n" are used.


using SFA.DAS.Authorization;
using System;
using System.Linq;
using System.Linq.Expressions;
using System.Web.Mvc;

namespace SFA.DAS.EmployerAccounts.Web.Extensions
{
    public static class HtmlHelperExtensions
    {
        public static MvcHtmlString CommaSeperatedAddressToHtml(this HtmlHelper htmlHelper, string commaSeperatedAddress)
        {
            var htmlAddress = commaSeperatedAddress.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
                .Select(line => $"{line.Trim()}<br/>")
                .Aggregate("", (x, y) => x + y);

            return new MvcHtmlString(htmlAddress);
        }

        public static AuthorizationResult GetAuthorizationResult(this HtmlHelper htmlHelper, FeatureType featureType)
        {
            var authorisationService = DependencyResolver.Current.GetService<IAuthorizationService>();
            var authorizationResult = authorisationService.GetAuthorizationResult(featureType);

            return authorizationResult;
        }

        public static bool IsValid<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression)
        {
            var partialFieldName = ExpressionHelper.GetExpressionText(expression);
            var fullHtmlFieldName = htmlHelper.ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldName(partialFieldName);

            if (htmlHelper.ViewData.ModelState.ContainsKey(fullHtmlFieldName))
            {
                var modelState = htmlHelper.ViewData.ModelState[fullHtmlFieldName];
                var errors = modelState?.Errors;

                if (errors != null && errors.Any())
                {
                    return false;
                }
            }

            return true;
        }

        public static bool ViewExists(this HtmlHelper html, string viewName)
        {
            var controllerContext = html.ViewContext.Controller.ControllerContext;
            var result = ViewEngines.Engines.FindView(controllerContext, viewName, null);

            return result.View != null;
        }
    }
}

using SFA.DAS.Authorization;
using System;
using System.Linq;
using System.Web.Mvc;

namespace SFA.DAS.EmployerAccounts.Web.Extensions
{
    public static class HtmlHelperExtensions
    {
        public static MvcHtmlString CommaSeperatedAddressToHtml(this HtmlHelper htmlHelper, string commaSeperatedAddress)
        {
            var htmlAddress = commaSeperatedAddress.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
                .Select(line => $"{line.Trim()}<br/>")
                .Aggregate("", (x, y) => x + y);

            return new MvcHtmlString(htmlAddress);
        }

        public static AuthorizationResult GetAuthorizationResult(this HtmlHelper htmlHelper, FeatureType featureType)
        {
            var authorisationService = DependencyResolver.Current.GetService<IAuthorizationService>();
            var authorizationResult = authorisationService.GetAuthorizationResult(featureType);

            return authorizationResult;
        }

        public static bool ViewExists(this HtmlHelper html, string viewName)
        {
            var controllerContext = html.ViewContext.Controller.ControllerContext;
            var result = ViewEngines.Engines.FindView(controllerContext, viewName, null);

            return result.View != null;
        }
    }
}

Fix bug by removing duplicate code

Fix bug by removing duplicate code


/* Empiria Extensions Framework ******************************************************************************
*                                                                                *
*  Module   : Empiria Web Api                              Component : Base controllers                      *
*  Assembly : Empiria.WebApi.dll                           Pattern   : Web Api Controller                    *
*  Type     : ServiceDirectoryController                   License   : Please read LICENSE.txt file          *
*                                                                                *
*  Summary  : Web api methods to get information about the web service directory.                            *
*                                                                                *
************************* Copyright(c) La Vía Óntica SC, Ontica LLC and contributors. All rights reserved. **/
using System;
using System.Web.Http;

using Empiria.Security;

namespace Empiria.WebApi.Controllers {

  /// Web api methods to get information about the web service directory.
  public class ServiceDirectoryController : WebApiController {

    #region Public APIs

    /// Gets a list of available web services in the context of the client application.
    /// <returns>A list of services as instances of the type ServiceDirectoryItem.</returns>
    [HttpGet, AllowAnonymous]
    [Route("v1/system/service-directory")]
    public CollectionModel GetServiceDirectory() {
      try {
        ClientApplication clientApplication = base.GetClientApplication();

        var services = ServiceDirectoryItem.GetList(clientApplication);

        return new CollectionModel(base.Request, services);
      } catch (Exception e) {
        throw base.CreateHttpException(e);
      }
    }

    #endregion Public APIs

  }  // class ServiceDirectoryController

}  // namespace Empiria.WebApi.Controllers

/* Empiria Extensions Framework ******************************************************************************
*                                                                                *
*  Module   : Empiria Web Api                              Component : Base controllers                      *
*  Assembly : Empiria.WebApi.dll                           Pattern   : Web Api Controller                    *
*  Type     : ServiceDirectoryController                   License   : Please read LICENSE.txt file          *
*                                                                                *
*  Summary  : Web api methods to get information about the web service directory.                            *
*                                                                                *
************************* Copyright(c) La Vía Óntica SC, Ontica LLC and contributors. All rights reserved. **/
using System;
using System.Web.Http;

using Empiria.Security;

namespace Empiria.WebApi.Controllers {

  /// Web api methods to get information about the web service directory.
  public class ServiceDirectoryController : WebApiController {

    #region Public APIs

    /// Gets a list of available web services in the context of the client application.
    /// <returns>A list of services as instances of the type ServiceDirectoryItem.</returns>
    [HttpGet, AllowAnonymous]
    [Route("v1/system/service-directory")]
    public CollectionModel GetServiceDirectory() {
      try {
        ClientApplication clientApplication = base.GetClientApplication();

        var endpointsList = EndpointConfig.GetList(clientApplication);

        return new CollectionModel(base.Request, endpointsList);
      } catch (Exception e) {
        throw base.CreateHttpException(e);
      }
    }

    #endregion Public APIs

  }  // class ServiceDirectoryController

}  // namespace Empiria.WebApi.Controllers

Update GetServiceDirectory() API to use EndpointConfig


using System.Drawing;
using MonoHaven.Graphics;

namespace MonoHaven.UI
{
	public class Label : Widget
	{
		private string text;
		private readonly TextBlock textBlock;

		public Label(Widget parent)
			: base(parent)
		{
			textBlock = new TextBlock(Fonts.Default);
		}

		public string Text
		{
			get { return text; }
			set
			{
				text = value;
				textBlock.Clear();
				textBlock.Append(text);
			}
		}

		public TextAlign TextAlign
		{
			get { return textBlock.TextAlign; }
			set { textBlock.TextAlign = value; }
		}

		public Color TextColor
		{
			get { return textBlock.TextColor; }
			set { textBlock.TextColor = value; }
		}

		protected override void OnDraw(DrawingContext dc)
		{
			dc.Draw(textBlock, 0, 0, Width, Height);
		}
	}
}

using System.Drawing;
using MonoHaven.Graphics;

namespace MonoHaven.UI
{
	public class Label : Widget
	{
		private string text;
		private readonly TextBlock textBlock;

		public Label(Widget parent, SpriteFont font) : base(parent)
		{
			textBlock = new TextBlock(font);
			textBlock.TextColor = Color.White;
			SetSize(0, font.Height);
		}

		public Label(Widget parent) : this(parent, Fonts.Default)
		{
		}

		public string Text
		{
			get { return text; }
			set
			{
				text = value;
				textBlock.Clear();
				textBlock.Append(text);
			}
		}

		public TextAlign TextAlign
		{
			get { return textBlock.TextAlign; }
			set { textBlock.TextAlign = value; }
		}

		public Color TextColor
		{
			get { return textBlock.TextColor; }
			set { textBlock.TextColor = value; }
		}

		protected override void OnDraw(DrawingContext dc)
		{
			dc.Draw(textBlock, 0, 0, Width, Height);
		}
	}
}

Allow to specify font in the label constructor


using System;
using Arkivverket.Arkade.Tests;

namespace Arkivverket.Arkade.Core.Addml.Processes
{
    public class AnalyseFindMinMaxValues : IAddmlProcess
    {
        public const string Name = "Analyse_FindMinMaxValues";
        private readonly TestRun _testRun;
        private int? _minValue;
        private int? _maxValue;

        public AnalyseFindMinMaxValues()
        {
            _testRun = new TestRun(Name, TestType.Content);
        }

        public string GetName()
        {
            return Name;
        }

        public void Run(FlatFile flatFile)
        {
        }

        public void Run(Record record)
        {
        }

        public TestRun GetTestRun()
        {
            return _testRun;
        }

        public void EndOfFile()
        {
            string minValueString = _minValue?.ToString() ?? "<no value>";
            string maxValueString = _maxValue?.ToString() ?? "<no value>";

            _testRun.Add(new TestResult(ResultType.Success,
                $"MinValue ({minValueString}). MaxValue {maxValueString}."));
        }

        public void Run(Field field)
        {
            // TODO: Use type to decide wether field is int?
            // field.Definition.GetType()

            try
            {
                int value = int.Parse(field.Value);

                if (!_maxValue.HasValue || value > _maxValue)
                {
                    _maxValue = value;
                }

                if (!_minValue.HasValue || value < _minValue)
                {
                    _minValue = value;
                }
            }
            catch (FormatException e)
            {
                // ignore
            }
        }
    }
}

using System;
using Arkivverket.Arkade.Tests;

namespace Arkivverket.Arkade.Core.Addml.Processes
{
    public class AnalyseFindMinMaxValues : IAddmlProcess
    {
        public const string Name = "Analyse_FindMinMaxValues";
        private readonly TestRun _testRun;
        private int? _minValue;
        private int? _maxValue;

        public AnalyseFindMinMaxValues()
        {
            _testRun = new TestRun(Name, TestType.Content);
        }

        public string GetName()
        {
            return Name;
        }

        public void Run(FlatFile flatFile)
        {
        }

        public void Run(Record record)
        {
        }

        public TestRun GetTestRun()
        {
            return _testRun;
        }

        public void EndOfFile()
        {
            string minValueString = _minValue?.ToString() ?? "<no value>";
            string maxValueString = _maxValue?.ToString() ?? "<no value>";

            _testRun.Add(new TestResult(ResultType.Success,
                $"MinValue ({minValueString}). MaxValue {maxValueString}."));
        }

        public void Run(Field field)
        {
            // TODO: Use type to decide wether field is int?
            // field.Definition.GetType()

            int value;

            if (!int.TryParse(field.Value, out value))
                return;

            if (!_maxValue.HasValue || value > _maxValue)
            {
                _maxValue = value;
            }

            if (!_minValue.HasValue || value < _minValue)
            {
                _minValue = value;
            }
        }
    }
}

Refactor process to remove FormatException from trace log


@model Orc.CheckForUpdate.Web.Models.VersionsViewModel

@{
    ViewBag.Title = "Index";
}

@section additionalstyles
{
    @Styles.Render("~/Content/css/downloads")
}

Releases

    @{
        Html.RenderPartial("ReleasesList", Model);
    }

@model Orc.CheckForUpdate.Web.Models.VersionsViewModel

@{
    ViewBag.Title = "Index";
}

@section additionalstyles
{
    @Styles.Render("~/Content/css/releases")
}

Releases

    @{
        Html.RenderPartial("ReleasesList", Model);
    }

Fix styling for users download page

Fix styling for users download page


using EasyRabbitMQ.Configuration;
using RabbitMQ.Client;

namespace EasyRabbitMQ.Infrastructure
{
    internal class ConnectionFactory : IConnectionFactory
    {
        private readonly IConfiguration _configuration;

        public ConnectionFactory(IConfiguration configuration)
        {
            _configuration = configuration;
        }

        public IConnection CreateConnection()
        {
            var factory = new RabbitMQ.Client.ConnectionFactory
            {
                Uri = _configuration.ConnectionString,
                AutomaticRecoveryEnabled = true
            };

            var connection = factory.CreateConnection();

            return connection;
        }
    }
}

using EasyRabbitMQ.Configuration;
using RabbitMQ.Client;

namespace EasyRabbitMQ.Infrastructure
{
    internal class ConnectionFactory : IConnectionFactory
    {
        private readonly IConfiguration _configuration;
        private const string ClientProvidedName = "EasyRabbitMQ";

        public ConnectionFactory(IConfiguration configuration)
        {
            _configuration = configuration;
        }

        public IConnection CreateConnection()
        {
            var factory = new RabbitMQ.Client.ConnectionFactory
            {
                Uri = _configuration.ConnectionString,
                AutomaticRecoveryEnabled = true
            };

            var connection = factory.CreateConnection(ClientProvidedName);

            return connection;
        }
    }
}

Set Client Provided Name when creating connection


// 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.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Configuration;
using osu.Framework.Platform;

namespace osu.Framework.Tests.Visual.Platform
{
    [Ignore("This test does not cover correct GL context acquire/release when ran headless.")]
    public class TestSceneExecutionModes : FrameworkTestScene
    {
        private Bindable<ExecutionMode> executionMode;

        [BackgroundDependencyLoader]
        private void load(FrameworkConfigManager configManager)
        {
            executionMode = configManager.GetBindable<ExecutionMode>(FrameworkSetting.ExecutionMode);
        }

        [Test]
        public void ToggleModeSmokeTest()
        {
            AddRepeatStep("toggle execution mode", () => executionMode.Value = executionMode.Value == ExecutionMode.MultiThreaded
                ? ExecutionMode.SingleThread
                : ExecutionMode.MultiThreaded, 2);
        }
    }
}

// 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.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Configuration;
using osu.Framework.Platform;

namespace osu.Framework.Tests.Visual.Platform
{
    [Ignore("This test does not cover correct GL context acquire/release when run headless.")]
    public class TestSceneExecutionModes : FrameworkTestScene
    {
        private Bindable<ExecutionMode> executionMode;

        [BackgroundDependencyLoader]
        private void load(FrameworkConfigManager configManager)
        {
            executionMode = configManager.GetBindable<ExecutionMode>(FrameworkSetting.ExecutionMode);
        }

        [Test]
        public void ToggleModeSmokeTest()
        {
            AddRepeatStep("toggle execution mode", () => executionMode.Value = executionMode.Value == ExecutionMode.MultiThreaded
                ? ExecutionMode.SingleThread
                : ExecutionMode.MultiThreaded, 2);
        }
    }
}

Fix weird english in test ignore comment


using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("PinWin")]
[assembly: AssemblyDescription("Allows user to make desktop windows top most")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PinWin")]
[assembly: AssemblyCopyright("Copyright © Victor Zakharov 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("7ae6966c-0686-4ac4-afbb-9ffd7bf7b81c")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.2.0")]
[assembly: AssemblyFileVersion("0.2.0")]

using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("PinWin")]
[assembly: AssemblyDescription("Allows user to make desktop windows top most")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PinWin")]
[assembly: AssemblyCopyright("Copyright © Victor Zakharov 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("7ae6966c-0686-4ac4-afbb-9ffd7bf7b81c")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.2.1")]
[assembly: AssemblyFileVersion("0.2.1")]

Fix - forgot to commit version change to 0.2.1.


// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE

using System;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Graphics.UserInterface.Tab;
using OpenTK;

namespace osu.Framework.Graphics.Containers
{
    public class TabFillFlowContainer<T> : FillFlowContainer<T> where T : TabItem
    {
        public Action<T, bool> TabVisibilityChanged;

        protected override IEnumerable<Vector2> ComputeLayoutPositions()
        {
            var result = base.ComputeLayoutPositions().ToArray();
            int i = 0;
            foreach (var child in FlowingChildren)
            {
                updateChildIfNeeded(child, result[i].Y == 0);
                ++i;
            }
            return result;
        }

        private Dictionary<T, bool> previousValues = new Dictionary<T, bool>();
        private void updateChildIfNeeded(T child, bool isVisible) {
            if (!previousValues.ContainsKey(child) || previousValues[child] != isVisible) {
                TabVisibilityChanged?.Invoke(child, isVisible);
                previousValues[child] = isVisible;
            }
        }
    }
}

// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE

using System;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Graphics.UserInterface.Tab;
using OpenTK;

namespace osu.Framework.Graphics.Containers
{
    public class TabFillFlowContainer<T> : FillFlowContainer<T> where T : TabItem
    {
        public Action<T, bool> TabVisibilityChanged;

        protected override IEnumerable<Vector2> ComputeLayoutPositions()
        {
            foreach (var child in Children)
                child.Y = 0;

            var result = base.ComputeLayoutPositions().ToArray();
            int i = 0;
            foreach (var child in FlowingChildren)
            {
                updateChildIfNeeded(child, result[i].Y == 0);
                ++i;
            }
            return result;
        }

        private Dictionary<T, bool> tabVisibility = new Dictionary<T, bool>();

        private void updateChildIfNeeded(T child, bool isVisible)
        {
            if (!tabVisibility.ContainsKey(child) || tabVisibility[child] != isVisible)
            {
                TabVisibilityChanged?.Invoke(child, isVisible);
                tabVisibility[child] = isVisible;
            }
        }
    }
}

Reset Y postiions of TabItems before performing layout.

Allows for expanding the size of an existing TabControl and having items re-appear.


@using Microsoft.Web.Mvc
@model CRP.Controllers.ViewModels.PaymentConfirmationViewModel

@{
    ViewBag.Title = "Confirmation";
}

Registration Confirmation

You have successfully registered for the following event:

        Item:
        @Model.Transaction.Item.Name

        Transaction:
        @Model.Transaction.TransactionNumber

        Amount:
        @($"{Model.Transaction.Total:C}")

    @if (Model.Transaction.Credit)
    {

Payment is still due:

            <form action="@Model.PostUrl" method="post" autocomplete="off" style="margin-right: 3px">
                @foreach (var pair in Model.PaymentDictionary)
                {
                    <input type="hidden" name="@pair.Key" value="@pair.Value"/>
                }
                <input type="hidden" name="signature" value="@Model.Signature"/>
                <input type="submit" class="btn btn-primary" value="Click here to be taken to our payment site"/>
            </form>

    }
    else if (Model.Transaction.Total > 0)
    {

            @Html.Raw(Model.Transaction.Item.CheckPaymentInstructions)

    }

@using Microsoft.Web.Mvc
@model CRP.Controllers.ViewModels.PaymentConfirmationViewModel

@{
    ViewBag.Title = "Confirmation";
}

Registration Confirmation

You have successfully registered for the following event:

        Item:
        @Model.Transaction.Item.Name

        Transaction:
        @Model.Transaction.TransactionNumber

        Amount:
        @($"{Model.Transaction.Total:C}")

    @if (Model.Transaction.Credit)
    {

            @if (Model.Transaction.Paid)
            {

                    <button type="button" class="close" data-dismiss="alert">×</button>
                    It appears this has been paid. If you think it hasn't you may still pay.

            }
            else
            {

Payment is still due:

            }

            <form action="@Model.PostUrl" method="post" autocomplete="off" style="margin-right: 3px">
                @foreach (var pair in Model.PaymentDictionary)
                {
                    <input type="hidden" name="@pair.Key" value="@pair.Value"/>
                }
                <input type="hidden" name="signature" value="@Model.Signature"/>
                <input type="submit" class="btn btn-primary" value="Click here to be taken to our payment site"/>
            </form>

    }
    else if (Model.Transaction.Total > 0)
    {

            @Html.Raw(Model.Transaction.Item.CheckPaymentInstructions)

    }

Check if credit card payment received

Check if credit card payment received


// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using Microsoft.AspNet.Mvc.OptionDescriptors;
using Microsoft.Framework.DependencyInjection;
using Microsoft.Framework.OptionsModel;

namespace Microsoft.AspNet.Mvc
{
    /// <inheritdoc />
    public class DefaultOutputFormattersProvider : OptionDescriptorBasedProvider<IOutputFormatter>, IOutputFormattersProvider
    {
        /// <summary>
        /// Initializes a new instance of the DefaultOutputFormattersProvider class.
        /// </summary>
        /// <param name="options">An accessor to the <see cref="MvcOptions"/> configured for this application.</param>
        /// <param name="typeActivator">An <see cref="ITypeActivator"/> instance used to instantiate types.</param>
        /// <param name="serviceProvider">A <see cref="IServiceProvider"/> instance that retrieves services from the
        /// service collection.</param>
        public DefaultOutputFormattersProvider(IOptionsAccessor<MvcOptions> optionsAccessor,
                                           ITypeActivator typeActivator,
                                           IServiceProvider serviceProvider)
            : base(optionsAccessor.Options.OutputFormatters, typeActivator, serviceProvider)
        {
        }

        /// <inheritdoc />
        public IReadOnlyList<IOutputFormatter> OutputFormatters
        {
            get
            {
                return Options;
            }
        }
    }
}

Fix Stylecop failure - long line

Fix Stylecop failure
- long line


#define DEBUG_COMMANDS
//using UnityEditor;
//using UnityEngine;
//using System.Collections;
using System.Diagnostics;

public class ShellHelpers {
  public static Process StartProcess(string filename, string arguments) {
#if DEBUG_COMMANDS
    UnityEngine.Debug.Log("Running: " + filename + " " + arguments);
#endif
    Process p = new Process();
    p.StartInfo.Arguments = arguments;
    p.StartInfo.CreateNoWindow = true;
    p.StartInfo.UseShellExecute = false;
    p.StartInfo.RedirectStandardOutput = true;
    p.StartInfo.RedirectStandardInput = true;
    p.StartInfo.RedirectStandardError = true;
    p.StartInfo.FileName = filename;
    p.Start();
    return p;
  }

  public static string OutputFromCommand(string filename, string arguments) {
    var p = StartProcess(filename, arguments);
    var output = p.StandardOutput.ReadToEnd();
    p.WaitForExit();
    if(output.EndsWith("\n"))
      output = output.Substring(0, output.Length - 1);
    return output;
  }
}

//define DEBUG_COMMANDS
using System.Diagnostics;

public class ShellHelpers {
  public static Process StartProcess(string filename, string arguments) {
#if DEBUG_COMMANDS
    UnityEngine.Debug.Log("Running: " + filename + " " + arguments);
#endif
    Process p = new Process();
    p.StartInfo.Arguments = arguments;
    p.StartInfo.CreateNoWindow = true;
    p.StartInfo.UseShellExecute = false;
    p.StartInfo.RedirectStandardOutput = true;
    p.StartInfo.RedirectStandardInput = true;
    p.StartInfo.RedirectStandardError = true;
    p.StartInfo.FileName = filename;
    p.Start();
    return p;
  }

  public static string OutputFromCommand(string filename, string arguments) {
    var p = StartProcess(filename, arguments);
    var output = p.StandardOutput.ReadToEnd();
    p.WaitForExit();
    if(output.EndsWith("\n"))
      output = output.Substring(0, output.Length - 1);
    return output;
  }
}

Disable command debugging for now, and clean up.


using Microsoft.AspNetCore.Mvc;
using Swashbuckle.AspNetCore.Annotations;
using Basic.Swagger;

namespace Basic.Controllers
{
    [SwaggerTag("Manipulate Carts to your heart's content", "http://www.tempuri.org")]
    public class SwaggerAnnotationsController
    {
        [HttpPost("/carts")]
        [SwaggerResponse(201, "The cart was created", typeof(Cart))]
        [SwaggerResponse(400, "The cart data is invalid")]
        public Cart Create([FromBody]Cart cart)
        {
            return new Cart { Id = 1 };
        }

        [HttpGet("/carts/{id}")]
        [SwaggerOperationFilter(typeof(AddCartsByIdGetExternalDocs))]
        public Cart GetById(int id)
        {
            return new Cart { Id = id };
        }

        [HttpDelete("/carts/{id}")]
        [SwaggerOperation(
            Summary = "Deletes a specific cart",
            Description = "Requires admin privileges",
            Consumes = new string[] { "test/plain", "application/json" },
            Produces = new string[] { "application/javascript", "application/xml" })]
        public Cart Delete([FromRoute(Name = "id"), SwaggerParameter("The cart identifier")]int cartId)
        {
            return new Cart { Id = cartId };
        }
    }

    public class Cart
    {
        public int Id { get; internal set; }
    }
}

using Microsoft.AspNetCore.Mvc;
using Swashbuckle.AspNetCore.Annotations;
using Basic.Swagger;

namespace Basic.Controllers
{
    [SwaggerTag("Manipulate Carts to your heart's content", "http://www.tempuri.org")]
    public class SwaggerAnnotationsController
    {
        [HttpPost("/carts")]
        [SwaggerResponse(201, "The cart was created", typeof(Cart))]
        [SwaggerResponse(400, "The cart data is invalid")]
        public Cart Create([FromBody]Cart cart)
        {
            return new Cart { Id = 1 };
        }

        [HttpGet("/carts/{id}")]
        [SwaggerOperationFilter(typeof(AddCartsByIdGetExternalDocs))]
        public Cart GetById(int id)
        {
            return new Cart { Id = id };
        }

        [HttpDelete("/carts/{id}")]
        [SwaggerOperation(
            OperationId = "DeleteCart",
            Summary = "Deletes a specific cart",
            Description = "Requires admin privileges",
            Consumes = new string[] { "test/plain", "application/json" },
            Produces = new string[] { "application/javascript", "application/xml" })]
        public Cart Delete([FromRoute(Name = "id"), SwaggerParameter("The cart identifier")]int cartId)
        {
            return new Cart { Id = cartId };
        }
    }

    public class Cart
    {
        public int Id { get; internal set; }
    }
}

Set OperationId via annotations in test project


using System.Reflection;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CakeMail.RestClient")]
[assembly: AssemblyDescription("CakeMail.RestClient is a .NET wrapper for the CakeMail API")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jeremie Desautels")]
[assembly: AssemblyProduct("CakeMail.RestClient")]
[assembly: AssemblyCopyright("Copyright Jeremie Desautels © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0-beta03")]

using System.Reflection;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CakeMail.RestClient")]
[assembly: AssemblyDescription("CakeMail.RestClient is a .NET wrapper for the CakeMail API")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jeremie Desautels")]
[assembly: AssemblyProduct("CakeMail.RestClient")]
[assembly: AssemblyCopyright("Copyright Jeremie Desautels © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0")]

Set nuget package version to 2.0.0

Set nuget package version to 2.0.0