using System;
using System.Windows;

namespace CefSharp.MinimalExample.Wpf
{
    public partial class App : Application
    {
        public App()
        {
            //Perform dependency check to make sure all relevant resources are in our output directory.
            var settings = new CefSettings();
            settings.EnableInternalPdfViewerOffScreen();

            Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null);
        }
    }
}

using System;
using System.Windows;

namespace CefSharp.MinimalExample.Wpf
{
    public partial class App : Application
    {
        public App()
        {
            //Perform dependency check to make sure all relevant resources are in our output directory.
            var settings = new CefSettings();

            Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null);
        }
    }
}

Remove call to EnableInternalPdfViewerOffScreen as it's been removed as Chromium no longer supports disabling of surfaces


using SPAD.neXt.Interfaces.Profile;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace SPAD.neXt.Interfaces.Configuration
{
    public interface ISettingsProvider : IProfileOptionsProvider, IWindowPlacementProvider
    { }

    public interface IProfileOptionsProvider
    {
        IProfileOption AddOption(string key, Interfaces.Profile.ProfileOptionTypes type, string defaultValue, bool needrestart = false, bool editable = false, bool hidden = false);
        IProfileOption GetOption(string key);
        void SetOption(string key, string value);
    }

    public interface IWindowPlacementProvider
    {
        IWindowPlacement GetWindowPlacement(string key);
        void SetWindowPlacement(IWindowPlacement placement);
    }

    public interface IWindowPlacement
    {
        string Key { get; }

        double Top { get; set; }
        double Left { get; set; }
        double Height { get; set; }
        double Width { get; set; }

        bool HasValues { get; }
        void ApplyPlacement(Window w);
        bool SavePlacement(Window w);

        T GetOption<T>(string key, T defaultValue = default(T));
        void SetOption(string key, object value);
    }
}

using SPAD.neXt.Interfaces.Profile;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace SPAD.neXt.Interfaces.Configuration
{
    public interface ISettingsProvider : IProfileOptionsProvider, IWindowPlacementProvider
    { }

    public interface IProfileOptionsProvider
    {
        IProfileOption AddOption(string key, Interfaces.Profile.ProfileOptionTypes type, string defaultValue, bool needrestart = false, bool editable = false, bool hidden = false,string groupName="Other");
        IProfileOption GetOption(string key);
        void SetOption(string key, string value);
    }

    public interface IWindowPlacementProvider
    {
        IWindowPlacement GetWindowPlacement(string key);
        void SetWindowPlacement(IWindowPlacement placement);
    }

    public interface IWindowPlacement
    {
        string Key { get; }

        double Top { get; set; }
        double Left { get; set; }
        double Height { get; set; }
        double Width { get; set; }

        bool HasValues { get; }
        void ApplyPlacement(Window w);
        bool SavePlacement(Window w);

        T GetOption<T>(string key, T defaultValue = default(T));
        void SetOption(string key, object value);
    }
}

Add option for groupname to group options by groups


using System;
using FluentMigrator.Runner;
using FluentMigrator.Runner.Announcers;
using FluentMigrator.Runner.Initialization;
using FluentMigrator.Runner.Processors.SqlServer;

namespace BroadbandStats.Database.Migrations
{
    public sealed class Migrator
    {
        private readonly string connectionString;

        public Migrator(string connectionString)
        {
            if (connectionString == null)
            {
                throw new ArgumentNullException(nameof(connectionString));
            }

            this.connectionString = connectionString;
        }

        public void MigrateToLatestSchema()
        {
            var todaysDate = DateTime.Today.ToString("yyyyMMdd");
            var todaysSchemaVersion = long.Parse(todaysDate);
            MigrateTo(todaysSchemaVersion);
        }

        private void MigrateTo(long targetVersion)
        {
            var options = new MigrationOptions { PreviewOnly = false, Timeout = 60 };
            var announcer = new NullAnnouncer();
            var processor = new SqlServer2012ProcessorFactory().Create(connectionString, announcer, options);
            var migrationContext = new RunnerContext(announcer) { Namespace = "BroadbandSpeedTests.Database.Migrations.Migrations" };

            var runner = new MigrationRunner(GetType().Assembly, migrationContext, processor);
            runner.MigrateUp(targetVersion, true);
        }
    }
}

using System;
using BroadbandStats.Database.Migrations.Migrations;
using FluentMigrator.Runner;
using FluentMigrator.Runner.Announcers;
using FluentMigrator.Runner.Initialization;
using FluentMigrator.Runner.Processors.SqlServer;

namespace BroadbandStats.Database.Migrations
{
    public sealed class Migrator
    {
        private readonly string connectionString;

        public Migrator(string connectionString)
        {
            if (connectionString == null)
            {
                throw new ArgumentNullException(nameof(connectionString));
            }

            this.connectionString = connectionString;
        }

        public void MigrateToLatestSchema()
        {
            var todaysDate = DateTime.Today.ToString("yyyyMMdd");
            var todaysSchemaVersion = long.Parse(todaysDate);
            MigrateTo(todaysSchemaVersion);
        }

        private void MigrateTo(long targetVersion)
        {
            var options = new MigrationOptions { PreviewOnly = false, Timeout = 60 };
            var announcer = new NullAnnouncer();
            var processor = new SqlServer2012ProcessorFactory().Create(connectionString, announcer, options);
            var migrationContext = new RunnerContext(announcer) { Namespace = typeof(InitialDatabase).Namespace };

            var runner = new MigrationRunner(GetType().Assembly, migrationContext, processor);
            runner.MigrateUp(targetVersion, true);
        }
    }
}

Fix the namespace following an earlier rename


namespace Tabster.Core.Plugins
{
    public interface ITabsterPlugin
    {
        string Name { get; }
        string Description { get; }
        string Author { get; }
        string Version { get; }
        string[] PluginClasses { get; }
    }
}

using System;

namespace Tabster.Core.Plugins
{
    public interface ITabsterPlugin
    {
        string Name { get; }
        string Description { get; }
        string Author { get; }
        string Version { get; }
        Type[] Types { get; }
    }
}

Use types instead of fully qualified names.


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

namespace Common.Data
{
    public class OnionState
    {
        public bool Enabled { get; set; } = true;
        public bool CustomWorldSize { get; set; } = false;
        public int Width { get; set; } = 256;
        public int Height { get; set; } = 384;
        public bool Debug { get; set; } = false;
        public bool FreeCamera { get; set; } = true;
        public bool CustomMaxCameraDistance { get; set; } = true;
        public float MaxCameraDistance { get; set; } = 300;
        public bool LogSeed { get; set; } = true;
        public bool CustomSeeds { get; set; } = false;
        public int WorldSeed { get; set; } = 0;
        public int LayoutSeed { get; set; } = 0;
        public int TerrainSeed { get; set; } = 0;
        public int NoiseSeed { get; set; } = 0;
    }
}

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

namespace Common.Data
{
    public class OnionState
    {
        public bool Enabled { get; set; } = true;
        public bool CustomWorldSize { get; set; } = false;
        public int Width { get; set; } = 8;
        public int Height { get; set; } = 12;
        public bool Debug { get; set; } = false;
        public bool FreeCamera { get; set; } = true;
        public bool CustomMaxCameraDistance { get; set; } = true;
        public float MaxCameraDistance { get; set; } = 300;
        public bool LogSeed { get; set; } = true;
        public bool CustomSeeds { get; set; } = false;
        public int WorldSeed { get; set; } = 0;
        public int LayoutSeed { get; set; } = 0;
        public int TerrainSeed { get; set; } = 0;
        public int NoiseSeed { get; set; } = 0;
    }
}

Change default world size to compensate for use of chunks


// 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.Collections.Specialized;

namespace CefSharp
{
    public interface IRequest
    {
        string Url { get; set; }
        string Method { get; }
        string Body { get; }
        NameValueCollection Headers { get; set; }
        TransitionType TransitionType { get; }
    }
}

// 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.Collections.Specialized;

namespace CefSharp
{
    public interface IRequest
    {
        string Url { get; set; }
        string Method { get; }
        string Body { get; }
        NameValueCollection Headers { get; set; }

        /// <summary>
        /// Get the transition type for this request.
        /// Applies to requests that represent a main frame or sub-frame navigation.
        /// </summary>
        TransitionType TransitionType { get; }
    }
}

Add xml comment to TransitionType

Add xml comment to TransitionType


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

using osu.Game.Rulesets.Mods;

namespace osu.Game.Rulesets.Catch.Mods
{
    public class CatchModHardRock : ModHardRock
    {
        public override double ScoreMultiplier => 1.12;
        public override bool Ranked => true;
    }
}

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

using osu.Framework.MathUtils;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Mods;
using System;

namespace osu.Game.Rulesets.Catch.Mods
{
    public class CatchModHardRock : ModHardRock, IApplicableToHitObject<CatchHitObject>
    {
        public override double ScoreMultiplier => 1.12;
        public override bool Ranked => true;

        private float lastStartX;
        private int lastStartTime;

        public void ApplyToHitObject(CatchHitObject hitObject)
        {
            // Code from Stable, we keep calculation on a scale of 0 to 512
            float position = hitObject.X * 512;
            int startTime = (int)hitObject.StartTime;

            if (lastStartX == 0)
            {
                lastStartX = position;
                lastStartTime = startTime;
                return;
            }

            float diff = lastStartX - position;
            int timeDiff = startTime - lastStartTime;

            if (timeDiff > 1000)
            {
                lastStartX = position;
                lastStartTime = startTime;
                return;
            }

            if (diff == 0)
            {
                bool right = RNG.NextBool();

                float rand = Math.Min(20, (float)RNG.NextDouble(0, timeDiff / 4));

                if (right)
                {
                    if (position + rand <= 512)
                        position += rand;
                    else
                        position -= rand;
                }
                else
                {
                    if (position - rand >= 0)
                        position -= rand;
                    else
                        position += rand;
                }

                hitObject.X = position / 512;

                return;
            }

            if (Math.Abs(diff) < timeDiff / 3)
            {
                if (diff > 0)
                {
                    if (position - diff > 0)
                        position -= diff;
                }
                else
                {
                    if (position - diff < 512)
                        position -= diff;
                }
            }

            hitObject.X = position / 512;

            lastStartX = position;
            lastStartTime = startTime;
        }
    }
}

