#if !NET452
namespace Fixie.Cli
{
    using System;
    using System.Diagnostics;
    using System.IO;
    using System.Runtime.InteropServices;

    class Dotnet
    {
        public static readonly string Path = FindDotnet();

        static string FindDotnet()
        {
            var fileName = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet";

            //If `dotnet` is the currently running process, return the full path to that executable.

            var mainModule = GetCurrentProcessMainModule();

            var currentProcessIsDotNet =
                !string.IsNullOrEmpty(mainModule?.FileName) &&
                System.IO.Path.GetFileName(mainModule.FileName)
                    .Equals(fileName, StringComparison.OrdinalIgnoreCase);

            if (currentProcessIsDotNet)
                return mainModule.FileName;

            // Find "dotnet" by using the location of the shared framework.

            var fxDepsFile = AppContext.GetData("FX_DEPS_FILE") as string;

            if (string.IsNullOrEmpty(fxDepsFile))
                throw new CommandLineException("While attempting to locate `dotnet`, FX_DEPS_FILE could not be found in the AppContext.");

            var dotnetDirectory =
                new FileInfo(fxDepsFile) // Microsoft.NETCore.App.deps.json
                    .Directory? // (version)
                    .Parent? // Microsoft.NETCore.App
                    .Parent? // shared
                    .Parent; // DOTNET_HOME

            if (dotnetDirectory == null)
                throw new CommandLineException("While attempting to locate `dotnet`. Could not traverse directories from FX_DEPS_FILE to DOTNET_HOME.");

            var dotnetPath = System.IO.Path.Combine(dotnetDirectory.FullName, fileName);

            if (!File.Exists(dotnetPath))
                throw new CommandLineException($"Failed to locate `dotnet`. The path does not exist: {dotnetPath}");

            return dotnetPath;
        }

        static ProcessModule GetCurrentProcessMainModule()
        {
            using (var currentProcess = Process.GetCurrentProcess())
                return currentProcess.MainModule;
        }
    }
}
#endif

#if !NET452
namespace Fixie.Cli
{
    using System;
    using System.Diagnostics;
    using System.IO;
    using System.Runtime.InteropServices;

    class Dotnet
    {
        public static readonly string Path = FindDotnet();

        static string FindDotnet()
        {
            var fileName = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet";

            //If `dotnet` is the currently running process, return the full path to that executable.

            using (var currentProcess = Process.GetCurrentProcess())
            {
                var mainModule = currentProcess.MainModule;

                var currentProcessIsDotNet =
                    !string.IsNullOrEmpty(mainModule?.FileName) &&
                    System.IO.Path.GetFileName(mainModule.FileName)
                        .Equals(fileName, StringComparison.OrdinalIgnoreCase);

                if (currentProcessIsDotNet)
                    return mainModule.FileName;

                throw new CommandLineException($"Failed to locate `dotnet`.");
            }
        }
    }
}
#endif

Remove usage of FX_DEPS_FILE as a fallback for locating `dotnet`, since that can find the wrong result when a newer patch is installed to the global dotnet location than the one installed into the folder containing Process.MainModule.

See https://github.com/aspnet/Extensions/pull/299
See https://github.com/aspnet/Scaffolding/pull/656


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

public class ObjectPlacer : MonoBehaviour {

	public CountryLocation reader;
	public GameObject prefab;

	// Use this for initialization
	void Start () {
		Debug.Log ("LOOK WE ARE DOING THINGS");
		reader.NotANormalWord ();
		Debug.Log ("Size of our data: " + reader.countries.Count);
		foreach (KeyValuePair<string, List<float>> entry in reader.countries)
		{
            int numItems = entry.Value.Count;
            if(numItems == 1)
            {
                Debug.Log(entry.Key + ", num items: " + entry.Value.Count);
            }
			Debug.Log (entry.Key + ", lat: " + entry.Value[1] + ", long: " + entry.Value[2]);
			GameObject marker = GameObject.Instantiate(prefab, Vector3.zero, Quaternion.Euler(new Vector3(0, -entry.Value[2], entry.Value[1])));
            marker.name = entry.Key;
        }
		Debug.Log ("THINGS HAVE BEEN DONE");
	}

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

	}
}

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

public class ObjectPlacer : MonoBehaviour {

	public CountryLocation reader;
	public GameObject prefab;

	private Dictionary<string, GameObject> markers;

	// Use this for initialization
	void Start () {
		Debug.Log ("LOOK WE ARE DOING THINGS");
		reader.NotANormalWord ();
		Debug.Log ("Size of our data: " + reader.countries.Count);
		foreach (KeyValuePair<string, List<float>> entry in reader.countries)
		{
            int numItems = entry.Value.Count;
            if(numItems == 1)
            {
                Debug.Log(entry.Key + ", num items: " + entry.Value.Count);
            }
			Debug.Log (entry.Key + ", lat: " + entry.Value[1] + ", long: " + entry.Value[2]);
			GameObject marker = GameObject.Instantiate(prefab, Vector3.zero, Quaternion.Euler(new Vector3(0, -entry.Value[2], entry.Value[1])));
            marker.name = entry.Key;
			markers.Add(entry.Key, marker);
        }
		Debug.Log ("THINGS HAVE BEEN DONE");
	}

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

	}
}

Put markers in a dictionary for reuse.

Put markers in a dictionary for reuse.


using System;

/// <summary>
/// Summary description for Class1
/// </summary>
public class Bot {
	public Bot() {
		//
		// TODO: Add constructor logic here
		//
	}
}

using System;

/// <summary>
/// Summary description for Class1
/// </summary>
public class Bot {

	private const int chromosomeSize = 10;
	private Chromosome<double> chromosome;

	public Bot() {
		chromosome = new Chromosome<double>(chromosomeSize);
	}

	public Bot(double[] values) {
		chromosome = new Chromosome<double>(values);
	}

	public bool betOrFold(int currentBet) {
		// True is bet, False is fold
		return true;
	}

	public int makeBet() {
		// returns the ammount to bet
		return 0;
	}

	private double getEnemyWinProb() {
		// Returns the probability of the enemy winning
		return 0.0;
	}

	private double getSelfWinProb() {
		// Returns the probability of us winning
		return 0.0;
	}

}

Add bot class method stubs

Add bot class method stubs


using Microsoft.AspNet.Builder;

namespace KWebStartup
{
    public class Startup
    {

        public void Configure(IApplicationBuilder app)
        {
            app.UseStaticFiles();
        }
    }
}

using Microsoft.AspNet.Builder;

namespace KWebStartup
{
    public class Startup
    {

        public void Configure(IApplicationBuilder app)
        {
            app.UseStaticFiles();
            app.UseWelcomePage();
        }
    }
}

Bring welcome page back to project

Bring welcome page back to project


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

namespace Microsoft.Azure.Commands.Sql.Database.Model
{
    /// <summary>
    /// The database edition
    /// </summary>
    public enum DatabaseEdition
    {
        /// <summary>
        /// No database edition specified
        /// </summary>
        None = 0,

        /// <summary>
        /// A database premium edition
        /// </summary>
        Premium = 3,

        /// <summary>
        /// A database basic edition
        /// </summary>
        Basic = 4,

        /// <summary>
        /// A database standard edition
        /// </summary>
        Standard = 5,

        /// <summary>
        /// Azure SQL Data Warehouse database edition
        /// </summary>
        DataWarehouse = 6,

        /// <summary>
        /// Azure SQL Stretch database edition
        /// </summary>
        Stretch = 7,

        /// <summary>
        /// Free database edition.  Reserved for special use cases/scenarios.
        /// </summary>
        Free = 8,

        /// <summary>
        /// A database PremiumRS edition
        /// </summary>
        PremiumRS = 9,
    }
}

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

namespace Microsoft.Azure.Commands.Sql.Database.Model
{
    /// <summary>
    /// The database edition
    /// </summary>
    public enum DatabaseEdition
    {
        /// <summary>
        /// No database edition specified
        /// </summary>
        None = 0,

        /// <summary>
        /// A database premium edition
        /// </summary>
        Premium = 3,

        /// <summary>
        /// A database basic edition
        /// </summary>
        Basic = 4,

        /// <summary>
        /// A database standard edition
        /// </summary>
        Standard = 5,

        /// <summary>
        /// Azure SQL Data Warehouse database edition
        /// </summary>
        DataWarehouse = 6,

        /// <summary>
        /// Azure SQL Stretch database edition
        /// </summary>
        Stretch = 7,

        /// <summary>
        /// Free database edition.  Reserved for special use cases/scenarios.
        /// </summary>
        Free = 8,
    }
}

Remove PremiumRS edition value due to public preview schedule changes


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

[ExecuteInEditMode]
public class TextMeshLimitSize : MonoBehaviour
{

#pragma warning disable 0649   //Serialized Fields
    [SerializeField]
    private Vector2 maxExtents;
    [SerializeField]
    private TextMesh textMesh;
    [SerializeField]
    private Renderer textRenderer;
    [SerializeField]
    private Vector3 defaultScale;
#pragma warning restore 0649

    private string lastString;

    void Awake()
	{
        if (textMesh == null)
            textMesh = GetComponent<TextMesh>();
        if (textRenderer == null)
            textRenderer = textMesh.GetComponent<Renderer>();
        if (maxExtents == Vector2.zero)
            maxExtents = textRenderer.bounds.extents;

        if (!Application.isPlaying)
            defaultScale = transform.localScale;
	}

    void Start()
    {
        lastString = "";
        updateScale();
    }

    void Update()
    {
        if (textMesh.text != lastString)
            updateScale();
    }

