using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
using Bloom.Publish;
using BloomTemp;
using Chorus.VcsDrivers.Mercurial;
using LibChorus.TestUtilities;
using NUnit.Framework;
using Palaso.IO;
using Palaso.Progress.LogBox;

namespace BloomTests
{
	[TestFixture]
	public class SendReceiveTests
	{
		[Test]
		public void CreateOrLocate_FolderHasAccentedLetter_FindsIt()
		{
			using (var setup = new RepositorySetup("Abé Books"))
			{
				Assert.NotNull(HgRepository.CreateOrLocate(setup.Repository.PathToRepo, new ConsoleProgress()));
			}
		}

		[Test]
		public void CreateOrLocate_FolderHasAccentedLetter2_FindsIt()
		{
			using (var testRoot = new TemporaryFolder("bloom sr test"))
			{
				string path = Path.Combine(testRoot.FolderPath, "Abé Books");
				Directory.CreateDirectory(path);

				Assert.NotNull(HgRepository.CreateOrLocate(path, new ConsoleProgress()));
				Assert.NotNull(HgRepository.CreateOrLocate(path, new ConsoleProgress()));
			}
		}
	  }
}

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
using Bloom.Publish;
using BloomTemp;
using Chorus.VcsDrivers.Mercurial;
using LibChorus.TestUtilities;
using NUnit.Framework;
using Palaso.IO;
using Palaso.Progress.LogBox;

namespace BloomTests
{
	[TestFixture]
	public class SendReceiveTests
	{
		[Test, Ignore("not yet")]
		public void CreateOrLocate_FolderHasAccentedLetter_FindsIt()
		{
			using (var setup = new RepositorySetup("Abé Books"))
			{
				Assert.NotNull(HgRepository.CreateOrLocate(setup.Repository.PathToRepo, new ConsoleProgress()));
			}
		}

		[Test, Ignore("not yet")]
		public void CreateOrLocate_FolderHasAccentedLetter2_FindsIt()
		{
			using (var testRoot = new TemporaryFolder("bloom sr test"))
			{
				string path = Path.Combine(testRoot.FolderPath, "Abé Books");
				Directory.CreateDirectory(path);

				Assert.NotNull(HgRepository.CreateOrLocate(path, new ConsoleProgress()));
				Assert.NotNull(HgRepository.CreateOrLocate(path, new ConsoleProgress()));
			}
		}
	  }
}

Disable 2 s/r tests that demonstrate known chorus problems


using System;
using System.Windows.Forms;

namespace BZ2TerrainEditor
{
	/// <summary>
	/// Main class.
	/// </summary>
	public static class Program
	{
		private static int editorInstances;

		/// <summary>
		/// Gets or sets the number of editor instances.
		/// The application will exit when the number of instaces equals 0.
		/// </summary>
		public static int EditorInstances
		{
			get { return editorInstances; }
			set
			{
				editorInstances = value;
				if (editorInstances == 0)
				{
					Application.Exit();
				}
			}
		}

		/// <summary>
		/// Entry point.
		/// </summary>
		[STAThread]
		public static void Main()
		{
			Application.EnableVisualStyles();
			Editor editor = new Editor();
			editor.Show();
			Application.Run();
		}
	}
}

using System;
using System.Windows.Forms;

namespace BZ2TerrainEditor
{
	/// <summary>
	/// Main class.
	/// </summary>
	public static class Program
	{
		private static int editorInstances;

		/// <summary>
		/// Gets or sets the number of editor instances.
		/// The application will exit when the number of instaces equals 0.
		/// </summary>
		public static int EditorInstances
		{
			get { return editorInstances; }
			set
			{
				editorInstances = value;
				if (editorInstances == 0)
				{
					Application.Exit();
				}
			}
		}

		/// <summary>
		/// Entry point.
		/// </summary>
		[STAThread]
		public static void Main(string[] args)
		{
			Application.EnableVisualStyles();

			Editor editor;

			if (args.Length > 0)
				editor = new Editor(args[0]);
			else
				editor = new Editor();

			editor.Show();
			Application.Run();
		}
	}
}

Add command line parsing (for "Open With...")


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

public class ResetBallUI : NetworkBehaviour {

    private void OnGUI()
    {
        GUILayout.BeginArea(new Rect(Screen.width - 150, 10, 140, 40));
        if (GUILayout.Button("Reset Ball Position"))
        {
            CmdResetBallPosition();
        }
        GUILayout.EndArea();
    }

    [Command]
    private void CmdResetBallPosition()
    {
        var ball = GameObject.FindGameObjectWithTag("Ball");
        if(ball != null)
        {
            ball.GetComponent<Ball>().ResetPosition();
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.Networking.NetworkSystem;

public class ResetBallUI : NetworkBehaviour {

	// Message handle for the client id message
	private short RESPAWN_MESSAGE = 1003;

	void OnServerStart()
	{
		NetworkServer.RegisterHandler(RESPAWN_MESSAGE, OnResetBallPosition);
	}

    private void OnGUI()
    {
        GUILayout.BeginArea(new Rect(Screen.width - 150, 10, 140, 40));
        if (GUILayout.Button("Reset Ball Position"))
		{
			ResetBallPosition();
        }
        GUILayout.EndArea();
    }

    [Server]
	private void OnResetBallPosition(NetworkMessage netMsg)
    {
		ResetBallPosition();
    }

	private void ResetBallPosition()
	{
		if (NetworkServer.connections.Count > 0 || !NetworkManager.singleton.isNetworkActive)
		{
			// If local or the server reset the ball position
			var ball = GameObject.FindGameObjectWithTag("Ball");
			if(ball != null)
			{
				ball.GetComponent<Ball>().ResetPosition();
			}
		}
		else
		{
			// Send an empty message of type respawn message
			NetworkManager.singleton.client.connection.Send(RESPAWN_MESSAGE, new EmptyMessage());
		}
	}
}

Fix reset ball ui for local and multiplayer


using System;
using System.Timers;
using Shell.Execute;

namespace PiDashcam
{
	public class StillCam
	{
		Timer timer;
		int imgcounter;

		public StillCam()
		{
			timer = new Timer(10000);
			timer.Elapsed += Timer_Elapsed;
			timer.Start();
			imgcounter = 1;
		}

		public void Stop()
		{
			timer.Stop();
		}

		void Timer_Elapsed(object sender, ElapsedEventArgs e)
		{
			ProgramLauncher.Execute("raspistill", String.Format("-o {0}.jpg",imgcounter++));
		}
	}
}

using System;
using System.Timers;
using Shell.Execute;

namespace PiDashcam
{
	public class StillCam
	{
		Timer timer;
		int imgcounter;

		public StillCam()
		{
			timer = new Timer(6000);
			timer.Elapsed += Timer_Elapsed;
			timer.Start();
			imgcounter = 1;
		}

		public void Stop()
		{
			timer.Stop();
		}

		void Timer_Elapsed(object sender, ElapsedEventArgs e)
		{
			ProgramLauncher.Execute("raspistill", String.Format("-h 1920 -v 1080 -n -o {0}.jpg",imgcounter++));
		}
	}
}

Change still image capture parameters.

Change still image capture parameters.


using CertiPay.Common.Logging;
using NUnit.Framework;
using System;
using System.Threading;

namespace CertiPay.Common.Tests.Logging
{
    public class MetricLoggingExtensionsTests
    {
        private static readonly ILog Log = LogManager.GetLogger<MetricLoggingExtensionsTests>();

        [Test]
        public void Use_Log_Timer_No_Identifier()
        {
            using (Log.Timer("Use_Log_Timer"))
            {
                // Cool stuff happens here
            }
        }

        [Test]
        public void Use_Log_Timer_With_Debug()
        {
            using (Log.Timer("Use_Log_Timer_With_Debug", level: LogLevel.Debug))
            {
                // Debug tracking happens here
            }
        }

        [Test]
        public void Takes_Longer_Than_Threshold()
        {
            using (Log.Timer("Takes_Longer_Than_Threshold", warnIfExceeds: TimeSpan.FromMilliseconds(100)))
            {
                Thread.Sleep(TimeSpan.FromMilliseconds(150));
            }
        }

        [Test]
        public void Object_Context_Provided()
        {
            using (Log.Timer("Object_Context_Provided", new { id = 10, userId = 12 }))
            {
                // Cool stuff happens here
            }
        }
    }
}

using CertiPay.Common.Logging;
using NUnit.Framework;
using System;
using System.Threading;

namespace CertiPay.Common.Tests.Logging
{
    public class MetricLoggingExtensionsTests
    {
        private static readonly ILog Log = LogManager.GetLogger<MetricLoggingExtensionsTests>();

        [Test]
        public void Use_Log_Timer_No_Identifier()
        {
            using (Log.Timer("Use_Log_Timer"))
            {
                // Cool stuff happens here
            }
        }

        [Test]
        public void Takes_Longer_Than_Threshold()
        {
            using (Log.Timer("Takes_Longer_Than_Threshold", warnIfExceeds: TimeSpan.FromMilliseconds(100)))
            {
                Thread.Sleep(TimeSpan.FromMilliseconds(150));
            }
        }

        [Test]
        public void Object_Context_Provided()
        {
            using (Log.Timer("Object_Context_Provided {id} {userId}", new { id = 10, userId = 12 }))
            {
                // Cool stuff happens here
            }
        }
    }
}

Tweak tests to reflect new interface for log timing


using UnityEngine;

public class ReturnToHiveState : State
{
    Arrive arrive;

    public ReturnToHiveState(GameObject gameObject) : base(gameObject)
    {
        this.gameObject = gameObject;
    }

    public override void Enter()
    {
        arrive = gameObject.GetComponent<Arrive>();
        arrive.targetGameObject = gameObject.transform.parent.gameObject;
    }

    public override void Exit()
    {

    }

    public override void Update()
    {
        if (Vector3.Distance(gameObject.transform.position, gameObject.transform.parent.transform.position) < 1.0f)
        {
            gameObject.transform.parent.GetComponent<BeeSpawner>().pollenCount += gameObject.GetComponent<Bee>().collectedPollen;
            gameObject.GetComponent<Bee>().collectedPollen = 0.0f;
            gameObject.GetComponent<StateMachine>().SwitchState(new ExploreState(gameObject));
        }
    }
}

using UnityEngine;

public class ReturnToHiveState : State
{
    Arrive arrive;

    public ReturnToHiveState(GameObject gameObject) : base(gameObject)
    {
        this.gameObject = gameObject;
    }

    public override void Enter()
    {
        arrive = gameObject.GetComponent<Arrive>();
        arrive.targetGameObject = gameObject.transform.parent.gameObject;
    }

    public override void Exit()
    {
        arrive.targetGameObject = null;
    }

    public override void Update()
    {
        if (Vector3.Distance(gameObject.transform.position, gameObject.transform.parent.transform.position) < 1.0f)
        {
            gameObject.transform.parent.GetComponent<BeeSpawner>().pollenCount += gameObject.GetComponent<Bee>().collectedPollen;
            gameObject.GetComponent<Bee>().collectedPollen = 0.0f;
            gameObject.GetComponent<StateMachine>().SwitchState(new ExploreState(gameObject));
        }
    }
}

Set targetGameObject = null on ReturnToHive state exit as this target was overriding the target position when the boids switched back to exploring


namespace Veil.Compiler
{
    internal partial class VeilTemplateCompiler
    {
        private static void EmitWriteExpression<T>(VeilCompilerState<T> state, SyntaxTreeNode.WriteExpressionNode node)
        {
            state.Emitter.LoadWriterToStack();
            state.PushExpressionScopeOnStack(node.Expression);
            state.Emitter.LoadExpressionFromCurrentModelOnStack(node.Expression);

            if (node.HtmlEncode && node.Expression.ResultType == typeof(string))
            {
                var method = typeof(Helpers).GetMethod("HtmlEncode");
                state.Emitter.Call(method);
            }
            else
            {
                state.Emitter.CallWriteFor(node.Expression.ResultType);
            }
        }
    }
}

using System.Reflection;

namespace Veil.Compiler
{
    internal partial class VeilTemplateCompiler
    {
        private static MethodInfo htmlEncodeMethod = typeof(Helpers).GetMethod("HtmlEncode");

        private static void EmitWriteExpression<T>(VeilCompilerState<T> state, SyntaxTreeNode.WriteExpressionNode node)
        {
            state.Emitter.LoadWriterToStack();
            state.PushExpressionScopeOnStack(node.Expression);
            state.Emitter.LoadExpressionFromCurrentModelOnStack(node.Expression);

            if (node.HtmlEncode)
            {
                if (node.Expression.ResultType != typeof(string)) throw new VeilCompilerException("Tried to HtmlEncode an expression that does not evaluate to a string");
                state.Emitter.Call(htmlEncodeMethod);
            }
            else
            {
                state.Emitter.CallWriteFor(node.Expression.ResultType);
            }
        }
    }
}

Tidy up error handling in WriteExpression


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

namespace Witness.Controllers
{
    public class SandboxController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }
    }
}

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

namespace Witness.Controllers
{
    public class SandboxController : Controller
    {
        public ActionResult Index()
        {
            Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(1));
            return View();
        }
    }
}