Add HardRock position mangling for CatchTheBeat


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Raven.Client.Document;

namespace RavenDBBlogConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            var docStore = new DocumentStore()
            {
                Url = "http://localhost:8080"
            };

            docStore.Initialize();

            using (var session = docStore.OpenSession())
            {
                var blog = session.Load<Blog>("blogs/1");

                Console.WriteLine("Name: {0}, Author: {1}", blog.Name, blog.Author);
            }
        }
    }

    public class Blog
    {
        public string Id { get; set; }
        public string Name { get; set; }
        public string Author { get; set; }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Raven.Client.Document;

namespace RavenDBBlogConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            var docStore = new DocumentStore()
            {
                Url = "http://localhost:8080"
            };

            docStore.Initialize();

            using (var session = docStore.OpenSession())
            {
                var post = new Post()
                           {
                               BlogId = "blogs/33",
                               Comments = new List<Comment>() { new Comment() { CommenterName = "Bob", Text = "Hello!" } },
                               Content = "Some text",
                               Tags = new List<string>() { "tech" },
                               Title = "First post",
                           };

                session.Store(post);
                session.SaveChanges();
            }
        }
    }

    public class Blog
    {
        public string Id { get; set; }
        public string Name { get; set; }
        public string Author { get; set; }
    }

    public class Post
    {
        public string Id { get; set; }
        public string BlogId { get; set; }
        public string Title { get; set; }
        public string Content { get; set; }
        public List<Comment> Comments { get; set; }
        public List<string> Tags { get; set; }
    }

    public class Comment
    {
        public string CommenterName { get; set; }
        public string Text { get; set; }
    }
}

Add object with collection properties

Add object with collection properties


using System;

namespace BmpListener.Bmp
{
    public class BmpInitiation : BmpMessage
    {
        public BmpInitiation(BmpHeader bmpHeader)
            : base(bmpHeader)
        { }
    }
}

using System;

namespace BmpListener.Bmp
{
    public class BmpInitiation : BmpMessage
    {
        public BmpInitiation(BmpHeader bmpHeader)
            : base(bmpHeader)
        {
            BmpVersion = BmpHeader.Version;
        }

        public int BmpVersion { get; }
    }
}

Add BMP version to initiation message

Add BMP version to initiation message


using System.Windows.Input;
using Microsoft.Practices.Prism.Commands;

namespace TimesheetParser
{
    class MainViewModel
    {
        public ICommand CopyCommand { get; set; }

        public MainViewModel()
        {
            CopyCommand = new DelegateCommand<string>(CopyCommand_Executed);
        }

        void CopyCommand_Executed(string param)
        {

        }
    }
}

using System.Windows;
using System.Windows.Input;
using Microsoft.Practices.Prism.Commands;

namespace TimesheetParser
{
    class MainViewModel
    {
        public ICommand CopyCommand { get; set; }

        public MainViewModel()
        {
            CopyCommand = new DelegateCommand<string>(CopyCommand_Executed);
        }

        void CopyCommand_Executed(string param)
        {
            Clipboard.SetData(DataFormats.UnicodeText, param);
        }
    }
}

Implement text copying to Clipboard.

Implement text copying to Clipboard.


@using DataAccess
@using Localization
@using WebApplication.Helpers
@using WebGrease
@model IEnumerable<DataAccess.Site>
@{
    ViewBag.Title = Resources.LabelSitesList;
}
@Html.Partial("_PageTitlePartial")

            @Html.DisplayNameFor(model => model.Name)

        Postcode
        Features
        @Html.ActionLink("Create a New Site", "Create")

    @foreach (var item in Model)
    {

                @Html.ActionLink("Delete Site", "Delete", new { id = item.Id })

                @Html.DisplayFor(modelItem => item.Name)

            @Html.DisplayFor(modelItem => item.Postcode)

                @Html.SiteSummaryIconsFor(item)

                @Html.ActionLink("Site Report", "Report", new { id = item.Id }) |
                @Html.ActionLink("Edit Site", "Edit", new { id = item.Id }) |
                @Html.ActionLink(Resources.LabelPerformanceData, "Index", "Months", new { id = item.Id }, null)

    }

Hide the site report on really small screens.


//
//  Copyright 2014  luke
//
//    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;

namespace WolfyBot.Core
{
	public class IRCMessage
	{
		public IRCMessage ()
		{
		}
	}
}

//
//  Copyright 2014  luke
//
//    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;

namespace WolfyBot.Core
{
	public class IRCMessage
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the <see cref="WolfyBot.Core.IRCMessage"/> class.
		/// </summary>
		/// <param name="ircMessage">A Message formatted in the IRC Protocol</param>
		public IRCMessage (String ircMessage)
		{
			TimeStamp = DateTime.Now;
			//TODO: write IRC Parser
		}

		//Copy Constructor
		public IRCMessage (IRCMessage other)
		{
			TimeStamp = other.TimeStamp;
			Prefix = new String (other.Prefix);
			Command = new String (other.Command);
			Parameters = new String (other.Parameters);
			TrailingParameters = new String (other.TrailingParameters);
		}

		#endregion

		#region Methods

		public String ToIRCString ()
		{
			//TODO: Implement Serialization to IRC Protocol
		}

		public String ToLogString ()
		{
			//TODO: Implement Serialization to logging format
		}

		#endregion

		#region Properties

		public String Prefix {
			get;
			set;
		}

		public String Command {
			get;
			set;
		}

		public String Parameters {
			get;
			set;
		}

		public String TrailingParameters {
			get;
			set;
		}

		public DateTime TimeStamp {
			get;
			set;
		}

		#endregion
	}
}

Implement basic IRC Message without parsing IRC format yet


using System.Linq;
using OdjfsScraper.Database;

namespace OdjfsScraper.Tool.Support
{
    public class DaemonEventLoop
    {
        private readonly Entities _ctx;

        public DaemonEventLoop(Entities ctx)
        {
            _ctx = ctx;
            UpdateCounts();
            CurrentStep = 0;
            IsRunning = true;
        }

        public bool IsRunning { get; set; }
        public int CurrentStep { get; private set; }
        public int CountyCount { get; private set; }
        public int ChildCareCount { get; private set; }

        private int StepCount
        {
            get { return CountyCount + ChildCareCount; }
        }

        public int ChildCaresPerCounty
        {
            get
            {
                if (CountyCount == 0)
                {
                    return 0;
                }
                return ChildCareCount/CountyCount;
            }
        }

        public bool IsCountyStep
        {
            get
            {
                if (ChildCaresPerCounty == 0)
                {
                    return true;
                }
                return CurrentStep%ChildCaresPerCounty == 1;
            }
        }

        public bool IsChildCareStep
        {
            get { return !IsCountyStep; }
        }

        private void UpdateCounts()
        {
            CountyCount = _ctx.Counties.Count();
            ChildCareCount = _ctx.ChildCares.Count();
        }

        public bool NextStep()
        {
            CurrentStep = (CurrentStep + 1)%StepCount;
            if (CurrentStep == 0)
            {
                UpdateCounts();
            }
            return IsRunning;
        }
    }
}

using System.Linq;
using OdjfsScraper.Database;

namespace OdjfsScraper.Tool.Support
{
    public class DaemonEventLoop
    {
        private readonly Entities _ctx;

        public DaemonEventLoop(Entities ctx)
        {
            _ctx = ctx;
            UpdateCounts();
            CurrentStep = -1;
            IsRunning = true;
        }

        public bool IsRunning { get; set; }
        public int CurrentStep { get; private set; }
        public int CountyCount { get; private set; }
        public int ChildCareCount { get; private set; }

        private int StepCount
        {
            get { return CountyCount + ChildCareCount; }
        }

        public int ChildCaresPerCounty
        {
            get
            {
                if (CountyCount == 0)
                {
                    return 0;
                }
                return ChildCareCount/CountyCount;
            }
        }

        public bool IsCountyStep
        {
            get
            {
                if (ChildCaresPerCounty == 0)
                {
                    return true;
                }
                return CurrentStep%ChildCaresPerCounty == 1;
            }
        }

        public bool IsChildCareStep
        {
            get { return !IsCountyStep; }
        }

        private void UpdateCounts()
        {
            CountyCount = _ctx.Counties.Count();
            ChildCareCount = _ctx.ChildCares.Count() + _ctx.ChildCareStubs.Count();
        }

        public bool NextStep()
        {
            CurrentStep = (CurrentStep + 1)%StepCount;
            if (CurrentStep == 0)
            {
                UpdateCounts();
            }
            return IsRunning;
        }
    }
}

Fix daemon event loop bugs

Fix daemon event loop bugs


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

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

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

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

            base.OnCreate(savedInstanceState);

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

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

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

namespace osu.Android
{