    public void updateScale()
    {
        transform.localScale = defaultScale;
        if (textRenderer.bounds.extents.x > maxExtents.x || textRenderer.bounds.extents.y > maxExtents.y)
            transform.localScale *= Mathf.Min(maxExtents.x / textRenderer.bounds.extents.x, maxExtents.y / textRenderer.bounds.extents.y);

        lastString = textMesh.text;
    }
}

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

[ExecuteInEditMode]
public class TextMeshLimitSize : MonoBehaviour
{

#pragma warning disable 0649   //Serialized Fields
    [SerializeField]
    private Vector2 maxExtents;
    [SerializeField]
    private TextMesh textMesh;
    [SerializeField]
    private Renderer textRenderer;
    [SerializeField]
    private Vector3 defaultScale;
#pragma warning restore 0649

    private string lastString;

    void Awake()
	{
        if (textMesh == null)
            textMesh = GetComponent<TextMesh>();
        if (textRenderer == null)
            textRenderer = textMesh.GetComponent<Renderer>();
        if (maxExtents == Vector2.zero)
            maxExtents = textRenderer.bounds.extents;

        if (!Application.isPlaying)
            defaultScale = transform.localScale;
	}

    void Start()
    {
        lastString = "";
        updateScale();
    }

    void Update()
    {
        if (textMesh.text != lastString)
            updateScale();
    }

    void LateUpdate()
    {
        if (textMesh.text != lastString)
            updateScale();
    }

    public void updateScale()
    {
        transform.localScale = defaultScale;
        if (textRenderer.bounds.extents.x > maxExtents.x || textRenderer.bounds.extents.y > maxExtents.y)
            transform.localScale *= Mathf.Min(maxExtents.x / textRenderer.bounds.extents.x, maxExtents.y / textRenderer.bounds.extents.y);

        lastString = textMesh.text;
    }
}

Add LateUpdate check to scaler

Add LateUpdate check to scaler


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

using System.Web;
using System.Web.Mvc;
using Microsoft.Owin.Security;

namespace GoogleCloudSamples.Controllers
{
    // [START login]
    public class SessionController : Controller
    {
        // GET: Session/Login
        public ActionResult Login()
        {
            HttpContext.GetOwinContext().Authentication.Challenge(
                new AuthenticationProperties { RedirectUri = "/" },
                "Google"
            );
            return new HttpUnauthorizedResult();
        }
        // ...
        // [END login]

        // [START logout]
        // GET: Session/Logout
        public ActionResult Logout()
        {
            Request.GetOwinContext().Authentication.SignOut();
            return Redirect("/");
        }
        // [END logout]
    }
}

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

using System.Web;
using System.Web.Mvc;
using Microsoft.Owin.Security;

namespace GoogleCloudSamples.Controllers
{
    // [START login]
    public class SessionController : Controller
    {
        public ActionResult Login()
        {
            // Redirect to the Google OAuth 2.0 user consent screen
            HttpContext.GetOwinContext().Authentication.Challenge(
                new AuthenticationProperties { RedirectUri = "/" },
                "Google"
            );
            return new HttpUnauthorizedResult();
        }

        // ...
        // [END login]

        // [START logout]
        public ActionResult Logout()
        {
            Request.GetOwinContext().Authentication.SignOut();
            return Redirect("/");
        }
        // [END logout]
    }
}

Add comment to Auth Login action describing redirect


using System;
using System.Globalization;
using System.Text.RegularExpressions;

namespace RohlikAPI.Helpers
{
    public class PriceParser
    {
        public double ParsePrice(string priceString)
        {
            var priceStringWithoutSpaces = priceString.Replace(" ", "").Replace(" ","");
            var cleanPriceString = Regex.Match(priceStringWithoutSpaces, @"(\d*?,\d*)|(\d+)").Value;
            try
            {
                var price = double.Parse(cleanPriceString, new CultureInfo("cs-CZ"));
                if (price <= 0)
                {
                    throw new Exception($"Failed to get product price from string '{priceString}'. Resulting price was {price}");
                }
                return price;
            }
            catch (Exception ex)
            {
                throw new Exception($"Failed to parse product price from string '{priceString}'. Exception: {ex}");
            }
        }
    }
}

using System;
using System.Globalization;
using System.Text.RegularExpressions;

namespace RohlikAPI.Helpers
{
    public class PriceParser
    {
        public double ParsePrice(string priceString)
        {
            var priceStringWithoutSpaces = priceString.Replace(" ", "").Replace(" ","");
            var cleanPriceString = Regex.Match(priceStringWithoutSpaces, @"(\d*?,\d*)|(\d+)").Value;
            try
            {
                var price = double.Parse(cleanPriceString, new CultureInfo("cs-CZ"));
                return price;
            }
            catch (Exception ex)
            {
                throw new Exception($"Failed to parse product price from string '{priceString}'. Exception: {ex}");
            }
        }
    }
}

Allow products to have 0 price

Allow products to have 0 price


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

using osu.Framework.Platform.Linux.Native;

namespace osu.Framework.Platform.Linux
{
    public class LinuxGameHost : DesktopGameHost
    {
        internal LinuxGameHost(string gameName, bool bindIPC = false)
            : base(gameName, bindIPC)
        {
            Window = new LinuxGameWindow();
            Window.WindowStateChanged += (sender, e) =>
            {
                if (Window.WindowState != OpenTK.WindowState.Minimized)
                    OnActivated();
                else
                    OnDeactivated();
            };

            Library.Load("libbass.so", Library.LoadFlags.RTLD_LAZY | Library.LoadFlags.RTLD_GLOBAL);
        }

        protected override Storage GetStorage(string baseName) => new LinuxStorage(baseName, this);

        public override Clipboard GetClipboard() => new LinuxClipboard();
    }
}

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

using osu.Framework.Platform.Linux.Native;

namespace osu.Framework.Platform.Linux
{
    public class LinuxGameHost : DesktopGameHost
    {
        internal LinuxGameHost(string gameName, bool bindIPC = false)
            : base(gameName, bindIPC)
        {
            Window = new LinuxGameWindow();
            Window.WindowStateChanged += (sender, e) =>
            {
                if (Window.WindowState != OpenTK.WindowState.Minimized)
                    OnActivated();
                else
                    OnDeactivated();
            };

            // required for the time being to address libbass_fx.so load failures (see https://github.com/ppy/osu/issues/2852)
            Library.Load("libbass.so", Library.LoadFlags.RTLD_LAZY | Library.LoadFlags.RTLD_GLOBAL);
        }

        protected override Storage GetStorage(string baseName) => new LinuxStorage(baseName, this);

        public override Clipboard GetClipboard() => new LinuxClipboard();
    }
}

Add comment as this may be removed in the future


@model CompetitionPlatform.Models.ProjectViewModels.ProjectListIndexViewModel

@{
    ViewData["Title"] = "Projects";
}

LykkeStreams

Here Great Ideas Meet the Brightest Minds

Current Projects

    @await Html.PartialAsync("ProjectListPartial", Model)

@model CompetitionPlatform.Models.ProjectViewModels.ProjectListIndexViewModel

@{
    ViewData["Title"] = "Projects";
}

LykkeStreams

Here the great ideas meet bright minds

Current Projects

    @await Html.PartialAsync("ProjectListPartial", Model)

Fix text on main page.

Fix text on main page.


using System;
using Microsoft.AspNet.Identity.EntityFramework;
using Project.Data.Configuration;
using System.Data.Entity;
using Project.Domain.Entities;

namespace Project.Data
{
    public class ProjectContext : IdentityDbContext<ApplicationUser>
    {
        public ProjectContext() : base("ProjectContext") { }

        public DbSet<Gadget> Gadgets { get; set; }
        public DbSet<Category> Categories { get; set; }

        public virtual void Commit()
        {
            base.SaveChanges();
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new GadgetConfiguration());
            modelBuilder.Configurations.Add(new CategoryConfiguration());
        }

        public static ProjectContext Create()
        {
            return new ProjectContext();
        }
    }
}

using Microsoft.AspNet.Identity.EntityFramework;
using Project.Data.Configuration;
using System.Data.Entity;
using Project.Domain.Entities;

namespace Project.Data
{
    public class ProjectContext : IdentityDbContext<ApplicationUser>
    {
        public ProjectContext() : base("ProjectContext") { }

        public DbSet<Gadget> Gadgets { get; set; }
        public DbSet<Category> Categories { get; set; }

        public virtual void Commit()
        {
            base.SaveChanges();
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);

            modelBuilder.Configurations.Add(new GadgetConfiguration());
            modelBuilder.Configurations.Add(new CategoryConfiguration());
        }

        public static ProjectContext Create()
        {
            return new ProjectContext();
        }
    }
}

Fix the EF causing issues identity framework


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CarFuel.DataAccess;
using CarFuel.Models;
using CarFuel.Services;
using Microsoft.AspNet.Identity;

namespace CarFuel.Controllers {
  public class CarsController : Controller {

    private ICarDb db;
    private CarService carService;

    public CarsController() {
      db = new CarDb();
      carService = new CarService(db);
    }

    [Authorize]
    public ActionResult Index() {
      var userId = new Guid(User.Identity.GetUserId());
      IEnumerable<Car> cars = carService.GetCarsByMember(userId);
      return View(cars);
    }

    [Authorize]
    public ActionResult Create() {
      return View();
    }

    [HttpPost]
    [Authorize]
    public ActionResult Create(Car item) {
      var userId = new Guid(User.Identity.GetUserId());
            try
            {
                carService.AddCar(item, userId);

            }
            catch (OverQuotaException ex){

                TempData["error"] = ex.Message;
            }

      return RedirectToAction("Index");
    }