Add short term caching to sandbox html response to avoid repeated download by the browser.


namespace Sep.Git.Tfs.Core.TfsInterop
{
    public class WrapperFor<T>
    {
        private readonly T _wrapped;

        public WrapperFor(T wrapped)
        {
            _wrapped = wrapped;
        }

        public T Unwrap()
        {
            return _wrapped;
        }

        public static T Unwrap(object wrapper)
        {
            return ((WrapperFor<T>)wrapper).Unwrap();
        }
    }
}

namespace Sep.Git.Tfs.Core.TfsInterop
{
    public class WrapperFor<TFS_TYPE>
    {
        private readonly TFS_TYPE _wrapped;

        public WrapperFor(TFS_TYPE wrapped)
        {
            _wrapped = wrapped;
        }

        public TFS_TYPE Unwrap()
        {
            return _wrapped;
        }

        public static TFS_TYPE Unwrap(object wrapper)
        {
            return ((WrapperFor<TFS_TYPE>)wrapper).Unwrap();
        }
    }
}

Make the generic type self-documenting.

Make the generic type self-documenting.


// Copyright 2020 Maintainers of NUKE.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE

using System;
using System.Linq;
using JetBrains.Annotations;
using Nuke.Common.Execution;
using Nuke.Common.Tools.DotNet;

namespace Nuke.Common.CI
{
    [PublicAPI]
    [AttributeUsage(AttributeTargets.Class)]
    public class ShutdownDotNetBuildServerOnFinish : Attribute, IOnBuildFinished
    {
        public void OnBuildFinished(NukeBuild build)
        {
            // Note https://github.com/dotnet/cli/issues/11424
            DotNetTasks.DotNet("build-server shutdown");
        }
    }
}

// Copyright 2020 Maintainers of NUKE.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE

using System;
using System.Linq;
using JetBrains.Annotations;
using Nuke.Common.Execution;
using Nuke.Common.Tools.DotNet;

namespace Nuke.Common.CI
{
    [PublicAPI]
    [AttributeUsage(AttributeTargets.Class)]
    public class ShutdownDotNetBuildServerOnFinish : Attribute, IOnBuildFinished
    {
        public bool EnableLogging { get; set; }

        public void OnBuildFinished(NukeBuild build)
        {
            // Note https://github.com/dotnet/cli/issues/11424
            DotNetTasks.DotNet("build-server shutdown", logInvocation: EnableLogging, logOutput: EnableLogging);
        }
    }
}

Disable logging for shutdown of dotnet process by default


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

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

[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
[assembly: AssemblyConfiguration("Release built on 2013-10-23 22:48")]
[assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")]
[assembly: AssemblyDescription("Autofac.Extras.NHibernate 3.0.0")]

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

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

[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
[assembly: AssemblyConfiguration("Release built on 2013-12-03 10:23")]
[assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")]
[assembly: AssemblyDescription("Autofac.Extras.NHibernate 3.0.0")]

Split WCF functionality out of Autofac.Extras.Multitenant into a separate assembly/package, Autofac.Extras.Multitenant.Wcf. Both packages are versioned 3.1.0.


@model Dinamico.Models.ContentPage

@{
	Content.Define(re =>
	{
		re.Title = "News page";
		re.IconUrl = "{IconsUrl}/newspaper.png";
		re.DefaultValue("Visible", false);
		re.RestrictParents("Container");
		re.Sort(N2.Definitions.SortBy.PublishedDescending);
	});
}

@Html.Partial("LayoutPartials/BlogContent")
@using (Content.BeginScope(Content.Traverse.Parent()))
{
	@Content.Render.Tokens("NewsFooter")
}

@model Dinamico.Models.ContentPage

@{
	Content.Define(re =>
	{
		re.Title = "News page";
		re.IconUrl = "{IconsUrl}/newspaper.png";
		re.DefaultValue("Visible", false);
		re.RestrictParents("Container");
		re.Sort(N2.Definitions.SortBy.PublishedDescending);
		re.Tags("Tags");
	});
}

@Html.Partial("LayoutPartials/BlogContent")
@using (Content.BeginScope(Content.Traverse.Parent()))
{
	@Content.Render.Tokens("NewsFooter")
}

Add tagging capability to Dinamico news page


namespace WarehouseSystem.Web
{
    using System.Web.Mvc;
    using System.Web.Optimization;
    using System.Web.Routing;
    using WarehouseSystem.Web.App_Start;

    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            DbConfig.Initialize();
            AutoMapperConfig.Execute();
        }
    }
}

namespace WarehouseSystem.Web
{
    using System.Web.Mvc;
    using System.Web.Optimization;
    using System.Web.Routing;
    using WarehouseSystem.Web.App_Start;

    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            ViewEngines.Engines.Clear();
            ViewEngines.Engines.Add(new RazorViewEngine());

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

            DbConfig.Initialize();
            AutoMapperConfig.Execute();
        }
    }
}

Set only Razor view Engine

Set only Razor view Engine


using System.Collections.Generic;
using Newtonsoft.Json;
using System;
using Newtonsoft.Json.Converters;

namespace Nest
{
	[JsonObject(MemberSerialization.OptIn)]
	public class DateMapping : MultiFieldMapping, IElasticType, IElasticCoreType
	{
		public DateMapping():base("date")
		{
		}

		/// <summary>
		/// The name of the field that will be stored in the index. Defaults to the property/field name.
		/// </summary>
		[JsonProperty("index_name")]
		public string IndexName { get; set; }

		[JsonProperty("store")]
		public bool? Store { get; set; }

		[JsonProperty("index"), JsonConverter(typeof(StringEnumConverter))]
		public NonStringIndexOption? Index { get; set; }

		[JsonProperty("format")]
		public string Format { get; set; }

		[JsonProperty("precision_step")]
		public int? PrecisionStep { get; set; }

		[JsonProperty("boost")]
		public double? Boost { get; set; }

		[JsonProperty("null_value")]
		public DateTime? NullValue { get; set; }

		[JsonProperty("ignore_malformed")]
		public bool? IgnoreMalformed { get; set; }

		[JsonProperty("doc_values")]
		public bool? DocValues { get; set; }

		[JsonProperty("numeric_resolution")]
		public NumericResolutionUnit NumericResolution { get; set; }
	}
}

using System.Collections.Generic;
using Newtonsoft.Json;
using System;
using Newtonsoft.Json.Converters;

namespace Nest
{
	[JsonObject(MemberSerialization.OptIn)]
	public class DateMapping : MultiFieldMapping, IElasticType, IElasticCoreType
	{
		public DateMapping():base("date")
		{
		}

		/// <summary>
		/// The name of the field that will be stored in the index. Defaults to the property/field name.
		/// </summary>
		[JsonProperty("index_name")]
		public string IndexName { get; set; }

		[JsonProperty("store")]
		public bool? Store { get; set; }

		[JsonProperty("index"), JsonConverter(typeof(StringEnumConverter))]
		public NonStringIndexOption? Index { get; set; }