    [Activity(Theme = "@android:style/Theme.NoTitleBar", MainLauncher = true, ScreenOrientation = ScreenOrientation.FullUser, SupportsPictureInPicture = false, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize, HardwareAccelerated = false)]
    [IntentFilter(new[] { Intent.ActionDefault }, Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable, Intent.CategoryAppFiles }, DataSchemes = new[] { "content" }, DataPathPatterns = new[] { ".*\\.osz", ".*\\.osk" }, DataMimeType = "application/*")]
    public class OsuGameActivity : AndroidGameActivity
    {
        protected override Framework.Game CreateGame() => new OsuGameAndroid(this);

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

            base.OnCreate(savedInstanceState);

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

Add an IntentFilter to handle osu! files.


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

namespace ActorTestingFramework
{
    public class RandomScheduler : IScheduler
    {
        private readonly Random rand;

        public RandomScheduler(int seed)
        {
            rand = new Random(seed);
        }

        private static bool IsProgressOp(OpType op)
        {
            switch (op)
            {
                case OpType.INVALID:
                case OpType.START:
                case OpType.END:
                case OpType.CREATE:
                case OpType.JOIN:
                case OpType.WaitForDeadlock:
                case OpType.Yield:
                    return false;
                case OpType.SEND:
                case OpType.RECEIVE:
                    return true;
                default:
                    throw new ArgumentOutOfRangeException(nameof(op), op, null);
            }
        }

        #region Implementation of IScheduler

        public ActorInfo GetNext(List<ActorInfo> actorList, ActorInfo currentActor)
        {
            if (currentActor.currentOp == OpType.Yield)
            {
                currentActor.enabled = false;
            }

            if (IsProgressOp(currentActor.currentOp))
            {
                foreach (var actorInfo in
                    actorList.Where(info => info.currentOp == OpType.Yield && !info.enabled))
                {
                    actorInfo.enabled = true;
                }
            }

            var enabled = actorList.Where(info => info.enabled).ToList();

            if (enabled.Count == 0)
            {
                return null;
            }

            int nextIndex = rand.Next(enabled.Count - 1);

            return enabled[nextIndex];
        }

        public void NextSchedule()
        {
        }

        #endregion
    }
}

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

namespace ActorTestingFramework
{
    public class RandomScheduler : IScheduler
    {
        private readonly Random rand;

        public RandomScheduler(int seed)
        {
            rand = new Random(seed);
        }

        private static bool IsProgressOp(OpType op)
        {
            switch (op)
            {
                case OpType.INVALID:
                case OpType.WaitForDeadlock:
                case OpType.Yield:
                    return false;
                case OpType.START:
                case OpType.END:
                case OpType.CREATE:
                case OpType.JOIN:
                case OpType.SEND:
                case OpType.RECEIVE:
                    return true;
                default:
                    throw new ArgumentOutOfRangeException(nameof(op), op, null);
            }
        }

        #region Implementation of IScheduler

        public ActorInfo GetNext(List<ActorInfo> actorList, ActorInfo currentActor)
        {
            if (currentActor.currentOp == OpType.Yield)
            {
                currentActor.enabled = false;
            }

            if (IsProgressOp(currentActor.currentOp))
            {
                foreach (var actorInfo in
                    actorList.Where(info => info.currentOp == OpType.Yield && !info.enabled))
                {
                    actorInfo.enabled = true;
                }
            }

            var enabled = actorList.Where(info => info.enabled).ToList();

            if (enabled.Count == 0)
            {
                return null;
            }

            int nextIndex = rand.Next(enabled.Count - 1);

            return enabled[nextIndex];
        }

        public void NextSchedule()
        {
        }

        #endregion
    }
}

Change how yield works: treat more op types as "progress".


using System.Reflection;
#if !NETCORE
using System.Runtime.Serialization;
#endif

namespace Moq
{
	/// <summary>
	/// A <see cref="IDefaultValueProvider"/> that returns an empty default value
	/// for serializable types that do not implement <see cref="ISerializable"/> properly,
	/// and returns the value provided by the decorated provider otherwise.
	/// </summary>
	internal class SerializableTypesValueProvider : IDefaultValueProvider
	{
		private readonly IDefaultValueProvider decorated;
		private readonly EmptyDefaultValueProvider emptyDefaultValueProvider = new EmptyDefaultValueProvider();

		public SerializableTypesValueProvider(IDefaultValueProvider decorated)
		{
			this.decorated = decorated;
		}

		public void DefineDefault<T>(T value)
		{
			decorated.DefineDefault(value);
		}

		public object ProvideDefault(MethodInfo member)
		{
			return !member.ReturnType.GetTypeInfo().IsSerializable || member.ReturnType.IsSerializableMockable()
				       ? decorated.ProvideDefault(member)
				       : emptyDefaultValueProvider.ProvideDefault(member);
		}
	}
}

using System.Reflection;
#if !NETCORE
using System.Runtime.Serialization;
#endif

namespace Moq
{
#if !NETCORE
	/// <summary>
	/// A <see cref="IDefaultValueProvider"/> that returns an empty default value
	/// for serializable types that do not implement <see cref="ISerializable"/> properly,
	/// and returns the value provided by the decorated provider otherwise.
	/// </summary>
#else
	/// <summary>
	/// A <see cref="IDefaultValueProvider"/> that returns an empty default value
	/// for serializable types that do not implement ISerializable properly,
	/// and returns the value provided by the decorated provider otherwise.
	/// </summary>
#endif
	internal class SerializableTypesValueProvider : IDefaultValueProvider
	{
		private readonly IDefaultValueProvider decorated;
		private readonly EmptyDefaultValueProvider emptyDefaultValueProvider = new EmptyDefaultValueProvider();

		public SerializableTypesValueProvider(IDefaultValueProvider decorated)
		{
			this.decorated = decorated;
		}

		public void DefineDefault<T>(T value)
		{
			decorated.DefineDefault(value);
		}

		public object ProvideDefault(MethodInfo member)
		{
			return !member.ReturnType.GetTypeInfo().IsSerializable || member.ReturnType.IsSerializableMockable()
				       ? decorated.ProvideDefault(member)
				       : emptyDefaultValueProvider.ProvideDefault(member);
		}
	}
}

Fix an issue where ISerializable is not available on .NET Core

It's unfortunate that conditional compilation directives cannnot
contain just part of a Xml Doc comment.


using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Hosting.WindowsServices;
using Resonance.Common.Web;
using System.Diagnostics;
using System.Linq;

namespace Resonance.Windows
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var isService = !(Debugger.IsAttached || args.Contains("--console"));

            var host = ResonanceWebHostBuilderExtensions.GetWebHostBuilder()
                .UseStartup<Startup>()
                .UseApplicationInsights()
                .Build();

            if (isService)
            {
                System.IO.Directory.SetCurrentDirectory(System.AppDomain.CurrentDomain.BaseDirectory);
                host.RunAsService();
            }
            else
            {
                host.Run();
            }
        }
    }
}

using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Hosting.WindowsServices;
using Resonance.Common.Web;
using System.Diagnostics;
using System.Linq;

namespace Resonance.Windows
{
    public class Program
    {
        public static void Main(string[] args)
        {
            System.IO.Directory.SetCurrentDirectory(System.AppDomain.CurrentDomain.BaseDirectory);

            var isService = !(Debugger.IsAttached || args.Contains("--console"));

            var host = ResonanceWebHostBuilderExtensions.GetWebHostBuilder()
                .UseStartup<Startup>()
                .UseApplicationInsights()
                .Build();

            if (isService)
            {
                host.RunAsService();
            }
            else
            {
                host.Run();
            }
        }
    }
}

Fix execution of windows app

Fix execution of windows app


using System;
using System.Collections.Generic;

namespace RimDev.Supurlative
{
    public class SupurlativeOptions
    {
        public static readonly SupurlativeOptions Defaults =
            new SupurlativeOptions();

        public UriKind UriKind { get; set; }
        public string PropertyNameSeperator { get; set; }
        public bool LowercaseKeys { get; set; }

        public SupurlativeOptions()
        {
            UriKind = UriKind.Absolute;
            PropertyNameSeperator = ".";
            Formatters = new List<BaseFormatterAttribute>();
            LowercaseKeys = true;
        }

        public void Validate()
        {
            if (UriKind == UriKind.RelativeOrAbsolute) throw new ArgumentException("must choose between relative or absolute", "UriKind");
            if (PropertyNameSeperator == null) throw new ArgumentNullException("PropertyNameSeperator", "seperator must not be null");
        }

        public IList<BaseFormatterAttribute> Formatters { get; protected set; }

        public SupurlativeOptions AddFormatter(BaseFormatterAttribute formatter)
        {
            if (formatter == null) throw new ArgumentNullException("formatter");

            Formatters.Add(formatter);
            return this;
        }

        public SupurlativeOptions AddFormatter<T>()
            where T : BaseFormatterAttribute
        {
            return AddFormatter(Activator.CreateInstance<T>());
        }

        public SupurlativeOptions AddFormatter<T>(Func<T, string> func)
        {
            return AddFormatter(new LambdaFormatter(typeof(T), (x) => func((T)x)));
        }
    }
}

using System;
using System.Collections.Generic;

namespace RimDev.Supurlative
{
    public class SupurlativeOptions
    {
        public static SupurlativeOptions Defaults
        {
            get
            {
                return new SupurlativeOptions();
            }
        }

        public UriKind UriKind { get; set; }
        public string PropertyNameSeperator { get; set; }
        public bool LowercaseKeys { get; set; }

        public SupurlativeOptions()
        {
            UriKind = UriKind.Absolute;
            PropertyNameSeperator = ".";
            Formatters = new List<BaseFormatterAttribute>();
            LowercaseKeys = true;
        }

        public void Validate()
        {
            if (UriKind == UriKind.RelativeOrAbsolute) throw new ArgumentException("must choose between relative or absolute", "UriKind");
            if (PropertyNameSeperator == null) throw new ArgumentNullException("PropertyNameSeperator", "seperator must not be null");
        }

        public IList<BaseFormatterAttribute> Formatters { get; protected set; }

        public SupurlativeOptions AddFormatter(BaseFormatterAttribute formatter)
        {
            if (formatter == null) throw new ArgumentNullException("formatter");

            Formatters.Add(formatter);
            return this;
        }

        public SupurlativeOptions AddFormatter<T>()
            where T : BaseFormatterAttribute
        {
            return AddFormatter(Activator.CreateInstance<T>());
        }

        public SupurlativeOptions AddFormatter<T>(Func<T, string> func)
        {
            return AddFormatter(new LambdaFormatter(typeof(T), (x) => func((T)x)));
        }
    }
}

Fix issue of singleton causing false-positives during running of full test-suite

Commit 0de2fbaf70a6617a00243c26871cda53bafb3101 introduced a `DummyFormatter` which is intended to throw an exception during invoking of the formatter.
Related tests capture this exception.