        public ActionResult Details(Guid id)
        {
            var userId = new Guid(User.Identity.GetUserId());

            var c = carService.GetCarsByMember(userId).SingleOrDefault(x => x.Id == id);

            return View(c);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CarFuel.DataAccess;
using CarFuel.Models;
using CarFuel.Services;
using Microsoft.AspNet.Identity;

namespace CarFuel.Controllers {
  public class CarsController : Controller {

    private ICarDb db;
    private CarService carService;

    public CarsController() {
      db = new CarDb();
      carService = new CarService(db);
    }

    [Authorize]
    public ActionResult Index() {
      var userId = new Guid(User.Identity.GetUserId());
      IEnumerable<Car> cars = carService.GetCarsByMember(userId);
      return View(cars);
    }

    [Authorize]
    public ActionResult Create() {
      return View();
    }

    [HttpPost]
    [Authorize]
    public ActionResult Create(Car item) {
      var userId = new Guid(User.Identity.GetUserId());
            try
            {
                carService.AddCar(item, userId);

            }
            catch (OverQuotaException ex){

                TempData["error"] = ex.Message;
            }

      return RedirectToAction("Index");
    }

        public ActionResult Details(Guid id)
        {
            if( id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest, "Bad Request");
            }

            var userId = new Guid(User.Identity.GetUserId());

            var c = carService.GetCarsByMember(userId).SingleOrDefault(x => x.Id == id);

            return View(c);
        }
    }
}

Add Response Bad Request on Detail Page

Add Response Bad Request on Detail Page


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

namespace NuGet.Common
{
    public static class AggregateRepositoryHelper
    {
        public static AggregateRepository CreateAggregateRepositoryFromSources(IPackageRepositoryFactory factory, IPackageSourceProvider sourceProvider, IEnumerable<string> sources)
        {
            AggregateRepository repository;
            if (sources != null && sources.Any())
            {
                var repositories = sources.Select(sourceProvider.ResolveSource)
                                             .Select(factory.CreateRepository)
                                             .ToList();
                repository = new AggregateRepository(repositories);
            }
            else
            {
                repository = sourceProvider.GetAggregate(factory, ignoreFailingRepositories: true);
            }

            return repository;
        }
    }
}

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

namespace NuGet.Common
{
    public static class AggregateRepositoryHelper
    {
        public static AggregateRepository CreateAggregateRepositoryFromSources(IPackageRepositoryFactory factory, IPackageSourceProvider sourceProvider, IEnumerable<string> sources)
        {
            AggregateRepository repository;
            if (sources != null && sources.Any())
            {
                var repositories = sources.Select(s => sourceProvider.ResolveSource(s))
                                             .Select(factory.CreateRepository)
                                             .ToList();
                repository = new AggregateRepository(repositories);
            }
            else
            {
                repository = sourceProvider.GetAggregate(factory, ignoreFailingRepositories: true);
            }

            return repository;
        }
    }
}

Undo a change which causes compiler error in .NET 4.0 (but not .NET 4.5


using System;
using System.Threading.Tasks;
using System.Web.Mvc;
using CroquetAustralia.Website.App.Infrastructure;

namespace CroquetAustralia.Website.App.tournaments
{
    [RoutePrefix("tournaments")]
    public class TournamentsController : ApplicationController
    {
        private readonly WebApi _webApi;

        public TournamentsController(WebApi webApi)
        {
            _webApi = webApi;
        }

        [Route("2016/ac/mens-open")]
        public ViewResult Mens_AC_Open_2016()
        {
            return View("tournament");
        }

        [Route("2016/ac/womens-open")]
        public ViewResult Womens_AC_Open_2016()
        {
            return View("tournament");
        }

        [Route("2016/gc/open-doubles")]
        public ViewResult GC_Open_Doubles_2016()
        {
            return View("tournament");
        }

        [Route("2016/gc/open-singles")]
        public ViewResult GC_Open_Singles_2016()
        {
            return View("tournament");
        }

        [Route("deposited")]
        public async Task<ViewResult> Deposited(Guid id)
        {
            await _webApi.PostAsync("/tournament-entry/payment-received", new {entityId = id, paymentMethod = "EFT"});
            return View("deposited");
        }
    }
}

using System;
using System.Threading.Tasks;
using System.Web.Mvc;
using CroquetAustralia.Website.App.Infrastructure;

namespace CroquetAustralia.Website.App.tournaments
{
    [RoutePrefix("tournaments")]
    public class TournamentsController : ApplicationController
    {
        private readonly WebApi _webApi;

        public TournamentsController(WebApi webApi)
        {
            _webApi = webApi;
        }

        [Route("{year}/{discipline}/{slug}")]
        public ViewResult Tournament()
        {
            return View("tournament");
        }

        [Route("deposited")]
        public async Task<ViewResult> Deposited(Guid id)
        {
            await _webApi.PostAsync("/tournament-entry/payment-received", new {entityId = id, paymentMethod = "EFT"});
            return View("deposited");
        }
    }
}

Replace tournament routes with generic {year}/{discipline}/{slug}


using System;
using UnityEditor;
using UnityEngine;

namespace GitHub.Unity
{
    [Serializable]
    class AuthenticationWindow : BaseWindow
    {
        private const string Title = "Sign in";

        [SerializeField] private AuthenticationView authView;

        [MenuItem("GitHub/Authenticate")]
        public static void Launch()
        {
            Open();
        }

        public static IView Open(Action<bool> onClose = null)
        {
            AuthenticationWindow authWindow = GetWindow<AuthenticationWindow>();
            if (onClose != null)
                authWindow.OnClose += onClose;
            authWindow.minSize = new Vector2(290, 290);
            authWindow.Show();
            return authWindow;
       }

        public override void OnGUI()
        {
            authView.OnGUI();
        }

        public override void Refresh()
        {
            authView.Refresh();
        }

        public override void OnEnable()
        {
            // Set window title
            titleContent = new GUIContent(Title, Styles.SmallLogo);

            Utility.UnregisterReadyCallback(CreateViews);
            Utility.RegisterReadyCallback(CreateViews);

            Utility.UnregisterReadyCallback(ShowActiveView);
            Utility.RegisterReadyCallback(ShowActiveView);
        }

        private void CreateViews()
        {
            if (authView == null)
                authView = new AuthenticationView();

            Initialize(EntryPoint.ApplicationManager);
            authView.InitializeView(this);
        }

        private void ShowActiveView()
        {
            authView.OnShow();
            Refresh();
        }

        public override void Finish(bool result)
        {
            Close();
            base.Finish(result);
        }
    }
}

using System;
using UnityEditor;
using UnityEngine;

namespace GitHub.Unity
{
    [Serializable]
    class AuthenticationWindow : BaseWindow
    {
        private const string Title = "Sign in";

        [SerializeField] private AuthenticationView authView;

        [MenuItem("GitHub/Authenticate")]
        public static void Launch()
        {
            Open();
        }

        public static IView Open(Action<bool> onClose = null)
        {
            AuthenticationWindow authWindow = GetWindow<AuthenticationWindow>();
            if (onClose != null)
                authWindow.OnClose += onClose;
            authWindow.minSize = new Vector2(290, 290);
            authWindow.Show();
            return authWindow;
       }

        public override void OnGUI()
        {
            if (authView == null)
            {
                CreateViews();
            }
            authView.OnGUI();
        }

        public override void Refresh()
        {
            authView.Refresh();
        }

        public override void OnEnable()
        {
            // Set window title
            titleContent = new GUIContent(Title, Styles.SmallLogo);

            Utility.UnregisterReadyCallback(CreateViews);
            Utility.RegisterReadyCallback(CreateViews);

            Utility.UnregisterReadyCallback(ShowActiveView);
            Utility.RegisterReadyCallback(ShowActiveView);
        }

        private void CreateViews()
        {
            if (authView == null)
                authView = new AuthenticationView();

            Initialize(EntryPoint.ApplicationManager);
            authView.InitializeView(this);
        }

        private void ShowActiveView()
        {
            authView.OnShow();
            Refresh();
        }

        public override void Finish(bool result)
        {
            Close();
            base.Finish(result);
        }
    }
}

Fix initializing the auth view'

Fix initializing the auth view'


// Copyright © 2010-2014 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

using System;
using System.Windows.Forms;
using CefSharp.Example;
using CefSharp.WinForms.Example.Minimal;

namespace CefSharp.WinForms.Example
{
    class Program
    {
        [STAThread]
        static void Main()
        {
            CefExample.Init();

            //var browser = new BrowserForm();
            var browser = new SimpleBrowserForm();
            Application.Run(browser);
        }
    }
}

// Copyright © 2010-2014 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

using System;
using System.Windows.Forms;
using CefSharp.Example;
using CefSharp.WinForms.Example.Minimal;

namespace CefSharp.WinForms.Example
{
    class Program
    {
        [STAThread]
        static void Main()
        {
            CefExample.Init();

            var browser = new BrowserForm();
            //var browser = new SimpleBrowserForm();
            Application.Run(browser);
        }
    }
}

Switch back to tabbed winforms example being the default (maybe one day create a method to switch between the two)


using System;
using System.IO;

namespace WebScriptHook.Framework
{
    public class Logger
    {
        public static string FileName
        {
            get;
            internal set;
        } = "WebScriptHook.log";

        public static LogType LogLevel
        {
            get;
            internal set;
        } = LogType.Info | LogType.Warning | LogType.Error;

        public static void Log(object message, LogType logType)
        {
            if ((LogLevel & logType) != LogType.None)
            {
                File.AppendAllText(FileName, "[" + DateTime.Now + "] [" + logType.ToString() + "]: " + message + Environment.NewLine);
            }
        }

        public static void Log(object message)
        {
            Log(message, LogType.Info);
        }
    }
}

using System;
using System.IO;
using System.Diagnostics;

namespace WebScriptHook.Framework
{
    public class Logger
    {
        public static string FileName
        {
            get;
            internal set;
        } = "WebScriptHook.log";

        public static LogType LogLevel
        {
            get;
            internal set;
        } = LogType.Info | LogType.Warning | LogType.Error;

        public static void Log(object message, LogType logType)
        {
            if ((LogLevel & logType) != LogType.None)
            {
                string formatedMessage = "[" + DateTime.Now + "] [" + logType.ToString() + "]: " + message;
                File.AppendAllText(FileName, formatedMessage + Environment.NewLine);
#if DEBUG
                Debug.WriteLine(formatedMessage);
#endif
            }
        }

        public static void Log(object message)
        {
            Log(message, LogType.Info);
        }
    }
}

Write to debug in debug env

Write to debug in debug env


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

namespace osu.Game.Rulesets.Taiko
{
    public enum TaikoSkinComponents
    {
        InputDrum,
        RimHit,
        DrumRollBody,
        DrumRollTick,
        Swell,
        HitTarget,
        TaikoDon
    }
}

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

namespace osu.Game.Rulesets.Taiko
{
    public enum TaikoSkinComponents
    {
        InputDrum,
        CentreHit,
        RimHit,
        DrumRollBody,
        DrumRollTick,
        Swell,
        HitTarget,
        TaikoDon
    }
}

Add removed skin component back

Add removed skin component back


using System.Threading.Tasks;
using CryptoExchange.Net.Interfaces;

namespace Binance.Net.Objects
{
    internal class BinanceStream
    {
        internal bool TryReconnect { get; set; } = true;
        public IWebsocket Socket { get; set; }
        public BinanceStreamSubscription StreamResult { get; set; }

        public async Task Close()
        {
            TryReconnect = false;
            await Socket.Close();
        }
    }
}

using System.Threading.Tasks;
using CryptoExchange.Net.Interfaces;

namespace Binance.Net.Objects
{
    internal class BinanceStream
    {
        internal bool TryReconnect { get; set; } = true;
        public IWebsocket Socket { get; set; }
        public BinanceStreamSubscription StreamResult { get; set; }

        public async Task Close()
        {
            TryReconnect = false;
            await Socket.Close().ConfigureAwait(false);
        }
    }
}

Fix for unsubscribe freezing ui thread

Fix for unsubscribe freezing ui thread


using System;
using System.Text;
using SurveyMonkey.Helpers;

namespace SurveyMonkey.ProcessedAnswers
{
    public class SingleChoiceAnswer : IProcessedResponse
    {
        public string Choice { get; set; }
        public string OtherText { get; set; }

        public string Printable
        {
            get
            {
                var sb = new StringBuilder();
                if (Choice != null)
                {
                    sb.Append(Choice);
                    sb.Append(Environment.NewLine);
                }
                if (OtherText != null)
                {
                    sb.Append(OtherText);
                }
                return ProcessedAnswerFormatHelper.Trim(sb);
            }
        }
    }
}

using System;
using System.Text;
using SurveyMonkey.Helpers;

namespace SurveyMonkey.ProcessedAnswers
{
    public class SingleChoiceAnswer : IProcessedResponse
    {
        public string Choice { get; set; }
        public string OtherText { get; set; }

        public string Printable
        {
            get
            {
                var sb = new StringBuilder();
                if (Choice != null)
                {
                    sb.Append(Choice);
                    sb.Append(Environment.NewLine);
                }
                if (OtherText != null)
                {
                    sb.Append($"Other: {OtherText}");
                }
                return ProcessedAnswerFormatHelper.Trim(sb);
            }
        }
    }
}

Print "Other:" for single choice questions


using MultiMiner.Coin.Api;
using Newtonsoft.Json.Linq;

namespace MultiMiner.CoinWarz.Api
{
    public static class CoinInformationExtensions
    {
        public static void PopulateFromJson(this CoinInformation coinInformation, JToken jToken)
        {
            coinInformation.Symbol = jToken.Value<string>("CoinTag");
            coinInformation.Name = jToken.Value<string>("CoinName");
            coinInformation.Algorithm = jToken.Value<string>("Algorithm");
            coinInformation.CurrentBlocks = jToken.Value<int>("BlockCount");
            coinInformation.Difficulty = jToken.Value<double>("Difficulty");
            coinInformation.Reward = jToken.Value<double>("BlockReward");
            coinInformation.Price = jToken.Value<double>("ExchangeRate");
            coinInformation.Exchange = jToken.Value<string>("Exchange");
            coinInformation.Profitability = jToken.Value<double>("ProfitRatio");
            coinInformation.AdjustedProfitability = jToken.Value<double>("ProfitRatio");
            coinInformation.AverageProfitability = jToken.Value<double>("AvgProfitRatio");
        }
    }
}

using MultiMiner.Coin.Api;
using Newtonsoft.Json.Linq;

namespace MultiMiner.CoinWarz.Api
{
    public static class CoinInformationExtensions
    {
        public static void PopulateFromJson(this CoinInformation coinInformation, JToken jToken)
        {
            coinInformation.Symbol = jToken.Value<string>("CoinTag");
            coinInformation.Name = jToken.Value<string>("CoinName");
            coinInformation.Algorithm = jToken.Value<string>("Algorithm");
            coinInformation.CurrentBlocks = jToken.Value<int>("BlockCount");
            coinInformation.Difficulty = jToken.Value<double>("Difficulty");
            coinInformation.Reward = jToken.Value<double>("BlockReward");

            if (coinInformation.Symbol.Equals("BTC", System.StringComparison.OrdinalIgnoreCase))
                coinInformation.Price = 1;
            else
                coinInformation.Price = jToken.Value<double>("ExchangeRate");

            coinInformation.Exchange = jToken.Value<string>("Exchange");
            coinInformation.Profitability = jToken.Value<double>("ProfitRatio");
            coinInformation.AdjustedProfitability = jToken.Value<double>("ProfitRatio");
            coinInformation.AverageProfitability = jToken.Value<double>("AvgProfitRatio");
        }
    }
}

Adjust the CoinWarz price / exchange rate so that BTC is 1 (100%)


using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;

namespace EasySnippets
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        private void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs args)
        {
            Console.WriteLine(@"An unexpected application exception occurred {0}", args.Exception);

            File.AppendAllLines(@".\es.log", new[] { $"{DateTime.UtcNow:yyyy-MM-dd HH\\:mm\\:ss.fff} {args.Exception.Message}", args.Exception.StackTrace });

            MessageBox.Show("An unexpected exception has occurred. Shutting down the application. Please check the log file for more details.");

            // Prevent default unhandled exception processing
            args.Handled = true;
        }
    }
}

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;