		[JsonProperty("format")]
		public string Format { get; set; }

		[JsonProperty("precision_step")]
		public int? PrecisionStep { get; set; }

		[JsonProperty("boost")]
		public double? Boost { get; set; }

		[JsonProperty("null_value")]
		public DateTime? NullValue { get; set; }

		[JsonProperty("ignore_malformed")]
		public bool? IgnoreMalformed { get; set; }

		[JsonProperty("doc_values")]
		public bool? DocValues { get; set; }

		[JsonProperty("numeric_resolution")]
		public NumericResolutionUnit? NumericResolution { get; set; }
	}
}

Make numeric_resolution on date mapping nullable


@model SFA.DAS.EmployerAccounts.Web.ViewModels.AccountDashboardViewModel

    @if (Model.ReservedFundingToShow != null)
    {

Apprenticeship funding secured

Legal entity:

@Model.ReservedFundingToShowLegalEntityName

Training course:

@Model.ReservedFundingToShow.CourseName

Start and end date:

@Model.ReservedFundingToShow.StartDate.ToString("MMMM yyyy") to @Model.ReservedFundingToShow.EndDate.ToString("MMMM yyyy")

    }

    @if (Model.RecentlyAddedReservationId != null &&
         Model.ReservedFundingToShow?.ReservationId != Model.RecentlyAddedReservationId)
    {

We're dealing with your request for funding, please check back later.

    }

Check and secure funding now

Remove nested div to fix style issue

[CON-378] Remove nested div to fix style issue


using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Microsoft.Azure.Mobile.Server;
using DailySoccer.Shared.Models;

namespace DailySoccerAppService.Controllers
{
    public class MatchesController : ApiController
    {
        public ApiServices Services { get; set; }