However, since most tests use the `SupurlativeOptions.Defaults` singleton, other tests adding formatters get passed to tests not expecting this formatters.
And, based on the ordering of when tests are executed (seems random between VS2013, VS2015, command-line runners), some tests get the `DummyFormatter` which causes that test to throw a false-positive.
This behavior is interesting since the previous assumption is that each test is run independently and the full-stack is tore down and rebuilt between tests.
New behavior retains static defaults property (to retain backwards compatibility), but now creates a new instance with each call.
A better approach might include just resetting formatters within the test-suite.


using Microsoft.Data.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GifWin.Data
{
    class GifWinDatabaseHelper : IDisposable
    {
        GifWinContext db;

        public GifWinDatabaseHelper()
        {
            db = new GifWinContext();
        }

        public async Task<int> ConvertGifWitLibraryAsync(GifWitLibrary librarySource)
        {
            foreach (var entry in librarySource) {
                var newGif = new GifEntry {
                    Url = entry.Url.ToString(),
                    AddedAt = DateTimeOffset.UtcNow,
                };

                foreach (var tag in entry.KeywordString.Split(' ')) {
                    newGif.Tags.Add(new GifTag { Tag = tag });
                }

                db.Gifs.Add(newGif);
            }

            return await db.SaveChangesAsync().ConfigureAwait(false);
        }

        public async Task<IEnumerable<GifEntry>> LoadAllGifsAsync()
        {
            return await db.Gifs.Include(ge => ge.Tags).ToArrayAsync().ConfigureAwait(false);
        }

        private bool disposedValue = false;

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue) {
                if (disposing) {
                    db.Dispose();
                }

                disposedValue = true;
            }
        }

        public void Dispose()
        {
            Dispose(true);
        }
    }
}

using Microsoft.Data.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GifWin.Data
{
    class GifWinDatabaseHelper : IDisposable
    {
        GifWinContext db;

        public GifWinDatabaseHelper()
        {
            db = new GifWinContext();
        }

        public async Task<int> ConvertGifWitLibraryAsync(GifWitLibrary librarySource)
        {
            foreach (var entry in librarySource) {
                var newGif = new GifEntry {
                    Url = entry.Url.ToString(),
                    AddedAt = DateTimeOffset.UtcNow,
                };

                foreach (var tag in entry.KeywordString.Split(' ')) {
                    newGif.Tags.Add(new GifTag { Tag = tag });
                }

                db.Gifs.Add(newGif);
            }

            return await db.SaveChangesAsync().ConfigureAwait(false);
        }

        public async Task RecordGifUsageAsync(int gifId)
        {
            var gif = await db.Gifs.SingleOrDefaultAsync(ge => ge.Id == gifId).ConfigureAwait(false);

            if (gif != null) {
                var ts = DateTimeOffset.UtcNow;
                var usage = new GifUsage();
                gif.LastUsed = usage.UsedAt = ts;
                gif.Usages.Add(usage);

                await db.SaveChangesAsync().ConfigureAwait(false);
            }
        }

        public async Task<IQueryable<GifEntry>> LoadAllGifsAsync()
        {
            var query = db.Gifs.Include(ge => ge.Tags);
            await query.LoadAsync().ConfigureAwait(false);
            return query;
        }

        private bool disposedValue = false;

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue) {
                if (disposing) {
                    db.Dispose();
                }

                disposedValue = true;
            }
        }

        public void Dispose()
        {
            Dispose(true);
        }
    }
}

Add way to record usage, fix LoadAllGifsAsync

Avoid some of the overhead of calling .ToArrayAsync() by
calling LoadAsync.


using System;
using System.Threading.Tasks;

namespace MicroFlow
{
  public abstract class SyncActivity<TResult> : Activity<TResult>
  {
    public sealed override Task<TResult> Execute()
    {
      var tcs = new TaskCompletionSource<TResult>();

      try
      {
        TResult result = ExecuteActivity();
        tcs.TrySetResult(result);
      }
      catch (Exception ex)
      {
        tcs.TrySetException(ex);
      }

      return tcs.Task;
    }

    protected abstract TResult ExecuteActivity();
  }

  public abstract class SyncActivity : Activity
  {
    protected sealed override Task ExecuteCore()
    {
      var tcs = new TaskCompletionSource<Null>();

      try
      {
        ExecuteActivity();
        tcs.TrySetResult(null);
      }
      catch (Exception ex)
      {
        tcs.TrySetException(ex);
      }

      return tcs.Task;
    }

    protected abstract void ExecuteActivity();
  }
}

using System;
using System.Threading.Tasks;

namespace MicroFlow
{
  public abstract class SyncActivity<TResult> : Activity<TResult>
  {
    public sealed override Task<TResult> Execute()
    {
      try
      {
        TResult result = ExecuteActivity();
        return TaskHelper.FromResult(result);
      }
      catch (Exception ex)
      {
        return TaskHelper.FromException<TResult>(ex);
      }
    }

    protected abstract TResult ExecuteActivity();
  }

  public abstract class SyncActivity : Activity
  {
    protected sealed override Task ExecuteCore()
    {
      try
      {
        ExecuteActivity();
        return TaskHelper.CompletedTask;
      }
      catch (Exception ex)
      {
        return TaskHelper.FromException(ex);
      }
    }

    protected abstract void ExecuteActivity();
  }
}

Use `TaskHelper` instead of TCS

Use `TaskHelper` instead of TCS


using Newtonsoft.Json;
using ReactiveUI.Mobile;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Akavache.Mobile
{
    public class Registrations : IWantsToRegisterStuff
    {
        public void Register(Action<Func<object>, Type, string> registerFunction)
        {
            registerFunction(() => new JsonSerializerSettings()
            {
                ObjectCreationHandling = ObjectCreationHandling.Replace,
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
                TypeNameHandling = TypeNameHandling.All,
            }, typeof(JsonSerializerSettings), null);

            var akavacheDriver = new AkavacheDriver();
            registerFunction(() => akavacheDriver, typeof(ISuspensionDriver), null);

#if APPKIT || UIKIT
            registerFunction(() => new MacFilesystemProvider(), typeof(IFilesystemProvider), null);
#endif
#if ANDROID
            registerFunction(() => new AndroidFilesystemProvider(), typeof(IFilesystemProvider), null);
#endif
        }
    }
}

using Newtonsoft.Json;
using ReactiveUI.Mobile;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

#if UIKIT
using MonoTouch.Foundation;
using ReactiveUI.Mobile;
#endif

#if APPKIT
using MonoMac.Foundation;
#endif

#if ANDROID
using Android.App;
#endif

#if APPKIT
namespace Akavache.Mac
#else
namespace Akavache.Mobile
#endif
{
    public class Registrations : IWantsToRegisterStuff
    {
        public void Register(Action<Func<object>, Type, string> registerFunction)
        {
            registerFunction(() => new JsonSerializerSettings()
            {
                ObjectCreationHandling = ObjectCreationHandling.Replace,
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
                TypeNameHandling = TypeNameHandling.All,
            }, typeof(JsonSerializerSettings), null);

            var akavacheDriver = new AkavacheDriver();
            registerFunction(() => akavacheDriver, typeof(ISuspensionDriver), null);

#if APPKIT || UIKIT
            BlobCache.ApplicationName = NSBundle.MainBundle.BundleIdentifier;
            registerFunction(() => new MacFilesystemProvider(), typeof(IFilesystemProvider), null);
#endif

#if ANDROID
            var ai = Application.Context.PackageManager.GetApplicationInfo(Application.Context.PackageName, 0);
            BlobCache.ApplicationName = ai.LoadLabel(Application.Context.PackageManager);

            registerFunction(() => new AndroidFilesystemProvider(), typeof(IFilesystemProvider), null);
#endif
        }
    }
}

Bring back setting the app name based on the package info


namespace HtmlLogger.Model
{
    public enum LogCategory
    {
        Info,
        Error
    }
}

namespace HtmlLogger.Model
{
    public enum LogCategory
    {
        Info,
        Warning,
        Error
    }
}

Add Warning value to the enumeration.

Add Warning value to the enumeration.


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("LibPhoneNumber.Contrib")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LibPhoneNumber.Contrib")]
[assembly: AssemblyCopyright("Copyright ©  2016")]
[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("9ea084a1-6add-4b90-97fe-5ec441b8cb76")]

[assembly: AssemblyVersion(AssemblyMeta.Version)]
[assembly: AssemblyFileVersion(AssemblyMeta.Version)]
[assembly: AssemblyInformationalVersion(AssemblyMeta.Version)]

internal static class AssemblyMeta
{
	public const string Version = "1.1.2";
}

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("LibPhoneNumber.Contrib")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LibPhoneNumber.Contrib")]
[assembly: AssemblyCopyright("Copyright ©  2016")]
[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("9ea084a1-6add-4b90-97fe-5ec441b8cb76")]

[assembly: AssemblyVersion(AssemblyMeta.Version)]
[assembly: AssemblyFileVersion(AssemblyMeta.Version)]
[assembly: AssemblyInformationalVersion(AssemblyMeta.Version)]

internal static class AssemblyMeta
{
	public const string Version = "1.2.0";
}

Update the assembly version for LibPhoneNumber.Contrib since we added a new extension method.


using ServiceStack.OrmLite;

namespace Nonagon.Modular
{
	/// <summary>
	/// Data module interface base class.
	/// </summary>
	public abstract class DataModuleInterface : ModuleInterface, IDataModuleInterface
	{
		/// <summary>
		/// Gets or sets the db connection factory.
		/// </summary>
		/// <value>The db connection factory.</value>
		public IDbConnectionFactory DbConnectionFactory { get; private set; }

		public DataModuleInterface(IDbConnectionFactory dbConnectionFactory)
		{
			DbConnectionFactory = dbConnectionFactory;
		}

		/// <summary>
		/// Resolve the instance of operation from type parameter.
		/// </summary>
		/// <typeparam name="TOperation">The IDataModuleOperation to be instantiated.</typeparam>
		protected override TOperation Resolve<TOperation>()
		{
			TOperation opt = base.Resolve<TOperation>();

			if(opt is IDataModuleOperation)
				(opt as IDataModuleOperation).DbConnectionFactory = DbConnectionFactory;

			return opt;
		}
	}
}

using ServiceStack.OrmLite;

