using System.Drawing;

namespace TileSharp.Symbolizers
{
	/// <summary>
	/// https://github.com/mapnik/mapnik/wiki/TextSymbolizer
	/// </summary>
	public class TextSymbolizer : Symbolizer
	{
		public readonly string LabelAttribute;
		public readonly PlacementType Placement;
		public readonly ContentAlignment Alignment;

		public readonly int FontSize;

		public readonly Color TextColor;
		public readonly Color TextHaloColor;

		/// <summary>
		/// The distance between repeated labels.
		/// 0: A single label is placed in the center.
		/// Based on Mapnik Spacing
		/// </summary>
		public readonly int Spacing;

		public TextSymbolizer(string labelAttribute, PlacementType placement, int fontSize, ContentAlignment alignment = ContentAlignment.MiddleCenter, int spacing = 0, Color? textColor = null)
		{
			LabelAttribute = labelAttribute;
			Placement = placement;
			Alignment = alignment;
			Spacing = spacing;

			FontSize = fontSize;

			TextColor = textColor ?? Color.Black;
			TextHaloColor = Color.White;
		}

		public enum PlacementType
		{
			Line,
			Point
		}
	}
}

using System.Drawing;

namespace TileSharp.Symbolizers
{
	/// <summary>
	/// https://github.com/mapnik/mapnik/wiki/TextSymbolizer
	/// </summary>
	public class TextSymbolizer : Symbolizer
	{
		public readonly string LabelAttribute;
		public readonly PlacementType Placement;
		public readonly ContentAlignment Alignment;

		public readonly int FontSize;

		public readonly Color TextColor;
		public readonly Color TextHaloColor;

		/// <summary>
		/// The distance between repeated labels.
		/// 0: A single label is placed in the center.
		/// Based on Mapnik Spacing
		/// </summary>
		public readonly int Spacing;

		public TextSymbolizer(string labelAttribute, PlacementType placement, int fontSize, ContentAlignment alignment = ContentAlignment.MiddleCenter, int spacing = 0, Color? textColor = null, Color? textHaloColor = null)
		{
			LabelAttribute = labelAttribute;
			Placement = placement;
			Alignment = alignment;
			Spacing = spacing;

			FontSize = fontSize;

			TextColor = textColor ?? Color.Black;
			TextHaloColor = textHaloColor ?? Color.White;
		}

		public enum PlacementType
		{
			Line,
			Point
		}
	}
}

Add ability to set text halo color.

Add ability to set text halo color.


using System.Collections.Generic;
using HarryPotterUnity.Cards.Generic;
using JetBrains.Annotations;

namespace HarryPotterUnity.Cards.Spells.Transfigurations
{
    [UsedImplicitly]
    public class MiceToSnuffboxes : GenericSpell {
        public override List<GenericCard> GetValidTargets()
        {
            var validCards = Player.InPlay.GetCreaturesInPlay();
            validCards.AddRange(Player.OppositePlayer.InPlay.GetCreaturesInPlay());

            return validCards;
        }

        protected override void SpellAction(List<GenericCard> selectedCards)
        {
            foreach(var card in selectedCards) {
                card.Player.Hand.Add(card, false);
                card.Player.InPlay.Remove(card);
            }
        }
    }
}

using System.Collections.Generic;
using HarryPotterUnity.Cards.Generic;
using JetBrains.Annotations;

namespace HarryPotterUnity.Cards.Spells.Transfigurations
{
    [UsedImplicitly]
    public class MiceToSnuffboxes : GenericSpell {
        public override List<GenericCard> GetValidTargets()
        {
            var validCards = Player.InPlay.GetCreaturesInPlay();
            validCards.AddRange(Player.OppositePlayer.InPlay.GetCreaturesInPlay());

            return validCards;
        }

        protected override void SpellAction(List<GenericCard> selectedCards)
        {
            int i = 0;
            foreach(var card in selectedCards) {
                card.Player.Hand.Add(card, preview: false, adjustSpacing: card.Player.IsLocalPlayer && i == 1);
                card.Player.InPlay.Remove(card);
                i++;
            }
        }
    }
}

Fix an animation bug with Mice to Snuffboxes


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using ProjectMarkdown.Annotations;

namespace ProjectMarkdown.ViewModels
{
    public class MainWindowViewModel : INotifyPropertyChanged
    {
        private string _currentDocumentPath;