        [HttpGet]
        public GetMatchesRespond GetMatches(GetMatchesRequest request)
        {
            var now = DateTime.Now;
            var matches = new List<MatchInformation>
            {
                new MatchInformation
                {
                    Id = 1,
                    BeginDate = now,
                    LeagueName = "Premier League",
                    TeamHome = new TeamInformation
                    {
                        Id = 1,
                        Name = "FC Astana",
                        CurrentScore = 1,
                        CurrentPredictionPoints = 7,
                        WinningPredictionPoints = 5
                    },
                    TeamAway = new TeamInformation
                    {
                        Id = 2,
                        Name = "Atletico Madrid",
                        CurrentScore = 0,
                        CurrentPredictionPoints = 3,
                    },
                },
            };

            return new GetMatchesRespond
            {
                CurrentDate = now,
                AccountInfo = new AccountInformation
                {
                    Points = 255,
                    RemainingGuessAmount = 5,
                    CurrentOrderedCoupon = 15
                },
                Matches = matches
            };
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Microsoft.Azure.Mobile.Server;
using DailySoccer.Shared.Models;

namespace DailySoccerAppService.Controllers
{
    public class MatchesController : ApiController
    {
        public ApiServices Services { get; set; }

        // GET: api/Matches
        [HttpGet]
        public string Get()
        {
            return "Respond by GET method";
        }

        [HttpPost]
        public string Post(int id)
        {
            return "Respond by POST method, your ID: " + id;
        }

        [HttpPost]
        public GetMatchesRespond GetMatches(GetMatchesRequest request)
        {
            var now = DateTime.Now;
            var matches = new List<MatchInformation>
            {
                new MatchInformation
                {
                    Id = 1,
                    BeginDate = now,
                    LeagueName = "Premier League",
                    TeamHome = new TeamInformation
                    {
                        Id = 1,
                        Name = "FC Astana",
                        CurrentScore = 1,
                        CurrentPredictionPoints = 7,
                        WinningPredictionPoints = 5
                    },
                    TeamAway = new TeamInformation
                    {
                        Id = 2,
                        Name = "Atletico Madrid",
                        CurrentScore = 0,
                        CurrentPredictionPoints = 3,
                    },
                },
            };

            return new GetMatchesRespond
            {
                CurrentDate = now,
                AccountInfo = new AccountInformation
                {
                    Points = 255,
                    RemainingGuessAmount = 5,
                    CurrentOrderedCoupon = 15
                },
                Matches = matches
            };
        }
    }
}

Add basic GET & POST methods into the MatchServices.

Signed-off-by: Sakul Jaruthanaset <17b4bfe9c570ddd7d4345ec4b3617835712513c0@perfenterprise.com>


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Threading;

namespace Smaller
{
    public class RunJobController
    {
        private  static readonly EventWaitHandle _showSignal = new EventWaitHandle(false, EventResetMode.AutoReset, "Smaller.ShowSignal");

        public void TriggerRunJobs()
        {
            _showSignal.Set();
        }

        private RunJobController()
        {
            StartListenForJobs();
        }

        private static readonly RunJobController _instance = new RunJobController();

        public static RunJobController Instance
        {
            get { return _instance; }
        }

        private void RunJobs()
        {
            Action x = () =>
            {
                //if (Application.Current.MainWindow == null)
                //{
                //    Application.Current.MainWindow = new MainWindow();
                //    Application.Current.MainWindow.Show();
                //}

                new JobRunner().Run();
            };

            Application.Current.Dispatcher.Invoke(x, DispatcherPriority.Send);
        }

        private void StartListenForJobs()
        {
            new Thread(() =>
            {
                while (true)
                {
                    _showSignal.WaitOne();

                    RunJobs();
                }
            }).Start();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Threading;

namespace Smaller
{
    public class RunJobController
    {
        private  static readonly EventWaitHandle _showSignal = new EventWaitHandle(false, EventResetMode.AutoReset, "Smaller.ShowSignal");

        public void TriggerRunJobs()
        {
            _showSignal.Set();
        }

        private RunJobController()
        {
            StartListenForJobs();
        }

        private static readonly RunJobController _instance = new RunJobController();

        public static RunJobController Instance
        {
            get { return _instance; }
        }

        private void RunJobs()
        {
            Action x = () =>
            {
                //if (Application.Current.MainWindow == null)
                //{
                //    Application.Current.MainWindow = new MainWindow();
                //    Application.Current.MainWindow.Show();
                //}

                new JobRunner().Run();
            };

            Application.Current.Dispatcher.Invoke(x, DispatcherPriority.Send);
        }

        private void StartListenForJobs()
        {
            new Thread(() =>
            {
                // only wait for signals while the app is running
                while (Application.Current != null)
                {
                    if (_showSignal.WaitOne(500))
                    {
                        RunJobs();
                    }
                }
            }).Start();
        }
    }
}

Fix bug where Smaller wouldn't exit properly


using System;

namespace TAPCfg {
	public class EthernetFrame {
		private byte[] data;
		private byte[] src = new byte[6];
		private byte[] dst = new byte[6];
		private int etherType;

		public EthernetFrame(byte[] data) {
			this.data = data;
			Array.Copy(data, 0, dst, 0, 6);
			Array.Copy(data, 6, src, 0, 6);
			etherType = (data[12] << 8) | data[13];
		}

		public byte[] Data {
			get { return data; }
		}

		public int Length {
			get { return data.Length; }
		}

		public byte[] SourceAddress {
			get { return src; }
		}

		public byte[] DestinationAddress {
			get { return dst; }
		}

		public int EtherType {
			get { return etherType; }
		}

		public byte[] Payload {
			get {
				byte[] ret = new byte[data.Length - 14];
				Array.Copy(data, 14, ret, 0, ret.Length);
				return ret;
			}
		}
	}
}

using System;

namespace TAPCfg {
	public enum EtherType : int {
		InterNetwork   = 0x0800,
		ARP            = 0x0806,
		RARP           = 0x8035,
		AppleTalk      = 0x809b,
		AARP           = 0x80f3,
		InterNetworkV6 = 0x86dd,
		CobraNet       = 0x8819,
	}

	public class EthernetFrame {
		private byte[] data;
		private byte[] src = new byte[6];
		private byte[] dst = new byte[6];
		private int etherType;

		public EthernetFrame(byte[] data) {
			this.data = data;
			Array.Copy(data, 0, dst, 0, 6);
			Array.Copy(data, 6, src, 0, 6);
			etherType = (data[12] << 8) | data[13];
		}

		public byte[] Data {
			get { return data; }
		}

		public int Length {
			get { return data.Length; }
		}

		public byte[] SourceAddress {
			get { return src; }
		}

		public byte[] DestinationAddress {
			get { return dst; }
		}

		public int EtherType {
			get { return etherType; }
		}

		public byte[] Payload {
			get {
				byte[] ret = new byte[data.Length - 14];
				Array.Copy(data, 14, ret, 0, ret.Length);
				return ret;
			}
		}
	}
}

Add EtherType enumeration for some types (not all)


using System;
using System.IO;

namespace Cake.AppVeyor.Tests
{
    public static class Keys
    {
        const string YOUR_APPVEYOR_API_TOKEN = "{APPVEYOR_APITOKEN}";

        static string appVeyorApiToken;

        public static string AppVeyorApiToken {
            get
            {
                if (appVeyorApiToken == null)
                {
                    // Check for a local file with a token first
                    var localFile = Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", ".appveyorapitoken");
                    if (File.Exists(localFile))
                        appVeyorApiToken = File.ReadAllText(localFile);

                    // Next check for an environment variable
                    if (string.IsNullOrEmpty(appVeyorApiToken))
                        appVeyorApiToken = Environment.GetEnvironmentVariable("appveyor_api_token");

                    // Finally use the const value
                    if (string.IsNullOrEmpty(appVeyorApiToken))
                        appVeyorApiToken = YOUR_APPVEYOR_API_TOKEN;
                }

                return appVeyorApiToken;
            }
        }
    }
}

using System;
using System.IO;

namespace Cake.AppVeyor.Tests
{
    public static class Keys
    {
        const string YOUR_APPVEYOR_API_TOKEN = "{APPVEYOR_APITOKEN}";

        static string appVeyorApiToken;

        public static string AppVeyorApiToken {
            get
            {
                if (appVeyorApiToken == null)
                {
                    // Check for a local file with a token first
                    var localFile = Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", "..", ".appveyorapitoken");
                    if (File.Exists(localFile))
                        appVeyorApiToken = File.ReadAllText(localFile);

                    // Next check for an environment variable
                    if (string.IsNullOrEmpty(appVeyorApiToken))
                        appVeyorApiToken = Environment.GetEnvironmentVariable("appveyor_api_token");

                    // Finally use the const value
                    if (string.IsNullOrEmpty(appVeyorApiToken))
                        appVeyorApiToken = YOUR_APPVEYOR_API_TOKEN;
                }

                return appVeyorApiToken;
            }
        }
    }
}

Fix path to local key file

Fix path to local key file


using System;
using NUnit.Framework;
using FbxSharp;

namespace FbxSharpTests
{
    [TestFixture]
    public class ObjectPrinterTest
    {
        [Test]
        public void QuoteQuotesAndEscapeStrings()
        {
            Assert.AreEqual("\"abcdefghijklmnopqrstuvwxyz\"", ObjectPrinter.quote("abcdefghijklmnopqrstuvwxyz"));
            Assert.AreEqual("\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"", ObjectPrinter.quote("ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
            Assert.AreEqual("\"0123456789\"", ObjectPrinter.quote("0123456789"));
            Assert.AreEqual("\"`~!@#$%^&*()_+-=\"", ObjectPrinter.quote("`~!@#$%^&*()_+-="));
//            Assert.AreEqual("\"\\\\\"", ObjectPrinter.quote("\\"));
//            Assert.AreEqual("\"\\\"\"", ObjectPrinter.quote("\""));
            Assert.AreEqual("\"[]{}|;:',<.>/?\"", ObjectPrinter.quote("[]{}|;:',<.>/?"));
            Assert.AreEqual("\"\\r\"", ObjectPrinter.quote("\r"));
            Assert.AreEqual("\"\\n\"", ObjectPrinter.quote("\n"));
            Assert.AreEqual("\"\\t\"", ObjectPrinter.quote("\t"));
        }
    }
}

using System;
using NUnit.Framework;
using FbxSharp;
using System.IO;

namespace FbxSharpTests
{
    [TestFixture]
    public class ObjectPrinterTest
    {
        [Test]
        public void QuoteQuotesAndEscapeStrings()
        {
            Assert.AreEqual("\"abcdefghijklmnopqrstuvwxyz\"", ObjectPrinter.quote("abcdefghijklmnopqrstuvwxyz"));
            Assert.AreEqual("\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"", ObjectPrinter.quote("ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
            Assert.AreEqual("\"0123456789\"", ObjectPrinter.quote("0123456789"));
            Assert.AreEqual("\"`~!@#$%^&*()_+-=\"", ObjectPrinter.quote("`~!@#$%^&*()_+-="));
//            Assert.AreEqual("\"\\\\\"", ObjectPrinter.quote("\\"));
//            Assert.AreEqual("\"\\\"\"", ObjectPrinter.quote("\""));
            Assert.AreEqual("\"[]{}|;:',<.>/?\"", ObjectPrinter.quote("[]{}|;:',<.>/?"));
            Assert.AreEqual("\"\\r\"", ObjectPrinter.quote("\r"));
            Assert.AreEqual("\"\\n\"", ObjectPrinter.quote("\n"));
            Assert.AreEqual("\"\\t\"", ObjectPrinter.quote("\t"));
        }

        [Test]
        public void PrintPropertyPrintsTheProperty()
        {
            // given
            var prop = new PropertyT<double>("something");
            var printer = new ObjectPrinter();
            var writer = new StringWriter();
            var expected =
@"        Name = something
        Type = Double (MonoType)
        Value = 0
        SrcObjectCount = 0
        DstObjectCount = 0
";

            // when
            printer.PrintProperty(prop, writer);

            // then
            Assert.AreEqual(expected, writer.ToString());
        }
    }
}

Add a test with a specific writer.

Add a test with a specific writer.


using System.Reflection;

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

using System.Reflection;

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

Revert "Bump WebApi version to 5.10.3"

Revert "Bump WebApi version to 5.10.3"

This reverts commit 9356b6eb8eb6c9080fd72df0cd1f69f7b499912b.


using System;
using Roton.Emulation.Core;
using Roton.Emulation.Data;
using Roton.Emulation.Data.Impl;
using Roton.Infrastructure.Impl;

namespace Roton.Emulation.Interactions.Impl
{
    [Context(Context.Original, 0x14)]
    [Context(Context.Super, 0x14)]
    public sealed class ForestInteraction : IInteraction
    {
        private readonly Lazy<IEngine> _engine;
        private IEngine Engine => _engine.Value;

        public ForestInteraction(Lazy<IEngine> engine)
        {
            _engine = engine;
        }

        public void Interact(IXyPair location, int index, IXyPair vector)
        {
            Engine.ClearForest(location);
            Engine.UpdateBoard(location);

            var forestIndex = Engine.State.ForestIndex;
            var forestSongLength = Engine.Sounds.Forest.Length;
            Engine.State.ForestIndex = (forestIndex + 2) % forestSongLength;
            Engine.PlaySound(3, Engine.Sounds.Forest, forestIndex, 2);

            if (!Engine.Alerts.Forest)
                return;

            Engine.SetMessage(0xC8, Engine.Alerts.ForestMessage);
            Engine.Alerts.Forest = false;
        }
    }
}

using System;
using Roton.Emulation.Core;
using Roton.Emulation.Data;
using Roton.Emulation.Data.Impl;
using Roton.Infrastructure.Impl;

namespace Roton.Emulation.Interactions.Impl
{
    [Context(Context.Original, 0x14)]
    [Context(Context.Super, 0x14)]
    public sealed class ForestInteraction : IInteraction
    {
        private readonly Lazy<IEngine> _engine;
        private IEngine Engine => _engine.Value;

        public ForestInteraction(Lazy<IEngine> engine)
        {
            _engine = engine;
        }

        public void Interact(IXyPair location, int index, IXyPair vector)
        {
            Engine.ClearForest(location);
            Engine.UpdateBoard(location);

            var forestSongLength = Engine.Sounds.Forest.Length;
            var forestIndex = Engine.State.ForestIndex % forestSongLength;
            Engine.State.ForestIndex = (forestIndex + 2) % forestSongLength;
            Engine.PlaySound(3, Engine.Sounds.Forest, forestIndex, 2);

            if (!Engine.Alerts.Forest)
                return;

            Engine.SetMessage(0xC8, Engine.Alerts.ForestMessage);
            Engine.Alerts.Forest = false;
        }
    }
}

Fix a forest crash in ZZT.

Fix a forest crash in ZZT.


//-------------------------------------------------------------------------------
// <copyright file="NewtonsoftJsonMessageSerializer.cs" company="MMS AG">
//   Copyright (c) MMS AG, 2008-2015
// </copyright>
//-------------------------------------------------------------------------------

namespace MMS.ServiceBus.Pipeline
{
    using System;
    using System.IO;
    using Newtonsoft.Json;

    public class NewtonsoftJsonMessageSerializer : IMessageSerializer
    {
        public string ContentType
        {
            get
            {
                return "application/json";
            }
        }

        public void Serialize(object message, Stream body)
        {
            var streamWriter = new StreamWriter(body);
            var writer = new JsonTextWriter(streamWriter);
            var serializer = new JsonSerializer();
            serializer.Serialize(writer, message);
            streamWriter.Flush();

            body.Flush();
            body.Position = 0;
        }

        public object Deserialize(Stream body, Type messageType)
        {
            var streamReader = new StreamReader(body);
            var reader = new JsonTextReader(streamReader);
            var serializer = new JsonSerializer();
            return serializer.Deserialize(reader, messageType);
        }
    }
}

//-------------------------------------------------------------------------------
// <copyright file="NewtonsoftJsonMessageSerializer.cs" company="MMS AG">
//   Copyright (c) MMS AG, 2008-2015
// </copyright>
//-------------------------------------------------------------------------------

namespace MMS.ServiceBus.Pipeline
{
    using System;
    using System.IO;
    using Newtonsoft.Json;

    public class NewtonsoftJsonMessageSerializer : IMessageSerializer
    {
        private readonly Func<JsonSerializerSettings> settings;

        public NewtonsoftJsonMessageSerializer() : this(() => null)
        {
        }

        public NewtonsoftJsonMessageSerializer(Func<JsonSerializerSettings> settings)
        {
            this.settings = settings;
        }

        public string ContentType
        {
            get
            {
                return "application/json";
            }
        }

        public void Serialize(object message, Stream body)
        {
            var streamWriter = new StreamWriter(body);
            var writer = new JsonTextWriter(streamWriter);
            var serializer = JsonSerializer.Create(this.settings());
            serializer.Serialize(writer, message);
            streamWriter.Flush();

            body.Flush();
            body.Position = 0;
        }

        public object Deserialize(Stream body, Type messageType)
        {
            var streamReader = new StreamReader(body);
            var reader = new JsonTextReader(streamReader);
            var serializer = JsonSerializer.Create(this.settings());
            return serializer.Deserialize(reader, messageType);
        }
    }
}

Enable configuration of Json Serializer

Enable configuration of Json Serializer


// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ContextExtensions.cs" company="Quartz Software SRL">
//   Copyright (c) Quartz Software SRL. All rights reserved.
// </copyright>
// <summary>
//   Implements the context extensions class.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Kephas.Data.InMemory
{
    using System.Collections.Generic;

    using Kephas.Data.Capabilities;
    using Kephas.Diagnostics.Contracts;
    using Kephas.Services;

    /// <summary>
    /// Extension methods for <see cref="IContext"/>.
    /// </summary>
    public static class ContextExtensions
    {
        /// <summary>
        /// Gets the initial data.
        /// </summary>
        /// <param name="context">The context to act on.</param>
        /// <returns>
        /// An enumeration of entity information.
        /// </returns>
        public static IEnumerable<IEntityInfo> GetInitialData(this IContext context)
        {
            Requires.NotNull(context, nameof(context));

            return context[nameof(InMemoryDataContextConfiguration.InitialData)] as IEnumerable<IEntityInfo>;
        }

        /// <summary>
        /// Sets the initial data.
        /// </summary>
        /// <param name="context">The context to act on.</param>
        /// <param name="initialData">The initial data.</param>
        public static void SetInitialData(this IContext context, IEnumerable<IEntityInfo> initialData)
        {
            Requires.NotNull(context, nameof(context));

            context[nameof(InMemoryDataContextConfiguration.InitialData)] = initialData;
        }
    }
}

// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ContextExtensions.cs" company="Quartz Software SRL">
//   Copyright (c) Quartz Software SRL. All rights reserved.
// </copyright>
// <summary>
//   Implements the context extensions class.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Kephas.Data.InMemory
{
    using System.Collections.Generic;

    using Kephas.Data.Capabilities;
    using Kephas.Diagnostics.Contracts;
    using Kephas.Services;

    /// <summary>
    /// Extension methods for <see cref="IContext"/>.
    /// </summary>
    public static class ContextExtensions
    {
        /// <summary>
        /// Gets the initial data.
        /// </summary>
        /// <param name="context">The context to act on.</param>
        /// <returns>
        /// An enumeration of entity information.
        /// </returns>
        public static IEnumerable<IEntityInfo> GetInitialData(this IContext context)
        {
            return context?[nameof(InMemoryDataContextConfiguration.InitialData)] as IEnumerable<IEntityInfo>;
        }

        /// <summary>
        /// Sets the initial data.
        /// </summary>
        /// <param name="context">The context to act on.</param>
        /// <param name="initialData">The initial data.</param>
        public static void SetInitialData(this IContext context, IEnumerable<IEntityInfo> initialData)
        {
            Requires.NotNull(context, nameof(context));

            context[nameof(InMemoryDataContextConfiguration.InitialData)] = initialData;
        }
    }
}

Allow context to be null when querying for initial data.


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

using System;
using Microsoft.AspNet.Security.DataProtection.KeyManagement;
using Microsoft.Framework.DependencyInjection;
using Microsoft.Framework.DependencyInjection.Fallback;
using Microsoft.Framework.OptionsModel;

namespace Microsoft.AspNet.Security.DataProtection
{
    public class DefaultDataProtectionProvider : IDataProtectionProvider
    {
        private readonly IDataProtectionProvider _innerProvider;

        public DefaultDataProtectionProvider()
        {
            // use DI defaults
            var collection = new ServiceCollection();
            var defaultServices = DataProtectionServices.GetDefaultServices();
            collection.Add(defaultServices);
            var serviceProvider = collection.BuildServiceProvider();

            _innerProvider = (IDataProtectionProvider)serviceProvider.GetService(typeof(IDataProtectionProvider));
            CryptoUtil.Assert(_innerProvider != null, "_innerProvider != null");
        }

        public DefaultDataProtectionProvider(
            [NotNull] IOptions<DataProtectionOptions> optionsAccessor,
            [NotNull] IKeyManager keyManager)
        {
            KeyRingBasedDataProtectionProvider rootProvider = new KeyRingBasedDataProtectionProvider(new KeyRingProvider(keyManager));
            var options = optionsAccessor.Options;
            _innerProvider = (!String.IsNullOrEmpty(options.ApplicationDiscriminator))
                ? (IDataProtectionProvider)rootProvider.CreateProtector(options.ApplicationDiscriminator)
                : rootProvider;
        }

        public IDataProtector CreateProtector([NotNull] string purpose)
        {
            return _innerProvider.CreateProtector(purpose);
        }
    }
}

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

using System;
using Microsoft.AspNet.Security.DataProtection.KeyManagement;
using Microsoft.Framework.DependencyInjection;
using Microsoft.Framework.DependencyInjection.Fallback;
using Microsoft.Framework.OptionsModel;

namespace Microsoft.AspNet.Security.DataProtection
{
    public class DefaultDataProtectionProvider : IDataProtectionProvider
    {
        private readonly IDataProtectionProvider _innerProvider;

        public DefaultDataProtectionProvider()
        {
            // use DI defaults
            var collection = new ServiceCollection();
            var defaultServices = DataProtectionServices.GetDefaultServices();
            collection.Add(defaultServices);
            var serviceProvider = collection.BuildServiceProvider();

            _innerProvider = serviceProvider.GetRequiredService<IDataProtectionProvider>();
        }

        public DefaultDataProtectionProvider(
            [NotNull] IOptions<DataProtectionOptions> optionsAccessor,
            [NotNull] IKeyManager keyManager)
        {
            KeyRingBasedDataProtectionProvider rootProvider = new KeyRingBasedDataProtectionProvider(new KeyRingProvider(keyManager));
            var options = optionsAccessor.Options;
            _innerProvider = (!String.IsNullOrEmpty(options.ApplicationDiscriminator))
                ? (IDataProtectionProvider)rootProvider.CreateProtector(options.ApplicationDiscriminator)
                : rootProvider;
        }

        public IDataProtector CreateProtector([NotNull] string purpose)
        {
            return _innerProvider.CreateProtector(purpose);
        }
    }
}

Change GetService call to GetRequiredService

Remove the assertion that the returned service is not null, since the
GetRequiredService extension method will throw instead of ever
returning 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.Game.Beatmaps;
using osu.Game.Online.API.Requests.Responses;

namespace osu.Game.Online.API.Requests
{
    public class GetBeatmapRequest : APIRequest<APIBeatmap>
    {
        private readonly BeatmapInfo beatmap;

        private string lookupString => beatmap.OnlineBeatmapID > 0 ? beatmap.OnlineBeatmapID.ToString() : $@"lookup?checksum={beatmap.MD5Hash}&filename={System.Uri.EscapeUriString(beatmap.Path)}";

        public GetBeatmapRequest(BeatmapInfo beatmap)
        {
            this.beatmap = beatmap;
        }

        protected override string Target => $@"beatmaps/{lookupString}";
    }
}

// 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.Game.Beatmaps;
using osu.Game.Online.API.Requests.Responses;

namespace osu.Game.Online.API.Requests
{
    public class GetBeatmapRequest : APIRequest<APIBeatmap>
    {
        private readonly BeatmapInfo beatmap;

        public GetBeatmapRequest(BeatmapInfo beatmap)
        {
            this.beatmap = beatmap;
        }

        protected override string Target => $@"beatmaps/lookup?id={beatmap.OnlineBeatmapID}&checksum={beatmap.MD5Hash}&filename={System.Uri.EscapeUriString(beatmap.Path)}";
    }
}

Simplify beatmap lookup to use a single endpoint


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

[assembly: AssemblyTitle("DanTup's DartAnalysis.NET: A .NET wrapper around Google's Analysis Server for Dart.")]
[assembly: AssemblyProduct("DanTup's DartAnalysis.NET: A .NET wrapper around Google's Analysis Server for Dart.")]
[assembly: AssemblyCompany("Danny Tuppeny")]
[assembly: AssemblyCopyright("Copyright Danny Tuppeny © 2014")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("0.1.*")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: InternalsVisibleTo("DanTup.DartAnalysis.Tests")]

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

[assembly: AssemblyTitle("DartAnalysis.NET: A .NET wrapper around Google's Analysis Server for Dart.")]
[assembly: AssemblyProduct("DartAnalysis.NET: A .NET wrapper around Google's Analysis Server for Dart.")]
[assembly: AssemblyCompany("Danny Tuppeny")]
[assembly: AssemblyCopyright("Copyright Danny Tuppeny © 2014")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("0.1.*")]
[assembly: InternalsVisibleTo("DanTup.DartAnalysis.Tests")]

Remove name from assembly info; this looks silly on NuGet.


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

namespace Mvc52Application.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult About()
        {
            string foo = ConfigurationManager.AppSettings["foo"];
            ViewBag.Message = String.Format("The value of setting foo is: '{0}'", foo);

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Mvc52Application.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            Trace.TraceInformation("{0}: This is an informational trace message", DateTime.Now);
            Trace.TraceWarning("{0}: Here is trace warning", DateTime.Now);
            Trace.TraceError("{0}: Something is broken; tracing an error!", DateTime.Now);

            return View();
        }

        public ActionResult About()
        {
            string foo = ConfigurationManager.AppSettings["foo"];
            ViewBag.Message = String.Format("The value of setting foo is: '{0}'", foo);

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}

Add some test tracing to Index action

Add some test tracing to Index action


using ErgastApi.Client.Attributes;
using ErgastApi.Responses;

namespace ErgastApi.Requests
{
    public class SeasonListRequest : StandardRequest<SeasonResponse>
    {
        // Value not used
        // ReSharper disable once UnassignedGetOnlyAutoProperty
        [UrlTerminator, UrlSegment("seasons")]
        protected object Seasons { get; }
    }
}

using ErgastApi.Client.Attributes;
using ErgastApi.Responses;

namespace ErgastApi.Requests
{
    public class SeasonListRequest : StandardRequest<SeasonResponse>
    {
        [UrlSegment("constructorStandings")]
        public int? ConstructorStanding { get; set; }

        [UrlSegment("driverStandings")]
        public int? DriverStanding { get; set; }

        // Value not used
        // ReSharper disable once UnassignedGetOnlyAutoProperty
        [UrlTerminator, UrlSegment("seasons")]
        protected object Seasons { get; }
    }
}

Support driver constructor standing parameter for season list request


using System.Threading.Tasks;
using Sinch.ServerSdk.Callouts;
using Sinch.WebApiClient;

public interface ICalloutApiEndpoints
{
    [HttpPost("calling/v1/callouts/")]
    Task<CalloutResponse> Callout([ToBody] CalloutRequest request);
}

using System.Threading.Tasks;
using Sinch.ServerSdk.Callouts;
using Sinch.WebApiClient;

public interface ICalloutApiEndpoints
{
    [HttpPost("calling/v1/callouts")]
    Task<CalloutResponse> Callout([ToBody] CalloutRequest request);
}

Remove API route trailing slash to avoid AWS API Gateway modification

Remove last slash in API route  so url don't get modified when passing AWS API Gateway. This may be cause of signature error


using ImGui.Rendering;

namespace ImGui.Development
{
    public class GUIDebug
    {
        public static void SetWindowPosition(string windowName, Point position)
        {
            var possibleWindow = Application.ImGuiContext.WindowManager.Windows.Find(window => window.Name == windowName);
            if (possibleWindow != null)
            {
                possibleWindow.Position = position;
            }
        }
    }
}

namespace ImGui
{
    public partial class GUI
    {
        public static void DebugBox(int id, Rect rect, Color color)
        {
            var window = GetCurrentWindow();
            if (window.SkipItems)
                return;

            //get or create the root node
            var container = window.AbsoluteVisualList;
            var node = (Node)container.Find(visual => visual.Id == id);
            if (node == null)
            {
                //create node
                node = new Node(id, $"DebugBox<{id}>");
                node.UseBoxModel = true;
                node.RuleSet.Replace(GUISkin.Current[GUIControlName.Box]);
                node.RuleSet.BackgroundColor = color;
                container.Add(node);
            }
            node.ActiveSelf = true;

            // last item state
            window.TempData.LastItemState = node.State;

            // rect
            node.Rect = window.GetRect(rect);

            using (var dc = node.RenderOpen())
            {
                dc.DrawBoxModel(node.RuleSet, node.Rect);
            }
        }
    }
}

Add DebugBox for debugging issues in popup windows


namespace SFA.DAS.EmployerApprenticeshipsService.Domain.Entities.Account
{
    public class LegalEntity
    {
        public long Id { get; set; }

        public string Name { get; set; }
    }
}

using System;

namespace SFA.DAS.EmployerApprenticeshipsService.Domain.Entities.Account
{
    public class LegalEntity
    {
        public long Id { get; set; }

        public string CompanyNumber { get; set; }

        public string Name { get; set; }

        public string RegisteredAddress { get; set; }

        public DateTime DateOfIncorporation { get; set; }
    }
}

Change legal entity to include the CompanyNumber, RegisteredAddress and DateOfIncorporation


namespace Akiba.Core
{
    using System.IO;
    using YamlDotNet.Serialization;
    using YamlDotNet.Serialization.NamingConventions;

    internal class Configuration
    {
        public const string ConfigurationName = "configuration.yaml";

        public enum ScreenModes : ushort
        {
            Windowed,
            Fullscreen,
            Borderless,
        };

        public ushort FramesPerSecond { get; private set; } = 60;
        public ushort RenderingResolutionWidth { get; private set; } = 1920;
        public ushort RenderingResolutionHeight { get; private set; } = 1080;
        public ScreenModes ScreenMode { get; private set; } = ScreenModes.Fullscreen;
        public bool VerticalSynchronization { get; private set; } = false;
        public bool AntiAliasing { get; private set; } = false;
        public bool HideCursor { get; private set; } = false;
        public bool PreventSystemSleep { get; private set; } = true;
        public bool DisableMovies { get; private set; } = false;

        public Configuration Save()
        {
            var serializer = new SerializerBuilder().EmitDefaults().WithNamingConvention(new CamelCaseNamingConvention()).Build();

            using (var streamWriter = new StreamWriter(ConfigurationName))
            {
                serializer.Serialize(streamWriter, this);
            }

            return this;
        }

        public static Configuration LoadFromFile()
        {
            var deserializer = new DeserializerBuilder().IgnoreUnmatchedProperties().WithNamingConvention(new CamelCaseNamingConvention()).Build();

            using (var streamReader = new StreamReader(ConfigurationName))
            {
                return deserializer.Deserialize<Configuration>(streamReader);
            }
        }
    }
}

namespace Akiba.Core
{
    using System.IO;
    using YamlDotNet.Serialization;
    using YamlDotNet.Serialization.NamingConventions;

    internal class Configuration
    {
        public const string ConfigurationName = "configuration.yaml";

        public enum ScreenModes : ushort
        {
            Windowed,
            Fullscreen,
            Borderless,
        };

        public ushort FramesPerSecond { get; private set; } = 60;
        public ushort RenderingResolutionWidth { get; private set; } = 1920;
        public ushort RenderingResolutionHeight { get; private set; } = 1080;
        public ScreenModes ScreenMode { get; private set; } = ScreenModes.Borderless;
        public bool VerticalSynchronization { get; private set; } = false;
        public bool AntiAliasing { get; private set; } = false;
        public bool HideCursor { get; private set; } = false;
        public bool PreventSystemSleep { get; private set; } = true;
        public bool DisableMovies { get; private set; } = false;

        public Configuration Save()
        {
            var serializer = new SerializerBuilder().EmitDefaults().WithNamingConvention(new CamelCaseNamingConvention()).Build();

            using (var streamWriter = new StreamWriter(ConfigurationName))
            {
                serializer.Serialize(streamWriter, this);
            }

            return this;
        }

        public static Configuration LoadFromFile()
        {
            var deserializer = new DeserializerBuilder().IgnoreUnmatchedProperties().WithNamingConvention(new CamelCaseNamingConvention()).Build();

            using (var streamReader = new StreamReader(ConfigurationName))
            {
                return deserializer.Deserialize<Configuration>(streamReader);
            }
        }
    }
}

Set a more sensible default for the screen mode.


// 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 System.Runtime.CompilerServices
{
    // Custom attribute to indicating a TypeDef is a discardable attribute.

    public class DiscardableAttribute : Attribute
    {
        public DiscardableAttribute() { }
    }
}

// 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 System.Runtime.CompilerServices
{
    // Custom attribute to indicating a TypeDef is a discardable attribute.
    [AttributeUsage(AttributeTargets.All)]
    public class DiscardableAttribute : Attribute
    {
        public DiscardableAttribute() { }
    }
}

Fix FxCop warning CA1018 (attributes should have AttributeUsage)


using Gtk;
using NLog;
using SlimeSimulation.Controller.WindowController.Templates;

namespace SlimeSimulation.View.WindowComponent.SimulationControlComponent
{
    class AdaptionPhaseControlBox : AbstractSimulationControlBox
    {
        private static readonly Logger Logger = LogManager.GetCurrentClassLogger();

        public AdaptionPhaseControlBox(SimulationStepAbstractWindowController simulationStepAbstractWindowController, Window parentWindow)
        {
            AddControls(simulationStepAbstractWindowController, parentWindow);
        }

        private void AddControls(SimulationStepAbstractWindowController simulationStepAbstractWindowController, Window parentWindow)
        {
            var controlInterfaceStartingValues = simulationStepAbstractWindowController.SimulationControlInterfaceValues;
            Add(new SimulationStepButton(simulationStepAbstractWindowController, parentWindow));
            Add(new SimulationStepNumberOfTimesComponent(simulationStepAbstractWindowController, parentWindow, controlInterfaceStartingValues));
            Add(new ShouldFlowResultsBeDisplayedControlComponent(controlInterfaceStartingValues));
            Add(new ShouldStepFromAllSourcesAtOnceControlComponent(controlInterfaceStartingValues));
            Add(new SimulationSaveComponent(simulationStepAbstractWindowController.SimulationController, parentWindow));
        }
    }
}

using Gtk;
using NLog;
using SlimeSimulation.Controller.WindowController.Templates;

namespace SlimeSimulation.View.WindowComponent.SimulationControlComponent
{
    class AdaptionPhaseControlBox : AbstractSimulationControlBox
    {
        private static readonly Logger Logger = LogManager.GetCurrentClassLogger();

        public AdaptionPhaseControlBox(SimulationStepAbstractWindowController simulationStepAbstractWindowController, Window parentWindow)
        {
            AddControls(simulationStepAbstractWindowController, parentWindow);
        }

        private void AddControls(SimulationStepAbstractWindowController simulationStepAbstractWindowController, Window parentWindow)
        {
            var controlInterfaceStartingValues = simulationStepAbstractWindowController.SimulationControlInterfaceValues;
            var container = new Table(6, 1, true);
            container.Attach(new SimulationStepButton(simulationStepAbstractWindowController, parentWindow), 0, 1, 0, 1);
            container.Attach(new SimulationStepNumberOfTimesComponent(simulationStepAbstractWindowController, parentWindow, controlInterfaceStartingValues), 0, 1, 1, 3);
            container.Attach(new ShouldFlowResultsBeDisplayedControlComponent(controlInterfaceStartingValues), 0, 1, 3, 4);
            container.Attach(new ShouldStepFromAllSourcesAtOnceControlComponent(controlInterfaceStartingValues), 0, 1, 4, 5);
            container.Attach(new SimulationSaveComponent(simulationStepAbstractWindowController.SimulationController, parentWindow), 0, 1, 5, 6);

            Add(container);
        }
    }
}

Add some changes to UI to make spacing equal for components


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

using System.Threading;
using NUnit.Framework;
using osu.Framework.Audio;

namespace osu.Framework.Tests.Audio
{
    [TestFixture]
    public class AudioCollectionManagerTest
    {
        private class TestingAdjustableAudioComponent : AdjustableAudioComponent
        {
        }

        [Test]
        public void TestDisposalWhileItemsAreAddedDoesNotThrowInvalidOperationException()
        {
            var manager = new AudioCollectionManager<AdjustableAudioComponent>();

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

            // in a seperate thread start processing the queue
            new Thread(() => manager.Update()).Start();

            // wait a little for beginning of the update to start
            Thread.Sleep(4);

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

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

using System.Threading;
using NUnit.Framework;
using osu.Framework.Audio;

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

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

            // in a seperate thread start processing the queue
            new Thread(() => manager.Update()).Start();

            // wait a little for beginning of the update to start
            Thread.Sleep(4);

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

        private class TestingAdjustableAudioComponent : AdjustableAudioComponent
        {
        }
    }
}

Move test component to bottom of class

Move test component to bottom of class


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

namespace ERMine.Core.Modeling
{
    public class Attribute : IEntityRelationship
    {
        public string Label { get; set; }
        public string DataType { get; set; }
        public Domain Domain { get; set; }
        public bool IsNullable { get; set; }
        public bool IsSparse { get; set; }
        public bool IsImmutable { get; set; }
        public KeyType Key { get; set; }
        public bool IsPartOfPrimaryKey
        {
            get { return Key == KeyType.Primary; }
            set { Key = value ? KeyType.Primary : KeyType.None; }
        }
        public bool IsPartOfPartialKey
        {
            get { return Key == KeyType.Partial; }
            set { Key = value ? KeyType.Partial : KeyType.None; }
        }
        public bool IsMultiValued { get; set; }
        public bool IsDerived { get; set; }
        public string DerivedFormula { get; set; }
        public bool IsDefault { get; set; }
        public string DefaultFormula { get; set; }
    }
}

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

namespace ERMine.Core.Modeling
{
    public class Attribute : IEntityRelationship
    {
        public string Label { get; set; }
        public string DataType { get; set; }
        public Domain Domain { get; set; }
        public bool IsConstrainedDomain
        {
            get { return Domain != null; }
        }
        public bool IsNullable { get; set; }
        public bool IsSparse { get; set; }
        public bool IsImmutable { get; set; }
        public KeyType Key { get; set; }
        public bool IsPartOfPrimaryKey
        {
            get { return Key == KeyType.Primary; }
            set { Key = value ? KeyType.Primary : KeyType.None; }
        }
        public bool IsPartOfPartialKey
        {
            get { return Key == KeyType.Partial; }
            set { Key = value ? KeyType.Partial : KeyType.None; }
        }
        public bool IsMultiValued { get; set; }
        public bool IsDerived { get; set; }
        public string DerivedFormula { get; set; }
        public bool IsDefault { get; set; }
        public string DefaultFormula { get; set; }
    }
}

Add quick check for attached domain

Add quick check for attached domain


using PS.Mothership.Core.Common.Template.Gen;
using PS.Mothership.Core.Common.Template.Opp;
using System;
using System.Runtime.Serialization;

namespace PS.Mothership.Core.Common.Dto.Application
{
    [DataContract]
    public class OpportunitySummaryDto
    {
        [DataMember]
        public Guid OpportunityGuid { get; set; }

        [DataMember]
        public double Credit { get; set; }

        [DataMember]
        public double Debit { get; set; }

        [DataMember]
        public OppTypeOfTransactionEnum TypeOfTransactionKey { get; set; }

        [DataMember]
        public string Vendor { get; set; }

        [DataMember]
        public string Model { get; set; }

        [DataMember]
        public GenOpportunityStatusEnum OpportunityStatusKey { get; set; }

        [DataMember]
        public string ContractLengthDescription { get; set; }
    }
}

using PS.Mothership.Core.Common.Template.Gen;
using PS.Mothership.Core.Common.Template.Opp;
using System;
using System.Runtime.Serialization;

namespace PS.Mothership.Core.Common.Dto.Application
{
    [DataContract]
    public class OpportunitySummaryDto
    {
        [DataMember]
        public Guid OpportunityGuid { get; set; }

        [DataMember]
        public double Credit { get; set; }

        [DataMember]
        public double Debit { get; set; }

        [DataMember]
        public OppTypeOfTransactionEnum TypeOfTransactionKey { get; set; }

        [DataMember]
        public string ProductType { get; set; }

        [DataMember]
        public GenOpportunityStatusEnum OpportunityStatusKey { get; set; }

        [DataMember]
        public string ContractLengthDescription { get; set; }
    }
}

Revert to use ProductType since this is all that is needed in the summary, as it is the only thing shown in the opportunity summary, in the offer page


using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;

namespace Bex.Extensions
{
    internal static class UriExtensions
    {
        internal static IEnumerable<KeyValuePair<string, string>> QueryString(this Uri uri)
        {
            var uriString = uri.IsAbsoluteUri ? uri.AbsoluteUri : uri.OriginalString;

            var queryIndex = uriString.IndexOf("?", StringComparison.OrdinalIgnoreCase);

            if (queryIndex == -1)
            {
                return Enumerable.Empty<KeyValuePair<string, string>>();
            }

            var query = uriString.Substring(queryIndex + 1);

            return query.Split('&')
                .Where(x => !string.IsNullOrEmpty(x))
                .Select(x => x.Split('='))
                .Select(x => new KeyValuePair<string, string>(WebUtility.UrlDecode(x[0]), x.Length == 2 && !string.IsNullOrEmpty(x[1]) ? WebUtility.UrlDecode(x[1]) : null));
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;

namespace Bex.Extensions
{
    internal static class UriExtensions
    {
        internal static IEnumerable<KeyValuePair<string, string>> QueryString(this Uri uri)
        {
            if (string.IsNullOrEmpty(uri.Query))
            {
                return Enumerable.Empty<KeyValuePair<string, string>>();
            }

            var query = uri.Query.TrimStart('?');

            return query.Split('&')
                .Where(x => !string.IsNullOrEmpty(x))
                .Select(x => x.Split('='))
                .Select(x => new KeyValuePair<string, string>(WebUtility.UrlDecode(x[0]), x.Length == 2 && !string.IsNullOrEmpty(x[1]) ? WebUtility.UrlDecode(x[1]) : null));
        }
    }
}

Use the Query property of the Uri

Use the Query property of the Uri


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

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ExCSS Parser")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ExCSS CSS Parser")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

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

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("eb4daa16-725f-4c8f-9d74-b9b569d57f42")]

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

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

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ExCSS Parser")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ExCSS CSS Parser")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

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

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("eb4daa16-725f-4c8f-9d74-b9b569d57f42")]

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

Align assembly verions with package release 2.0.3

Current NuGet package release is at 2.0.3 (https://www.nuget.org/packages/ExCSS/2.0.3) but the assembly version attributes still reflect version 2.0.2.


namespace Octokit
{
    public static class AcceptHeaders
    {
        public const string StableVersion = "application/vnd.github.v3";

        public const string StableVersionHtml = "application/vnd.github.html";

        public const string RedirectsPreviewThenStableVersionJson = "application/vnd.github.quicksilver-preview+json; charset=utf-8, application/vnd.github.v3+json; charset=utf-8";

        public const string LicensesApiPreview = "application/vnd.github.drax-preview+json";

        public const string ProtectedBranchesApiPreview = "application/vnd.github.loki-preview+json";

        public const string StarCreationTimestamps = "application/vnd.github.v3.star+json";

        public const string IssueLockingUnlockingApiPreview = "application/vnd.github.the-key-preview+json";

        public const string CommitReferenceSha1Preview = "application/vnd.github.chitauri-preview+sha";

        public const string SquashCommitPreview = "application/vnd.github.polaris-preview+json";

        public const string MigrationsApiPreview = "  application/vnd.github.wyandotte-preview+json";

        public const string OrganizationPermissionsPreview = "application/vnd.github.ironman-preview+json";
    }
}

using System.Diagnostics.CodeAnalysis;

namespace Octokit
{
    public static class AcceptHeaders
    {
        public const string StableVersion = "application/vnd.github.v3";

        public const string StableVersionHtml = "application/vnd.github.html";

        public const string RedirectsPreviewThenStableVersionJson = "application/vnd.github.quicksilver-preview+json; charset=utf-8, application/vnd.github.v3+json; charset=utf-8";

        public const string LicensesApiPreview = "application/vnd.github.drax-preview+json";

        public const string ProtectedBranchesApiPreview = "application/vnd.github.loki-preview+json";

        public const string StarCreationTimestamps = "application/vnd.github.v3.star+json";

        public const string IssueLockingUnlockingApiPreview = "application/vnd.github.the-key-preview+json";

        public const string CommitReferenceSha1Preview = "application/vnd.github.chitauri-preview+sha";

        public const string SquashCommitPreview = "application/vnd.github.polaris-preview+json";

        public const string MigrationsApiPreview = "  application/vnd.github.wyandotte-preview+json";

        public const string OrganizationPermissionsPreview = "application/vnd.github.ironman-preview+json";

        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gpg")]
        public const string GpgKeysPreview = "application/vnd.github.cryptographer-preview+sha";
    }
}

Add GPG Keys API preview header

Add GPG Keys API preview header


// 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.Configuration;
using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Framework.Screens;
using osu.Game.Localisation;
using osu.Game.Screens;
using osu.Game.Screens.Import;

namespace osu.Game.Overlays.Settings.Sections.DebugSettings
{
    public class GeneralSettings : SettingsSubsection
    {
        protected override LocalisableString Header => DebugSettingsStrings.GeneralHeader;

        [BackgroundDependencyLoader(true)]
        private void load(FrameworkDebugConfigManager config, FrameworkConfigManager frameworkConfig, IPerformFromScreenRunner performer)
        {
            Children = new Drawable[]
            {
                new SettingsCheckbox
                {
                    LabelText = DebugSettingsStrings.ShowLogOverlay,
                    Current = frameworkConfig.GetBindable<bool>(FrameworkSetting.ShowLogOverlay)
                },
                new SettingsCheckbox
                {
                    LabelText = DebugSettingsStrings.BypassFrontToBackPass,
                    Current = config.GetBindable<bool>(DebugSetting.BypassFrontToBackPass)
                }
            };
            Add(new SettingsButton
            {
                Text = DebugSettingsStrings.ImportFiles,
                Action = () => performer?.PerformFromScreen(menu => menu.Push(new FileImportScreen()))
            });
        }
    }
}

// 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.Configuration;
using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Framework.Screens;
using osu.Game.Localisation;
using osu.Game.Screens;
using osu.Game.Screens.Import;

namespace osu.Game.Overlays.Settings.Sections.DebugSettings
{
    public class GeneralSettings : SettingsSubsection
    {
        protected override LocalisableString Header => DebugSettingsStrings.GeneralHeader;

        [BackgroundDependencyLoader(true)]
        private void load(FrameworkDebugConfigManager config, FrameworkConfigManager frameworkConfig, IPerformFromScreenRunner performer)
        {
            Children = new Drawable[]
            {
                new SettingsCheckbox
                {
                    LabelText = DebugSettingsStrings.ShowLogOverlay,
                    Current = frameworkConfig.GetBindable<bool>(FrameworkSetting.ShowLogOverlay)
                },
                new SettingsCheckbox
                {
                    LabelText = DebugSettingsStrings.BypassFrontToBackPass,
                    Current = config.GetBindable<bool>(DebugSetting.BypassFrontToBackPass)
                },
                new SettingsButton
                {
                    Text = DebugSettingsStrings.ImportFiles,
                    Action = () => performer?.PerformFromScreen(menu => menu.Push(new FileImportScreen()))
                },
                new SettingsButton
                {
                    Text = @"Run latency comparer",
                    Action = () => performer?.PerformFromScreen(menu => menu.Push(new LatencyComparerScreen()))
                }
            };
        }
    }
}

Add button to access latency comparer from game


using System;
using System.IO;
using Ploeh.AutoFixture;

namespace AppHarbor.Tests
{
	public class TextWriterCustomization : ICustomization
	{
		public void Customize(IFixture fixture)
		{
			fixture.Customize<TextWriter>(x => x.FromFactory(() => { return Console.Out; }));
		}
	}
}

using System.IO;
using Moq;
using Ploeh.AutoFixture;

namespace AppHarbor.Tests
{
	public class TextWriterCustomization : ICustomization
	{
		public void Customize(IFixture fixture)
		{
			var textWriterMock = new Mock<TextWriter>();
			fixture.Customize<TextWriter>(x => x.FromFactory(() => { return textWriterMock.Object; }));
			fixture.Customize<Mock<TextWriter>>(x => x.FromFactory(() => { return textWriterMock; }));
		}
	}
}

Make sure to also customize Mock<TextWriter> and use same instance


using System;
using Newtonsoft.Json;
using System.Collections.Generic;

namespace Stripe
{
	public class StripeSubscriptionUpdateOptions : StripeSubscriptionCreateOptions
	{
		[JsonProperty("prorate")]
		public bool? Prorate { get; set; }
	}
}

using System;
using Newtonsoft.Json;
using System.Collections.Generic;

namespace Stripe
{
	public class StripeSubscriptionUpdateOptions : StripeSubscriptionCreateOptions
	{
		[JsonProperty("prorate")]
		public bool? Prorate { get; set; }

		[JsonProperty("plan")]
		public string PlanId { get; set; }
	}
}

Add "plan" to StripSubscriptionUpdateOptions so we can change plans.


using System;
using System.IO;

namespace DarkMultiPlayerServer
{
    public class LogExpire
    {
        private static string logDirectory
        {
            get
            {
                return Path.Combine(Server.universeDirectory, DarkLog.LogFolder);
            }
        }

        public static void ExpireLogs()
        {
            if (!Directory.Exists(logDirectory))
            {
                //Screenshot directory is missing so there will be no screenshots to delete.
                return;
            }
            string[] logFiles = Directory.GetFiles(logDirectory);
            foreach (string logFile in logFiles)
            {
                Console.WriteLine("LogFile: " + logFile);
                //Check if the expireScreenshots setting is enabled
                if (Settings.settingsStore.expireLogs > 0)
                {
                    //If the file is older than a day, delete it
                    if (File.GetCreationTime(logFile).AddDays(Settings.settingsStore.expireLogs) < DateTime.Now)
                    {
                        DarkLog.Debug("Deleting saved log '" + logFile + "', reason: Expired!");
                        try
                        {
                            File.Delete(logFile);
                        }
                        catch (Exception e)
                        {
                            DarkLog.Error("Exception while trying to delete '" + logFile + "'!, Exception: " + e.Message);
                        }
                    }
                }
            }
        }
    }
}

using System;
using System.IO;

namespace DarkMultiPlayerServer
{
    public class LogExpire
    {
        private static string logDirectory
        {
            get
            {
                return Path.Combine(Server.universeDirectory, DarkLog.LogFolder);
            }
        }

        public static void ExpireLogs()
        {
            if (!Directory.Exists(logDirectory))
            {
                //Screenshot directory is missing so there will be no screenshots to delete.
                return;
            }
            string[] logFiles = Directory.GetFiles(logDirectory);
            foreach (string logFile in logFiles)
            {
                //Check if the expireScreenshots setting is enabled
                if (Settings.settingsStore.expireLogs > 0)
                {
                    //If the file is older than a day, delete it
                    if (File.GetCreationTime(logFile).AddDays(Settings.settingsStore.expireLogs) < DateTime.Now)
                    {
                        DarkLog.Debug("Deleting saved log '" + logFile + "', reason: Expired!");
                        try
                        {
                            File.Delete(logFile);
                        }
                        catch (Exception e)
                        {
                            DarkLog.Error("Exception while trying to delete '" + logFile + "'!, Exception: " + e.Message);
                        }
                    }
                }
            }
        }
    }
}

Remove debugging line. Sorry RockyTV!

Remove debugging line. Sorry RockyTV!


using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Vocal.Model;

namespace Vocal.Core
{
    public class JsonCommandLoader
    {
        const string DefaultConfigFile = "commandsTemplate.json";
        const string WriteableConfigFile = "commands.json";

        public static IEnumerable<IVoiceCommand> LoadCommandsFromConfiguration()
        {
            if(!File.Exists(WriteableConfigFile))
            {
                CreateWriteableConfigFile(DefaultConfigFile, WriteableConfigFile);
            }

            if (!File.Exists(WriteableConfigFile))
                throw new Exception($"There was an error creating the command configuration file {WriteableConfigFile}. You may need to create this file manually.");

            return JsonConvert.DeserializeObject<VoiceCommand[]>(File.ReadAllText(WriteableConfigFile));
        }

        public static void CreateWriteableConfigFile(string source, string destination)
        {
            if (!File.Exists(source))
                throw new Exception($"The source configuration file {source} does not exist. A writeable configuration cannot be created.  See the documentation for more details.");

            File.Copy(source, destination);
        }
    }
}

using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using Vocal.Model;

namespace Vocal.Core
{
    public class JsonCommandLoader
    {
        const string AppDataFolder = "VocalBuildEngine";
        const string DefaultConfigFile = "commandsTemplate.json";
        const string WriteableCommandFile = "commands.json";

        public static IEnumerable<IVoiceCommand> LoadCommandsFromConfiguration()
        {
            var commandFile = GetDefaultPath(WriteableCommandFile);

            if (!File.Exists(commandFile))
            {
                var file = new FileInfo(commandFile);

                if (!Directory.Exists(file.Directory.FullName))
                    Directory.CreateDirectory(file.Directory.FullName);

                CreateWriteableConfigFile(DefaultConfigFile, commandFile);
            }

            if (!File.Exists(commandFile))
                throw new Exception($"There was an error creating the command configuration file {commandFile}. You may need to create this file manually.");

            return JsonConvert.DeserializeObject<VoiceCommand[]>(File.ReadAllText(commandFile));
        }

        public static void CreateWriteableConfigFile(string source, string destination)
        {
            if (!File.Exists(source))
                throw new Exception($"The source configuration file {source} does not exist. A writeable configuration cannot be created.  See the documentation for more details.");

            File.Copy(source, destination);
        }

        public static string GetDefaultPath(string fileName)
        {
            return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), AppDataFolder, fileName);
        }
    }
}

Move command file to appdata

Move command file to appdata


@using FormFactory
@model PropertyVm
<input type="hidden" name="@Model.Name" id="MyFileSubmitPlaceHolder" />@*here to trick model binding into working :( *@
<input type="file" name="@Model.Name" @Model.Readonly() @Model.Disabled() />

@using FormFactory
@model PropertyVm
@if(!Model.Readonly)
{
    <input type="hidden" name="@Model.Name"  /> @*here to trick model binding into working :( *@
    <input type="file" name="@Model.Name" @Model.Readonly() @Model.Disabled() />
}

Hide file input if readonly

Hide file input if readonly


// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System;
using System.Composition;
using System.IO;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.Serialization;

namespace Microsoft.CodeAnalysis.Host
{
    interface IPersistentStorageLocationService : IWorkspaceService
    {
        string TryGetStorageLocation(Solution solution);
    }

    [ExportWorkspaceService(typeof(IPersistentStorageLocationService)), Shared]
    internal class DefaultPersistentStorageLocationService : IPersistentStorageLocationService
    {
        [ImportingConstructor]
        public DefaultPersistentStorageLocationService()
        {
        }

        public string TryGetStorageLocation(Solution solution)
        {
            if (string.IsNullOrWhiteSpace(solution.FilePath))
                return null;

            // Ensure that each unique workspace kind for any given solution has a unique
            // folder to store their data in.
            var checksums = new[] { Checksum.Create(solution.FilePath), Checksum.Create(solution.Workspace.Kind) };
            var hashedName = Checksum.Create(WellKnownSynchronizationKind.Null, checksums).ToString();
            var workingFolder = Path.Combine(Path.GetTempPath(), hashedName);

            return workingFolder;
        }
    }
}

// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System;
using System.Composition;
using System.IO;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.Serialization;

namespace Microsoft.CodeAnalysis.Host
{
    interface IPersistentStorageLocationService : IWorkspaceService
    {
        string TryGetStorageLocation(Solution solution);
    }

    [ExportWorkspaceService(typeof(IPersistentStorageLocationService)), Shared]
    internal class DefaultPersistentStorageLocationService : IPersistentStorageLocationService
    {
        [ImportingConstructor]
        public DefaultPersistentStorageLocationService()
        {
        }

        public string TryGetStorageLocation(Solution solution)
        {
            if (string.IsNullOrWhiteSpace(solution.FilePath))
                return null;

            // Ensure that each unique workspace kind for any given solution has a unique
            // folder to store their data in.
            var checksums = new[] { Checksum.Create(solution.FilePath), Checksum.Create(solution.Workspace.Kind) };
            var hashedName = Checksum.Create(WellKnownSynchronizationKind.Null, checksums).ToString();

            var appDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData, Environment.SpecialFolderOption.Create);
            var workingFolder = Path.Combine(appDataFolder, "Roslyn", hashedName);

            return workingFolder;
        }
    }
}

Switch to using LocalApplicationData folder