namespace Nonagon.Modular
{
	/// <summary>
	/// Data module interface base class.
	/// </summary>
	public abstract class DataModuleInterface : ModuleInterface, IDataModuleInterface
	{
		/// <summary>
		/// Gets or sets the db connection factory.
		/// </summary>
		/// <value>The db connection factory.</value>
		public IDbConnectionFactory DbConnectionFactory { get; private set; }

		protected DataModuleInterface(IDbConnectionFactory dbConnectionFactory)
		{
			DbConnectionFactory = dbConnectionFactory;
		}

		/// <summary>
		/// Resolve the instance of operation from type parameter.
		/// </summary>
		/// <typeparam name="TOperation">The IDataModuleOperation to be instantiated.</typeparam>
		protected override TOperation Resolve<TOperation>()
		{
			TOperation opt = base.Resolve<TOperation>();

			var iDataModuleOperation = opt as IDataModuleOperation;
			if(iDataModuleOperation != null)
				iDataModuleOperation.DbConnectionFactory = DbConnectionFactory;

			return opt;
		}
	}
}

Fix code as suggested by compiler.

Fix code as suggested by compiler.


using System.Collections.Generic;
using CommandLine;
using CommandLine.Text;

namespace dotnet_setversion
{
    public class Options
    {
        [Option('r', "recursive", Default = false, HelpText =
            "Recursively search the current directory for csproj files and apply the given version to all files found. " +
            "Mutually exclusive to the csprojFile argument.")]
        public bool Recursive { get; set; }

        [Value(0, MetaName = "version", HelpText = "The version to apply to the given csproj file(s).",
            Required = true)]
        public string Version { get; set; }

        [Value(1, MetaName = "csprojFile", Required = false, HelpText =
            "Path to a csproj file to apply the given version. Mutually exclusive to the --recursive option.")]
        public string CsprojFile { get; set; }

        [Usage(ApplicationAlias = "dotnet setversion")]
        public static IEnumerable<Example> Examples
        {
            get
            {
                yield return new Example("Directory with a single csproj file", new Options {Version = "1.2.3"});
                yield return new Example("Explicitly specifying a csproj file",
                    new Options {Version = "1.2.3", CsprojFile = "MyProject.csproj"});
                yield return new Example("Large repo with multiple csproj files in nested directories",
                    new UnParserSettings {PreferShortName = true}, new Options {Version = "1.2.3", Recursive = true});
            }
        }
    }
}

using System.Collections.Generic;
using CommandLine;
using CommandLine.Text;

namespace dotnet_setversion
{
    public class Options
    {
        [Option('r', "recursive", Default = false, HelpText =
            "Recursively search the current directory for csproj files and apply the given version to all files found. " +
            "Mutually exclusive to the csprojFile argument.")]
        public bool Recursive { get; set; }

        [Value(0, MetaName = "version", HelpText = "The version to apply to the given csproj file(s).",
            Required = true)]
        public string Version { get; set; }

        [Value(1, MetaName = "csprojFile", Required = false, HelpText =
            "Path to a csproj file to apply the given version. Mutually exclusive to the --recursive option.")]
        public string CsprojFile { get; set; }

        [Usage(ApplicationAlias = "setversion")]
        public static IEnumerable<Example> Examples
        {
            get
            {
                yield return new Example("Directory with a single csproj file", new Options {Version = "1.2.3"});
                yield return new Example("Explicitly specifying a csproj file",
                    new Options {Version = "1.2.3", CsprojFile = "MyProject.csproj"});
                yield return new Example("Large repo with multiple csproj files in nested directories",
                    new UnParserSettings {PreferShortName = true}, new Options {Version = "1.2.3", Recursive = true});
            }
        }
    }
}

Update alias in usage examples

Update alias in usage examples

Renamed alias from "dotnet setversion" to just "setversion" to reflect that this tool is a global .NET Core tool.


// 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.Rulesets.Beatmaps;
using osu.Game.Rulesets.Mania.Objects;
using System;
using System.Collections.Generic;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Types;
using System.Linq;

namespace osu.Game.Rulesets.Mania.Beatmaps
{
    public class ManiaBeatmapConverter : BeatmapConverter<ManiaHitObject>
    {
        protected override IEnumerable<Type> ValidConversionTypes { get; } = new[] { typeof(IHasXPosition) };

        protected override Beatmap<ManiaHitObject> ConvertBeatmap(Beatmap original)
        {
            // Todo: This should be cased when we get better conversion methods
            var converter = new LegacyConverter(original);

            return new Beatmap<ManiaHitObject>
            {
                BeatmapInfo = original.BeatmapInfo,
                TimingInfo = original.TimingInfo,
                HitObjects = original.HitObjects.SelectMany(converter.Convert).ToList()
            };
        }

        protected override IEnumerable<ManiaHitObject> ConvertHitObject(HitObject original, Beatmap beatmap)
        {
            // Handled by the LegacyConvereter
            yield return null;
        }
    }
}

// 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.Rulesets.Beatmaps;
using osu.Game.Rulesets.Mania.Objects;
using System;
using System.Collections.Generic;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Types;
using System.Linq;

namespace osu.Game.Rulesets.Mania.Beatmaps
{
    public class ManiaBeatmapConverter : BeatmapConverter<ManiaHitObject>
    {
        protected override IEnumerable<Type> ValidConversionTypes { get; } = new[] { typeof(IHasXPosition) };

        protected override Beatmap<ManiaHitObject> ConvertBeatmap(Beatmap original)
        {
            // Todo: This should be cased when we get better conversion methods
            var converter = new LegacyConverter(original);

            return new Beatmap<ManiaHitObject>
            {
                BeatmapInfo = original.BeatmapInfo,
                TimingInfo = original.TimingInfo,
                // We need to sort here, because the converter generates patterns
                HitObjects = original.HitObjects.SelectMany(converter.Convert).OrderBy(h => h.StartTime).ToList()
            };
        }

        protected override IEnumerable<ManiaHitObject> ConvertHitObject(HitObject original, Beatmap beatmap)
        {
            // Handled by the LegacyConvereter
            yield return null;
        }
    }
}

Fix out of range exceptions due to out-of-order hitobjects.


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;

namespace HouseCannith_Frontend
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var host = new WebHostBuilder()
                .UseUrls("https://localhost:5001")
                .UseKestrel()
                .UseContentRoot(Directory.GetCurrentDirectory())
                .UseIISIntegration()
                .UseStartup<Startup>()
                .Build();

            host.Run();
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;

namespace HouseCannith_Frontend
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var host = new WebHostBuilder()
                // This URL is only applicable to Development - when run behind a reverse-proxy IIS
                // instance (like Azure App Service does in production), this is overriden
                .UseUrls("https://localhost:5001")
                .UseKestrel()
                .UseContentRoot(Directory.GetCurrentDirectory())
                .UseIISIntegration()
                .UseStartup<Startup>()
                .Build();

            host.Run();
        }
    }
}

Add comment explaining UseUrls usage

Add comment explaining UseUrls usage


using System;

namespace XeroApi.Model
{
    public class Payment : EndpointModelBase
    {
        [ItemId]
        public Guid? PaymentID { get; set; }

        public DateTime Date { get; set; }

        public decimal Amount { get; set; }

        public string Reference { get; set; }

        public decimal? CurrencyRate { get; set; }

        public string PaymentType { get; set; }

        public string Status { get; set; }

        [ItemUpdatedDate]
        public DateTime? UpdatedDateUTC { get; set; }

        public Account Account { get; set; }

        public Invoice Invoice { get; set; }
    }

    public class Payments : ModelList<Payment>
    {
    }
}

using System;

namespace XeroApi.Model
{
    public class Payment : EndpointModelBase
    {
        [ItemId]
        public Guid? PaymentID { get; set; }

        public DateTime Date { get; set; }

        public decimal Amount { get; set; }

        public string Reference { get; set; }

        public decimal? CurrencyRate { get; set; }

        public string PaymentType { get; set; }

        public string Status { get; set; }

        public bool IsReconciled { get; set; }

        [ItemUpdatedDate]
        public DateTime? UpdatedDateUTC { get; set; }

        public Account Account { get; set; }

        public Invoice Invoice { get; set; }
    }

    public class Payments : ModelList<Payment>
    {
    }
}

Allow payments to be marked as reconciled

Update with version 2.43


using System;
using System.IO;

namespace LibSassGen
{
    public partial class CodeGenerator
    {
        private const string DefaultIncludeDir = @"../../../../../libsass/include";

        private const string DefaultOutputFilePath = @"../../../../SharpScss/LibSass.Generated.cs";
        private const int IndentMultiplier = 4;

        private int _indentLevel;

        private TextWriter _writer;

        private TextWriter _writerBody;

        private TextWriter _writerGlobal;

        public bool OutputToConsole { get; set; }

        public void Run()
        {
            var outputFilePath = Path.Combine(Environment.CurrentDirectory, DefaultOutputFilePath);
            outputFilePath = Path.GetFullPath(outputFilePath);

            _writerGlobal = new StringWriter();
            _writerBody = new StringWriter();

            ParseAndWrite();

            var finalWriter = OutputToConsole
                ? Console.Out
                : new StreamWriter(outputFilePath);

            finalWriter.Write(_writerGlobal);

            if (!OutputToConsole)
            {
                finalWriter.Flush();
                finalWriter.Dispose();
                finalWriter = null;
            }
        }
    }
}

using System;
using System.IO;

namespace LibSassGen
{
    public partial class CodeGenerator
    {
        private const string DefaultIncludeDir = @"../../../../libsass/include";

        private const string DefaultOutputFilePath = @"../../../SharpScss/LibSass.Generated.cs";
        private const int IndentMultiplier = 4;

        private int _indentLevel;

        private TextWriter _writer;

        private TextWriter _writerBody;

        private TextWriter _writerGlobal;

        public bool OutputToConsole { get; set; }