namespace EasySnippets
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        private void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs args)
        {
            Console.WriteLine(@"An unexpected application exception occurred {0}", args.Exception);

            MessageBox.Show("An unexpected exception has occurred. Shutting down the application. Please check the log file for more details.");

            // Prevent default unhandled exception processing
            args.Handled = true;

            Environment.Exit(0);
        }
    }
}

Revert "Added log of exceptions"

Revert "Added log of exceptions"

This reverts commit 27d31e494cb55c6dcbb79875bd388e67d8d928c1.


using UnityEngine;

public class Trials {
    public static void Reset() {
        Debug.Log("Reset trials");
    }

    public static void AddSuccess() {
        string trials = PlayerPrefs.GetString("Trials");

        trials += "S";

        while(trials.Length > 100) {
            trials = trials.Substring(1);
        }

        PlayerPrefs.SetString("Trials", trials);
    }

    public static void AddFailure() {
        string trials = PlayerPrefs.GetString("Trials");

        trials += "F";

        while(trials.Length > 100) {
            trials = trials.Substring(1);
        }

        PlayerPrefs.SetString("Trials", trials);
    }

    public static int GetSuccess() {
        int count = 0;
        string trials = PlayerPrefs.GetString("Trials");

        foreach(char trial in trials) {
            if(trial == 'S') {
                count += 1;
            }
        }

        return count;
    }

    public static int GetFailure() {
        int count = 0;
        string trials = PlayerPrefs.GetString("Trials");

        foreach(char trial in trials) {
            if(trial == 'F') {
                count += 1;
            }
        }

        return count;
    }
}

using UnityEngine;

public class Trials {
    public static void Reset() {
        PlayerPrefs.SetString("Trials", "");
    }

    public static void AddSuccess() {
        string trials = PlayerPrefs.GetString("Trials");

        trials += "S";

        while(trials.Length > 100) {
            trials = trials.Substring(1);
        }

        PlayerPrefs.SetString("Trials", trials);
    }

    public static void AddFailure() {
        string trials = PlayerPrefs.GetString("Trials");

        trials += "F";

        while(trials.Length > 100) {
            trials = trials.Substring(1);
        }

        PlayerPrefs.SetString("Trials", trials);
    }

    public static int GetSuccess() {
        int count = 0;
        string trials = PlayerPrefs.GetString("Trials");

        foreach(char trial in trials) {
            if(trial == 'S') {
                count += 1;
            }
        }

        return count;
    }

    public static int GetFailure() {
        int count = 0;
        string trials = PlayerPrefs.GetString("Trials");

        foreach(char trial in trials) {
            if(trial == 'F') {
                count += 1;
            }
        }

        return count;
    }
}