        public string CurrentDocumentPath
        {
            get { return _currentDocumentPath; }
            set
            {
                if (value == _currentDocumentPath) return;
                _currentDocumentPath = value;
                OnPropertyChanged(nameof(CurrentDocumentPath));
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        public MainWindowViewModel()
        {
            if (DesignerProperties.GetIsInDesignMode(new DependencyObject()))
            {
                return;
            }
            CurrentDocumentPath = "Untitled.md";
        }
        [NotifyPropertyChangedInvocator]
        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Input;
using ProjectMarkdown.Annotations;

namespace ProjectMarkdown.ViewModels
{
    public class MainWindowViewModel : INotifyPropertyChanged
    {
        private string _currentDocumentPath;
        private string _currentText;
        private string _currentHtml;

        public string CurrentDocumentPath
        {
            get { return _currentDocumentPath; }
            set
            {
                if (value == _currentDocumentPath) return;
                _currentDocumentPath = value;
                OnPropertyChanged(nameof(CurrentDocumentPath));
            }
        }

        public string CurrentText
        {
            get { return _currentText; }
            set
            {
                if (value == _currentText) return;
                _currentText = value;
                OnPropertyChanged(nameof(CurrentText));
            }
        }

        public string CurrentHtml
        {
            get { return _currentHtml; }
            set
            {
                if (value == _currentHtml) return;
                _currentHtml = value;
                OnPropertyChanged(nameof(CurrentHtml));
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        public ICommand SaveDocumentCommand { get; set; }

        public MainWindowViewModel()
        {
            if (DesignerProperties.GetIsInDesignMode(new DependencyObject()))
            {
                return;
            }
            using (var sr = new StreamReader("Example.html"))
            {
                CurrentHtml = sr.ReadToEnd();
            }
            LoadCommands();
            CurrentDocumentPath = "Untitled.md";
        }

        private void LoadCommands()
        {
            SaveDocumentCommand = new RelayCommand(SaveDocument, CanSaveDocument);
        }

        public void SaveDocument(object obj)
        {
            using (var sr = new StreamReader("Example.html"))
            {
                CurrentHtml = sr.ReadToEnd();
            }
        }

        public bool CanSaveDocument(object obj)
        {
            return true;
        }

        [NotifyPropertyChangedInvocator]
        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}

Save feature added for testing.

Save feature added for testing.


using System;
using System.Globalization;
using Umbraco.Core.Models.PublishedContent;

namespace Umbraco.Core.PropertyEditors.ValueConverters
{
    [DefaultPropertyValueConverter]
    public class DecimalValueConverter : PropertyValueConverterBase
    {
        public override bool IsConverter(PublishedPropertyType propertyType)
            => Constants.PropertyEditors.Aliases.Decimal.Equals(propertyType.EditorAlias);

        public override Type GetPropertyValueType(PublishedPropertyType propertyType)
            => typeof (decimal);

        public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
            => PropertyCacheLevel.Element;

        public override object ConvertSourceToIntermediate(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
        {
            if (source == null) return 0M;

            // in XML a decimal is a string
            if (source is string sourceString)
            {
                return decimal.TryParse(sourceString, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture, out decimal d) ? d : 0M;
            }

            // in the database an a decimal is an a decimal
            // default value is zero
            return source is decimal ? source : 0M;
        }
    }
}

using System;
using System.Globalization;
using Umbraco.Core.Models.PublishedContent;

namespace Umbraco.Core.PropertyEditors.ValueConverters
{
    [DefaultPropertyValueConverter]
    public class DecimalValueConverter : PropertyValueConverterBase
    {
        public override bool IsConverter(PublishedPropertyType propertyType)
            => Constants.PropertyEditors.Aliases.Decimal.Equals(propertyType.EditorAlias);

        public override Type GetPropertyValueType(PublishedPropertyType propertyType)
            => typeof (decimal);

        public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
            => PropertyCacheLevel.Element;

        public override object ConvertSourceToIntermediate(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
        {
            if (source == null)
            {
                return 0M;
            }

            // is it already a decimal?
            if(source is decimal)
            {
                return source;
            }

            // is it a double?
            if(source is double sourceDouble)
            {
                return Convert.ToDecimal(sourceDouble);
            }

            // is it a string?
            if (source is string sourceString)
            {
                return decimal.TryParse(sourceString, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture, out decimal d) ? d : 0M;
            }

            // couldn't convert the source value - default to zero
            return 0M;
        }
    }
}

Make sure the decimal field value converter can handle double values when converting


using System;
using System.IO;

namespace Hangman {
  public class Hangman {
    public static void Main(string[] args) {
      var game = new Game("HANG THE MAN");

      while (true) {
        string titleText = File.ReadAllText("title.txt");

        Cell[] title = {
          new Cell(titleText, Cell.CentreAlign)
        };

        string shownWord = game.ShownWord();
        Cell[] word = {
          new Cell(shownWord, Cell.CentreAlign)
        };

        Cell[] stats = {
          new Cell("Incorrect letters:\n A B I U"),
          new Cell("Lives remaining:\n 11/15", Cell.RightAlign)
        };

        Cell[] status = {
          new Cell("Press any letter to guess!", Cell.CentreAlign)
        };

        Row[] rows = {
          new Row(title),
          new Row(word),
          new Row(stats),
          new Row(status)
        };

        var table = new Table(
          Math.Min(81, Console.WindowWidth),
          2,
          rows
        );

        var tableOutput = table.Draw();

        Console.WriteLine(tableOutput);

        char key = Console.ReadKey(true).KeyChar;
        bool wasCorrect = game.GuessLetter(key);
        Console.Clear();
      }
    }
  }
}

using System;
using System.IO;

namespace Hangman {
  public class Hangman {
    public static void Main(string[] args) {
      var game = new Game("HANG THE MAN");

      while (true) {
        string titleText = File.ReadAllText("title.txt");

        Cell[] title = {
          new Cell(titleText, Cell.CentreAlign)
        };

        string shownWord = game.ShownWord();
        Cell[] word = {
          new Cell(shownWord, Cell.CentreAlign)
        };

        Cell[] stats = {
          new Cell("Incorrect letters:\n A B I U"),
          new Cell("Lives remaining:\n 11/15", Cell.RightAlign)
        };

        Cell[] status = {
          new Cell("Press any letter to guess!", Cell.CentreAlign)
        };

        Row[] rows = {
          new Row(title),
          new Row(word),
          new Row(stats),
          new Row(status)
        };

        var table = new Table(
          Math.Min(81, Console.WindowWidth),
          2,
          rows
        );

        var tableOutput = table.Draw();

        Console.WriteLine(tableOutput);

        char key = Console.ReadKey(true).KeyChar;
        bool wasCorrect = game.GuessLetter(Char.ToUpper(key));
        Console.Clear();
      }
    }
  }
}

Make key entry case insensitive

Make key entry case insensitive


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace CatchAllRule
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace CatchAllRule
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                "Everything",
                "{*url}",
                new { controller = "Everything", action = "Index" }
            );
        }
    }
}

Add a catch all route

CatchAllRule: Add a catch all route


using Microsoft.Framework.ConfigurationModel;
using Microsoft.Framework.DependencyInjection;
using System;

namespace Glimpse
{
    public static class GlimpseServiceCollectionExtensions
    {
        public static IServiceCollection AddMvc(this IServiceCollection services)
        {
            return services.Add(GlimpseServices.GetDefaultServices());
        }

        public static IServiceCollection AddMvc(this IServiceCollection services, IConfiguration configuration)
        {
            return services.Add(GlimpseServices.GetDefaultServices(configuration));
        }
    }
}

using Microsoft.Framework.ConfigurationModel;
using Microsoft.Framework.DependencyInjection;
using System;

namespace Glimpse
{
    public static class GlimpseServiceCollectionExtensions
    {
        public static IServiceCollection AddGlimpse(this IServiceCollection services)
        {
            return services.Add(GlimpseServices.GetDefaultServices());
        }

        public static IServiceCollection AddGlimpse(this IServiceCollection services, IConfiguration configuration)
        {
            return services.Add(GlimpseServices.GetDefaultServices(configuration));
        }
    }
}

Rename service collection extensions to be correct


using HelixToolkit.Wpf.SharpDX.Model.Scene;
using HelixToolkit.Wpf.SharpDX.Render;
using SharpDX;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Markup;

namespace HelixToolkit.Wpf.SharpDX
{
    [ContentProperty("Content")]
    public class Element3DPresenter : Element3D
    {
        /// <summary>
        /// Gets or sets the content.
        /// </summary>
        /// <value>
        /// The content.
        /// </value>
        public Element3D Content
        {
            get { return (Element3D)GetValue(ContentProperty); }
            set { SetValue(ContentProperty, value); }
        }

        /// <summary>
        /// The content property
        /// </summary>
        public static readonly DependencyProperty ContentProperty =
            DependencyProperty.Register("Content", typeof(Element3D), typeof(Element3DPresenter), new PropertyMetadata(null, (d,e)=>
            {
                var model = d as Element3DPresenter;
                if(e.OldValue != null)
                {
                    model.RemoveLogicalChild(e.OldValue);
                    (model.SceneNode as GroupNode).RemoveChildNode(e.OldValue as Element3D);
                }
                if(e.NewValue != null)
                {
                    model.AddLogicalChild(e.NewValue);
                    (model.SceneNode as GroupNode).AddChildNode(e.NewValue as Element3D);
                }
            }));

        protected override SceneNode OnCreateSceneNode()
        {
            return new GroupNode();
        }
    }
}

using HelixToolkit.Wpf.SharpDX.Model.Scene;
using HelixToolkit.Wpf.SharpDX.Render;
using SharpDX;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Markup;

namespace HelixToolkit.Wpf.SharpDX
{
    [ContentProperty("Content")]
    public class Element3DPresenter : Element3D
    {
        /// <summary>
        /// Gets or sets the content.
        /// </summary>
        /// <value>
        /// The content.
        /// </value>
        public Element3D Content
        {
            get { return (Element3D)GetValue(ContentProperty); }
            set { SetValue(ContentProperty, value); }
        }

        /// <summary>
        /// The content property
        /// </summary>
        public static readonly DependencyProperty ContentProperty =
            DependencyProperty.Register("Content", typeof(Element3D), typeof(Element3DPresenter), new PropertyMetadata(null, (d,e)=>
            {
                var model = d as Element3DPresenter;
                if(e.OldValue != null)
                {
                    model.RemoveLogicalChild(e.OldValue);
                    (model.SceneNode as GroupNode).RemoveChildNode(e.OldValue as Element3D);
                }
                if(e.NewValue != null)
                {
                    model.AddLogicalChild(e.NewValue);
                    (model.SceneNode as GroupNode).AddChildNode(e.NewValue as Element3D);
                }
            }));

        public Element3DPresenter()
        {
            Loaded += Element3DPresenter_Loaded;
        }

        protected override SceneNode OnCreateSceneNode()
        {
            return new GroupNode();
        }

        private void Element3DPresenter_Loaded(object sender, RoutedEventArgs e)
        {
            if (Content != null)
            {
                RemoveLogicalChild(Content);
                AddLogicalChild(Content);
            }
        }
    }
}

Fix element3d presenter binding issue.

Fix element3d presenter binding issue.


using System;
using System.Threading.Tasks;
using NSubstitute;
using Octokit.Tests.Helpers;
using Xunit;

namespace Octokit.Tests.Clients
{
    /// <summary>
    /// Client tests mostly just need to make sure they call the IApiConnection with the correct
    /// relative Uri. No need to fake up the response. All *those* tests are in ApiConnectionTests.cs.
    /// </summary>
    public class TeamsClientTests
    {
        public class TheConstructor
        {
            [Fact]
            public void EnsuresNonNullArguments()
            {
                Assert.Throws<ArgumentNullException>(() => new TeamsClient(null));
            }
        }

        public class TheGetAllMethod
        {
            [Fact]
            public void RequestsTheCorrectUrl()
            {
                var client = Substitute.For<IApiConnection>();
                var orgs = new TeamsClient(client);

                orgs.GetAllTeams("username");

                client.Received().GetAll<Team>(Arg.Is<Uri>(u => u.ToString() == "users/username/orgs"));
            }

            [Fact]
            public async Task EnsuresNonNullArguments()
            {
                var teams = new TeamsClient(Substitute.For<IApiConnection>());

                AssertEx.Throws<ArgumentNullException>(async () => await teams.GetAllTeams(null));
            }
        }
    }
}

using System;
using System.Threading.Tasks;
using NSubstitute;
using Octokit.Tests.Helpers;
using Xunit;

namespace Octokit.Tests.Clients
{
    /// <summary>
    /// Client tests mostly just need to make sure they call the IApiConnection with the correct
    /// relative Uri. No need to fake up the response. All *those* tests are in ApiConnectionTests.cs.
    /// </summary>
    public class TeamsClientTests
    {
        public class TheConstructor
        {
            [Fact]
            public void EnsuresNonNullArguments()
            {
                Assert.Throws<ArgumentNullException>(() => new TeamsClient(null));
            }
        }

        public class TheGetAllMethod
        {
            [Fact]
            public void RequestsTheCorrectUrl()
            {
                var client = Substitute.For<IApiConnection>();
                var orgs = new TeamsClient(client);

                orgs.GetAllTeams("username");

                client.Received().GetAll<TeamItem>(Arg.Is<Uri>(u => u.ToString() == "users/username/orgs"));
            }

            [Fact]
            public async Task EnsuresNonNullArguments()
            {
                var teams = new TeamsClient(Substitute.For<IApiConnection>());

                AssertEx.Throws<ArgumentNullException>(async () => await teams.GetAllTeams(null));
            }
        }
    }
}

Fix up the test to return correct type

Fix up the test to return correct type


using System.Reflection;

[assembly: AssemblyCompany("Dimension Data")]
[assembly: AssemblyProduct("Compute as a Service (CaaS) API client.")]
[assembly: AssemblyCopyright("Copyright © Dimension Data 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.3.0.2")]

using System.Reflection;

[assembly: AssemblyCompany("Dimension Data")]
[assembly: AssemblyProduct("Compute as a Service (CaaS) API client.")]
[assembly: AssemblyCopyright("Copyright © Dimension Data 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.3.1.0")]

Update solution version to 1.3.1

Update solution version to 1.3.1


using System.Collections.Generic;
using System.Net.Mail;

namespace StressMeasurementSystem.Models
{
    public class Patient
    {
        #region Structs

        public struct Name
        {
            public string Prefix { get; set; }
            public string First { get; set; }
            public string Middle { get; set; }
            public string Last { get; set; }
            public string Suffix { get; set; }
        }

        public struct Organization
        {
            public string Company { get; set; }
            public string JobTitle { get; set; }
        }

        public struct PhoneNumber
        {
            public enum Type { Mobile, Home, Work, Main, WorkFax, HomeFax, Pager, Other }

            public string Number { get; set; }
            public Type T { get; set; }
        }

        public struct Email
        {
            public enum Type { Home, Work, Other }

            public MailAddress Address { get; set; }
            public Type T { get; set; }
        }

        #endregion

        #region Fields

        private Name? _name;
        private uint? _age;
        private Organization? _organization;
        private List<PhoneNumber> _phoneNumbers;
        private List<Email> _emails;

        #endregion

        #region Constructors

        public Patient(Name? name, uint? age, Organization? organization,
            List<PhoneNumber> phoneNumbers, List<Email> emails)
        {
            _name = name;
            _age = age;
            _organization = organization;
            _phoneNumbers = phoneNumbers;
            _emails = emails;
        }

        #endregion
    }
}

using System;
using System.Collections.Generic;
using System.Net.Mail;

namespace StressMeasurementSystem.Models
{
    public class Patient
    {
        #region Structs

        public struct Name
        {
            public string Prefix { get; set; }
            public string First { get; set; }
            public string Middle { get; set; }
            public string Last { get; set; }
            public string Suffix { get; set; }
        }

        public struct Organization
        {
            public string Company { get; set; }
            public string JobTitle { get; set; }
        }

        public struct PhoneNumber
        {
            public enum Type { Mobile, Home, Work, Main, WorkFax, HomeFax, Pager, Other }

            public string Number { get; set; }
            public Type T { get; set; }
        }

        public struct Email
        {
            public enum Type { Home, Work, Other }

            public MailAddress Address { get; set; }
            public Type T { get; set; }
        }

        #endregion

        #region Fields

        private Name? _name;
        private DateTime _dateOfBirth;
        private Organization? _organization;
        private List<PhoneNumber> _phoneNumbers;
        private List<Email> _emails;

        #endregion

        #region Constructors

        public Patient(Name? name, DateTime dateOfBirth, Organization? organization,
            List<PhoneNumber> phoneNumbers, List<Email> emails)
        {
            _name = name;
            _dateOfBirth = dateOfBirth;
            _organization = organization;
            _phoneNumbers = phoneNumbers;
            _emails = emails;
        }

        #endregion
    }
}

Replace age with date of birth

Replace age with date of birth


// Copyright (c) Wiesław Šoltés. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Core2D.Shapes.Interfaces;

namespace Core2D.UnitTests
{
    public class TestPointShape : TestBaseShape, IPointShape
    {
        public double X { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); }
        public double Y { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); }
        public PointAlignment Alignment { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); }
        public IBaseShape Shape { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); }
    }
}

// Copyright (c) Wiesław Šoltés. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Core2D.Shapes.Interfaces;

namespace Core2D.UnitTests
{
    public class TestPointShape : TestBaseShape, IPointShape
    {
        public double X { get; set; }
        public double Y { get; set; }
        public PointAlignment Alignment { get; set; }
        public IBaseShape Shape { get; set; }
    }
}

Use default getters and setters

Use default getters and setters


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

using System.IO;
using System.Runtime.InteropServices;
using Microsoft.NET.TestFramework;
using Microsoft.NET.TestFramework.Assertions;
using Microsoft.NET.TestFramework.Commands;
using Xunit;
using static Microsoft.NET.TestFramework.Commands.MSBuildTest;

namespace Microsoft.NET.Build.Tests
{
    public class GivenThatWeWantToBuildASolutionWithNonAnyCPUPlatform
    {
        private TestAssetsManager _testAssetsManager = TestAssetsManager.TestProjectsAssetsManager;