        public void Run()
        {
            var outputFilePath = Path.Combine(Environment.CurrentDirectory, DefaultOutputFilePath);
            outputFilePath = Path.GetFullPath(outputFilePath);

            _writerGlobal = new StringWriter();
            _writerBody = new StringWriter();

            ParseAndWrite();

            var finalWriter = OutputToConsole
                ? Console.Out
                : new StreamWriter(outputFilePath);

            finalWriter.Write(_writerGlobal);

            if (!OutputToConsole)
            {
                finalWriter.Flush();
                finalWriter.Dispose();
                finalWriter = null;
            }
        }
    }
}

Update code generator relative filepath

Update code generator relative filepath


using System;
using System.IO;
using System.Security.Cryptography;
using Mono.Security;
using Mono.Security.Cryptography;

namespace Xpdm.PurpleOnion
{
	class Program
	{
		private static void Main()
		{
			long count = 0;
			while (true)
			{
				RSA pki = RSA.Create();
				ASN1 asn = RSAExtensions.ToAsn1Key(pki);
				byte[] hash = SHA1CryptoServiceProvider.Create().ComputeHash(asn.GetBytes());
				string onion = ConvertExtensions.FromBytesToBase32String(hash).Substring(0,16).ToLowerInvariant();
				if (onion.Contains("tor") || onion.Contains("mirror"))
				{
					Console.WriteLine("Found: " + onion);
					Directory.CreateDirectory(onion);
					File.WriteAllText(Path.Combine(onion, "pki.xml"), pki.ToXmlString(true));
					File.WriteAllText(Path.Combine(onion, "private_key"), System.Convert.ToBase64String(PKCS8.PrivateKeyInfo.Encode(pki)));
					File.WriteAllText(Path.Combine(onion, "hostname"), onion + ".onion");
				}

				Console.WriteLine(onion + " " + ++count);
			}
		}
	}
}

using System;
using System.IO;
using System.Security.Cryptography;
using Mono.Security;
using Mono.Security.Cryptography;

namespace Xpdm.PurpleOnion
{
	static class Program
	{
		private static void Main()
		{
			long count = 0;
			while (true)
			{
				RSA pki = RSA.Create();
				ASN1 asn = RSAExtensions.ToAsn1Key(pki);
				byte[] hash = SHA1CryptoServiceProvider.Create().ComputeHash(asn.GetBytes());
				string onion = ConvertExtensions.FromBytesToBase32String(hash).Substring(0,16).ToLowerInvariant();
				if (onion.Contains("tor") || onion.Contains("mirror"))
				{
					Console.WriteLine("Found: " + onion);
					Directory.CreateDirectory(onion);
					File.WriteAllText(Path.Combine(onion, "pki.xml"), pki.ToXmlString(true));
					File.WriteAllText(Path.Combine(onion, "private_key"), System.Convert.ToBase64String(PKCS8.PrivateKeyInfo.Encode(pki)));
					File.WriteAllText(Path.Combine(onion, "hostname"), onion + ".onion");
				}

				Console.WriteLine(onion + " " + ++count);
			}
		}
	}
}

Make main program class static

Make main program class static

(Gendarme:AvoidConstructorsInStaticTypes)


using System;
using System.Resources;
using System.Windows.Data;

namespace GoldenAnvil.Utility.Windows
{
	public sealed class EnumToDisplayStringConverter : IValueConverter
	{
		public static readonly EnumToDisplayStringConverter Instance = new EnumToDisplayStringConverter();

		public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			if (!(parameter is ResourceManager resources))
				throw new ArgumentException($"{nameof(parameter)} must be a ResourceManager.");

			var method = typeof(ResourceManagerUtility).GetMethod("EnumToDisplayString");
			var generic = method.MakeGenericMethod(value.GetType());
			return generic.Invoke(null, new [] { resources, value });
		}

		public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			throw new NotImplementedException();
		}
	}
}

using System;
using System.Resources;
using System.Windows.Data;

namespace GoldenAnvil.Utility.Windows
{
	public sealed class EnumToDisplayStringConverter : IValueConverter
	{
		public static readonly EnumToDisplayStringConverter Instance = new EnumToDisplayStringConverter();

		public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			if (!(parameter is ResourceManager resources))
				throw new ArgumentException($"{nameof(parameter)} must be a ResourceManager.");

			// sometimes an empty string can be passed instead of a null value
			if (value is string stringValue)
			{
				if (stringValue == "")
					return null;
			}

			var method = typeof(ResourceManagerUtility).GetMethod("EnumToDisplayString");
			var generic = method.MakeGenericMethod(value.GetType());
			return generic.Invoke(null, new [] { resources, value });
		}

		public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			throw new NotImplementedException();
		}
	}
}

Fix crash when clearing resetting template


using System;
using System.Data;

namespace Smooth.IoC.Dapper.Repository.UnitOfWork.Data
{
    public interface IDbFactory
    {
        /// <summary>
        /// Creates an instance of your ISession expanded interface
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns>ISession</returns>
        T Create<T>() where T : class, ISession;
        [Obsolete]
        T CreateSession<T>() where T : class, ISession;
        TUnitOfWork Create<TUnitOfWork, TSession>(IsolationLevel isolationLevel= IsolationLevel.Serializable) where TUnitOfWork : class, IUnitOfWork where TSession : class, ISession;
        T Create<T>(IDbFactory factory, ISession session, IsolationLevel isolationLevel = IsolationLevel.Serializable) where T : class, IUnitOfWork;
        void Release(IDisposable instance);

    }
}

using System;
using System.Data;

namespace Smooth.IoC.Dapper.Repository.UnitOfWork.Data
{
    public interface IDbFactory
    {
        /// <summary>
        /// Creates an instance of your ISession expanded interface
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns>ISession</returns>
        T Create<T>() where T : class, ISession;

        /// <summary>
        /// Creates a UnitOfWork and Session at same time. The session has the same scope as the unit of work.
        /// </summary>
        /// <param name="isolationLevel"></param>
        /// <typeparam name="TUnitOfWork"></typeparam>
        /// <typeparam name="TSession"></typeparam>
        /// <returns></returns>
        TUnitOfWork Create<TUnitOfWork, TSession>(IsolationLevel isolationLevel= IsolationLevel.Serializable) where TUnitOfWork : class, IUnitOfWork where TSession : class, ISession;
        /// <summary>
        /// Used for Session base to create UnitOfWork. Not recommeded to use in other code
        /// </summary>
        /// <param name="factory"></param>
        /// <param name="session"></param>
        /// <param name="isolationLevel"></param>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        T Create<T>(IDbFactory factory, ISession session, IsolationLevel isolationLevel = IsolationLevel.Serializable) where T : class, IUnitOfWork;

        /// <summary>
        /// Release the component. Done by Sessnion and UnitOfWork on there own.
        /// </summary>
        /// <param name="instance"></param>
        void Release(IDisposable instance);

    }
}

Remove obsolete methods and add sumary texts.


using CefSharp;
using CefSharp.Wpf;
using Playnite.Common;
using Playnite.Settings;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Playnite
{
    public class CefTools
    {
        public static bool IsInitialized { get; private set; }

        public static void ConfigureCef()
        {
            FileSystem.CreateDirectory(PlaynitePaths.BrowserCachePath);
            var settings = new CefSettings();
            settings.WindowlessRenderingEnabled = true;

            if (settings.CefCommandLineArgs.ContainsKey("disable-gpu"))
            {
                settings.CefCommandLineArgs.Remove("disable-gpu");
            }

            if (settings.CefCommandLineArgs.ContainsKey("disable-gpu-compositing"))
            {
                settings.CefCommandLineArgs.Remove("disable-gpu-compositing");
            }

            settings.CefCommandLineArgs.Add("disable-gpu", "1");
            settings.CefCommandLineArgs.Add("disable-gpu-compositing", "1");

            settings.CachePath = PlaynitePaths.BrowserCachePath;
            settings.PersistSessionCookies = true;
            settings.LogFile = Path.Combine(PlaynitePaths.ConfigRootPath, "cef.log");
            IsInitialized = Cef.Initialize(settings);
        }

        public static void Shutdown()
        {
            Cef.Shutdown();
            IsInitialized = false;
        }
    }
}

using CefSharp;
using CefSharp.Wpf;
using Playnite.Common;
using Playnite.Settings;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Playnite
{
    public class CefTools
    {
        public static bool IsInitialized { get; private set; }

        public static void ConfigureCef()
        {
            FileSystem.CreateDirectory(PlaynitePaths.BrowserCachePath);
            var settings = new CefSettings();
            settings.WindowlessRenderingEnabled = true;

            if (settings.CefCommandLineArgs.ContainsKey("disable-gpu"))
            {
                settings.CefCommandLineArgs.Remove("disable-gpu");
            }

            if (settings.CefCommandLineArgs.ContainsKey("disable-gpu-compositing"))
            {
                settings.CefCommandLineArgs.Remove("disable-gpu-compositing");
            }

            settings.CefCommandLineArgs.Add("disable-gpu", "1");
            settings.CefCommandLineArgs.Add("disable-gpu-compositing", "1");

            settings.CachePath = PlaynitePaths.BrowserCachePath;
            settings.PersistSessionCookies = true;
            settings.LogFile = Path.Combine(PlaynitePaths.ConfigRootPath, "cef.log");
            settings.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0";
            IsInitialized = Cef.Initialize(settings);
        }

        public static void Shutdown()
        {
            Cef.Shutdown();
            IsInitialized = false;
        }
    }
}

Change default user agent for web views

Change default user agent for web views


using System;
using System.Collections.Generic;

namespace TirkxDownloader.Framework
{
    public sealed class Pair<TFirst, TSecond> : IEquatable<Pair<TFirst, TSecond>>
    {
        private readonly TFirst first;
        private readonly TSecond second;

        public Pair(TFirst first, TSecond second)
        {
            this.first = first;
            this.second = second;
        }

        public TFirst First
        {
            get { return first; }
        }

        public TSecond Second
        {
            get { return second; }
        }

        public override bool Equals(Pair<TFirst, TSecond> other)
        {
            if (other == null)
            {
                return false;
            }

            return EqualityComparer<TFirst>.Default.Equals(first, other.first) &&
                EqualityComparer<TSecond>.Default.Equals(second, other.second);
        }