Fix bug in reset code

Fix bug in reset code


using System;
using System.Diagnostics;
using System.Linq;
using System.DoubleNumerics;
using JetBrains.Annotations;
using SolidworksAddinFramework.OpenGl;
using SolidWorks.Interop.sldworks;

namespace SolidworksAddinFramework.Geometry
{
    public class BSpline3D : BSpline<Vector4>
    {
        public BSpline3D([NotNull] Vector4[] controlPoints, [NotNull] double[] knotVectorU, int order, bool isClosed, bool isRational) : base(controlPoints, knotVectorU, order, isClosed, isRational)
        {
            if(!IsRational)
            {
                Debug.Assert(controlPoints.All(c => Math.Abs(c.W - 1.0) < 1e-9));
            }
        }
        public ICurve ToCurve()
        {
            var propsDouble = PropsDouble;
            var knots = KnotVectorU;
            var ctrlPtCoords = ControlPoints.SelectMany(p => Vector3Extensions.ToDoubles((Vector4) p)).ToArray();
            return (ICurve) SwAddinBase.Active.Modeler.CreateBsplineCurve( propsDouble, knots, ctrlPtCoords);
        }

        public double[] ToDoubles(Vector4 t)
        {
            return t.ToDoubles();
        }

        public override int Dimension => IsRational ? 4 : 3;
    }
}

using System;
using System.Diagnostics;
using System.Linq;
using System.DoubleNumerics;
using JetBrains.Annotations;
using SolidworksAddinFramework.OpenGl;
using SolidWorks.Interop.sldworks;

namespace SolidworksAddinFramework.Geometry
{
    public class BSpline3D : BSpline<Vector4>
    {
        public BSpline3D([NotNull] Vector4[] controlPoints, [NotNull] double[] knotVectorU, int order, bool isClosed, bool isRational) : base(controlPoints, knotVectorU, order, isClosed, isRational)
        {
            if(!IsRational)
            {
                Debug.Assert(controlPoints.All(c => Math.Abs(c.W - 1.0) < 1e-9));
            }
        }
        public ICurve ToCurve()
        {
            var propsDouble = PropsDouble;
            var knots = KnotVectorU;
            var ctrlPtCoords = ControlPoints.SelectMany(p => p.ToDoubles()).ToArray();
            return (ICurve) SwAddinBase.Active.Modeler.CreateBsplineCurve( propsDouble, knots, ctrlPtCoords);
        }

        public double[] ToDoubles(Vector4 t)
        {
            return t.ToDoubles();
        }

        public override int Dimension => IsRational ? 4 : 3;
    }
}

Convert code to use extension method

Convert code to use extension method


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

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("UnitTests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UnitTests")]
[assembly: AssemblyCopyright("Copyright ©  2015")]
[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("2cc38a28-87ec-4b55-8130-ce705cdb49e8")]

// 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("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

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

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("UnitTests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UnitTests")]
[assembly: AssemblyCopyright("Copyright ©  2015")]
[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("2cc38a28-87ec-4b55-8130-ce705cdb49e8")]

// 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("1.0.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]

Set version number of unit tests to be different

This way the test case can verify they are working correctly


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

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

[assembly: AssemblyTitle("Microsoft Azure Traffic Manager Management Library")]
[assembly: AssemblyDescription("Provides Microsoft Azure Traffic Manager management functions for managing the Microsoft Azure Traffic Manager service.")]

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

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

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

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

[assembly: AssemblyTitle("Microsoft Azure Traffic Manager Management Library")]
[assembly: AssemblyDescription("Provides Microsoft Azure Traffic Manager management functions for managing the Microsoft Azure Traffic Manager service.")]

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

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

Revert AssemblyVersion to 2.0.0 because there are no breaking changes in this version


using System;
using Eto.Drawing;
using System.Collections.Generic;
using MonoTouch.UIKit;
using System.Linq;

namespace Eto.Platform.iOS.Drawing
{
	public class FontFamilyHandler : WidgetHandler<object, FontFamily>, IFontFamily
	{
		public FontFamilyHandler ()
		{
		}

		public FontFamilyHandler (string familyName)
		{
			Create (familyName);
		}

		public void Create (string familyName)
		{
			this.Name = familyName;
		}

		public string Name { get; private set; }

		public IEnumerable<FontTypeface> Typefaces {
			get { return UIFont.FontNamesForFamilyName(this.Name).Select(r => new FontTypeface(Widget, new FontTypefaceHandler(r))); }
		}

		public UIFont CreateFont (float size, FontStyle style)
		{
			// scan!
			var handler = Typefaces.First().Handler as FontTypefaceHandler;
			return handler.CreateFont(size);
		}

		public FontTypeface GetFace(UIFont font)
		{
			return Typefaces.FirstOrDefault (r => string.Equals (((FontTypefaceHandler)r.Handler).FontName, font.Name, StringComparison.InvariantCultureIgnoreCase));
		}
	}
}

using System;
using Eto.Drawing;
using System.Collections.Generic;
using MonoTouch.UIKit;
using System.Linq;

namespace Eto.Platform.iOS.Drawing
{
	public class FontFamilyHandler : WidgetHandler<object, FontFamily>, IFontFamily
	{
		public FontFamilyHandler ()
		{
		}

		public FontFamilyHandler (string familyName)
		{
			Create (familyName);
		}

		public void Create (string familyName)
		{
			this.Name = familyName;
		}

		public string Name { get; private set; }

		public IEnumerable<FontTypeface> Typefaces {
			get { return UIFont.FontNamesForFamilyName(this.Name).Select(r => new FontTypeface(Widget, new FontTypefaceHandler(r))); }
		}

		public UIFont CreateFont (float size, FontStyle style)
		{
			var matched = Typefaces.FirstOrDefault (r => r.FontStyle == style);
			if (matched == null) matched = Typefaces.First ();
			var handler = matched.Handler as FontTypefaceHandler;
			return handler.CreateFont(size);
		}

		public FontTypeface GetFace(UIFont font)
		{
			return Typefaces.FirstOrDefault (r => string.Equals (((FontTypefaceHandler)r.Handler).FontName, font.Name, StringComparison.InvariantCultureIgnoreCase));
		}
	}
}

iOS: Fix creating a font with a specific style


using System.ComponentModel.Composition.Hosting;

namespace IocPerformance.Adapters
{
    public sealed class MefContainerAdapter : IContainerAdapter
    {
        private CompositionContainer container;

        public void Prepare()
        {
            var catalog = new AssemblyCatalog(typeof(Program).Assembly);
            this.container = new CompositionContainer(catalog);
        }

        public T Resolve<T>() where T : class
        {
            return this.container.GetExportedValue<T>();
        }

        public void Dispose()
        {
            this.container = null;
        }
    }
}

using System.ComponentModel.Composition.Hosting;

namespace IocPerformance.Adapters
{
    public sealed class MefContainerAdapter : IContainerAdapter
    {
        private CompositionContainer container;

        public void Prepare()
        {
            var catalog = new TypeCatalog(typeof(Implementation1), typeof(Implementation2), typeof(Combined));
            this.container = new CompositionContainer(catalog);
        }

        public T Resolve<T>() where T : class
        {
            return this.container.GetExportedValue<T>();
        }

        public void Dispose()
        {
            // Allow the container and everything it references to be disposed.
            this.container = null;
        }
    }
}

Change to using TypeCatalog instead of AssemblyCatalog


using System;
using System.Collections.Generic;
using System.Threading;

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

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

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

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

        public static T DebugBreak<T>(this T obj)
        {
            System.Diagnostics.Debugger.Break();
            return obj;
        }

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

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

using System;
using System.Collections.Generic;
using System.Threading;

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

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

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

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

        public static T DebugBreak<T>(this T obj)
        {
            if(System.Diagnostics.Debugger.IsAttached)
                System.Diagnostics.Debugger.Break();
            return obj;
        }

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

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

Make sure debugger is attached for DebugBreak, otherwise user is prompted to attach a debugger


namespace SoxSharp.Effects
{
  public abstract class BaseEffect : IBaseEffect
  {
    public abstract string Name { get; }

    public virtual bool IsValid() { return true; }

    public abstract override string ToString();
  }
}

namespace SoxSharp.Effects
{
  public abstract class BaseEffect : IBaseEffect
  {
    public abstract string Name { get; }

    public abstract override string ToString();
  }
}

Revert "Added method to perform validity check for effect parameters"

This reverts commit faf0ad746b78f754dca89a552c114a912c68b3d3.


using System;
using System.Collections.Generic;
using System.Linq;
using PrepareLanding.Extensions;
using RimWorld;
using RimWorld.Planet;
using UnityEngine;
using Verse;

namespace PrepareLanding.Filters
{
    public abstract class TileFilter : ITileFilter
    {
        protected List<int> _filteredTiles = new List<int>();

        public abstract string SubjectThingDef { get; }

        public virtual List<int> FilteredTiles => _filteredTiles;

        public virtual string RunningDescription => $"Filtering {SubjectThingDef}";

        public string AttachedProperty { get; }
        public Action<PrepareLandingUserData, List<int>> FilterAction { get; }
        public FilterHeaviness Heaviness { get; }

        protected TileFilter(string attachedProperty, FilterHeaviness heaviness)
        {
            AttachedProperty = attachedProperty;
            Heaviness = heaviness;
            FilterAction = Filter;
        }

        public virtual void Filter(PrepareLandingUserData userData, List<int> inputList)
        {
            _filteredTiles.Clear();
        }
    }

}