        [Fact]
        public void It_builds_solusuccessfully()
        {
            var testAsset = _testAssetsManager
                .CopyTestAsset("x64SolutionBuild")
                .WithSource()
                .Restore();

            var buildCommand = new BuildCommand(Stage0MSBuild, testAsset.TestRoot, "x64SolutionBuild.sln");
            buildCommand
                .Execute()
                .Should()
                .Pass();

            buildCommand.GetOutputDirectory("netcoreapp1.0", @"x64\Debug")
                .Should()
                .OnlyHaveFiles(new[] {
                    "x64SolutionBuild.runtimeconfig.dev.json",
                    "x64SolutionBuild.runtimeconfig.json",
                    "x64SolutionBuild.deps.json",
                    "x64SolutionBuild.dll",
                    "x64SolutionBuild.pdb"
                });
        }
    }
}

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

using System.IO;
using System.Runtime.InteropServices;
using Microsoft.NET.TestFramework;
using Microsoft.NET.TestFramework.Assertions;
using Microsoft.NET.TestFramework.Commands;
using Xunit;
using static Microsoft.NET.TestFramework.Commands.MSBuildTest;

namespace Microsoft.NET.Build.Tests
{
    public class GivenThatWeWantToBuildASolutionWithNonAnyCPUPlatform
    {
        private TestAssetsManager _testAssetsManager = TestAssetsManager.TestProjectsAssetsManager;

        [Fact]
        public void It_builds_solusuccessfully()
        {
            var testAsset = _testAssetsManager
                .CopyTestAsset("x64SolutionBuild")
                .WithSource()
                .Restore();

            var buildCommand = new BuildCommand(Stage0MSBuild, testAsset.TestRoot, "x64SolutionBuild.sln");
            buildCommand
                .Execute()
                .Should()
                .Pass();

            buildCommand.GetOutputDirectory("netcoreapp1.0", Path.Combine("x64", "Debug"))
                .Should()
                .OnlyHaveFiles(new[] {
                    "x64SolutionBuild.runtimeconfig.dev.json",
                    "x64SolutionBuild.runtimeconfig.json",
                    "x64SolutionBuild.deps.json",
                    "x64SolutionBuild.dll",
                    "x64SolutionBuild.pdb"
                });
        }
    }
}

Fix path separator on Linux

Fix path separator on Linux


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

using System;
using osu.Game.Beatmaps;
using osu.Game.Graphics;

namespace osu.Game.Rulesets.Mods
{
    public abstract class ModHardRock : Mod, IApplicableToDifficulty
    {
        public override string Name => "Hard Rock";
        public override FontAwesome Icon => FontAwesome.fa_osu_mod_hardrock;
        public override ModType Type => ModType.DifficultyIncrease;
        public override string Description => "Everything just got a bit harder...";
        public override Type[] IncompatibleMods => new[] { typeof(ModEasy) };

        public void ApplyToDifficulty(BeatmapDifficulty difficulty)
        {
            const float ratio = 1.4f;
            difficulty.CircleSize *= ratio;
            difficulty.ApproachRate *= ratio;
            difficulty.DrainRate *= ratio;
            difficulty.OverallDifficulty *= ratio;
        }
    }
}

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

using System;
using osu.Game.Beatmaps;
using osu.Game.Graphics;

namespace osu.Game.Rulesets.Mods
{
    public abstract class ModHardRock : Mod, IApplicableToDifficulty
    {
        public override string Name => "Hard Rock";
        public override FontAwesome Icon => FontAwesome.fa_osu_mod_hardrock;
        public override ModType Type => ModType.DifficultyIncrease;
        public override string Description => "Everything just got a bit harder...";
        public override Type[] IncompatibleMods => new[] { typeof(ModEasy) };