        public override int GetHashCode()
        {
            return EqualityComparer<TFirst>.Default.GetHashCode(first) * 37 +
               EqualityComparer<TSecond>.Default.GetHashCode(second);
        }
    }
}

using System;
using System.Collections.Generic;

namespace TirkxDownloader.Framework
{
    public sealed class Pair<TFirst, TSecond> : IEquatable<Pair<TFirst, TSecond>>
    {
        private readonly TFirst first;
        private readonly TSecond second;

        public Pair(TFirst first, TSecond second)
        {
            this.first = first;
            this.second = second;
        }

        public TFirst First
        {
            get { return first; }
        }

        public TSecond Second
        {
            get { return second; }
        }

        public bool Equals(Pair<TFirst, TSecond> other)
        {
            if (other == null)
            {
                return false;
            }

            return EqualityComparer<TFirst>.Default.Equals(first, other.first) &&
                EqualityComparer<TSecond>.Default.Equals(second, other.second);
        }

        public override int GetHashCode()
        {
            return EqualityComparer<TFirst>.Default.GetHashCode(first) * 37 +
               EqualityComparer<TSecond>.Default.GetHashCode(second);
        }
    }
}

Delete override keyword from Equals method to indicate that this method implement interface


using System;
using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Schema;

using NUnit.Framework;

namespace SharpBrake.Tests
{
    public class AirbrakeValidator
    {
        public static void ValidateSchema(string xml)
        {
            var schema = GetXmlSchema();

            XmlReaderSettings settings = new XmlReaderSettings
            {
                ValidationType = ValidationType.Schema,
            };

            var errorBuffer = new StringBuilder();

            settings.ValidationEventHandler += (sender, args) => errorBuffer.AppendLine(args.Message);
            settings.Schemas.Add(schema);

            using (var reader = new StringReader(xml))
            {
                using (var xmlReader = new XmlTextReader(reader))
                {
                    using (var validator = XmlReader.Create(xmlReader, settings))
                    {
                        while (validator.Read())
                        {
                        }
                    }
                }
            }

            if (errorBuffer.Length > 0)
                Assert.Fail(errorBuffer.ToString());
        }

        private static XmlSchema GetXmlSchema()
        {
            const string xsd = "hoptoad_2_1.xsd";

            Type clientType = typeof(AirbrakeClient);
            XmlSchema schema;

            using (Stream schemaStream = clientType.Assembly.GetManifestResourceStream(clientType, xsd))
            {
                if (schemaStream == null)
                    Assert.Fail("{0}.{1} not found.", clientType.Namespace, xsd);

                schema = XmlSchema.Read(schemaStream, (sender, args) => {  });
            }
            return schema;
        }
    }
}

using System;
using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Schema;

using NUnit.Framework;

namespace SharpBrake.Tests
{
    public class AirbrakeValidator
    {
        public static void ValidateSchema(string xml)
        {
            var schema = GetXmlSchema();

            XmlReaderSettings settings = new XmlReaderSettings
            {
                ValidationType = ValidationType.Schema,
            };

            var errorBuffer = new StringBuilder();

            settings.ValidationEventHandler += (sender, args) => errorBuffer.AppendLine(args.Message);
            settings.Schemas.Add(schema);

            using (var reader = new StringReader(xml))
            {
                using (var xmlReader = new XmlTextReader(reader))
                {
                    using (var validator = XmlReader.Create(xmlReader, settings))
                    {
                        while (validator.Read())
                        {
                        }
                    }
                }
            }

            if (errorBuffer.Length > 0)
                Assert.Fail(errorBuffer.ToString());
        }

        private static XmlSchema GetXmlSchema()
        {
            Type clientType = typeof(AirbrakeClient);
            const string xsd = "hoptoad_2_1.xsd";

            using (Stream schemaStream = clientType.Assembly.GetManifestResourceStream(clientType, xsd))
            {
                if (schemaStream == null)
                    Assert.Fail("{0}.{1} not found.", clientType.Namespace, xsd);

                return XmlSchema.Read(schemaStream, (sender, args) => {  });
            }
        }
    }
}

Return instead of using a variable.

Return instead of using a variable.


using Alexa.NET.Management.Vendors;
using Refit;

namespace Alexa.NET.Management
{
    [Headers("Authorization: Bearer")]
    public interface IVendorApi
    {
        [Get("/vendors")]
        Vendor[] Get();
    }
}

using System.Threading.Tasks;
using Alexa.NET.Management.Vendors;
using Refit;

namespace Alexa.NET.Management
{
    [Headers("Authorization: Bearer")]
    public interface IVendorApi
    {
        [Get("/vendors")]
        Task<Vendor[]> Get();
    }
}

Update vendor api to ensure task returned


// Original Work Copyright (c) Ethan Moffat 2014-2016
// This file is subject to the GPL v2 License
// For additional details, see the LICENSE file

using EndlessClient.GameExecution;
using EOLib.DependencyInjection;
using Microsoft.Practices.Unity;
using Microsoft.Xna.Framework;

namespace EndlessClient
{
    public class XNAControlsDependencyContainer : IInitializableContainer
    {
        public void RegisterDependencies(IUnityContainer container)
        {
        }

        public void InitializeDependencies(IUnityContainer container)
        {
            var game = (Game)container.Resolve<IEndlessGame>();
            XNAControls.GameRepository.SetGame(game);

            //todo: remove this once converted to new XNAControls code
            XNAControls.Old.XNAControls.Initialize(game);
            XNAControls.Old.XNAControls.IgnoreEnterForDialogs = true;
            XNAControls.Old.XNAControls.IgnoreEscForDialogs = true;
        }
    }
}

// Original Work Copyright (c) Ethan Moffat 2014-2016
// This file is subject to the GPL v2 License
// For additional details, see the LICENSE file

using EndlessClient.GameExecution;
using EOLib.DependencyInjection;
using Microsoft.Practices.Unity;
using Microsoft.Xna.Framework;

namespace EndlessClient
{
    public class XNAControlsDependencyContainer : IInitializableContainer
    {
        public void RegisterDependencies(IUnityContainer container)
        {
        }

        public void InitializeDependencies(IUnityContainer container)
        {
            var game = (Game)container.Resolve<IEndlessGame>();
            XNAControls.GameRepository.SetGame(game);
        }
    }
}

Remove old XNAControls code from initialization. Crash & burn if old XNAControls are used.


using System;
using System.Collections.Generic;
using System.Linq;
using Prism.API;

namespace Prism.Mods.Hooks
{
    class ModDefHooks : IHookManager
    {
        IEnumerable<Action>
            onAllModsLoaded,
            onUnload       ,
            preUpdate      ,
            postUpdate     ;

        public void Create()
        {
            onAllModsLoaded = HookManager.CreateHooks<ModDef, Action>(ModData.mods.Values, "OnAllModsLoaded");
            onUnload        = HookManager.CreateHooks<ModDef, Action>(ModData.mods.Values, "OnUnload"       );
            preUpdate       = HookManager.CreateHooks<ModDef, Action>(ModData.mods.Values, "PreUpdate"      );
            postUpdate      = HookManager.CreateHooks<ModDef, Action>(ModData.mods.Values, "PostUpdate"     );
        }
        public void Clear ()
        {
            onAllModsLoaded = null;
            onUnload        = null;
            postUpdate      = null;
        }