using System;
using System.Collections.Generic;
using System.Linq;
using PrepareLanding.Extensions;
using RimWorld;
using RimWorld.Planet;
using UnityEngine;
using Verse;

namespace PrepareLanding.Filters
{
    public abstract class TileFilter : ITileFilter
    {
        protected List<int> _filteredTiles = new List<int>();

        protected PrepareLandingUserData UserData;

        public abstract string SubjectThingDef { get; }

        public abstract bool IsFilterActive { get; }

        public virtual List<int> FilteredTiles => _filteredTiles;

        public virtual string RunningDescription => $"Filtering {SubjectThingDef}";

        public string AttachedProperty { get; }

        public Action<List<int>> FilterAction { get; }

        public FilterHeaviness Heaviness { get; }

        protected TileFilter(PrepareLandingUserData userData, string attachedProperty, FilterHeaviness heaviness)
        {
            UserData = userData;
            AttachedProperty = attachedProperty;
            Heaviness = heaviness;
            FilterAction = Filter;
        }

        public virtual void Filter(List<int> inputList)
        {
            _filteredTiles.Clear();
        }
    }

}

Add IsFilterActive; remove unneeded parameters for filter method (pass it on ctor)


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

[assembly: AssemblyTitle("NModbus4")]
[assembly: AssemblyProduct("NModbus4")]
[assembly: AssemblyCompany("Maxwe11")]
[assembly: AssemblyCopyright("Licensed under MIT License.")]
[assembly: AssemblyDescription("Differs from this one (https://code.google.com/p/nmodbus) in following: " +
                               "removed FtdAdapter.dll, log4net, Unme.Common.dll dependencies, assembly renamed to NModbus.dll, " +
                               "target framework changed to .NET 4")]

// required for VBA applications

[assembly: ComVisible(true)]
[assembly: CLSCompliant(false)]
[assembly: Guid("95B2AE1E-E0DC-4306-8431-D81ED10A2D5D")]
[assembly: AssemblyVersion("1.12.0.0")]
#if !WindowsCE

[assembly: AssemblyFileVersion("1.12.0.0")]
#endif

#if !SIGNED

[assembly: InternalsVisibleTo(@"Modbus.UnitTests")]
[assembly: InternalsVisibleTo(@"DynamicProxyGenAssembly2")]
#endif

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

[assembly: AssemblyTitle("NModbus4")]
[assembly: AssemblyProduct("NModbus4")]
[assembly: AssemblyCompany("Maxwe11")]
[assembly: AssemblyCopyright("Licensed under MIT License.")]
[assembly: AssemblyDescription("NModbus is a C# implementation of the Modbus protocol. " +
           "Provides connectivity to Modbus slave compatible devices and applications. " +
           "Supports serial ASCII, serial RTU, TCP, and UDP protocols. "+
           "NModbus4 it's a fork of NModbus(https://code.google.com/p/nmodbus)")]

[assembly: CLSCompliant(false)]
[assembly: Guid("95B2AE1E-E0DC-4306-8431-D81ED10A2D5D")]
[assembly: AssemblyVersion("2.0.*")]

#if !SIGNED
[assembly: InternalsVisibleTo(@"Modbus.UnitTests")]
[assembly: InternalsVisibleTo(@"DynamicProxyGenAssembly2")]
#endif

Update description, version and remove ComVisible


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

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Common.Core")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Software Passion")]
[assembly: AssemblyProduct("Common.Core")]
[assembly: AssemblyCopyright("Copyright © Software Passion 2014")]
[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("30a96287-13a9-48e0-85db-4d0afe222eaf")]

// 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("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]

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

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Common.Core")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Software Passion")]
[assembly: AssemblyProduct("Common.Core")]
[assembly: AssemblyCopyright("Copyright © Software Passion 2014")]
[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("30a96287-13a9-48e0-85db-4d0afe222eaf")]

// 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("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]

Increase version number to 1.2.0.0.

Increase version number to 1.2.0.0.


// 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.Collections.Generic;
using System.Linq;
using osu.Framework.Bindables;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Game.Graphics.UserInterface;
using osu.Game.Input.Bindings;
using osu.Game.Localisation;
using osu.Game.Rulesets.Mods;

namespace osu.Game.Overlays.Mods
{
    public class DeselectAllModsButton : ShearedButton, IKeyBindingHandler<GlobalAction>
    {
        public DeselectAllModsButton(ModSelectOverlay modSelectOverlay)
            : base(ModSelectOverlay.BUTTON_WIDTH)
        {
            Text = CommonStrings.DeselectAll;
            Action = modSelectOverlay.DeselectAll;
        }

        public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
        {
            if (e.Repeat || e.Action != GlobalAction.DeselectAllMods)
                return false;

            TriggerClick();
            return true;
        }

        public void OnReleased(KeyBindingReleaseEvent<GlobalAction> e)
        {
        }
    }
}

// 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.Collections.Generic;
using System.Linq;
using osu.Framework.Bindables;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Game.Graphics.UserInterface;
using osu.Game.Input.Bindings;
using osu.Game.Localisation;
using osu.Game.Rulesets.Mods;

namespace osu.Game.Overlays.Mods
{
    public class DeselectAllModsButton : ShearedButton, IKeyBindingHandler<GlobalAction>
    {
        private readonly Bindable<IReadOnlyList<Mod>> selectedMods = new Bindable<IReadOnlyList<Mod>>();

        public DeselectAllModsButton(ModSelectOverlay modSelectOverlay)
            : base(ModSelectOverlay.BUTTON_WIDTH)
        {
            Text = CommonStrings.DeselectAll;
            Action = modSelectOverlay.DeselectAll;

            selectedMods.BindTo(modSelectOverlay.SelectedMods);
        }

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

            selectedMods.BindValueChanged(_ => updateEnabledState(), true);
        }

        private void updateEnabledState()
        {
            Enabled.Value = selectedMods.Value.Any();
        }

        public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
        {
            if (e.Repeat || e.Action != GlobalAction.DeselectAllMods)
                return false;

            TriggerClick();
            return true;
        }

        public void OnReleased(KeyBindingReleaseEvent<GlobalAction> e)
        {
        }
    }
}

Disable "deselect all mods" button if none are selected


using MyDocs.Common.Contract.Service;
using MyDocs.Common.Model.Logic;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Windows.Data.Pdf;
using Windows.Storage;

namespace MyDocs.WindowsStore.Service
{
    public class PdfPageExtractorService : IPageExtractorService
    {
        public bool SupportsExtension(string extension)
        {
            return new[] { ".pdf" }.Contains(extension, StringComparer.OrdinalIgnoreCase);
        }

        public async Task<IEnumerable<Photo>> ExtractPages(StorageFile file, Document document)
        {
            var doc = await PdfDocument.LoadFromFileAsync(file);

            var folder = ApplicationData.Current.TemporaryFolder;
            var extractTasks = Enumerable.Range(0, (int)doc.PageCount)
                .Select(i => ExtractPage(doc, file.Name, i, folder));
            var images = await Task.WhenAll(extractTasks);
            return images.Select(image => new Photo(image));
        }

        private async Task<StorageFile> ExtractPage(PdfDocument doc, string fileName, int pageNumber, StorageFolder folder)
        {
            var pageFileName = Path.ChangeExtension(fileName, ".jpg");
            var image = await folder.CreateFileAsync(pageFileName, CreationCollisionOption.GenerateUniqueName);
            using (var page = doc.GetPage((uint)pageNumber))
            using (var stream = await image.OpenAsync(FileAccessMode.ReadWrite)) {
                await page.RenderToStreamAsync(stream);
            }
            return image;
        }
    }
}

using MyDocs.Common.Contract.Service;
using MyDocs.Common.Model.Logic;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Windows.Data.Pdf;
using Windows.Storage;

namespace MyDocs.WindowsStore.Service
{
    public class PdfPageExtractorService : IPageExtractorService
    {
        public bool SupportsExtension(string extension)
        {
            return new[] { ".pdf" }.Contains(extension, StringComparer.OrdinalIgnoreCase);
        }

        public async Task<IEnumerable<Photo>> ExtractPages(StorageFile file, Document document)
        {
            var doc = await PdfDocument.LoadFromFileAsync(file);

            var baseFolder = await file.GetParentAsync();
            var folder = await baseFolder.CreateFolderAsync(Path.GetFileNameWithoutExtension(file.Name));
            var extractTasks = Enumerable.Range(0, (int)doc.PageCount)
                .Select(i => ExtractPage(doc, file.Name, i, folder));
            var images = await Task.WhenAll(extractTasks);
            return images.Select(image => new Photo(image));
        }

        private async Task<StorageFile> ExtractPage(PdfDocument doc, string fileName, int pageNumber, IStorageFolder folder)
        {
            var pageFileName = Path.ChangeExtension(fileName, ".jpg");
            var image = await folder.CreateFileAsync(pageFileName, CreationCollisionOption.GenerateUniqueName);
            using (var page = doc.GetPage((uint)pageNumber))
            using (var stream = await image.OpenAsync(FileAccessMode.ReadWrite)) {
                await page.RenderToStreamAsync(stream);
            }
            return image;
        }
    }
}

Store extracted pages in subfolder

Store extracted pages in subfolder


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

namespace Nest
{
	[JsonObject]
	public class ClusterRerouteExplanation
	{
		[JsonProperty("command")]
		public string Comand { get; set; }

		[JsonProperty("parameters")]
		public ClusterRerouteParameters Parameters { get; set; }

		[JsonProperty("decisions")]
		public IEnumerable<ClusterRerouteDecision> Descisions { get; set; }
	}
}

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