        public void ApplyToDifficulty(BeatmapDifficulty difficulty)
        {
            const float ratio = 1.4f;
            difficulty.CircleSize *= 1.3f; // CS uses a custom 1.3 ratio.
            difficulty.ApproachRate *= ratio;
            difficulty.DrainRate *= ratio;
            difficulty.OverallDifficulty *= ratio;
        }
    }
}

Adjust CS multiplier to match stable

Adjust CS multiplier to match stable


@using Tracker
@using Tracker.Models
@using Tracker.ViewModels.Account
@using Tracker.ViewModels.Manage
@using Microsoft.AspNet.Identity
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"

@using ShatteredTemple.LegoDimensions.Tracker
@using ShatteredTemple.LegoDimensions.Tracker.Models
@using ShatteredTemple.LegoDimensions.Tracker.ViewModels.Account
@using ShatteredTemple.LegoDimensions.Tracker.ViewModels.Manage
@using Microsoft.AspNet.Identity
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"

Update starting solution with correct namespaces.


//
// Copyright (c) Microsoft.  All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

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

[assembly: AssemblyTitle("Microsoft Azure Batch Management Library")]
[assembly: AssemblyDescription("Provides management functions for Microsoft Azure Batch services.")]

[assembly: AssemblyVersion("2.1.0.0")]
[assembly: AssemblyFileVersion("2.1.0.0")]

[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Microsoft Azure .NET SDK")]
[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]

//
// Copyright (c) Microsoft.  All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

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

[assembly: AssemblyTitle("Microsoft Azure Batch Management Library")]
[assembly: AssemblyDescription("Provides management functions for Microsoft Azure Batch services.")]

[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.1.0.0")]

[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Microsoft Azure .NET SDK")]
[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]

Update assembly version per feedback

Update assembly version per feedback


using StockportWebapp.Models;
using StockportWebapp.Parsers;
using StockportWebapp.Utils;

namespace StockportWebapp.ContentFactory
{
    public class EventFactory
    {
        private readonly ISimpleTagParserContainer _simpleTagParserContainer;
        private readonly MarkdownWrapper _markdownWrapper;
        private readonly IDynamicTagParser<Document> _documentTagParser;

        public EventFactory(ISimpleTagParserContainer simpleTagParserContainer, MarkdownWrapper markdownWrapper, IDynamicTagParser<Document> documentTagParser)
        {
            _simpleTagParserContainer = simpleTagParserContainer;
            _markdownWrapper = markdownWrapper;
            _documentTagParser = documentTagParser;
        }

        public virtual ProcessedEvents Build(Event eventItem)
        {
            var description = _simpleTagParserContainer.ParseAll(eventItem.Description, eventItem.Title);
            description = _documentTagParser.Parse(description, eventItem.Documents);
            description = _markdownWrapper.ConvertToHtml(description ?? "");

            return new ProcessedEvents(eventItem.Title, eventItem.Slug, eventItem.Teaser, eventItem.ImageUrl,
                                       eventItem.ThumbnailImageUrl, description, eventItem.Fee, eventItem.Location, eventItem.SubmittedBy,
                                       eventItem.EventDate, eventItem.StartTime, eventItem.EndTime, eventItem.Breadcrumbs);
        }
    }
}

using StockportWebapp.Models;
using StockportWebapp.Parsers;
using StockportWebapp.Utils;

namespace StockportWebapp.ContentFactory
{
    public class EventFactory
    {
        private readonly ISimpleTagParserContainer _simpleTagParserContainer;
        private readonly MarkdownWrapper _markdownWrapper;
        private readonly IDynamicTagParser<Document> _documentTagParser;

        public EventFactory(ISimpleTagParserContainer simpleTagParserContainer, MarkdownWrapper markdownWrapper, IDynamicTagParser<Document> documentTagParser)
        {
            _simpleTagParserContainer = simpleTagParserContainer;
            _markdownWrapper = markdownWrapper;
            _documentTagParser = documentTagParser;
        }

        public virtual ProcessedEvents Build(Event eventItem)
        {
            var description = _simpleTagParserContainer.ParseAll(eventItem.Description, eventItem.Title);
            description = _markdownWrapper.ConvertToHtml(description ?? "");
            description = _documentTagParser.Parse(description, eventItem.Documents);

            return new ProcessedEvents(eventItem.Title, eventItem.Slug, eventItem.Teaser, eventItem.ImageUrl,
                                       eventItem.ThumbnailImageUrl, description, eventItem.Fee, eventItem.Location, eventItem.SubmittedBy,
                                       eventItem.EventDate, eventItem.StartTime, eventItem.EndTime, eventItem.Breadcrumbs);
        }
    }
}

Fix event factory parsing of documents

Fix event factory parsing of documents


// 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.Bindables;
using osu.Game.Users;

namespace osu.Game.Online.API
{
    public class DummyAPIAccess : IAPIProvider
    {
        public Bindable<User> LocalUser { get; } = new Bindable<User>(new User
        {
            Username = @"Dummy",
            Id = 1001,
        });

        public bool IsLoggedIn => true;

        public string ProvidedUsername => LocalUser.Value.Username;

        public string Endpoint => "http://localhost";

        public APIState State => LocalUser.Value.Id == 1 ? APIState.Offline : APIState.Online;

        public virtual void Queue(APIRequest request)
        {
        }

        public void Register(IOnlineComponent component)
        {
            // todo: add support
        }

        public void Unregister(IOnlineComponent component)
        {
            // todo: add support
        }

        public void Login(string username, string password)
        {
            LocalUser.Value = new User
            {
                Username = @"Dummy",
                Id = 1,
            };
        }

        public void Logout()
        {
            LocalUser.Value = new GuestUser();
        }

        public RegistrationRequest.RegistrationRequestErrors CreateAccount(string email, string username, string password) => null;
    }
}

// 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.Bindables;
using osu.Game.Users;

namespace osu.Game.Online.API
{
    public class DummyAPIAccess : IAPIProvider
    {
        public Bindable<User> LocalUser { get; } = new Bindable<User>(new User
        {
            Username = @"Dummy",
            Id = 1001,
        });

        public bool IsLoggedIn => true;

        public string ProvidedUsername => LocalUser.Value.Username;

        public string Endpoint => "http://localhost";

        public APIState State => LocalUser.Value.Id == 1 ? APIState.Offline : APIState.Online;

        public virtual void Queue(APIRequest request)
        {
        }

        public void Register(IOnlineComponent component)
        {
            // todo: add support
        }

        public void Unregister(IOnlineComponent component)
        {
            // todo: add support
        }

        public void Login(string username, string password)
        {
            LocalUser.Value = new User
            {
                Username = @"Dummy",
                Id = 1001,
            };
        }

        public void Logout()
        {
            LocalUser.Value = new GuestUser();
        }

        public RegistrationRequest.RegistrationRequestErrors CreateAccount(string email, string username, string password) => null;
    }
}

Use non-guest user ID for non-guest user


using System.IO;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using JetBrains.Annotations;

namespace Diadoc.Api
{
	public static class XmlSerializerExtensions
	{
		public static byte[] SerializeToXml<T>(this T @object)
		{
			var serializer = new XmlSerializer(typeof(T));
			using (var ms = new MemoryStream())
			{
				using (var sw = new StreamWriter(ms, Encoding.UTF8))
				{
					XmlSerializerNamespaces namespaces = null;
					var ns = FindXmlNamespace<T>();
					if (!IsNullOrWhiteSpace(ns))
					{
						namespaces = new XmlSerializerNamespaces();
						namespaces.Add("", ns);
					}

					serializer.Serialize(sw, @object, namespaces ?? new XmlSerializerNamespaces(new[] {new XmlQualifiedName(string.Empty)}));
				}

				return ms.ToArray();
			}
		}

		[CanBeNull]
		private static string FindXmlNamespace<T>()
		{
			var root = typeof(T).GetCustomAttributes(typeof(XmlRootAttribute), true).Cast<XmlRootAttribute>().FirstOrDefault();
			return root != null && !IsNullOrWhiteSpace(root.Namespace) ? root.Namespace : null;
		}

		private static bool IsNullOrWhiteSpace(string value) => string.IsNullOrEmpty(value) || value.Trim().Length == 0;
	}
}

using System.IO;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using JetBrains.Annotations;

namespace Diadoc.Api
{
	public static class XmlSerializerExtensions
	{
		public static byte[] SerializeToXml<T>(this T @object)
		{
			var serializer = new XmlSerializer(typeof(T));
			return SerializeToXml(@object, serializer);
		}

		public static byte[] SerializeToXml(object @object)
		{
			var serializer = new XmlSerializer(@object.GetType());
			return SerializeToXml(@object, serializer);
		}

		private static byte[] SerializeToXml<T>(T @object, XmlSerializer serializer)
		{
			using (var ms = new MemoryStream())
			{
				using (var sw = new StreamWriter(ms, Encoding.UTF8))
				{
					XmlSerializerNamespaces namespaces = null;
					var ns = FindXmlNamespace<T>();
					if (!IsNullOrWhiteSpace(ns))
					{
						namespaces = new XmlSerializerNamespaces();
						namespaces.Add("", ns);
					}

					serializer.Serialize(sw, @object,
						namespaces ?? new XmlSerializerNamespaces(new[] {new XmlQualifiedName(string.Empty)}));
				}

				return ms.ToArray();
			}
		}

		[CanBeNull]
		private static string FindXmlNamespace<T>()
		{
			var root = typeof(T).GetCustomAttributes(typeof(XmlRootAttribute), true).Cast<XmlRootAttribute>().FirstOrDefault();
			return root != null && !IsNullOrWhiteSpace(root.Namespace) ? root.Namespace : null;
		}

		private static bool IsNullOrWhiteSpace(string value) => string.IsNullOrEmpty(value) || value.Trim().Length == 0;
	}
}

Add overload SerializeToXml with object type


using System;
using System.Reflection;
[assembly: AssemblyTitle("GraphQL")]
[assembly: AssemblyProduct("GraphQL")]
[assembly: AssemblyDescription("GraphQL for .NET")]
[assembly: AssemblyCopyright("Copyright 2015-2016 Joseph T. McBride, et al.  All rights reserved.")]
[assembly: AssemblyVersion("0.8.2.0")]
[assembly: AssemblyFileVersion("0.8.2.0")]
[assembly: CLSCompliant(false)]

Add assembly attribute to get rid of warnings


using System.Threading.Tasks;

namespace Upload.Security
{
    public class ApiKeyValidator : IApiKeyValidator
    {
        public Task<bool> ValidateAsync(string apiKey)
        {
            return Task.FromResult(true);
        }
    }
}

using System;
using System.Threading.Tasks;

namespace Upload.Security
{
    public class ApiKeyValidator : IApiKeyValidator
    {
        public Task<bool> ValidateAsync(string apiKey)
        {
            return Task.FromResult(apiKey == Environment.GetEnvironmentVariable("APPSETTING_ApiKey"));
        }
    }
}

Read api key from env setting

Read api key from env setting


using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
using BetterNotes.NoteClasses;

namespace BetterNotes.NoteUIObjects
{
	public class NoteExpButton : NoteUIObjectBase
	{
		private NotesExperiment expObject;
		private bool highlight;

		private void Start()
		{
			highlight = NotesMainMenu.Settings.HighLightPart;
		}

		protected override void OnLeftClick()
		{
			//Run Experiment
		}

		protected override void OnRightClick()
		{
			//Part Right-Click menu
		}

		protected override void OnMouseIn()
		{
			if (highlight)
				expObject.RootPart.SetHighlight(true, false);
		}

		protected override void OnMouseOut()
		{
			if (highlight)
				expObject.RootPart.SetHighlight(false, false);
		}

		protected override void ToolTip()
		{
			throw new NotImplementedException();
		}
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
using BetterNotes.NoteClasses;

namespace BetterNotes.NoteUIObjects
{
	public class NoteExpButton : NoteUIObjectBase
	{
		private NotesExperiment expObject;
		private bool highlight;

		private void Start()
		{
			highlight = NotesMainMenu.Settings.HighLightPart;
		}

		protected override bool assignObject(object obj)
		{
			if (obj == null || obj.GetType() != typeof(NotesExperiment))
			{
				return false;
			}

			expObject = (NotesExperiment)obj;

			return true;
		}

		protected override void OnLeftClick()
		{
			if (expObject.deployExperiment())
			{
				//log success
			}
			else
			{
				//log fail
			}
		}

		protected override void OnRightClick()
		{
			//Part Right-Click menu
		}

		protected override void OnMouseIn()
		{
			if (highlight)
				expObject.RootPart.SetHighlight(true, false);
		}

		protected override void OnMouseOut()
		{
			if (highlight)
				expObject.RootPart.SetHighlight(false, false);
		}

		protected override void ToolTip()
		{
			throw new NotImplementedException();
		}
	}
}

Add deploy experiment function to left-click on button


using System.Collections.Generic;

namespace Esprima
{
    public class ErrorHandler : IErrorHandler
    {
        public IList<ParserException> Errors { get; }
        public bool Tolerant { get; set; }

        public string Source { get; set; }

        public ErrorHandler()
        {
            Errors = new List<ParserException>();
            Tolerant = false;
        }

        public void RecordError(ParserException error)
        {
            Errors.Add(error);
        }

        public void Tolerate(ParserException error)
        {
            if (Tolerant)
            {
                RecordError(error);
            }
            else
            {
                throw error;
            }
        }

        public ParserException CreateError(int index, int line, int col, string description)
        {
            var msg = $"Line {line}': {description}";
            var error = new ParserException(msg)
            {
                Index = index,
                Column = col,
                LineNumber = line,
                Description = description,
                Source = Source
            };
            return error;
        }

        public void TolerateError(int index, int line, int col, string description)
        {
            var error = this.CreateError(index, line, col, description);
            if (Tolerant)
            {
                this.RecordError(error);
            }
            else
            {
                throw error;
            }
        }
    }
}

using System.Collections.Generic;

namespace Esprima
{
    public class ErrorHandler : IErrorHandler
    {
        public IList<ParserException> Errors { get; }
        public bool Tolerant { get; set; }

        public string Source { get; set; }

        public ErrorHandler()
        {
            Errors = new List<ParserException>();
            Tolerant = false;
        }

        public void RecordError(ParserException error)
        {
            Errors.Add(error);
        }

        public void Tolerate(ParserException error)
        {
            if (Tolerant)
            {
                RecordError(error);
            }
            else
            {
                throw error;
            }
        }

        public ParserException CreateError(int index, int line, int col, string description)
        {
            var msg = $"Line {line}: {description}";
            var error = new ParserException(msg)
            {
                Index = index,
                Column = col,
                LineNumber = line,
                Description = description,
                Source = Source
            };
            return error;
        }

        public void TolerateError(int index, int line, int col, string description)
        {
            var error = this.CreateError(index, line, col, description);
            if (Tolerant)
            {
                this.RecordError(error);
            }
            else
            {
                throw error;
            }
        }
    }
}

Remove apostrophe in parse error description


using System.IO;
using System.Net;

namespace ServiceStack.Text
{
    public static class WebRequestExtensions
    {
        public static string GetJsonFromUrl(this string url)
        {
            return url.GetStringFromUrl("application/json");
        }

        public static string GetStringFromUrl(this string url, string acceptContentType)
        {
            var webReq = (HttpWebRequest)WebRequest.Create(url);
            webReq.Accept = acceptContentType;
            using (var webRes = webReq.GetResponse())
            using (var stream = webRes.GetResponseStream())
            using (var reader = new StreamReader(stream))
            {
                return reader.ReadToEnd();
            }
        }
    }
}

using System;
using System.IO;
using System.Net;

namespace ServiceStack.Text
{
    public static class WebRequestExtensions
    {
        public static string GetJsonFromUrl(this string url)
        {
            return url.GetStringFromUrl("application/json");
        }

        public static string GetStringFromUrl(this string url, string acceptContentType="*/*")
        {
            var webReq = (HttpWebRequest)WebRequest.Create(url);
            webReq.Accept = acceptContentType;
            using (var webRes = webReq.GetResponse())
            using (var stream = webRes.GetResponseStream())
            using (var reader = new StreamReader(stream))
            {
                return reader.ReadToEnd();
            }
        }

        public static bool Is404(this Exception ex)
        {
            return HasStatus(ex as WebException, HttpStatusCode.NotFound);
        }

        public static HttpStatusCode? GetResponseStatus(this string url)
        {
            try
            {
                var webReq = (HttpWebRequest)WebRequest.Create(url);
                using (var webRes = webReq.GetResponse())
                {
                    var httpRes = webRes as HttpWebResponse;
                    return httpRes != null ? httpRes.StatusCode : (HttpStatusCode?)null;
                }
            }
            catch (Exception ex)
            {
                return ex.GetStatus();
            }
        }

        public static HttpStatusCode? GetStatus(this Exception ex)
        {
            return GetStatus(ex as WebException);
        }

        public static HttpStatusCode? GetStatus(this WebException webEx)
        {
            if (webEx == null) return null;
            var httpRes = webEx.Response as HttpWebResponse;
            return httpRes != null ? httpRes.StatusCode : (HttpStatusCode?) null;
        }

        public static bool HasStatus(this WebException webEx, HttpStatusCode statusCode)
        {
            return GetStatus(webEx) == statusCode;
        }
    }
}

Add helper WebRequest extensions, useful when playing with REST-ful APIs


using Microsoft.Data.Entity;
using System;
using System.IO;
using Windows.Storage;

namespace UnicornPacker.Models
{
    public class OrdersContext : DbContext
    {
        public DbSet<Order> Orders { get; set; }
        public DbSet<OrderLine> OrderLines { get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            string localDirectory = string.Empty;
            try
            {
                localDirectory = ApplicationData.Current.LocalFolder.Path;
            }
            catch (InvalidOperationException)
            { }

            optionsBuilder.UseSqlite($"Data source={Path.Combine(localDirectory, "Orders001.db")}");
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Order>()
                .Property(o => o.OrderId)
                .ValueGeneratedNever();

            modelBuilder.Entity<OrderLine>()
                .Key(l => new { l.OrderId, l.ProductId });
        }
    }
}

using Microsoft.Data.Entity;
using System;
using System.IO;
using Windows.Storage;

namespace UnicornPacker.Models
{
    public class OrdersContext : DbContext
    {
        public DbSet<Order> Orders { get; set; }
        public DbSet<OrderLine> OrderLines { get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            optionsBuilder.UseSqlite($"Data source={GetLocalDatabaseFile()}");
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Order>()
                .Property(o => o.OrderId)
                .ValueGeneratedNever();

            modelBuilder.Entity<OrderLine>()
                .Key(l => new { l.OrderId, l.ProductId });
        }

        private static string GetLocalDatabaseFile()
        {
            string localDirectory = string.Empty;
            try
            {
                localDirectory = ApplicationData.Current.LocalFolder.Path;
            }
            catch (InvalidOperationException)
            { }

            return Path.Combine(localDirectory, "Orders.db");
        }

    }
}

Clean up code for SQLite connection

:art: Clean up code for SQLite connection


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

namespace ValveResourceFormat.ResourceTypes
{
    public class Sound : Blocks.ResourceData
    {
        private BinaryReader Reader;
        private long DataOffset;
        private NTRO NTROBlock;

        public override void Read(BinaryReader reader, Resource resource)
        {
            Reader = reader;

            reader.BaseStream.Position = Offset;

            if (resource.Blocks.ContainsKey(BlockType.NTRO))
            {
                NTROBlock = new NTRO();
                NTROBlock.Offset = Offset;
                NTROBlock.Size = Size;
                NTROBlock.Read(reader, resource);
            }

            DataOffset = Offset + Size;
        }

        public byte[] GetSound()
        {
            Reader.BaseStream.Position = DataOffset;

            return Reader.ReadBytes((int)Reader.BaseStream.Length);
        }

        public override string ToString()
        {
            if (NTROBlock != null)
            {
                return NTROBlock.ToString();
            }

            return "This is a sound.";
        }
    }
}

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

namespace ValveResourceFormat.ResourceTypes
{
    public class Sound : Blocks.ResourceData
    {
        private BinaryReader Reader;
        private NTRO NTROBlock;

        public override void Read(BinaryReader reader, Resource resource)
        {
            Reader = reader;

            reader.BaseStream.Position = Offset;

            if (resource.Blocks.ContainsKey(BlockType.NTRO))
            {
                NTROBlock = new NTRO();
                NTROBlock.Offset = Offset;
                NTROBlock.Size = Size;
                NTROBlock.Read(reader, resource);
            }
        }

        public byte[] GetSound()
        {
            Reader.BaseStream.Position = Offset + Size;

            return Reader.ReadBytes((int)(Reader.BaseStream.Length - Reader.BaseStream.Position));
        }

        public override string ToString()
        {
            if (NTROBlock != null)
            {
                return NTROBlock.ToString();
            }

            return "This is a sound.";
        }
    }
}

Read sound until the end of file correctly


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

namespace IronFoundry.Container
{
    public class ContainerHostDependencyHelper
    {
        const string ContainerHostAssemblyName = "IronFoundry.Container.Host";

        readonly Assembly containerHostAssembly;

        public ContainerHostDependencyHelper()
        {
            this.containerHostAssembly = GetContainerHostAssembly();
        }

        public virtual string ContainerHostExe
        {
            get { return ContainerHostAssemblyName + ".exe"; }
        }

        public virtual string ContainerHostExePath
        {
            get { return containerHostAssembly.Location; }
        }

        public string ContainerHostExeConfig
        {
            get { return ContainerHostExe + ".config"; }
        }

        public string ContainerHostExeConfigPath
        {
            get { return ContainerHostExePath + ".config"; }
        }

        static Assembly GetContainerHostAssembly()
        {
            return Assembly.ReflectionOnlyLoad(ContainerHostAssemblyName);
        }

        public virtual IReadOnlyList<string> GetContainerHostDependencies()
        {
            return EnumerateLocalReferences(containerHostAssembly).ToList();
        }

        IEnumerable<string> EnumerateLocalReferences(Assembly assembly)
        {
            foreach (var referencedAssemblyName in assembly.GetReferencedAssemblies())
            {
                var referencedAssembly = Assembly.ReflectionOnlyLoad(referencedAssemblyName.FullName);

                if (!referencedAssembly.GlobalAssemblyCache)
                {
                    yield return referencedAssembly.Location;

                    if (!referencedAssembly.Location.Contains("ICSharpCode.SharpZipLib.dll"))
                        foreach (var nestedReferenceFilePath in EnumerateLocalReferences(referencedAssembly))
                            yield return nestedReferenceFilePath;
                }
            }
        }
    }
}

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

namespace IronFoundry.Container
{
    public class ContainerHostDependencyHelper
    {
        const string ContainerHostAssemblyName = "IronFoundry.Container.Host";

        readonly Assembly containerHostAssembly;

        public ContainerHostDependencyHelper()
        {
            this.containerHostAssembly = GetContainerHostAssembly();
        }

        public virtual string ContainerHostExe
        {
            get { return ContainerHostAssemblyName + ".exe"; }
        }

        public virtual string ContainerHostExePath
        {
            get { return containerHostAssembly.Location; }
        }

        public string ContainerHostExeConfig
        {
            get { return ContainerHostExe + ".config"; }
        }

        public string ContainerHostExeConfigPath
        {
            get { return ContainerHostExePath + ".config"; }
        }

        static Assembly GetContainerHostAssembly()
        {
            return Assembly.ReflectionOnlyLoad(ContainerHostAssemblyName);
        }

        public virtual IReadOnlyList<string> GetContainerHostDependencies()
        {
            return EnumerateLocalReferences(containerHostAssembly).ToList();
        }

        IEnumerable<string> EnumerateLocalReferences(Assembly assembly)
        {
            foreach (var referencedAssemblyName in assembly.GetReferencedAssemblies())
            {
                var referencedAssembly = Assembly.ReflectionOnlyLoad(referencedAssemblyName.FullName);

                if (!referencedAssembly.GlobalAssemblyCache)
                {
                    yield return referencedAssembly.Location;

                    foreach (var nestedReferenceFilePath in EnumerateLocalReferences(referencedAssembly))
                        yield return nestedReferenceFilePath;
                }
            }
        }
    }
}

Remove unnecessary check for SharpZipLib dll.


#region

using System.Diagnostics;
using System.IO;
using DesktopWidgets.Classes;

#endregion

namespace DesktopWidgets.Helpers
{
    internal static class ProcessHelper
    {
        public static void Launch(string path, string args = "", string startIn = "",
            ProcessWindowStyle style = ProcessWindowStyle.Normal)
        {
            Launch(new ProcessFile {Path = path, Arguments = args, StartInFolder = startIn, WindowStyle = style});
        }

        public static void Launch(ProcessFile file)
        {
            if (string.IsNullOrWhiteSpace(file.Path) || !File.Exists(file.Path))
                return;
            Process.Start(new ProcessStartInfo
            {
                FileName = file.Path,
                Arguments = file.Arguments,
                WorkingDirectory = file.StartInFolder,
                WindowStyle = file.WindowStyle
            });
        }

        public static void OpenFolder(string path)
        {
            if (File.Exists(path) || Directory.Exists(path))
                Launch("explorer.exe", "/select," + path);
        }
    }
}

#region

using System.Diagnostics;
using System.IO;
using DesktopWidgets.Classes;

#endregion

namespace DesktopWidgets.Helpers
{
    internal static class ProcessHelper
    {
        public static void Launch(string path, string args = "", string startIn = "",
            ProcessWindowStyle style = ProcessWindowStyle.Normal)
        {
            Launch(new ProcessFile {Path = path, Arguments = args, StartInFolder = startIn, WindowStyle = style});
        }

        public static void Launch(ProcessFile file)
        {
            Process.Start(new ProcessStartInfo
            {
                FileName = file.Path,
                Arguments = file.Arguments,
                WorkingDirectory = file.StartInFolder,
                WindowStyle = file.WindowStyle
            });
        }

        public static void OpenFolder(string path)
        {
            if (File.Exists(path) || Directory.Exists(path))
                Launch("explorer.exe", "/select," + path);
        }
    }
}

Revert "Fix error when launching missing files"

This reverts commit df9c57117a6b2de5ec1dee7926f929bc4d24693f.


using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace Dbus
{
    public partial class Connection
    {
        private static async Task authenticate(Stream stream)
        {
            using (var writer = new StreamWriter(stream, Encoding.ASCII, 32, true))
            using (var reader = new StreamReader(stream, Encoding.ASCII, false, 32, true))
            {
                writer.NewLine = "\r\n";

                await writer.WriteAsync("\0AUTH EXTERNAL ").ConfigureAwait(false);

                var uid = getuid();
                var stringUid = $"{uid}";
                var uidBytes = Encoding.ASCII.GetBytes(stringUid);
                foreach (var b in uidBytes)
                    await writer.WriteAsync($"{b:X}").ConfigureAwait(false);

                await writer.WriteLineAsync().ConfigureAwait(false);
                await writer.FlushAsync().ConfigureAwait(false);

                var response = await reader.ReadLineAsync().ConfigureAwait(false);
                if (!response.StartsWith("OK "))
                    throw new InvalidOperationException("Authentication failed: " + response);

                await writer.WriteLineAsync("BEGIN").ConfigureAwait(false);
                await writer.FlushAsync().ConfigureAwait(false);
            }
        }

        [DllImport("c")]
        private static extern int getuid();
    }
}

using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace Dbus
{
    public partial class Connection
    {
        private static async Task authenticate(Stream stream)
        {
            using (var writer = new StreamWriter(stream, Encoding.ASCII, 32, true))
            using (var reader = new StreamReader(stream, Encoding.ASCII, false, 32, true))
            {
                writer.NewLine = "\r\n";

                await writer.WriteAsync("\0AUTH EXTERNAL ").ConfigureAwait(false);

                var uid = getuid();
                var stringUid = $"{uid}";
                var uidBytes = Encoding.ASCII.GetBytes(stringUid);
                foreach (var b in uidBytes)
                    await writer.WriteAsync($"{b:X}").ConfigureAwait(false);

                await writer.WriteLineAsync().ConfigureAwait(false);
                await writer.FlushAsync().ConfigureAwait(false);

                var response = await reader.ReadLineAsync().ConfigureAwait(false);
                if (!response.StartsWith("OK "))
                    throw new InvalidOperationException("Authentication failed: " + response);

                await writer.WriteLineAsync("BEGIN").ConfigureAwait(false);
                await writer.FlushAsync().ConfigureAwait(false);
            }
        }

        [DllImport("libc")]
        private static extern int getuid();
    }
}

Add a `lib` prefix to the DllImport so it works with mono


// Copyright 2006 Alp Toker <alp@atoker.com>
// This software is made available under the MIT License
// See COPYING for details

using System;
using System.Collections.Generic;
using NDesk.DBus;
using org.freedesktop.DBus;

public class ManagedDBusTestObjects
{
	public static void Main ()
	{
		Bus bus = Bus.Session;

		ObjectPath myPath = new ObjectPath ("/org/ndesk/test");
		string myName = "org.ndesk.test";

		//TODO: write the rest of this demo and implement
	}
}

public class Device : IDevice
{
	public string GetName ()
	{
		return "Some device";
	}
}

public class DeviceManager : IDeviceManager
{
	public IDevice GetCurrentDevice ()
	{
		return new Device ();
	}
}

public interface IDevice
{
	string GetName ();
}

public interface IDeviceManager
{
	IDevice GetCurrentDevice ();
}

public interface IUglyDeviceManager
{
	ObjectPath GetCurrentDevice ();
}

// Copyright 2006 Alp Toker <alp@atoker.com>
// This software is made available under the MIT License
// See COPYING for details

using System;
using System.Collections.Generic;
using NDesk.DBus;
using org.freedesktop.DBus;

public class ManagedDBusTestObjects
{
	public static void Main ()
	{
		Bus bus = Bus.Session;

		ObjectPath myPath = new ObjectPath ("/org/ndesk/test");
		string myName = "org.ndesk.test";

		//TODO: write the rest of this demo and implement
	}
}

public class Device : IDevice
{
	public string Name
	{
		get {
			return "Some device";
		}
	}
}

public class DeviceManager : IDeviceManager
{
	public IDevice CurrentDevice
	{
		get {
			return new Device ();
		}
	}
}

public interface IDevice
{
	string Name { get; }
}

public interface IDeviceManager
{
	IDevice CurrentDevice { get; }
}

public interface IUglyDeviceManager
{
	ObjectPath CurrentDevice { get; }
}

Use properties in example code

Use properties in example code


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

[assembly: AssemblyTitle("Sandra")]
[assembly: AssemblyDescription("Hosted on https://github.com/PenguinF/sandra-three")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Sandra")]
[assembly: AssemblyCopyright("Copyright © 2002-2016 - Henk Nicolai")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

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

[assembly: AssemblyTitle("Sandra")]
[assembly: AssemblyDescription("Hosted on https://github.com/PenguinF/sandra-three")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Sandra")]
[assembly: AssemblyCopyright("Copyright © 2004-2016 - Henk Nicolai")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

Correct year when development started.

Correct year when development started.


using System;

namespace Mpdn.CustomLinearScaler
{
    namespace Example
    {
        public class Gaussian : ICustomLinearScaler
        {
            public Guid Guid
            {
                get { return new Guid("647351FF-7FEC-4EAB-86C7-CE1BEF43EFD4"); }
            }

            public string Name
            {
                get { return "Gaussian"; }
            }

            public bool AllowDeRing
            {
                get { return false; }
            }

            public ScalerTaps MaxTapCount
            {
                get { return ScalerTaps.Eight; }
            }

            public float GetWeight(float n, int width)
            {
                return (float) GaussianKernel(n, width);
            }

            private static double GaussianKernel(double x, double radius)
            {
                var sigma = radius/6;
                return Math.Exp(-(x*x/(2*sigma*sigma)));
            }
        }
    }
}

using System;

namespace Mpdn.CustomLinearScaler
{
    namespace Example
    {
        public class Gaussian : ICustomLinearScaler
        {
            public Guid Guid
            {
                get { return new Guid("647351FF-7FEC-4EAB-86C7-CE1BEF43EFD4"); }
            }

            public string Name
            {
                get { return "Gaussian"; }
            }

            public bool AllowDeRing
            {
                get { return false; }
            }

            public ScalerTaps MaxTapCount
            {
                get { return ScalerTaps.Eight; }
            }

            public float GetWeight(float n, int width)
            {
                return (float) GaussianKernel(n, width / 2);
            }

            private static double GaussianKernel(double x, double radius)
            {
                var sigma = radius / 4;
                return Math.Exp(-(x*x/(2*sigma*sigma)));
            }
        }
    }
}

Fix radius calculation and lower sigma.

Fix radius calculation and lower sigma.


using UnityEngine;
using UnityEngine.UI;
using System.Collections;

namespace UDBase.Components.Log {
	public class Log_Visual_Behaviour : MonoBehaviour {
		public Text Text;

		public void Init() {
			Text.text = "";
		}

		public void AddMessage(string msg) {
			Text.text += msg + "\n";
		}
	}
}

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

namespace UDBase.Components.Log {
	public class Log_Visual_Behaviour : MonoBehaviour {
		public Text Text;

		List<string> _messages = new List<string>();

		public void Init() {
			Clear();
		}

		public void Clear() {
			Text.text = "";
		}

		public void AddMessage(string msg) {
			_messages.Add(msg);
			ApplyMessage(msg);
		}

		void ApplyMessage(string msg) {
			Text.text += msg + "\n";
		}
	}
}

Store messages in list to future filter; Clear method;


using System;
using System.Linq;
using System.Reflection;
using NUnit.Framework;

[SetUpFixture]
public class SplatModeDetectorSetUp
{
    static SplatModeDetectorSetUp()
    {
        // HACK: Force .NET 4.5 version of Splat to load when executing inside NCrunch
        var ncrunchAsms = Environment.GetEnvironmentVariable("NCrunch.AllAssemblyLocations")?.Split(';');
        if (ncrunchAsms != null)
        {
            ncrunchAsms.Where(x => x.EndsWith(@"\Net45\Splat.dll")).Select(Assembly.LoadFrom).FirstOrDefault();
        }
    }

    [OneTimeSetUp]
    public void RunBeforeAnyTests()
    {
        Splat.ModeDetector.Current.SetInUnitTestRunner(true);
    }
}

using System;
using System.Linq;
using System.Reflection;
using NUnit.Framework;

[SetUpFixture]
public class SplatModeDetectorSetUp
{
    [OneTimeSetUp]
    public void RunBeforeAnyTests()
    {
        Splat.ModeDetector.Current.SetInUnitTestRunner(true);
    }
}

Remove hack to load correct version of Splat.


using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.NodeServices;
using Microsoft.AspNetCore.SpaServices.Prerendering;
using Microsoft.Extensions.DependencyInjection.Extensions;

namespace Microsoft.Extensions.DependencyInjection
{
    /// <summary>
    /// Extension methods for setting up prerendering features in an <see cref="IServiceCollection" />.
    /// </summary>
    public static class PrerenderingServiceCollectionExtensions
    {
        /// <summary>
        /// Configures the dependency injection system to supply an implementation
        /// of <see cref="ISpaPrerenderer"/>.
        /// </summary>
        /// <param name="serviceCollection">The <see cref="IServiceCollection"/>.</param>
        public static void AddSpaPrerenderer(this IServiceCollection serviceCollection)
        {
            serviceCollection.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
            serviceCollection.AddSingleton<ISpaPrerenderer, DefaultSpaPrerenderer>();
        }
    }
}

using Microsoft.AspNetCore.SpaServices.Prerendering;

namespace Microsoft.Extensions.DependencyInjection
{
    /// <summary>
    /// Extension methods for setting up prerendering features in an <see cref="IServiceCollection" />.
    /// </summary>
    public static class PrerenderingServiceCollectionExtensions
    {
        /// <summary>
        /// Configures the dependency injection system to supply an implementation
        /// of <see cref="ISpaPrerenderer"/>.
        /// </summary>
        /// <param name="serviceCollection">The <see cref="IServiceCollection"/>.</param>
        public static void AddSpaPrerenderer(this IServiceCollection serviceCollection)
        {
            serviceCollection.AddHttpContextAccessor();
            serviceCollection.AddSingleton<ISpaPrerenderer, DefaultSpaPrerenderer>();
        }
    }
}

Clean up how IHttpContextAccessor is added


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

[assembly: AssemblyTitle("WpfAboutView")]
[assembly: AssemblyDescription("Simple About control with app name, icon, version, and credits")]
[assembly: AssemblyCompany("Daniel Chalmers")]
[assembly: AssemblyProduct("WpfAboutView")]
[assembly: AssemblyCopyright("© Daniel Chalmers 2017")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("1.1.0.0")]

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

[assembly: AssemblyTitle("WpfAboutView")]
[assembly: AssemblyDescription("Simple About control with app name, icon, version, and credits")]
[assembly: AssemblyCompany("Daniel Chalmers")]
[assembly: AssemblyProduct("WpfAboutView")]
[assembly: AssemblyCopyright("© Daniel Chalmers 2018")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("1.1.0.0")]

Update copyright year to 2018

Update copyright year to 2018


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

namespace osu.Framework.Benchmarks
{
    public class BenchmarkManySpinningBoxes : GameBenchmark
    {
        [Test]
        [Benchmark]
        public void RunFrame() => RunSingleFrame();

        protected override Game CreateGame() => new TestGame();

        private class TestGame : Game
        {
            protected override void LoadComplete()
            {
                base.LoadComplete();

                for (int i = 0; i < 1000; i++)
                {
                    var box = new Box
                    {
                        RelativeSizeAxes = Axes.Both,
                        Colour = Color4.Black
                    };

                    Add(box);

                    box.Spin(200, RotationDirection.Clockwise);
                }
            }
        }
    }
}

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

namespace osu.Framework.Benchmarks
{
    public class BenchmarkManySpinningBoxes : GameBenchmark
    {
        private TestGame game;

        [Test]
        [Benchmark]
        public void RunFrame()
        {
            game.MainContent.AutoSizeAxes = Axes.None;
            game.MainContent.RelativeSizeAxes = Axes.Both;
            RunSingleFrame();
        }

        [Test]
        [Benchmark]
        public void RunFrameWithAutoSize()
        {
            game.MainContent.RelativeSizeAxes = Axes.None;
            game.MainContent.AutoSizeAxes = Axes.Both;
            RunSingleFrame();
        }

        [Test]
        [Benchmark]
        public void RunFrameWithAutoSizeDuration()
        {
            game.MainContent.RelativeSizeAxes = Axes.None;
            game.MainContent.AutoSizeAxes = Axes.Both;
            game.MainContent.AutoSizeDuration = 100;
            RunSingleFrame();
        }

        protected override Game CreateGame() => game = new TestGame();

        private class TestGame : Game
        {
            public Container MainContent;

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

                Add(MainContent = new Container());

                for (int i = 0; i < 1000; i++)
                {
                    var box = new Box
                    {
                        Size = new Vector2(100),
                        Colour = Color4.Black
                    };

                    MainContent.Add(box);

                    box.Spin(200, RotationDirection.Clockwise);
                }
            }
        }
    }
}

Add autosize coverage to spinning boxes benchmark


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

using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;

namespace osu.Game.Tournament.Screens.Showcase
{
    public class TournamentLogo : CompositeDrawable
    {
        public TournamentLogo()
        {
            RelativeSizeAxes = Axes.X;
            Margin = new MarginPadding { Vertical = 5 };

            Height = 100;
        }

        [BackgroundDependencyLoader]
        private void load(TextureStore textures)
        {
            InternalChild = new Sprite
            {
                Anchor = Anchor.TopCentre,
                Origin = Anchor.TopCentre,
                FillMode = FillMode.Fit,
                RelativeSizeAxes = Axes.Both,
                Texture = textures.Get("game-screen-logo"),
            };
        }
    }
}

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

using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;

namespace osu.Game.Tournament.Screens.Showcase
{
    public class TournamentLogo : CompositeDrawable
    {
        public TournamentLogo()
        {
            RelativeSizeAxes = Axes.X;
            Margin = new MarginPadding { Vertical = 5 };

            Height = 100;
        }

        [BackgroundDependencyLoader]
        private void load(TextureStore textures)
        {
            InternalChild = new Sprite
            {
                Anchor = Anchor.TopCentre,
                Origin = Anchor.TopCentre,
                FillMode = FillMode.Fit,
                RelativeSizeAxes = Axes.Both,
                Texture = textures.Get("header-logo"),
            };
        }
    }
}

Use new logo name for showcase screen

Use new logo name for showcase screen


using EntityCore.DynamicEntity;
using EntityCore.Utils;
using System.Configuration;
using System.Data.Common;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;

namespace EntityCore
{
    public static class Context
    {
        public static DynamicEntityContext New(string nameOrConnectionString)
        {
            Check.NotEmpty(nameOrConnectionString, "nameOrConnectionString");
            var connnection = DbHelpers.GetDbConnection(nameOrConnectionString);
            DbCompiledModel model = GetCompiledModel(connnection);

            return new DynamicEntityContext(nameOrConnectionString, model);
        }

        public static DynamicEntityContext New(DbConnection existingConnection)
        {
            Check.NotNull(existingConnection, "existingConnection");
            DbCompiledModel model = GetCompiledModel(existingConnection);

            return new DynamicEntityContext(existingConnection, model, false);
        }

        private static DbCompiledModel GetCompiledModel(DbConnection connection)
        {
            var builder = new DbModelBuilder(DbModelBuilderVersion.Latest);

            foreach (var entity in EntityTypeCache.GetEntitiesTypes(connection))
                builder.RegisterEntityType(entity);

            var model = builder.Build(connection);

            return model.Compile();
        }
    }
}

using EntityCore.DynamicEntity;
using EntityCore.Utils;
using System.Data.Common;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Data.Entity.ModelConfiguration.Conventions;
using System.Data.SqlClient;
using System.Linq;

namespace EntityCore
{
    public static class Context
    {
        public static DynamicEntityContext New(string nameOrConnectionString)
        {
            Check.NotEmpty(nameOrConnectionString, "nameOrConnectionString");
            var connection = DbHelpers.GetDbConnection(nameOrConnectionString);
            DbCompiledModel model = GetCompiledModel(connection);

            return new DynamicEntityContext(nameOrConnectionString, model);
        }

        public static DynamicEntityContext New(DbConnection existingConnection)
        {
            Check.NotNull(existingConnection, "existingConnection");
            DbCompiledModel model = GetCompiledModel(existingConnection);

            return new DynamicEntityContext(existingConnection, model, false);
        }

        private static DbCompiledModel GetCompiledModel(DbConnection connection)
        {
            var builder = new DbModelBuilder(DbModelBuilderVersion.Latest);

            foreach (var entity in EntityTypeCache.GetEntitiesTypes(connection))
                builder.RegisterEntityType(entity);

            if (!(connection is SqlConnection)) // Compatible Effort. See https://effort.codeplex.com/workitem/678
                builder.Conventions.Remove<ColumnAttributeConvention>();

            var model = builder.Build(connection);

            return model.Compile();
        }
    }
}

Remove unsupported column attribute convention with no sql connection.


using System.IO;
using OpenZH.Data.Utilities.Extensions;

namespace OpenZH.Data.Map
{
    public sealed class PolygonTrigger
    {
        public string Name { get; private set; }
        public string LayerName { get; private set; }
        public uint UniqueId { get; private set; }
        public PolygonTriggerType TriggerType { get; private set; }
        public MapVector3i[] Points { get; private set; }

        public static PolygonTrigger Parse(BinaryReader reader)
        {
            var name = reader.ReadUInt16PrefixedAsciiString();
            var layerName = reader.ReadUInt16PrefixedAsciiString();

            var uniqueId = reader.ReadUInt32();

            var triggerType = reader.ReadUInt32AsEnum<PolygonTriggerType>();

            var unknown = reader.ReadUInt16();
            if (unknown != 0)
            {
                throw new InvalidDataException();
            }

            var numPoints = reader.ReadUInt32();
            var points = new MapVector3i[numPoints];

            for (var i = 0; i < numPoints; i++)
            {
                points[i] = MapVector3i.Parse(reader);
            }

            return new PolygonTrigger
            {
                Name = name,
                LayerName = layerName,
                UniqueId = uniqueId,
                TriggerType = triggerType,
                Points = points
            };
        }
    }

    public enum PolygonTriggerType : uint
    {
        Area = 0,
        Water = 1
    }
}

using System;
using System.IO;
using OpenZH.Data.Utilities.Extensions;

namespace OpenZH.Data.Map
{
    public sealed class PolygonTrigger
    {
        public string Name { get; private set; }
        public string LayerName { get; private set; }
        public uint UniqueId { get; private set; }
        public PolygonTriggerType TriggerType { get; private set; }
        public MapVector3i[] Points { get; private set; }

        public static PolygonTrigger Parse(BinaryReader reader)
        {
            var name = reader.ReadUInt16PrefixedAsciiString();
            var layerName = reader.ReadUInt16PrefixedAsciiString();

            var uniqueId = reader.ReadUInt32();

            var triggerType = reader.ReadUInt32AsEnum<PolygonTriggerType>();

            var unknown = reader.ReadUInt16();
            if (unknown != 0)
            {
                throw new InvalidDataException();
            }

            var numPoints = reader.ReadUInt32();
            var points = new MapVector3i[numPoints];

            for (var i = 0; i < numPoints; i++)
            {
                points[i] = MapVector3i.Parse(reader);
            }

            return new PolygonTrigger
            {
                Name = name,
                LayerName = layerName,
                UniqueId = uniqueId,
                TriggerType = triggerType,
                Points = points
            };
        }
    }

    [Flags]
    public enum PolygonTriggerType : uint
    {
        Area = 0,
        Water = 1,
        River = 256,
        Unknown = 65536,

        WaterAndRiver = Water | River,
        WaterAndUnknown = Water | Unknown,
    }
}

Support more polygon trigger types

Support more polygon trigger types


using NUnit.Framework;
using Mos6510.Instructions;

namespace Mos6510.Tests.Instructions
{
  [TestFixture]
  public class InyTests
  {
    [Test]
    public void IncrementsTheValueInRegisterY()
    {
      const int initialValue = 42;

      var model = new ProgrammingModel();
      model.GetRegister(RegisterName.Y).SetValue(initialValue);
      var instruction = new Iny();
      instruction.Execute(model);
      Assert.That(model.GetRegister(RegisterName.Y).GetValue(),
                  Is.EqualTo(initialValue + 1));
    }
  }
}

using NUnit.Framework;
using Mos6510.Instructions;

namespace Mos6510.Tests.Instructions
{
  [TestFixture]
  public class InyTests
  {
    [Test]
    public void IncrementsTheValueInRegisterY()
    {
      const int initialValue = 42;

      var model = new ProgrammingModel();
      model.GetRegister(RegisterName.Y).SetValue(initialValue);
      var instruction = new Iny();
      instruction.Execute(model);
      Assert.That(model.GetRegister(RegisterName.Y).GetValue(),
                  Is.EqualTo(initialValue + 1));
    }

    [TestCase(0x7F, true)]
    [TestCase(0x7E, false)]
    public void VerifyValuesOfNegativeFlag(int initialValue, bool expectedResult)
    {
      var model = new ProgrammingModel();
      model.GetRegister(RegisterName.Y).SetValue(initialValue);
      model.NegativeFlag = !expectedResult;

      var instruction = new Iny();
      instruction.Execute(model);

      Assert.That(model.NegativeFlag, Is.EqualTo(expectedResult));
    }

    [TestCase(0xFF, true)]
    [TestCase(0x00, false)]
    public void VerifyValuesOfZeroFlag(int initialValue, bool expectedResult)
    {
      var model = new ProgrammingModel();
      model.GetRegister(RegisterName.Y).SetValue(initialValue);
      model.ZeroFlag = !expectedResult;

      var instruction = new Iny();
      instruction.Execute(model);

      Assert.That(model.ZeroFlag, Is.EqualTo(expectedResult));
    }
  }
}

Add tests for the status flags set by iny.

There is no need for production code changes, as the status flag logic
is already present in the RegisterUtils class.


using System;
using System.Reflection;
using System.Security.Permissions;

// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.

[assembly: AssemblyTitle("MongoDBDriver")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

[assembly: AssemblyVersion("1.0.*")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.

[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]

[assembly: System.Runtime.InteropServices.ComVisible(false)]
[assembly: CLSCompliantAttribute(true)]

[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Bson")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Bson")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, Execution = true)]

using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security.Permissions;

// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.

[assembly: AssemblyTitle("MongoDBDriver")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

[assembly: AssemblyVersion("1.0.*")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.

[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]

[assembly: System.Runtime.InteropServices.ComVisible(false)]
[assembly: CLSCompliantAttribute(true)]

[assembly: InternalsVisibleTo("MongoDB.Driver.Tests")]

[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Bson")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Bson")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, Execution = true)]

Allow MongoDB.Driver.Tests to see internals of MongoDB.Driver.


// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.Graph
{
    /// <summary>
    /// Represents a single item that points to a range from a result. See https://github.com/Microsoft/language-server-protocol/blob/master/indexFormat/specification.md#request-textdocumentreferences
    /// for an example of item edges.
    /// </summary>
    internal sealed class Item : Edge
    {
        public Id<LsifDocument> Document { get; }
        public string? Property { get; }

        public Item(Id<Vertex> outVertex, Id<Range> range, Id<LsifDocument> document, IdFactory idFactory, string? property = null)
            : base(label: "item", outVertex, new[] { range.As<Range, Vertex>() }, idFactory)
        {
            Document = document;
            Property = property;
        }
    }
}

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.Graph
{
    /// <summary>
    /// Represents a single item that points to a range from a result. See https://github.com/Microsoft/language-server-protocol/blob/master/indexFormat/specification.md#request-textdocumentreferences
    /// for an example of item edges.
    /// </summary>
    internal sealed class Item : Edge
    {
        public Id<LsifDocument> Shard { get; }
        public string? Property { get; }

        public Item(Id<Vertex> outVertex, Id<Range> range, Id<LsifDocument> document, IdFactory idFactory, string? property = null)
            : base(label: "item", outVertex, new[] { range.As<Range, Vertex>() }, idFactory)
        {
            Shard = document;
            Property = property;
        }
    }
}

Rename document to shard in item edges

Rename document to shard in item edges


// ReSharper disable InconsistentNaming
#pragma warning disable
namespace Gu.Wpf.UiAutomation.WindowsAPI
{
    using System;
    using System.Diagnostics;
    using System.Runtime.InteropServices;
    using System.Windows;

    [DebuggerDisplay("({X}, {Y})")]
    [StructLayout(LayoutKind.Sequential)]
    public struct POINT : IEquatable<POINT>
    {
        public int X;
        public int Y;

        public POINT(int x, int y)
        {
            this.X = x;
            this.Y = y;
        }

        public static bool operator ==(POINT left, POINT right)
        {
            return left.Equals(right);
        }

        public static bool operator !=(POINT left, POINT right)
        {
            return !left.Equals(right);
        }

        public static POINT Create(Point p)
        {
            return new POINT
            {
                X = (int)p.X,
                Y = (int)p.Y,
            };
        }

        /// <inheritdoc />
        public bool Equals(POINT other)
        {
            return this.X == other.X && this.Y == other.Y;
        }

        /// <inheritdoc />
        public override bool Equals(object obj) => obj is POINT other &&
                                                   this.Equals(other);

        /// <inheritdoc />
        public override int GetHashCode()
        {
            unchecked
            {
                return (this.X * 397) ^ this.Y;
            }
        }
    }
}

// ReSharper disable InconsistentNaming
#pragma warning disable
namespace Gu.Wpf.UiAutomation.WindowsAPI
{
    using System;
    using System.Diagnostics;
    using System.Runtime.InteropServices;
    using System.Windows;

    [DebuggerDisplay("({X}, {Y})")]
    [StructLayout(LayoutKind.Sequential)]
    public struct POINT : IEquatable<POINT>
    {
        public int X;
        public int Y;

        public POINT(int x, int y)
        {
            this.X = x;
            this.Y = y;
        }

        public static bool operator ==(POINT left, POINT right)
        {
            return left.Equals(right);
        }

        public static bool operator !=(POINT left, POINT right)
        {
            return !left.Equals(right);
        }

        /// <inheritdoc />
        public bool Equals(POINT other)
        {
            return this.X == other.X && this.Y == other.Y;
        }

        /// <inheritdoc />
        public override bool Equals(object obj) => obj is POINT other &&
                                                   this.Equals(other);

        /// <inheritdoc />
        public override int GetHashCode()
        {
            unchecked
            {
                return (this.X * 397) ^ this.Y;
            }
        }

        internal static POINT Create(Point p)
        {
            return new POINT
            {
                X = (int)p.X,
                Y = (int)p.Y,
            };
        }
    }
}

Make point factory method internal.

Make point factory method internal.