        public void OnAllModsLoaded()
        {
            HookManager.Call(onAllModsLoaded);
        }
        public void OnUnload       ()
        {
            HookManager.Call(onUnload);
        }
        public void PreUpdate     ()
        {
            HookManager.Call(preUpdate);
        }
        public void PostUpdate     ()
        {
            HookManager.Call(postUpdate);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using Prism.API;

namespace Prism.Mods.Hooks
{
    class ModDefHooks : IHookManager
    {
        IEnumerable<Action>
            onAllModsLoaded,
            onUnload       ,
            preUpdate      ,
            postUpdate     ;

        public void Create()
        {
            onAllModsLoaded = HookManager.CreateHooks<ModDef, Action>(ModData.mods.Values, "OnAllModsLoaded");
            onUnload        = HookManager.CreateHooks<ModDef, Action>(ModData.mods.Values, "OnUnload"       );
            preUpdate       = HookManager.CreateHooks<ModDef, Action>(ModData.mods.Values, "PreUpdate"      );
            postUpdate      = HookManager.CreateHooks<ModDef, Action>(ModData.mods.Values, "PostUpdate"     );
        }
        public void Clear ()
        {
            onAllModsLoaded = null;
            onUnload        = null;
            preUpdate       = null;
            postUpdate      = null;
        }

        public void OnAllModsLoaded()
        {
            HookManager.Call(onAllModsLoaded);
        }
        public void OnUnload       ()
        {
            HookManager.Call(onUnload);
        }
        public void PreUpdate     ()
        {
            HookManager.Call(preUpdate);
        }
        public void PostUpdate     ()
        {
            HookManager.Call(postUpdate);
        }
    }
}

Set preUpdate to null with the rest of the hooks.


using System;

namespace Umbraco.Web.PublishedCache
{
    public class UmbracoContextPublishedSnapshotAccessor : IPublishedSnapshotAccessor
    {
        private readonly IUmbracoContextAccessor _umbracoContextAccessor;

        public UmbracoContextPublishedSnapshotAccessor(IUmbracoContextAccessor umbracoContextAccessor)
        {
            _umbracoContextAccessor = umbracoContextAccessor;
        }

        public IPublishedSnapshot PublishedSnapshot
        {
            get
            {
                var umbracoContext = _umbracoContextAccessor.UmbracoContext;
                if (umbracoContext == null) throw new Exception("The IUmbracoContextAccessor could not provide an UmbracoContext.");
                return umbracoContext.PublishedSnapshot;
            }

            set
            {
                throw new NotSupportedException(); // not ok to set
            }
        }
    }
}

using System;

namespace Umbraco.Web.PublishedCache
{
    public class UmbracoContextPublishedSnapshotAccessor : IPublishedSnapshotAccessor
    {
        private readonly IUmbracoContextAccessor _umbracoContextAccessor;

        public UmbracoContextPublishedSnapshotAccessor(IUmbracoContextAccessor umbracoContextAccessor)
        {
            _umbracoContextAccessor = umbracoContextAccessor;
        }

        public IPublishedSnapshot PublishedSnapshot
        {
            get
            {
                var umbracoContext = _umbracoContextAccessor.UmbracoContext;
                return umbracoContext?.PublishedSnapshot;
            }

            set => throw new NotSupportedException(); // not ok to set
        }
    }
}

Fix PublishedSnapshotAccessor to not throw but return null


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

using System;
using System.Runtime.InteropServices;

namespace MICore
{
    internal class NativeMethods
    {
        // TODO: It would be better to route these to the correct .so files directly rather than pasing through system.native.

        [DllImport("System.Native", SetLastError = true)]
        internal static extern int Kill(int pid, int mode);

        [DllImport("System.Native", SetLastError = true)]
        internal static extern int MkFifo(string name, int mode);

        [DllImport("System.Native", SetLastError = true)]
        internal static extern uint GetEUid();
    }
}

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

using System;
using System.Runtime.InteropServices;

namespace MICore
{
    internal class NativeMethods
    {
        private const string Libc = "libc";

        [DllImport(Libc, EntryPoint = "kill", SetLastError = true)]
        internal static extern int Kill(int pid, int mode);

        [DllImport(Libc, EntryPoint = "mkfifo", SetLastError = true)]
        internal static extern int MkFifo(string name, int mode);

        [DllImport(Libc, EntryPoint = "geteuid", SetLastError = true)]
        internal static extern uint GetEUid();
    }
}

Change interop calls to directly pinvoke.


using System;
using System.Text;

namespace Python.Runtime
{
    using static Runtime;

    [Obsolete("Only to be used from within Python")]
    static class Loader
    {
        public unsafe static int Initialize(IntPtr data, int size)
        {
            try
            {
                var dllPath = Encoding.UTF8.GetString((byte*)data.ToPointer(), size);

                if (!string.IsNullOrEmpty(dllPath))
                {
                    PythonDLL = dllPath;
                }
                else
                {
                    PythonDLL = null;
                }

                var gs = PyGILState_Ensure();

                try
                {
                    // Console.WriteLine("Startup thread");
                    PythonEngine.InitExt();
                    // Console.WriteLine("Startup finished");
                }
                finally
                {
                    PyGILState_Release(gs);
                }
            }
            catch (Exception exc)
            {
                Console.Error.Write(
                    $"Failed to initialize pythonnet: {exc}\n{exc.StackTrace}"
                );
                return 1;
            }

            return 0;
        }

        public unsafe static int Shutdown(IntPtr data, int size)
        {
            try
            {
                var command = Encoding.UTF8.GetString((byte*)data.ToPointer(), size);

                if (command == "full_shutdown")
                {
                    var gs = PyGILState_Ensure();
                    try
                    {
                        PythonEngine.Shutdown();
                    }
                    finally
                    {
                        PyGILState_Release(gs);
                    }
                }
            }
            catch (Exception exc)
            {
                Console.Error.Write(
                    $"Failed to shutdown pythonnet: {exc}\n{exc.StackTrace}"
                );
                return 1;
            }

            return 0;
        }
    }
}

using System;
using System.Text;

namespace Python.Runtime
{
    using static Runtime;

    [Obsolete("Only to be used from within Python")]
    static class Loader
    {
        public unsafe static int Initialize(IntPtr data, int size)
        {
            try
            {
                var dllPath = Encoding.UTF8.GetString((byte*)data.ToPointer(), size);

                if (!string.IsNullOrEmpty(dllPath))
                {
                    PythonDLL = dllPath;
                }
                else
                {
                    PythonDLL = null;
                }

                using var _ = Py.GIL();
                PythonEngine.InitExt();
            }
            catch (Exception exc)
            {
                Console.Error.Write(
                    $"Failed to initialize pythonnet: {exc}\n{exc.StackTrace}"
                );
                return 1;
            }

            return 0;
        }

        public unsafe static int Shutdown(IntPtr data, int size)
        {
            try
            {
                var command = Encoding.UTF8.GetString((byte*)data.ToPointer(), size);

                if (command == "full_shutdown")
                {
                    using var _ = Py.GIL();
                    PythonEngine.Shutdown();
                }
            }
            catch (Exception exc)
            {
                Console.Error.Write(
                    $"Failed to shutdown pythonnet: {exc}\n{exc.StackTrace}"
                );
                return 1;
            }

            return 0;
        }
    }
}

Use Py.GIL directly, now that it doesn't try to init anymore


using System;
using GitHubSharp.Models;
using System.Collections.Generic;

namespace GitHubSharp.Controllers
{
    public class CommitsController : Controller
    {
        public RepositoryController RepositoryController { get; private set; }

        public CommitController this[string key]
        {
            get { return new CommitController(Client, RepositoryController, key); }
        }

        public CommitsController(Client client, RepositoryController repo)
            : base(client)
        {
            RepositoryController = repo;
        }

        public GitHubRequest<List<CommitModel>> GetAll(string sha = null)
        {
            if (sha == null)
                return GitHubRequest.Get<List<CommitModel>>(Uri);
            else
                return GitHubRequest.Get<List<CommitModel>>(Uri, new { sha = sha });
        }

        public override string Uri
        {
            get { return RepositoryController.Uri + "/commits"; }
        }
    }

    public class CommitController : Controller
    {
        public RepositoryController RepositoryController { get; private set; }

        public string Sha { get; private set; }

        public CommitCommentsController Comments
        {
            get { return new CommitCommentsController(Client, this); }
        }

        public CommitController(Client client, RepositoryController repositoryController, string sha)
            : base(client)
        {
            RepositoryController = repositoryController;
            Sha = sha;
        }

        public GitHubRequest<CommitModel> Get()
        {
            return GitHubRequest.Get<CommitModel>(Uri);
        }

        public override string Uri
        {
            get { return RepositoryController.Uri + "/commits/" + Sha; }
        }
    }
}

using System;
using GitHubSharp.Models;
using System.Collections.Generic;

namespace GitHubSharp.Controllers
{
    public class CommitsController : Controller
    {
        public string FilePath { get; set; }

        public RepositoryController RepositoryController { get; private set; }

        public CommitController this[string key]
        {
            get { return new CommitController(Client, RepositoryController, key); }
        }

        public CommitsController(Client client, RepositoryController repo)
            : base(client)
        {
            RepositoryController = repo;
        }

        public GitHubRequest<List<CommitModel>> GetAll(string sha = null)
        {
            if (sha == null)
                return GitHubRequest.Get<List<CommitModel>>(Uri);
            else
                return GitHubRequest.Get<List<CommitModel>>(Uri, new { sha = sha });
        }

        public override string Uri
        {
            get { return RepositoryController.Uri + "/commits" + (string.IsNullOrEmpty(this.FilePath) ? string.Empty : "?path=" + this.FilePath); }
        }
    }

    public class CommitController : Controller
    {
        public RepositoryController RepositoryController { get; private set; }

        public string Sha { get; private set; }

        public CommitCommentsController Comments
        {
            get { return new CommitCommentsController(Client, this); }
        }

        public CommitController(Client client, RepositoryController repositoryController, string sha)
            : base(client)
        {
            RepositoryController = repositoryController;
            Sha = sha;
        }

        public GitHubRequest<CommitModel> Get()
        {
            return GitHubRequest.Get<CommitModel>(Uri);
        }

        public override string Uri
        {
            get { return RepositoryController.Uri + "/commits/" + Sha; }
        }
    }
}

Support commit listing for single file within repository


namespace ATP.AnimationPathTools {

    public class TargetAnimationPath : AnimationPath {
    }
}

using UnityEngine;

namespace ATP.AnimationPathTools {

    public class TargetAnimationPath : AnimationPath {

        /// <summary>
        /// Color of the gizmo curve.
        /// </summary>
        private Color gizmoCurveColor = Color.magenta;
    }
}

Set default target path gizmo curve color


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

namespace TourOfCSharp6
{
    public class Point
    {
        public double X { get; set; }
        public double Y { get; set; }
        public double Distance
        {
            get
            {
                return Math.Sqrt(X * X + Y * Y);
            }
        }
    }
}

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

namespace TourOfCSharp6
{
    public class Point
    {
        public double X { get; set; }
        public double Y { get; set; }
        public double Distance => Math.Sqrt(X * X + Y * Y);
    }
}

Convert Distance to Expression Bodied Member

This gives a simpler version of the class.


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

[ assembly : ComVisible( false ) ]
[ assembly : AssemblyProduct( "ShipStationAccess" ) ]
[ assembly : AssemblyCompany( "Agile Harbor, LLC" ) ]
[ assembly : AssemblyCopyright( "Copyright (C) Agile Harbor, LLC" ) ]
[ assembly : AssemblyDescription( "ShipStation webservices API wrapper." ) ]
[ assembly : AssemblyTrademark( "" ) ]
[ assembly : AssemblyCulture( "" ) ]
[ assembly : CLSCompliant( false ) ]

// 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.*")]

// Keep in track with CA API version
[ assembly : AssemblyVersion( "1.3.76.0" ) ]

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

[ assembly : ComVisible( false ) ]
[ assembly : AssemblyProduct( "ShipStationAccess" ) ]
[ assembly : AssemblyCompany( "Agile Harbor, LLC" ) ]
[ assembly : AssemblyCopyright( "Copyright (C) Agile Harbor, LLC" ) ]
[ assembly : AssemblyDescription( "ShipStation webservices API wrapper." ) ]
[ assembly : AssemblyTrademark( "" ) ]
[ assembly : AssemblyCulture( "" ) ]
[ assembly : CLSCompliant( false ) ]

// 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.*")]

// Keep in track with CA API version
[ assembly : AssemblyVersion( "1.3.75.0" ) ]

Revert "bump version again to 1.3.76.0"

Revert "bump version again to 1.3.76.0"

This reverts commit 0bbf8e1a07481611eb85b8913c55d1b0b9a867d2.