namespace Nest
{
	[JsonObject]
	public class ClusterRerouteExplanation
	{
		[JsonProperty("command")]
		public string Command { get; set; }

		[JsonProperty("parameters")]
		public ClusterRerouteParameters Parameters { get; set; }

		[JsonProperty("decisions")]
		public IEnumerable<ClusterRerouteDecision> Decisions { get; set; }
	}
}

Fix typos in cluster reroute explanation


using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;

namespace AgateLib.Drivers
{
    class AgateSandBoxLoader : MarshalByRefObject
    {
        public AgateDriverInfo[] ReportDrivers(string file)
        {
            List<AgateDriverInfo> retval = new List<AgateDriverInfo>();

            Assembly ass = Assembly.LoadFrom(file);

            foreach (Type t in ass.GetTypes())
            {
                if (t.IsAbstract)
                    continue;
                if (typeof(AgateDriverReporter).IsAssignableFrom(t) == false)
                    continue;

                AgateDriverReporter reporter = (AgateDriverReporter)Activator.CreateInstance(t);

                foreach (AgateDriverInfo info in reporter.ReportDrivers())
                {
                    info.AssemblyFile = file;
                    info.AssemblyName = ass.FullName;

                    retval.Add(info);
                }
            }

            return retval.ToArray();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;

namespace AgateLib.Drivers
{
    class AgateSandBoxLoader : MarshalByRefObject
    {
        public AgateDriverInfo[] ReportDrivers(string file)
        {
            List<AgateDriverInfo> retval = new List<AgateDriverInfo>();
            Assembly ass;

            try
            {
                ass = Assembly.LoadFrom(file);
            }
            catch (BadImageFormatException)
            {
                System.Diagnostics.Debug.Print("Could not load the file {0}.  Is it a CLR assembly?", file);
                return retval.ToArray();
            }

            foreach (Type t in ass.GetTypes())
            {
                if (t.IsAbstract)
                    continue;
                if (typeof(AgateDriverReporter).IsAssignableFrom(t) == false)
                    continue;

                AgateDriverReporter reporter = (AgateDriverReporter)Activator.CreateInstance(t);

                foreach (AgateDriverInfo info in reporter.ReportDrivers())
                {
                    info.AssemblyFile = file;
                    info.AssemblyName = ass.FullName;

                    retval.Add(info);
                }
            }

            return retval.ToArray();
        }
    }
}

Correct the sand box to catch exception if a non-CLR dll is present.


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

namespace Cassette
{
    class HtmlTemplateModuleContainerBuilder : ModuleContainerBuilder
    {
        readonly string applicationRoot;

        public HtmlTemplateModuleContainerBuilder(IsolatedStorageFile storage, string rootDirectory, string applicationRoot)
            : base(storage, rootDirectory)
        {
            this.applicationRoot = EnsureDirectoryEndsWithSlash(applicationRoot);
        }

        public override ModuleContainer Build()
        {
            var moduleBuilder = new UnresolveHtmlTemplateModuleBuilder(rootDirectory);
            var unresolvedModules = relativeModuleDirectories.Select(x => moduleBuilder.Build(x.Item1, x.Item2));
            var modules = UnresolvedModule.ResolveAll(unresolvedModules);
            return new ModuleContainer(
                modules,
                storage,
                textWriter => new HtmlTemplateModuleWriter(textWriter, rootDirectory, LoadFile)
            );
        }
    }
}

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

namespace Cassette
{
    public class HtmlTemplateModuleContainerBuilder : ModuleContainerBuilder
    {
        readonly string applicationRoot;

        public HtmlTemplateModuleContainerBuilder(IsolatedStorageFile storage, string rootDirectory, string applicationRoot)
            : base(storage, rootDirectory)
        {
            this.applicationRoot = EnsureDirectoryEndsWithSlash(applicationRoot);
        }

        public override ModuleContainer Build()
        {
            var moduleBuilder = new UnresolveHtmlTemplateModuleBuilder(rootDirectory);
            var unresolvedModules = relativeModuleDirectories.Select(x => moduleBuilder.Build(x.Item1, x.Item2));
            var modules = UnresolvedModule.ResolveAll(unresolvedModules);
            return new ModuleContainer(
                modules,
                storage,
                textWriter => new HtmlTemplateModuleWriter(textWriter, rootDirectory, LoadFile)
            );
        }
    }
}

Make html template container builder public.


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;

using System.Windows.Forms;
using Assimp;

namespace open3mod
{
    public partial class TextureDetailsDialog : Form
    {
        private TextureThumbnailControl _tex;
        public TextureDetailsDialog()
        {
            InitializeComponent();
        }

        public TextureThumbnailControl GetTexture()
        {
            return _tex;
        }

        public void SetTexture(TextureThumbnailControl tex)
        {
            Debug.Assert(tex != null && tex.Texture != null);

            _tex = tex;
            var img = tex.Texture.Image;

            Text = Path.GetFileName(tex.FilePath) + " - Details";

            pictureBox1.Image = img;
            labelInfo.Text = string.Format("Size: {0} x {1} px", img.Width, img.Height);
            checkBoxHasAlpha.Checked = tex.Texture.HasAlpha == Texture.AlphaState.HasAlpha;

            pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
        }
    }
}

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;

using System.Windows.Forms;
using Assimp;

namespace open3mod
{
    public partial class TextureDetailsDialog : Form
    {
        private TextureThumbnailControl _tex;
        public TextureDetailsDialog()
        {
            InitializeComponent();
        }

        public TextureThumbnailControl GetTexture()
        {
            return _tex;
        }

        public void SetTexture(TextureThumbnailControl tex)
        {
            Debug.Assert(tex != null && tex.Texture != null);

            _tex = tex;
            var img = tex.Texture.Image;

            Text = Path.GetFileName(tex.FilePath) + " - Details";

            pictureBox1.Image = img;

            if (img != null)
            {
                labelInfo.Text = string.Format("Size: {0} x {1} px", img.Width, img.Height);
            }
            checkBoxHasAlpha.Checked = tex.Texture.HasAlpha == Texture.AlphaState.HasAlpha;
            pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
        }
    }
}

Fix null ref access when texture panel is open and you hover over a texture that failed to load.


using System.Management.Automation;

namespace PoshGit2
{
    class PSCurrentWorkingDirectory : ICurrentWorkingDirectory
    {
        private SessionState _sessionState;

        public PSCurrentWorkingDirectory(SessionState sessionState)
        {
            _sessionState = sessionState;
        }

        public string CWD
        {
            get
            {
                return _sessionState.Path.CurrentFileSystemLocation.Path;
            }
        }
    }
}

using System.Management.Automation;

namespace PoshGit2
{
    class PSCurrentWorkingDirectory : ICurrentWorkingDirectory
    {
        private SessionState _sessionState;

        public PSCurrentWorkingDirectory(SessionState sessionState)
        {
            _sessionState = sessionState;
        }

        public string CWD
        {
            get
            {
                return _sessionState.Path.CurrentLocation.ProviderPath;
            }
        }
    }
}

Use CurrentLocation.ProviderPath to get actual file system path


namespace SqlStreamStore
{
    using System;
    using System.Threading.Tasks;
    using Shouldly;
    using SqlStreamStore.Streams;
    using Xunit;

    public class messageTests
    {
        [Fact]
        public async Task Can_deserialize()
        {
            var message = new StreamMessage(
                "stream",
                Guid.NewGuid(),
                1,
                2,
                DateTime.UtcNow,
                "type",
                "\"meta\"", "\"data\"");

            (await message.GetJsonDataAs<string>()).ShouldBe("data");
            message.JsonMetadataAs<string>().ShouldBe("meta");
        }
    }
}

namespace SqlStreamStore
{
    using System;
    using System.Threading.Tasks;
    using Shouldly;
    using SqlStreamStore.Streams;
    using Xunit;

    public class StreamEventTests
    {
        [Fact]
        public async Task Can_deserialize()
        {
            var message = new StreamMessage(
                "stream",
                Guid.NewGuid(),
                1,
                2,
                DateTime.UtcNow,
                "type",
                "\"meta\"", "\"data\"");

            (await message.GetJsonDataAs<string>()).ShouldBe("data");
            message.JsonMetadataAs<string>().ShouldBe("meta");
        }
    }
}

Fix test type name to match file.

Fix test type name to match file.


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

using osu.Game.Modes.Objects.Drawables;
using osu.Game.Modes.Osu.Judgements;
using osu.Game.Modes.Osu.Objects;
using osu.Game.Modes.Scoring;
using osu.Game.Modes.UI;

namespace osu.Game.Modes.Osu.Scoring
{
    internal class OsuScoreProcessor : ScoreProcessor<OsuHitObject, OsuJudgement>
    {
        public OsuScoreProcessor()
        {
        }

        public OsuScoreProcessor(HitRenderer<OsuHitObject, OsuJudgement> hitRenderer)
            : base(hitRenderer)
        {
        }

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

            Health.Value = 1;
            Accuracy.Value = 1;
        }

        protected override void OnNewJudgement(OsuJudgement judgement)
        {
            if (judgement != null)
            {
                switch (judgement.Result)
                {
                    case HitResult.Hit:
                        Combo.Value++;
                        Health.Value += 0.1f;
                        break;
                    case HitResult.Miss:
                        Combo.Value = 0;
                        Health.Value -= 0.2f;
                        break;
                }
            }

            int score = 0;
            int maxScore = 0;

            foreach (var j in Judgements)
            {
                score += j.ScoreValue;
                maxScore += j.MaxScoreValue;
            }

            TotalScore.Value = score;
            Accuracy.Value = (double)score / maxScore;
        }
    }
}

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

using osu.Game.Modes.Objects.Drawables;
using osu.Game.Modes.Osu.Judgements;
using osu.Game.Modes.Osu.Objects;
using osu.Game.Modes.Scoring;
using osu.Game.Modes.UI;

namespace osu.Game.Modes.Osu.Scoring
{
    internal class OsuScoreProcessor : ScoreProcessor<OsuHitObject, OsuJudgement>
    {
        public OsuScoreProcessor()
        {
        }

        public OsuScoreProcessor(HitRenderer<OsuHitObject, OsuJudgement> hitRenderer)
            : base(hitRenderer)
        {
        }

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

            Health.Value = 1;
            Accuracy.Value = 1;
        }

        protected override void OnNewJudgement(OsuJudgement judgement)
        {
            int score = 0;
            int maxScore = 0;

            foreach (var j in Judgements)
            {
                score += j.ScoreValue;
                maxScore += j.MaxScoreValue;
            }

            TotalScore.Value = score;
            Accuracy.Value = (double)score / maxScore;
        }
    }
}

Fix osu! mode adding combos twice.

Fix osu! mode adding combos twice.


using System;
using Nancy;

namespace MicroServicesHelloWorld{

public class CurrentDateTimeModule: NancyModule
{
    public CurrentDateTimeModule()
    {
        Get("/", _ => DateTime.UtcNow);
    }
}
}

using System;
using Nancy;

namespace MicroServicesHelloWorld{

public class CurrentDateTimeModule: NancyModule
{
    public CurrentDateTimeModule()
    {
        Get("/", _ => {

            var response = (Response)("\""+DateTime.UtcNow.ToString()+"\"");

        response.ContentType = "application/json";

        return response;

            });
    }
}
}

Test to have json overall anser

Test to have json overall anser


using System.Collections.Generic;

namespace Wax
{
    public class CbxBundleView : JsonBasedObject
    {
        public string ByteCode { get { return this.GetString("byteCode"); } set { this.SetString("byteCode", value); } }
        public ResourceDatabase ResourceDB { get { return this.GetObject("resources") as ResourceDatabase; } set { this.SetObject("resources", value); } }

        public CbxBundleView(Dictionary<string, object> data) : base(data) { }

        public CbxBundleView(string byteCode, ResourceDatabase resDb)
        {
            this.ByteCode = ByteCode;
            this.ResourceDB = resDb;
        }
    }
}

using System.Collections.Generic;

namespace Wax
{
    public class CbxBundleView : JsonBasedObject
    {
        public string ByteCode { get { return this.GetString("byteCode"); } set { this.SetString("byteCode", value); } }
        public ResourceDatabase ResourceDB { get { return this.GetObject("resources") as ResourceDatabase; } set { this.SetObject("resources", value); } }

        public CbxBundleView(Dictionary<string, object> data) : base(data) { }

        public CbxBundleView(string byteCode, ResourceDatabase resDb)
        {
            this.ByteCode = byteCode;
            this.ResourceDB = resDb;
        }
    }
}

Fix typo in the CbxBundle refactoring causing the bytecode to not get copied to exported projects.


using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;

namespace Portal.CMS.Web
{
    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
        }

        protected void Application_Error()
        {
            //Response.Redirect("~/Home/Error");
        }
    }
}

using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;

namespace Portal.CMS.Web
{
    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
        }

        protected void Application_Error()
        {
            Response.Redirect("~/Home/Error");
        }
    }
}

Add Custom Error Page and Routing

Add Custom Error Page and Routing


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

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

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

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

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

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

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

Remove whitespace to test how well Subversion works via GitHub.


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

using System;
using System.Reflection;
using System.Reflection.Metadata;
using System.Threading;
using Debug = System.Diagnostics.Debug;

using Internal.TypeSystem;

namespace Internal.TypeSystem.Ecma
{
    // This file has implementations of the .Interfaces.cs logic from its base type.

    public sealed partial class EcmaType : MetadataType
    {
        private DefType[] _implementedInterfaces;

        public override DefType[] ExplicitlyImplementedInterfaces
        {
            get
            {
                if (_implementedInterfaces == null)
                    return InitializeImplementedInterfaces();
                return _implementedInterfaces;
            }
        }

        private DefType[] InitializeImplementedInterfaces()
        {
            var interfaceHandles = _typeDefinition.GetInterfaceImplementations();

            int count = interfaceHandles.Count;
            if (count == 0)
                return (_implementedInterfaces = Array.Empty<DefType>());

            DefType[] implementedInterfaces = new DefType[count];
            int i = 0;
            foreach (var interfaceHandle in interfaceHandles)
            {
                var interfaceImplementation = this.MetadataReader.GetInterfaceImplementation(interfaceHandle);
                implementedInterfaces[i++] = (DefType)_module.GetType(interfaceImplementation.Interface);
            }

            return (_implementedInterfaces = implementedInterfaces);
        }
    }
}

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

using System;
using System.Reflection;
using System.Reflection.Metadata;
using System.Threading;
using Debug = System.Diagnostics.Debug;

using Internal.TypeSystem;

namespace Internal.TypeSystem.Ecma
{
    // This file has implementations of the .Interfaces.cs logic from its base type.

    public sealed partial class EcmaType : MetadataType
    {
        private DefType[] _implementedInterfaces;

        public override DefType[] ExplicitlyImplementedInterfaces
        {
            get
            {
                if (_implementedInterfaces == null)
                    return InitializeImplementedInterfaces();
                return _implementedInterfaces;
            }
        }

        private DefType[] InitializeImplementedInterfaces()
        {
            var interfaceHandles = _typeDefinition.GetInterfaceImplementations();

            int count = interfaceHandles.Count;
            if (count == 0)
                return (_implementedInterfaces = Array.Empty<DefType>());

            DefType[] implementedInterfaces = new DefType[count];
            int i = 0;
            foreach (var interfaceHandle in interfaceHandles)
            {
                var interfaceImplementation = this.MetadataReader.GetInterfaceImplementation(interfaceHandle);
                DefType interfaceType = _module.GetType(interfaceImplementation.Interface) as DefType;
                if (interfaceType == null)
                    throw new TypeSystemException.TypeLoadException(ExceptionStringID.ClassLoadBadFormat, this);

                implementedInterfaces[i++] = interfaceType;
            }

            return (_implementedInterfaces = implementedInterfaces);
        }
    }
}

Throw better exception for invalid interfaces


using System;
using Xwt;
using System.Threading;
using System.Net;
using TrueCraft.Core;

namespace TrueCraft.Launcher
{
    class Program
    {
        public static LauncherWindow Window { get; set; }

        [STAThread]
        public static void Main(string[] args)
        {
            if (RuntimeInfo.IsLinux)
            {
                try
                {
                    Application.Initialize(ToolkitType.Gtk3);
                }
                catch
                {
                    Application.Initialize(ToolkitType.Gtk);
                }
            }
            else if (RuntimeInfo.IsMacOSX)
                Application.Initialize(ToolkitType.Gtk); // TODO: Cocoa
            else if (RuntimeInfo.IsWindows)
                Application.Initialize(ToolkitType.Wpf);
            UserSettings.Local = new UserSettings();
            UserSettings.Local.Load();
            var thread = new Thread(KeepSessionAlive);
            thread.IsBackground = true;
            thread.Priority = ThreadPriority.Lowest;
            Window = new LauncherWindow();
            thread.Start();
            Window.Show();
            Window.Closed += (sender, e) => Application.Exit();
            Application.Run();
            Window.Dispose();
            thread.Abort();
        }

        private static void KeepSessionAlive()
        {
            while (true)
            {
                if (!string.IsNullOrEmpty(Window.User.SessionId))
                {
                    var wc = new WebClient();
                    wc.DownloadString(string.Format(TrueCraftUser.AuthServer + "/session?name={0}&session={1}",
                        Window.User.Username, Window.User.SessionId));
                }
                Thread.Sleep(60 * 5 * 1000);
            }
        }
    }
}

using System;
using Xwt;
using System.Threading;
using System.Net;
using TrueCraft.Core;

namespace TrueCraft.Launcher
{
    class Program
    {
        public static LauncherWindow Window { get; set; }

        [STAThread]
        public static void Main(string[] args)
        {
            if (RuntimeInfo.IsLinux)
                Application.Initialize(ToolkitType.Gtk);
            else if (RuntimeInfo.IsMacOSX)
                Application.Initialize(ToolkitType.Gtk); // TODO: Cocoa
            else if (RuntimeInfo.IsWindows)
                Application.Initialize(ToolkitType.Wpf);
            UserSettings.Local = new UserSettings();
            UserSettings.Local.Load();
            var thread = new Thread(KeepSessionAlive);
            thread.IsBackground = true;
            thread.Priority = ThreadPriority.Lowest;
            Window = new LauncherWindow();
            thread.Start();
            Window.Show();
            Window.Closed += (sender, e) => Application.Exit();
            Application.Run();
            Window.Dispose();
            thread.Abort();
        }

        private static void KeepSessionAlive()
        {
            while (true)
            {
                if (!string.IsNullOrEmpty(Window.User.SessionId))
                {
                    var wc = new WebClient();
                    wc.DownloadString(string.Format(TrueCraftUser.AuthServer + "/session?name={0}&session={1}",
                        Window.User.Username, Window.User.SessionId));
                }
                Thread.Sleep(60 * 5 * 1000);
            }
        }
    }
}

Switch back to GTK2 for now

Switch back to GTK2 for now

Fixes #238

Ref https://github.com/mono/xwt/issues/591