using System.Collections.Generic;
using osu.Framework.Input;
// 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.Replays;

namespace osu.Game.Rulesets.Mania.Replays
{
    internal class ManiaFramedReplayInputHandler : FramedReplayInputHandler
    {
        public ManiaFramedReplayInputHandler(Replay replay)
            : base(replay)
        {
        }

        public override List<InputState> GetPendingStates()
        {
            var actions = new List<ManiaAction>();

            int activeColumns = (int)(CurrentFrame.MouseX ?? 0);

            int counter = 0;
            while (activeColumns > 0)
            {
                if ((activeColumns & 1) > 0)
                    actions.Add(ManiaAction.Key1 + counter);
                counter++;
                activeColumns >>= 1;
            }

            return new List<InputState> { new ReplayState<ManiaAction> { PressedActions = actions } };
        }
    }
}

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

using System.Collections.Generic;
using osu.Framework.Input;
using osu.Game.Rulesets.Replays;

namespace osu.Game.Rulesets.Mania.Replays
{
    internal class ManiaFramedReplayInputHandler : FramedReplayInputHandler
    {
        public ManiaFramedReplayInputHandler(Replay replay)
            : base(replay)
        {
        }

        public override List<InputState> GetPendingStates()
        {
            var actions = new List<ManiaAction>();

            int activeColumns = (int)(CurrentFrame.MouseX ?? 0);

            int counter = 0;
            while (activeColumns > 0)
            {
                if ((activeColumns & 1) > 0)
                    actions.Add(ManiaAction.Key1 + counter);
                counter++;
                activeColumns >>= 1;
            }

            return new List<InputState> { new ReplayState<ManiaAction> { PressedActions = actions } };
        }
    }
}

Fix ordering of license header.

Fix ordering of license header.


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

namespace MMLibrarySystem.Controllers
{
    public class BookListController : Controller
    {
        public ActionResult Index(string searchTerm = null)
        {
            List<Book> books = new List<Book>();
            using (var dbContext = new BookLibraryContext())
            {
                var tempBooks = dbContext.Books.Include("BookInfo");

                if (string.IsNullOrEmpty(searchTerm))
                {
                    books.AddRange(tempBooks.ToList());
                }
                else
                {
                    books.AddRange(tempBooks.Where(b => b.BookInfo.Title.Contains(searchTerm) || b.BookInfo.Description.Contains(searchTerm)));
                }
            }

            if (Request.IsAjaxRequest())
            {
                PartialView("_BookList", books);
            }

            return View(books);
        }
    }
}

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

namespace MMLibrarySystem.Controllers
{
    public class BookListController : Controller
    {
        public ActionResult Index(string searchTerm = null)
        {
            List<Book> books = new List<Book>();
            using (var dbContext = new BookLibraryContext())
            {
                var tempBooks = dbContext.Books.Include("BookInfo");

                if (string.IsNullOrEmpty(searchTerm))
                {
                    books.AddRange(tempBooks.ToList());
                }
                else
                {
                    books.AddRange(tempBooks.Where(b => b.BookInfo.Title.Contains(searchTerm) || b.BookInfo.Description.Contains(searchTerm)));
                }
            }

            if (Request.IsAjaxRequest())
            {
                return PartialView("_BookList", books);
            }

            return View(books);
        }
    }
}

Change The Detail of the ajax Search

Change The Detail of the ajax Search


using RTS.MIDI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace RTS
{
    public partial class ViewTone : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            int toneId;
            if (!String.IsNullOrEmpty(Request["ToneId"]))
            {

                try
                {
                    toneId = int.Parse(Request["ToneId"]);
                }
                catch (Exception ex)
                {
                    Response.Clear();
                    Response.Write(ex.Message);
                    Response.End();
                    return;
                }
            } else
            {
                Response.Redirect("Default.aspx");
                return;
            }
            SqlExec.IncrementDownloadCount(toneId);
            var result = SqlExec.GetToneById(toneId);
            if (result == null)
            {
                Response.Redirect("Default.aspx");
                return;
            }

            Page.Title = Properties.Settings.Default.PageTitle + " (" + result.Artist + " - " + result.Title + ")";

            ToneArtist.InnerText = result.Artist;
            ToneTitle.InnerText = result.Title;
            ToneDownloads.InnerText = string.Format("{0:n0}", result.Counter);
            ToneRtttl.InnerText = result.Rtttl;
            TonePreviewLink.HRef = "Default.aspx?MIDI=" + result.ToneId.ToString();

        }
    }
}

using RTS.MIDI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace RTS
{
    public partial class ViewTone : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            int toneId;
            if (!String.IsNullOrEmpty(Request["ToneId"]))
            {

                try
                {
                    toneId = int.Parse(Request["ToneId"]);
                }
                catch (Exception ex)
                {
                    Response.Redirect("Default.aspx");
                    return;
                }
            } else
            {
                Response.Redirect("Default.aspx");
                return;
            }
            SqlExec.IncrementDownloadCount(toneId);
            var result = SqlExec.GetToneById(toneId);
            if (result == null)
            {
                Response.Redirect("Default.aspx");
                return;
            }

            Page.Title = Properties.Settings.Default.PageTitle + " (" + result.Artist + " - " + result.Title + ")";

            ToneArtist.InnerText = result.Artist;
            ToneTitle.InnerText = result.Title;
            ToneDownloads.InnerText = string.Format("{0:n0}", result.Counter);
            ToneRtttl.InnerText = result.Rtttl;
            TonePreviewLink.HRef = "Default.aspx?MIDI=" + result.ToneId.ToString();

        }
    }
}

Change from displaying an error to redirecting back home


namespace Microsoft.AspNetCore.Hosting
{
    using System.Diagnostics;
    using System.Globalization;
    using Microsoft.ApplicationInsights.AspNetCore.Extensions;
    using Microsoft.Extensions.Configuration;
    using Microsoft.Extensions.DependencyInjection;
    using Microsoft.Extensions.Options;

    /// <summary>
    /// <see cref="IConfigureOptions<ApplicationInsightsServiceOptions>"/> implemetation that reads options from 'appsettings.json',
    /// environment variables and sets developer mode based on debugger state.
    /// </summary>
    internal class DefaultApplicationInsightsServiceConfigureOptions : IConfigureOptions<ApplicationInsightsServiceOptions>
    {
        private readonly IHostingEnvironment hostingEnvironment;

        /// <summary>
        /// Creates a new instance of <see cref="DefaultApplicationInsightsServiceConfigureOptions"/>
        /// </summary>
        /// <param name="hostingEnvironment"><see cref="IHostingEnvironment"/> to use for retreiving ContentRootPath</param>
        public DefaultApplicationInsightsServiceConfigureOptions(IHostingEnvironment hostingEnvironment)
        {
            this.hostingEnvironment = hostingEnvironment;
        }

        /// <inheritdoc />
        public void Configure(ApplicationInsightsServiceOptions options)
        {
            var configBuilder = new ConfigurationBuilder()
                .SetBasePath(this.hostingEnvironment.ContentRootPath)
                .AddJsonFile("appsettings.json", true)
                .AddJsonFile(string.Format(CultureInfo.InvariantCulture,"appsettings.{0}.json", hostingEnvironment.EnvironmentName), true)
                .AddEnvironmentVariables();
            ApplicationInsightsExtensions.AddTelemetryConfiguration(configBuilder.Build(), options);

            if (Debugger.IsAttached)
            {
                options.DeveloperMode = true;
            }
        }
    }
}

namespace Microsoft.AspNetCore.Hosting
{
    using System.Diagnostics;
    using System.Globalization;
    using System.IO;
    using Microsoft.ApplicationInsights.AspNetCore.Extensions;
    using Microsoft.Extensions.Configuration;
    using Microsoft.Extensions.DependencyInjection;
    using Microsoft.Extensions.Options;

    /// <summary>
    /// <see cref="IConfigureOptions<ApplicationInsightsServiceOptions>"/> implemetation that reads options from 'appsettings.json',
    /// environment variables and sets developer mode based on debugger state.
    /// </summary>
    internal class DefaultApplicationInsightsServiceConfigureOptions : IConfigureOptions<ApplicationInsightsServiceOptions>
    {
        private readonly IHostingEnvironment hostingEnvironment;

        /// <summary>
        /// Creates a new instance of <see cref="DefaultApplicationInsightsServiceConfigureOptions"/>
        /// </summary>
        /// <param name="hostingEnvironment"><see cref="IHostingEnvironment"/> to use for retreiving ContentRootPath</param>
        public DefaultApplicationInsightsServiceConfigureOptions(IHostingEnvironment hostingEnvironment)
        {
            this.hostingEnvironment = hostingEnvironment;
        }

        /// <inheritdoc />
        public void Configure(ApplicationInsightsServiceOptions options)
        {
            var configBuilder = new ConfigurationBuilder()
                .SetBasePath(this.hostingEnvironment.ContentRootPath??Directory.GetCurrentDirectory())
                .AddJsonFile("appsettings.json", true)
                .AddJsonFile(string.Format(CultureInfo.InvariantCulture,"appsettings.{0}.json", hostingEnvironment.EnvironmentName), true)
                .AddEnvironmentVariables();
            ApplicationInsightsExtensions.AddTelemetryConfiguration(configBuilder.Build(), options);

            if (Debugger.IsAttached)
            {
                options.DeveloperMode = true;
            }
        }
    }
}

Set base path to current directory if ContentRootPath is null on hosting environment. This path is where AI would look for appsettings.json file for ikey, endpoint etc.


using System;
using System.Security.Cryptography;

namespace THNETII.Security.JOSE
{
    public static class JsonWebRsaExtensions
    {
        public static JsonRsaWebKey ExportJsonWebKey(this RSA rsa, bool includePrivateParameters)
        {
            if (rsa == null)
                throw new ArgumentNullException(nameof(rsa));

            var param = rsa.ExportParameters(includePrivateParameters);
            var jwk = new JsonRsaWebKey
            {
                N = param.Modulus,
                E = param.Exponent
            };

            if (param.D != null)
                jwk.D = param.D;
            if (param.P != null)
                jwk.P = param.P;
            if (param.Q != null)
                jwk.Q = param.Q;
            if (param.DP != null)
                jwk.DP = param.DP;
            if (param.DQ != null)
                jwk.DQ = param.DQ;
            if (param.InverseQ != null)
                jwk.QI = param.InverseQ;

            return jwk;
        }
    }
}

using Newtonsoft.Json;
using System;
using System.Security.Cryptography;

namespace THNETII.Security.JOSE
{
    public static class JsonWebRsaExtensions
    {
        public static JsonRsaWebKey ExportJsonWebKey(this RSA rsa, bool includePrivateParameters)
        {
            if (rsa == null)
                throw new ArgumentNullException(nameof(rsa));

            var param = rsa.ExportParameters(includePrivateParameters);
            var jwk = new JsonRsaWebKey
            {
                N = param.Modulus,
                E = param.Exponent
            };

            if (param.D != null)
                jwk.D = param.D;
            if (param.P != null)
                jwk.P = param.P;
            if (param.Q != null)
                jwk.Q = param.Q;
            if (param.DP != null)
                jwk.DP = param.DP;
            if (param.DQ != null)
                jwk.DQ = param.DQ;
            if (param.InverseQ != null)
                jwk.QI = param.InverseQ;

            return jwk;
        }

        public static JsonRsaWebKey ToRsaWebKey(this JsonWebKey jwk_general)
        {
            if (jwk_general == null)
                return null;
            else if (jwk_general is JsonRsaWebKey jwk_rsa)
                return jwk_rsa;
            else
            {
                var jwk_json = JsonConvert.SerializeObject(jwk_general);
                return JsonConvert.DeserializeObject<JsonRsaWebKey>(jwk_json);
            }
        }
    }
}

Add general JWK to JWK (RSA) conversion

Add general JWK to JWK (RSA) conversion


using PickupMailViewer.Helpers;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;

namespace PickupMailViewer.Models
{
    public class MailModel
    {
        private readonly CDO.Message mail;
        private readonly string mailPath;
        public MailModel(string mailPath)
        {
            this.mailPath = mailPath;
            this.mail = MailHelper.ReadMessage(mailPath);
        }

        [Newtonsoft.Json.JsonIgnore]
        public DateTime SentOn
        {
            get
            {
                return mail.SentOn;
            }
        }

        public string SentOnFormatted
        {
            get
            {
                return mail.SentOn.ToString();
            }
        }

        public string ToAddress
        {
            get
            {
                return new System.Net.Mail.MailAddress(mail.To).Address;
            }
        }

        public string FromAddress
        {
            get
            {
                return new System.Net.Mail.MailAddress(mail.From).Address;
            }
        }

        public string Subject
        {
            get
            {
                return mail.Subject;
            }
        }

        [Newtonsoft.Json.JsonIgnore]
        public string Body
        {
            get { return mail.TextBody; }
        }

        public string MailId
        {
            get
            {
                return Path.GetFileName(mailPath);
            }
        }
    }
}

using PickupMailViewer.Helpers;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;

namespace PickupMailViewer.Models
{
    public class MailModel
    {
        private readonly CDO.Message mail;
        private readonly string mailPath;
        public MailModel(string mailPath)
        {
            this.mailPath = mailPath;
            this.mail = MailHelper.ReadMessage(mailPath);
        }

        [Newtonsoft.Json.JsonIgnore]
        public DateTime SentOn
        {
            get
            {
                return mail.SentOn;
            }
        }

        public string SentOnFormatted
        {
            get
            {
                return mail.SentOn.ToString();
            }
        }

        public string ToAddress
        {
            get
            {
                return string.Join(", ", mail.To.Split(',').Select(a => new System.Net.Mail.MailAddress(a).Address));
            }
        }

        public string FromAddress
        {
            get
            {
                return new System.Net.Mail.MailAddress(mail.From).Address;
            }
        }

        public string Subject
        {
            get
            {
                return mail.Subject;
            }
        }

        [Newtonsoft.Json.JsonIgnore]
        public string Body
        {
            get { return mail.TextBody; }
        }

        public string MailId
        {
            get
            {
                return Path.GetFileName(mailPath);
            }
        }
    }
}

Handle multiple addresses in the To field


using System.ComponentModel.Composition;
using Microsoft.VisualStudio.ProjectSystem;

namespace Cosmos.VS.ProjectSystem
{
    [Export(typeof(IProjectTreePropertiesProvider))]
    [AppliesTo(ProjectCapability.Cosmos)]
    [Order(Order.OverrideManaged)]
    internal class ProjectTreePropertiesProvider : IProjectTreePropertiesProvider
    {
        public void CalculatePropertyValues(
            IProjectTreeCustomizablePropertyContext propertyContext,
            IProjectTreeCustomizablePropertyValues propertyValues)
        {
            if (propertyValues.Flags.Contains(ProjectTreeFlags.Common.ProjectRoot))
            {
                propertyValues.Icon = CosmosImagesMonikers.ProjectRootIcon.ToProjectSystemType();
            }
        }
    }
}

using System.ComponentModel.Composition;
using Microsoft.VisualStudio.Imaging;
using Microsoft.VisualStudio.ProjectSystem;

namespace Cosmos.VS.ProjectSystem
{
    [Export(typeof(IProjectTreePropertiesProvider))]
    [AppliesTo(ProjectCapability.Cosmos)]
    [Order(Order.OverrideManaged)]
    internal class ProjectTreePropertiesProvider : IProjectTreePropertiesProvider
    {
        public void CalculatePropertyValues(
            IProjectTreeCustomizablePropertyContext propertyContext,
            IProjectTreeCustomizablePropertyValues propertyValues)
        {
            if (propertyValues.Flags.Contains(ProjectTreeFlags.Common.ProjectRoot))
            {
                //propertyValues.Icon = CosmosImagesMonikers.ProjectRootIcon.ToProjectSystemType();
                propertyValues.Icon = KnownMonikers.StatusOK.ToProjectSystemType();
            }
        }
    }
}

Replace by other icon (temporary)

Replace by other icon (temporary)


using System;

namespace Leaf
{
    /// <summary>
    /// Handles serialization and meta-data of nodes in a container.
    /// </summary>
    public abstract class Engine
    {
        /// <summary>
        /// Numerical version used to distinguish this engine from others.
        /// </summary>
        public abstract int Version { get; }

        /// <summary>
        /// Header containing information on how the nodes are structured.
        /// </summary>
        protected Header InternalHeader { get; }

        /// <summary>
        /// Create the base of the engine.
        /// </summary>
        /// <param name="header">Header containing information on how the nodes are structured.</param>
        protected Engine(Header header)
        {
            throw new NotImplementedException();
        }
    }
}

using System.IO;
using Leaf.Nodes;

namespace Leaf
{
    /// <summary>
    /// Handles serialization and meta-data of nodes in a container.
    /// </summary>
    public abstract class Engine
    {
        /// <summary>
        /// Numerical version used to distinguish this engine from others.
        /// </summary>
        public abstract int Version { get; }

        /// <summary>
        /// Create a header that contains the node structure information that the engine can use later after serialization.
        /// </summary>
        /// <return>Header containing information on how the nodes are structured.</return>
        internal abstract Header CreateHeader();

        /// <summary>
        /// Reads a root node (structure) from a stream.
        /// </summary>
        /// <param name="reader">Reader used to pull data from the stream.</param>
        /// <returns>Root node (structure).</returns>
        internal abstract Node ReadStructure(BinaryReader reader);

        /// <summary>
        /// Writes a root node (structure) to a stream.
        /// </summary>
        /// <param name="writer">Writer used to put data into the stream.</param>
        /// <param name="node">Root node (structure).</param>
        internal abstract void WriteStructure(BinaryWriter writer, Node node);
    }
}

Change structure of engine class

Change structure of engine class


namespace Albireo.Otp
{
    using System;
    using System.Diagnostics.Contracts;

    public static class Hotp
    {
        public static int GetCode(string secret, long counter, int digits = Otp.DefaultDigits)
        {
            Contract.Requires<ArgumentNullException>(secret != null);
            Contract.Requires<ArgumentOutOfRangeException>(counter >= 0);
            Contract.Requires<ArgumentOutOfRangeException>(digits > 0);
            Contract.Ensures(Contract.Result<int>() > 0);
            Contract.Ensures(Contract.Result<int>() < Math.Pow(10, digits));
            return Otp.GetCode(secret, counter, digits);
        }
    }
}

namespace Albireo.Otp
{
    using System;
    using System.Diagnostics.Contracts;

    public static class Hotp
    {
        public static int GetCode(string secret, long counter, int digits = Otp.DefaultDigits)
        {
            Contract.Requires<ArgumentNullException>(secret != null);
            Contract.Requires<ArgumentOutOfRangeException>(counter >= 0);
            Contract.Requires<ArgumentOutOfRangeException>(digits > 0);
            Contract.Ensures(Contract.Result<int>() > 0);
            Contract.Ensures(Contract.Result<int>() < Math.Pow(10, digits));
            return Otp.GetCode(secret, counter, digits);
        }

        public static string GetKeyUri(
            string issuer,
            string account,
            byte[] secret,
            long counter,
            int digits = Otp.DefaultDigits)
        {
            Contract.Requires<ArgumentNullException>(issuer != null);
            Contract.Requires<ArgumentOutOfRangeException>(!string.IsNullOrWhiteSpace(issuer));
            Contract.Requires<ArgumentNullException>(account != null);
            Contract.Requires<ArgumentOutOfRangeException>(!string.IsNullOrWhiteSpace(account));
            Contract.Requires<ArgumentNullException>(secret != null);
            Contract.Requires<ArgumentException>(secret.Length > 0);
            Contract.Requires<ArgumentOutOfRangeException>(digits > 0);
            Contract.Requires<ArgumentOutOfRangeException>(counter >= 0);
            Contract.Ensures(!string.IsNullOrWhiteSpace(Contract.Result<string>()));

            return
                Otp.GetKeyUri(
                    OtpType.Hotp,
                    issuer,
                    account,
                    secret,
                    HashAlgorithm.Sha1,
                    digits,
                    counter,
                    0);
        }
    }
}

Add HOTP key URI implementation

Add HOTP key URI implementation


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

namespace SimpleToggle
{
    public class Toggle
    {
        public class Config
        {
            static Config()
            {
                NoToggleBehaviour = DefaultNoToggleBehaviour;
            }

            private static bool DefaultNoToggleBehaviour(string toggle)
            {
                throw new KeyNotFoundException(string.Format("Toggle {0} could not be found in any of the {1} ToggleStateProviders", toggle, Providers.Count));
            }

            public static readonly IList<IToggleStateProvider> Providers = new List<IToggleStateProvider>();
            public static Func<string, bool> NoToggleBehaviour { get; set; }

            public static void Default()
            {
                Providers.Clear();
                NoToggleBehaviour = DefaultNoToggleBehaviour;
            }
        }

        public static string NameFor<T>()
        {
            return typeof(T).Name;
        }

        public static bool Enabled<T>()
        {
            return Enabled(NameFor<T>());
        }

        public static bool Enabled(string toggle)
        {
            var provider = Config.Providers
                .FirstOrDefault(p => p.HasValue(toggle));

            return provider == null ? Config.NoToggleBehaviour(toggle) : provider.IsEnabled(toggle);
        }
    }
}

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

namespace SimpleToggle
{
    public class Toggle
    {
        public class Config
        {
            static Config()
            {
                NoToggleBehaviour = DefaultNoToggleBehaviour;
            }

            private static bool DefaultNoToggleBehaviour(string toggle)
            {
                throw new KeyNotFoundException(string.Format("Toggle {0} could not be found in any of the {1} ToggleStateProviders", toggle, Providers.Count));
            }

            public static readonly IList<IToggleStateProvider> Providers = new List<IToggleStateProvider>();
            public static Func<string, bool> NoToggleBehaviour { get; set; }

            public static void Default()
            {
                Providers.Clear();
                NoToggleBehaviour = DefaultNoToggleBehaviour;
            }
        }

        public static string NameFor<T>()
        {
            return typeof(T).FullName;
        }

        public static bool Enabled<T>()
        {
            return Enabled(NameFor<T>());
        }

        public static bool Enabled(string toggle)
        {
            var provider = Config.Providers
                .FirstOrDefault(p => p.HasValue(toggle));

            return provider == null ? Config.NoToggleBehaviour(toggle) : provider.IsEnabled(toggle);
        }
    }
}

Use full type name to allow multiple toggles with same name but different namespace.


using System;

namespace LiteDB.Shell
{
    internal class ShellException : Exception
    {
        public ShellException(string message)
            : base(message)
        {
        }

        public static ShellException NoDatabase()
        {
            return new ShellException("No open database");
        }
    }
}

using System;

namespace LiteDB.Shell
{
    [Serializable]
    internal class ShellException : Exception
    {
        public ShellException(string message)
            : base(message)
        {
        }

        public static ShellException NoDatabase()
        {
            return new ShellException("No open database");
        }
    }
}

Mark class [Serializable] to address warning

Addresses warning CA2237: https://docs.microsoft.com/en-us/visualstudio/code-quality/ca2237-mark-iserializable-types-with-serializableattribute


using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media.Animation;

namespace clipman.Views
{
    /// <summary>
    /// Interaction logic for ClipList.xaml
    /// </summary>
    public partial class ClipList : UserControl
    {
        public ClipList()
        {
            InitializeComponent();
        }

        private void ListBoxItem_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            Utility.Logging.Log("Double-click copy");

            var viewModel = (ViewModels.ClipViewModel)(sender as ListBoxItem).DataContext;
            viewModel.Clip.Copy();
            Echo(sender as ListBoxItem);
        }

        private void Echo(ListBoxItem control)
        {
            var echoAnim = FindResource("Echo") as Storyboard;
            echoAnim.Begin(control, control.Template);
        }

        private void OnClearButtonClick(object sender, System.Windows.RoutedEventArgs e)
        {
            var viewModel = (ViewModels.ClipListViewModel)DataContext;
            viewModel.Clips.Clear();
        }
    }
}

using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media.Animation;

namespace clipman.Views
{
    /// <summary>
    /// Interaction logic for ClipList.xaml
    /// </summary>
    public partial class ClipList : UserControl
    {
        public ClipList()
        {
            InitializeComponent();
        }

        private void ListBoxItem_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            Utility.Logging.Log("Double-click copy");

            var viewModel = (ViewModels.ClipViewModel)(sender as ListBoxItem).DataContext;
            viewModel.Clip.Copy();
            //Echo(sender as ListBoxItem);
        }

        private void Echo(ListBoxItem control)
        {
            var echoAnim = FindResource("Echo") as Storyboard;
            echoAnim.Begin(control, control.Template);
        }

        private void OnClearButtonClick(object sender, System.Windows.RoutedEventArgs e)
        {
            var viewModel = (ViewModels.ClipListViewModel)DataContext;
            viewModel.Clips.Clear();
        }
    }
}

Disable echo effect on double click copy


using System;
using System.Threading.Tasks;

namespace Marcello.Transactions
{
    internal class Transaction
    {
        Marcello Session { get; set; }

        internal bool Running { get; set; }

        internal bool IsCommitting { get; set; }

        int Enlisted { get; set; }

        internal Transaction(Marcello session)
        {
            this.Session = session;
            this.Running = true;
            this.IsCommitting = false;
            this.Apply(); //apply to be sure
        }

        internal void Enlist()
        {
            if (this.IsCommitting)
                return;

            this.Enlisted++;
        }

        internal void Leave()
        {
            if (this.IsCommitting)
                return;

            this.Enlisted--;

            if (this.Enlisted == 0)
            {
                this.Commit();
                this.Running = false;
            }
        }

        internal void Rollback()
        {
            Session.Journal.ClearUncommitted();
            this.Running = false;
        }

        internal void Commit()
        {
            this.IsCommitting = true;
            Session.Journal.Commit();
            this.IsCommitting = false;
            this.ApplyAsync();
        }

        void Apply()
        {
            lock (this.Session.SyncLock)
            {
                Session.Journal.Apply();
            }
        }

        void ApplyAsync()
        {
            Task.Run (() => {
                Apply();
            });
        }
    }
}

using System;
using System.Threading.Tasks;

namespace Marcello.Transactions
{
    internal class Transaction
    {
        Marcello Session { get; set; }

        internal bool Running { get; set; }

        internal bool IsCommitting { get; set; }

        int Enlisted { get; set; }

        internal Transaction(Marcello session)
        {
            this.Session = session;
            this.Running = true;
            this.IsCommitting = false;
            this.Apply(); //apply to be sure
        }

        internal void Enlist()
        {
            if (this.IsCommitting)
                return;

            this.Enlisted++;
        }

        internal void Leave()
        {
            if (this.IsCommitting)
                return;

            this.Enlisted--;

            if (this.Enlisted == 0)
            {
                this.Commit();
                this.Running = false;
            }
        }

        internal void Rollback()
        {
            Session.Journal.ClearUncommitted();
            this.Running = false;
        }

        internal void Commit()
        {
            this.IsCommitting = true;
            Session.Journal.Commit();
            this.IsCommitting = false;
            this.TryApply();
        }

        void Apply()
        {
            lock (this.Session.SyncLock)
            {
                Session.Journal.Apply();
            }
        }

        void TryApply()
        {
            try{
                Apply();
            }catch(Exception){}
        }
    }
}

Apply transaction in same thread

Apply transaction in same thread


using LibPixelPet;
using System;

namespace PixelPet.CLI.Commands {
	internal class PadTilesetCmd : CliCommand {
		public PadTilesetCmd()
			: base("Pad-Tileset",
				new Parameter(true, new ParameterValue("width"))
			) { }

		public override void Run(Workbench workbench, ILogger logger) {
			int width = FindUnnamedParameter(0).Values[0].ToInt32();

			if (width < 1) {
				logger?.Log("Invalid tileset width.", LogLevel.Error);
				return;
			}

			int tw = workbench.Tileset.TileWidth;
			int th = workbench.Tileset.TileHeight;

			int addedTiles = 0;
			while (workbench.Tileset.Count % width != 0) {
				workbench.Tileset.AddTile(new Tile(tw, th), false, false);
				addedTiles++;
			}

			logger?.Log("Padded tileset to width " + width + " (added " + addedTiles + " tiles).", LogLevel.Information);
		}
	}
}

using LibPixelPet;
using System;

namespace PixelPet.CLI.Commands {
	internal class PadTilesetCmd : CliCommand {
		public PadTilesetCmd()
			: base("Pad-Tileset",
				new Parameter(true, new ParameterValue("width"))
			) { }

		public override void Run(Workbench workbench, ILogger logger) {
			int width = FindUnnamedParameter(0).Values[0].ToInt32();

			if (width < 1) {
				logger?.Log("Invalid tileset width.", LogLevel.Error);
				return;
			}

			int tw = workbench.Tileset.TileWidth;
			int th = workbench.Tileset.TileHeight;

			int addedTiles = 0;
			while (workbench.Tileset.Count < width) {
				workbench.Tileset.AddTile(new Tile(tw, th), false, false);
				addedTiles++;
			}

			logger?.Log("Padded tileset to width " + width + " (added " + addedTiles + " tiles).", LogLevel.Information);
		}
	}
}

Change Pad-Tileset behavior to be similar to Pad-Palettes.


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

namespace IdunnSql.Console
{
    [Verb("generate", HelpText = "Generate a file")]
    public class GenerateOptions
    {
        [Option('s', "source", Required = true,
        HelpText = "Name of the file containing information about the permissions to check")]
        public string Source { get; set; }

        [Option('d', "destination", Required = true,
        HelpText = "Name of the file to be generated.")]
        public string Destination { get; set; }

        [Option('p', "principal", Required = false,
        HelpText = "Name of the principal to impersonate.")]
        public string Principal { get; set; }
    }
}

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

namespace IdunnSql.Console
{
    [Verb("generate", HelpText = "Generate a file")]
    public class GenerateOptions
    {
        [Option('s', "source", Required = true,
        HelpText = "Name of the file containing information about the permissions to check")]
        public string Source { get; set; }

        [Option('t', "template", Required = false,
        HelpText = "Name of the file containing the template")]
        public string Template { get; set; }

        [Option('d', "destination", Required = true,
        HelpText = "Name of the file to be generated.")]
        public string Destination { get; set; }

        [Option('p', "principal", Required = false,
        HelpText = "Name of the principal to impersonate.")]
        public string Principal { get; set; }
    }
}

Add an option to provide a template name


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

namespace IllusionInjector
{
    class PluginComponent : MonoBehaviour
    {
        private CompositePlugin plugins;
        private bool freshlyLoaded = false;

        void Awake()
        {
            DontDestroyOnLoad(this);

            if (Environment.CommandLine.Contains("--verbose") && !Screen.fullScreen)
            {
                Windows.GuiConsole.CreateConsole();
            }

            plugins = new CompositePlugin(PluginManager.LoadPlugins());
            plugins.OnApplicationStart();
        }

        void Start()
        {
            OnLevelWasLoaded(Application.loadedLevel);
        }

        void Update()
        {
            if (freshlyLoaded)
            {
                freshlyLoaded = false;
                plugins.OnLevelWasInitialized(Application.loadedLevel);
            }
            plugins.OnUpdate();
        }

        void FixedUpdate()
        {
            plugins.OnFixedUpdate();
        }

        void OnDestroy()
        {
            plugins.OnApplicationQuit();
        }

        void OnLevelWasLoaded(int level)
        {
            plugins.OnLevelWasLoaded(level);
            freshlyLoaded = true;
        }

        void OnLateUpdate()
        {
            plugins.OnLateUpdate();
        }

    }
}

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

namespace IllusionInjector
{
    class PluginComponent : MonoBehaviour
    {
        private CompositePlugin plugins;
        private bool freshlyLoaded = false;

        void Awake()
        {
            DontDestroyOnLoad(this);

            if (Environment.CommandLine.Contains("--verbose") && !Screen.fullScreen)
            {
                Windows.GuiConsole.CreateConsole();
            }

            plugins = new CompositePlugin(PluginManager.LoadPlugins());
            plugins.OnApplicationStart();
        }

        void Start()
        {
            OnLevelWasLoaded(Application.loadedLevel);
        }

        void Update()
        {
            if (freshlyLoaded)
            {
                freshlyLoaded = false;
                plugins.OnLevelWasInitialized(Application.loadedLevel);
            }
            plugins.OnUpdate();
        }

        void LateUpdate()
        {
            plugins.OnLateUpdate();
        }

        void FixedUpdate()
        {
            plugins.OnFixedUpdate();
        }

        void OnDestroy()
        {
            plugins.OnApplicationQuit();
        }

        void OnLevelWasLoaded(int level)
        {
            plugins.OnLevelWasLoaded(level);
            freshlyLoaded = true;
        }

    }
}

Fix typo for LateUpdate calls

Fix typo for LateUpdate calls


using System;
using System.Runtime.InteropServices;

namespace NFluidsynth.Native
{
    internal static partial class LibFluidsynth
    {
        public const string LibraryName = "fluidsynth";

        public const int FluidOk = 0;
        public const int FluidFailed = -1;

#if NETCOREAPP
        static LibFluidsynth()
        {
            NativeLibrary.SetDllImportResolver(typeof(LibFluidsynth).Assembly, (name, assembly, path) =>
            {
                if (name == LibraryName)
                {
                    if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
                    {
                        // Assumption here is that this binds against whatever API .2 is,
                        //  but will try the general name anyway just in case.
                        try
                        {
                            return NativeLibrary.Load("libfluidsynth.so.2");
                        }
                        catch (Exception ex)
                        {
                        }
                        return NativeLibrary.Load("libfluidsynth.so");
                    }

                    if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
                    {
                        return NativeLibrary.Load("libfluidsynth.dylib");
                    }
                }

                return IntPtr.Zero;
            });
        }
#endif
    }
}

using System;
using System.Runtime.InteropServices;

namespace NFluidsynth.Native
{
    internal static partial class LibFluidsynth
    {
        public const string LibraryName = "fluidsynth";

        public const int FluidOk = 0;
        public const int FluidFailed = -1;

#if NETCOREAPP
        static LibFluidsynth()
        {
            try
            {
                NativeLibrary.SetDllImportResolver(typeof(LibFluidsynth).Assembly, (name, assembly, path) =>
                {
                    IntPtr handle;
                    if (name == LibraryName)
                    {
                        if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
                        {
                            // Assumption here is that this binds against whatever API .2 is,
                            //  but will try the general name anyway just in case.
                            if (NativeLibrary.TryLoad("libfluidsynth.so.2", assembly, path, out handle))
                                return handle;

                            if (NativeLibrary.TryLoad("libfluidsynth.so", assembly, path, out handle))
                                return handle;
                        }

                        if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
                        {
                            if (NativeLibrary.TryLoad("libfluidsynth.dylib", assembly, path, out handle))
                                return handle;
                        }
                    }

                    return IntPtr.Zero;
                });
            }
            catch (Exception)
            {
                // An exception can be thrown in the above call if someone has already set a DllImportResolver.
                // (Can occur if the application wants to override behaviour.)
                // This does not throw away failures to resolve.
            }
        }
#endif
    }
}

Fix issues with specifying manual resolve paths and with-application shipped fluidsynth libraries


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

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

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

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

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

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

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

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

Add commented out example to start second form


<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-85228036-1', 'auto');
  ga('send', 'pageview');

</script>

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window, document, 'script', '//cdn.owlcdn.com/google/analytics/analytics.js', 'ga');

  ga('create', 'UA-85228036-1', 'auto');
  ga('send', 'pageview');

</script>

Use OWL CDN for google analytics

Use OWL CDN for google analytics


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

using BenchmarkDotNet.Running;

namespace osu.Framework.Benchmarks
{
    public static class Program
    {
        public static void Main(string[] args)
        {
            BenchmarkSwitcher
                .FromAssembly(typeof(Program).Assembly)
                .Run(args);
        }
    }
}

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

using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Running;

namespace osu.Framework.Benchmarks
{
    public static class Program
    {
        public static void Main(string[] args)
        {
            BenchmarkSwitcher
                .FromAssembly(typeof(Program).Assembly)
                .Run(args, DefaultConfig.Instance.WithOption(ConfigOptions.DisableOptimizationsValidator, true));
        }
    }
}

Fix benchmarks not running due to unoptimised nunit


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

namespace SadConsole
{
    /// <summary>
    /// The old value and the value it changed to.
    /// </summary>
    public class ValueChangedEventArgs<T> : EventArgs
    {
        /// <summary>
        /// The previous object.
        /// </summary>
        public readonly T OldValue;

        /// <summary>
        /// The new object.
        /// </summary>
        public readonly T NewValue;

        /// <summary>
        /// Creates a new instance of this object with the specified old and new value.
        /// </summary>
        /// <param name="oldValue">The old value.</param>
        /// <param name="newValue">The new value.</param>
        public ValueChangedEventArgs(T oldValue, T newValue) =>
            (OldValue, NewValue) = (oldValue, newValue);
    }
}

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

namespace SadConsole
{
    /// <summary>
    /// The old value and the value it changed to.
    /// </summary>
    public class ValueChangedEventArgs<T> : EventArgs
    {
        /// <summary>
        /// The previous object.
        /// </summary>
        public readonly T OldValue;

        /// <summary>
        /// The new object.
        /// </summary>
        public readonly T NewValue;

        /// <summary>
        /// When <see langword="true"/>, indicates this value change can be cancelled; otherwise <see langword="false"/>.
        /// </summary>
        public readonly bool SupportsCancel;

        /// <summary>
        /// When <see langword="true"/>, indicates this value change can be flagged as handled and stop further event handlers; otherwise <see langword="false"/>.
        /// </summary>
        public readonly bool SupportsHandled;

        /// <summary>
        /// When <see cref="SupportsCancel"/> is <see langword="true"/>, setting this property to <see langword="true"/> causes the value change to be cancelled and to stop processing further event handlers.
        /// </summary>
        public bool IsCancelled { get; set; }

        /// <summary>
        /// When <see cref="SupportsHandled"/> is <see langword="true"/>, setting this property to <see langword="true"/> flags this change as handled and to stop processing further event handlers.
        /// </summary>
        public bool IsHandled { get; set; }

        /// <summary>
        /// Creates a new instance of this object with the specified old and new value.
        /// </summary>
        /// <param name="oldValue">The old value.</param>
        /// <param name="newValue">The new value.</param>
        /// <param name="supportsCancel">When <see langword="true"/>, indicates this value change can be cancelled.</param>
        /// <param name="supportsHandled">When <see langword="true"/>, indicates this value change can be flagged as handled and stop further event handlers.</param>
        public ValueChangedEventArgs(T oldValue, T newValue, bool supportsCancel = false, bool supportsHandled = false) =>
            (OldValue, NewValue, SupportsCancel, SupportsHandled) = (oldValue, newValue, supportsCancel, supportsCancel);
    }
}

Add cancel/handle for value changed eventargs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using KenticoInspector.Core.Models;
using KenticoInspector.Core.Services;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;

namespace KenticoInspector.WebApplication.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class InstancesController : ControllerBase
    {
        [HttpGet]
        public ActionResult<IEnumerable<InstanceConfiguration>> Get()
        {
            var db = new DatabaseConfiguration();
            db.User = "Me";
            db.ServerName = $"S-{DateTime.Now.Millisecond}";

            var admin = new AdministrationConfiguration("http://localhost", "C:\\inetpub\\");

            var instance = new InstanceConfiguration(db, admin);
            var fsics = new FileSystemInstanceConfigurationService();

            //fsics.Upsert(instance);

            return fsics.GetItems();
        }

        [HttpGet("{guid}")]
        public ActionResult<InstanceConfiguration> Get(Guid guid)
        {
            var fsics = new FileSystemInstanceConfigurationService();
            return fsics.GetItem(guid);
        }

        [HttpDelete("{guid}")]
        public void Delete(Guid guid)

        {
            var fsics = new FileSystemInstanceConfigurationService();
            fsics.Delete(guid);
        }

        [HttpPost]
        public void Post([FromBody] InstanceConfiguration instanceConfiguration)
        {
            var fsics = new FileSystemInstanceConfigurationService();
            fsics.Upsert(instanceConfiguration);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using KenticoInspector.Core.Models;
using KenticoInspector.Core.Services;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;

namespace KenticoInspector.WebApplication.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class InstancesController : ControllerBase
    {
        [HttpGet]
        public ActionResult<IEnumerable<InstanceConfiguration>> Get()
        {
            var fsics = new FileSystemInstanceConfigurationService();
            return fsics.GetItems();
        }

        [HttpGet("{guid}")]
        public ActionResult<InstanceConfiguration> Get(Guid guid)
        {
            var fsics = new FileSystemInstanceConfigurationService();
            return fsics.GetItem(guid);
        }

        [HttpDelete("{guid}")]
        public void Delete(Guid guid)

        {
            var fsics = new FileSystemInstanceConfigurationService();
            fsics.Delete(guid);
        }

        [HttpPost]
        public Guid Post([FromBody] InstanceConfiguration instanceConfiguration)
        {
            var fsics = new FileSystemInstanceConfigurationService();
            return fsics.Upsert(instanceConfiguration);
        }
    }
}

Remove old testing code in instance controller


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

namespace Umbraco.Examine
{

    /// <summary>
    /// Utility to rebuild all indexes ensuring minimal data queries
    /// </summary>
    public class IndexRebuilder
    {
        private readonly IEnumerable<IIndexPopulator> _populators;
        public IExamineManager ExamineManager { get; }

        public IndexRebuilder(IExamineManager examineManager, IEnumerable<IIndexPopulator> populators)
        {
            _populators = populators;
            ExamineManager = examineManager;
        }

        public bool CanRebuild(IIndex index)
        {
            return _populators.Any(x => x.IsRegistered(index));
        }

        public void RebuildIndex(string indexName)
        {
            if (!ExamineManager.TryGetIndex(indexName, out var index))
                throw new InvalidOperationException($"No index found with name {indexName}");
            index.CreateIndex(); // clear the index
            foreach (var populator in _populators)
            {
                populator.Populate(index);
            }
        }

        public void RebuildIndexes(bool onlyEmptyIndexes)
        {
            var indexes = (onlyEmptyIndexes
                ? ExamineManager.Indexes.Where(x => !x.IndexExists())
                : ExamineManager.Indexes).ToArray();

            if (indexes.Length == 0) return;

            foreach (var index in indexes)
            {
                index.CreateIndex(); // clear the index
            }

            //run the populators in parallel against all indexes
            Parallel.ForEach(_populators, populator => populator.Populate(indexes));
        }

    }
}

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

namespace Umbraco.Examine
{

    /// <summary>
    /// Utility to rebuild all indexes ensuring minimal data queries
    /// </summary>
    public class IndexRebuilder
    {
        private readonly IEnumerable<IIndexPopulator> _populators;
        public IExamineManager ExamineManager { get; }

        public IndexRebuilder(IExamineManager examineManager, IEnumerable<IIndexPopulator> populators)
        {
            _populators = populators;
            ExamineManager = examineManager;
        }

        public bool CanRebuild(IIndex index)
        {
            return _populators.Any(x => x.IsRegistered(index));
        }

        public void RebuildIndex(string indexName)
        {
            if (!ExamineManager.TryGetIndex(indexName, out var index))
                throw new InvalidOperationException($"No index found with name {indexName}");
            index.CreateIndex(); // clear the index
            foreach (var populator in _populators)
            {
                populator.Populate(index);
            }
        }

        public void RebuildIndexes(bool onlyEmptyIndexes)
        {
            var indexes = (onlyEmptyIndexes
                ? ExamineManager.Indexes.Where(x => !x.IndexExists())
                : ExamineManager.Indexes).ToArray();

            if (indexes.Length == 0) return;

            foreach (var index in indexes)
            {
                index.CreateIndex(); // clear the index
            }

            // run each populator over the indexes
            foreach(var populator in _populators)
            {
                populator.Populate(indexes);
            }
        }

    }
}

Remove the usage of Parallel to run the populators


namespace Xunit
{
    /// <summary>
    /// Suggested values for the Visual Studio Version to run tests against.
    /// </summary>
    public static class VisualStudioVersion
    {
        /// <summary>
        /// Specifies that the test should be run against all installed
        /// Visual Studio versions that have a corresponding VSSDK installed.
        /// </summary>
        public const string All = "All";

        /// <summary>
        /// Specifies that the test should be run against the currently running
        /// VS version (or the latest if not run within an IDE integrated runner).
        /// </summary>
        public const string Current = "Current";

        /// <summary>
        /// Specifies that the test should be run against the latest installed
        /// VS version (even if different from the current version when run
        /// from within an IDE integrated runner).
        /// </summary>
        public const string Latest = "Latest";

        /// <summary>
        /// Visual Studio 2012.
        /// </summary>
        public const string VS2012 = "11.0";

        /// <summary>
        /// Visual Studio 2013.
        /// </summary>
        public const string VS2013 = "12.0";

        /// <summary>
        /// Visual Studio 2015.
        /// </summary>
        public const string VS2015 = "14.0";
    }
}

namespace Xunit
{
    /// <summary>
    /// Suggested values for the Visual Studio Version to run tests against.
    /// </summary>
    public static class VisualStudioVersion
    {
        /// <summary>
        /// Specifies that the test should be run against all installed
        /// Visual Studio versions that have a corresponding VSSDK installed.
        /// </summary>
        public const string All = "All";

        /// <summary>
        /// Specifies that the test should be run against the currently running
        /// VS version (or the latest if not run within an IDE integrated runner).
        /// </summary>
        public const string Current = "Current";

        /// <summary>
        /// Specifies that the test should be run against the latest installed
        /// VS version (even if different from the current version when run
        /// from within an IDE integrated runner).
        /// </summary>
        public const string Latest = "Latest";

        /// <summary>
        /// Visual Studio 2012.
        /// </summary>
        public const string VS2012 = "11.0";

        /// <summary>
        /// Visual Studio 2013.
        /// </summary>
        public const string VS2013 = "12.0";

        /// <summary>
        /// Visual Studio 2015.
        /// </summary>
        public const string VS2015 = "14.0";

        /// <summary>
        /// Visual Studio 2017.
        /// </summary>
        public const string VS2017 = "15.0";

        /// <summary>
        /// Visual Studio 2019.
        /// </summary>
        public const string VS2019 = "16.0";
    }
}

Add VS2017 and VS2019 as known versions

Add VS2017 and VS2019 as known versions


using Antagonists;
using UnityEngine;

namespace Messages.Server.LocalGuiMessages
{
	public class AntagBannerMessage: ServerMessage
	{
		public string AntagName;
		public string AntagSound;
		public Color TextColor;
		public Color BackgroundColor;
		private bool playSound;

		public static AntagBannerMessage Send(
			GameObject player,
			string antagName,
			string antagSound,
			Color textColor,
			Color backgroundColor,
			bool playSound)
		{
			AntagBannerMessage msg = new AntagBannerMessage
			{
				AntagName = antagName,
				AntagSound = antagSound,
				TextColor = textColor,
				BackgroundColor = backgroundColor,
				playSound = playSound
			};

			msg.SendTo(player);
			return msg;
		}

		public override void Process()
		{
			UIManager.Instance.antagBanner.Show(AntagName, TextColor, BackgroundColor);

			if (playSound)
			{
				SoundManager.Play(AntagSound);
			}
		}
	}
}

using Antagonists;
using Audio.Managers;
using Mirror;
using UnityEngine;

namespace Messages.Server.LocalGuiMessages
{
	public class AntagBannerMessage: ServerMessage
	{
		public string AntagName;
		public string AntagSound;
		public Color TextColor;
		public Color BackgroundColor;
		private bool PlaySound;

		public static AntagBannerMessage Send(
			GameObject player,
			string antagName,
			string antagSound,
			Color textColor,
			Color backgroundColor,
			bool playSound)
		{
			AntagBannerMessage msg = new AntagBannerMessage
			{
				AntagName = antagName,
				AntagSound = antagSound,
				TextColor = textColor,
				BackgroundColor = backgroundColor,
				PlaySound = playSound
			};

			msg.SendTo(player);
			return msg;
		}

		public override void Serialize(NetworkWriter writer)
		{
			base.Serialize(writer);
			writer.WriteString(AntagName);
			writer.WriteString(AntagSound);
			writer.WriteColor(TextColor);
			writer.WriteColor(BackgroundColor);
			writer.WriteBoolean(PlaySound);
		}

		public override void Deserialize(NetworkReader reader)
		{
			base.Deserialize(reader);
			AntagName = reader.ReadString();
			AntagSound = reader.ReadString();
			TextColor = reader.ReadColor();
			BackgroundColor = reader.ReadColor();
			PlaySound = reader.ReadBoolean();
		}

		public override void Process()
		{
			UIManager.Instance.antagBanner.Show(AntagName, TextColor, BackgroundColor);

			if (PlaySound)
			{
				// make sure that all sound is disabled
				SoundAmbientManager.StopAllAudio();
				//play the spawn sound
				SoundAmbientManager.PlayAudio(AntagSound);
			}
		}
	}
}

Rewrite message serialization to fix PlaySound missing flag


using Portal.CMS.Entities.Entities;
using System.Collections.Generic;
using System.Linq;

namespace Portal.CMS.Entities.Seed
{
    public static class MenuSeed
    {
        public static void Seed(PortalEntityModel context)
        {
            if (!context.Menus.Any(x => x.MenuName == "Main Menu"))
            {
                var menuItems = new List<MenuItem>();

                menuItems.Add(new MenuItem { LinkText = "Home", LinkURL = "/Home/Index", LinkIcon = "fa-home" });
                menuItems.Add(new MenuItem { LinkText = "Blog", LinkURL = "/Blog/Index", LinkIcon = "fa-book" });
                menuItems.Add(new MenuItem { LinkText = "Contact", LinkURL = "/Contact/Index", LinkIcon = "fa-envelope" });

                context.Menus.Add(new MenuSystem { MenuName = "Main Menu", MenuItems = menuItems });
            }
        }
    }
}

using Portal.CMS.Entities.Entities;
using System.Collections.Generic;
using System.Linq;

namespace Portal.CMS.Entities.Seed
{
    public static class MenuSeed
    {
        public static void Seed(PortalEntityModel context)
        {
            if (!context.Menus.Any(x => x.MenuName == "Main Menu"))
            {
                var menuItems = new List<MenuItem>();

                menuItems.Add(new MenuItem { LinkText = "Home", LinkURL = "/Home/Index", LinkIcon = "fa-home" });
                menuItems.Add(new MenuItem { LinkText = "Blog", LinkURL = "/Blog/Index", LinkIcon = "fa-book" });

                context.Menus.Add(new MenuSystem { MenuName = "Main Menu", MenuItems = menuItems });
            }
        }
    }
}

Remove Contact Page from Menu Seed

Remove Contact Page from Menu Seed


using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.MSBuild;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using StyleCop.Analyzers.ReadabilityRules;

namespace StyleCop.Analyzers.Test
{
    [TestClass]
    public class ExportCodeFixProviderAttributeNameTest
    {
        [TestMethod]
        public void Test()
        {
            var issues = new List<string>();

            var codeFixProviders = typeof(SA1110OpeningParenthesisMustBeOnDeclarationLine)
                .Assembly
                .GetExportedTypes()
                .Where(t => typeof(CodeFixProvider).IsAssignableFrom(t))
                .ToList();

            foreach (var codeFixProvider in codeFixProviders)
            {
                var exportCodeFixProviderAttribute = codeFixProvider.GetCustomAttributes(false)
                    .OfType<ExportCodeFixProviderAttribute>()
                    .FirstOrDefault();
                if (exportCodeFixProviderAttribute == null)
                {
                    issues.Add(string.Format("{0} should have ExportCodeFixProviderAttribute attribute", codeFixProvider.Name));
                    continue;
                }

                if (!string.Equals(exportCodeFixProviderAttribute.Name, codeFixProvider.Name,
                        StringComparison.InvariantCulture))
                {
                    issues.Add(string.Format("Name parameter of ExportCodeFixProviderAttribute applied on {0} should be set to {0}", codeFixProvider.Name));
                }
            }

            if (issues.Any())
            {
                Assert.Fail(string.Join("\r\t", issues));
            }
        }
    }
}

namespace StyleCop.Analyzers.Test
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Reflection;
    using Microsoft.CodeAnalysis;
    using Microsoft.CodeAnalysis.CodeFixes;
    using StyleCop.Analyzers.ReadabilityRules;
    using Xunit;

    public class ExportCodeFixProviderAttributeNameTest
    {
        public static IEnumerable<object[]> CodeFixProviderTypeData
        {
            get
            {
                var codeFixProviders = typeof(SA1110OpeningParenthesisMustBeOnDeclarationLine)
                    .Assembly
                    .GetTypes()
                    .Where(t => typeof(CodeFixProvider).IsAssignableFrom(t));

                return codeFixProviders.Select(x => new[] { x });
            }
        }

        [Theory]
        [MemberData(nameof(CodeFixProviderTypeData))]
        public void Test(Type codeFixProvider)
        {
            var exportCodeFixProviderAttribute = codeFixProvider.GetCustomAttributes<ExportCodeFixProviderAttribute>(false).FirstOrDefault();

            Assert.NotNull(exportCodeFixProviderAttribute);
            Assert.Equal(codeFixProvider.Name, exportCodeFixProviderAttribute.Name);
            Assert.Equal(1, exportCodeFixProviderAttribute.Languages.Length);
            Assert.Equal(LanguageNames.CSharp, exportCodeFixProviderAttribute.Languages[0]);
        }
    }
}

Test if ExportCodeFixProviderAttribute is applied correctly - adjusted/corrected


using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace EventLogDataSource
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace EventLogDataSource
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new Form1());
            Console.WriteLine("beginDSInfo");
            Console.WriteLine("endDSInfo");
            Console.WriteLine("beginData");
            Console.WriteLine("hello, world");
            Console.WriteLine("endData");
        }
    }
}

Implement the simplest possible 'Hello World' DAE


using UnityEngine;
using System.Collections;

public class Movement : MonoBehaviour {

	public float speed = 6.0F;

	private Animator animator;
	private Vector3 moveDirection = Vector3.zero;
	public float lookSpeed = 10;
	private Vector3 curLoc;
	private Vector3 prevLoc;

	void Start(){
		animator = GetComponent<Animator>();
	}

	void Update() {
			InputCheck();
			if(Input.GetAxis("Horizontal") != 0 || Input.GetAxis("Vertical") != 0){
				animator.SetBool("isWalking", true);
			}
			else{
				animator.SetBool("isWalking", false);
			}
			transform.rotation = Quaternion.Lerp (transform.rotation,  Quaternion.LookRotation(transform.position - prevLoc), Time.fixedDeltaTime * lookSpeed);

		}

	private void InputCheck()
	{
		prevLoc = curLoc;
		curLoc = transform.position;

		if(Input.GetAxis("Horizontal") != 0)
			curLoc.x += Input.GetAxis("Horizontal") * speed * Time.deltaTime;
		if(Input.GetAxis("Vertical") != 0)
			curLoc.z += Input.GetAxis("Vertical") * speed * Time.deltaTime;

		transform.position = curLoc;

	}

}

using UnityEngine;
using System.Collections;

public class Movement : MonoBehaviour {

	public float speed = 6.0F;

	private Animator animator;
	private Vector3 moveDirection = Vector3.zero;
	public float lookSpeed = 10;
	private Vector3 curLoc;
	private Vector3 prevLoc;

	void Start(){
		animator = GetComponent<Animator>();
	}

	void Update() {
			InputCheck();
			if(Input.GetAxis("Horizontal") != 0 || Input.GetAxis("Vertical") != 0){
				animator.SetBool("isWalking", true);
			}
			else{
				animator.SetBool("isWalking", false);
			}
			transform.rotation = Quaternion.Lerp (transform.rotation,  Quaternion.LookRotation(transform.position - prevLoc), Time.fixedDeltaTime * lookSpeed);

		}

	private void InputCheck()
	{
		prevLoc = curLoc;
		curLoc = transform.position;

		if(Input.GetAxis("Horizontal") != 0)
			curLoc.x += Input.GetAxis("Horizontal") * speed * Time.deltaTime;
		if(Input.GetAxis("Vertical") != 0)
			curLoc.z += Input.GetAxis("Vertical") * speed * Time.deltaTime;

		transform.position = curLoc;

	}

	public void Tether(GameObject sprite){
	}

}

Revert "Revert "AI detects when player is close""

This reverts commit 2613d21e307d05d3109e790b0512d60ceddf7055.


using System;
using IvionWebSoft;

public class Site
{
    public readonly Uri SiteUrl;
    public readonly int DisplayMax;

    public string GoogleSiteDeclaration
    {
        get { return "site:" + SiteUrl.Host; }
    }

    public static readonly Site None;
    public static readonly Site YouTube;
    public static readonly Site MyAnimeList;
    public static readonly Site AniDb;
    public static readonly Site MangaUpdates;

    static Site()
    {
        None = new Site();
        YouTube = new Site("https://www.youtube.com/", 3);
        MyAnimeList = new Site("http://myanimelist.net/", 2);
        AniDb = new Site("https://anidb.net/", 2);
        MangaUpdates = new Site("https://www.mangaupdates.com/", 2);
    }

    Site(string url, int displayMax) : this(new Uri(url), displayMax) {}

    public Site(Uri url, int displayMax)
    {
        SiteUrl = url;
        DisplayMax = displayMax;
    }

    public Site()
    {
        SiteUrl = null;
        DisplayMax = 3;
    }

    public SearchResults Search(string searchQuery)
    {
        string finalQuery;
        if (SiteUrl == null)
            finalQuery = searchQuery;
        else
            finalQuery = GoogleSiteDeclaration + " " + searchQuery;

        return GoogleTools.Search(finalQuery);
    }
}

using System;
using IvionWebSoft;

public class Site
{
    public readonly Uri SiteUrl;
    public readonly int DisplayMax;

    public string GoogleSiteDeclaration
    {
        get { return "site:" + SiteUrl.Host; }
    }

    public static readonly Site None;
    public static readonly Site YouTube;
    public static readonly Site MyAnimeList;
    public static readonly Site AniDb;
    public static readonly Site MangaUpdates;
    public static readonly Site VnDb;

    static Site()
    {
        None = new Site();
        YouTube = new Site("https://www.youtube.com/", 3);
        MyAnimeList = new Site("http://myanimelist.net/", 2);
        AniDb = new Site("https://anidb.net/", 2);
        MangaUpdates = new Site("https://www.mangaupdates.com/", 2);
        VnDb = new Site("https://vndb.org/", 2);
    }

    Site(string url, int displayMax) : this(new Uri(url), displayMax) {}

    public Site(Uri url, int displayMax)
    {
        SiteUrl = url;
        DisplayMax = displayMax;
    }

    public Site()
    {
        SiteUrl = null;
        DisplayMax = 3;
    }

    public SearchResults Search(string searchQuery)
    {
        string finalQuery;
        if (SiteUrl == null)
            finalQuery = searchQuery;
        else
            finalQuery = GoogleSiteDeclaration + " " + searchQuery;

        return GoogleTools.Search(finalQuery);
    }
}

Add VNDB as possible search site

Add VNDB as possible search site


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

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

namespace osu.Game.Screens.Edit
{
    /// <summary>
    /// TODO: eventually make this inherit Screen and add a local screen stack inside the Editor.
    /// </summary>
    public abstract class EditorScreen : VisibilityContainer
    {
        [Resolved]
        protected EditorBeatmap EditorBeatmap { get; private set; }

        protected override Container<Drawable> Content => content;
        private readonly Container content;

        public readonly EditorScreenMode Type;

        protected EditorScreen(EditorScreenMode type)
        {
            Type = type;

            Anchor = Anchor.Centre;
            Origin = Anchor.Centre;
            RelativeSizeAxes = Axes.Both;

            InternalChild = content = new Container { RelativeSizeAxes = Axes.Both };
        }

        protected override void PopIn()
        {
            this.ScaleTo(1f, 200, Easing.OutQuint)
                .FadeIn(200, Easing.OutQuint);
        }

        protected override void PopOut()
        {
            this.ScaleTo(0.98f, 200, Easing.OutQuint)
                .FadeOut(200, Easing.OutQuint);
        }
    }
}

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

using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;

namespace osu.Game.Screens.Edit
{
    /// <summary>
    /// TODO: eventually make this inherit Screen and add a local screen stack inside the Editor.
    /// </summary>
    public abstract class EditorScreen : VisibilityContainer
    {
        [Resolved]
        protected EditorBeatmap EditorBeatmap { get; private set; }

        protected override Container<Drawable> Content => content;
        private readonly Container content;

        public readonly EditorScreenMode Type;

        protected EditorScreen(EditorScreenMode type)
        {
            Type = type;

            Anchor = Anchor.Centre;
            Origin = Anchor.Centre;
            RelativeSizeAxes = Axes.Both;

            InternalChild = content = new PopoverContainer { RelativeSizeAxes = Axes.Both };
        }

        protected override void PopIn()
        {
            this.ScaleTo(1f, 200, Easing.OutQuint)
                .FadeIn(200, Easing.OutQuint);
        }

        protected override void PopOut()
        {
            this.ScaleTo(0.98f, 200, Easing.OutQuint)
                .FadeOut(200, Easing.OutQuint);
        }
    }
}

Add local popover container to editor screens


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

namespace ExpressRunner.DesignerMocks
{
    public class TestExplorerViewModel
    {
        private readonly TestGroup selectedTestGroup;
        public TestGroup SelectedTestGroup
        {
            get { return selectedTestGroup; }
        }

        public TestExplorerViewModel()
        {
            selectedTestGroup = new TestGroup("Tests");
            selectedTestGroup.Tests.Add(new TestItem(new Api.Test("First test", "tests", "1")));
            selectedTestGroup.Tests.Add(new TestItem(new Api.Test("Second test", "tests", "2")));
            selectedTestGroup.Tests.Add(new TestItem(new Api.Test("Third test", "tests", "3")));
        }
    }
}

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

namespace ExpressRunner.DesignerMocks
{
    public class TestExplorerViewModel
    {
        private readonly TestGroup selectedTestGroup;
        public TestGroup SelectedTestGroup
        {
            get { return selectedTestGroup; }
        }

        private readonly IEnumerable<TestGroup> testGroups;
        public IEnumerable<TestGroup> TestGroups
        {
            get { return testGroups; }
        }

        public TestExplorerViewModel()
        {
            selectedTestGroup = new TestGroup("Tests");
            selectedTestGroup.Tests.Add(new TestItem(new Api.Test("First test", "tests", "1")));
            selectedTestGroup.Tests.Add(new TestItem(new Api.Test("Second test", "tests", "2")));
            selectedTestGroup.Tests.Add(new TestItem(new Api.Test("Third test", "tests", "3")));

            var rootGroup = new TestGroup("Root");
            rootGroup.SubGroups.Add(new TestGroup("First"));
            rootGroup.SubGroups.Add(new TestGroup("Second"));
            rootGroup.SubGroups.Add(new TestGroup("Third"));
            testGroups = Enumerable.Repeat(rootGroup, 1);
        }
    }
}

Add test data to mock view-model

Add test data to mock view-model


using System;
using System.Linq;
using System.Threading.Tasks;
using CommandLine;
using VstsMetrics.Abstractions;
using VstsMetrics.Extensions;
using VstsMetrics.Renderers;

namespace VstsMetrics.Commands.Throughput
{
    public class ThroughputCommand : Command
    {
        [Option('d', "doneState", DefaultValue = "Done", HelpText = "The work item state you project is using to indicate a work item is 'Done'.")]
        public string DoneState { get; set; }

        [Option('s', "since", Required = false, DefaultValue = null, HelpText = "Only calculate throuput for work items that entered the done state on or after this date.")]
        public DateTime? Since { get; set; }

        public override async Task Execute()
        {
            var workItemClient = WorkItemClientFactory.Create(ProjectCollectionUrl, PatToken);
            var workItemReferences = await workItemClient.QueryWorkItemsAsync(ProjectName, Query);

            var calculator = new WorkItemDoneDateAggregator(workItemClient, DoneState);
            var workItemDoneDates = await calculator.AggregateAsync(workItemReferences);

            var weeklyThroughput =
                workItemDoneDates
                    .GroupBy(t => t.DoneDate.StartOfWeek(DayOfWeek.Monday))
                    .OrderBy(t => t.Key)
                    .Select(g => new {WeekBeginning = g.Key, Throughput = g.Count()});

            OutputRendererFactory.Create(OutputFormat).Render(weeklyThroughput);
        }

        public ThroughputCommand(IWorkItemClientFactory workItemClientFactory, IOutputRendererFactory outputRendererFactory)
            : base(workItemClientFactory, outputRendererFactory)
        {
        }
    }
}

using System;
using System.Linq;
using System.Threading.Tasks;
using CommandLine;
using VstsMetrics.Abstractions;
using VstsMetrics.Extensions;
using VstsMetrics.Renderers;

namespace VstsMetrics.Commands.Throughput
{
    public class ThroughputCommand : Command
    {
        [Option('d', "doneState", DefaultValue = "Done", HelpText = "The work item state you project is using to indicate a work item is 'Done'.")]
        public string DoneState { get; set; }

        [Option('s', "since", Required = false, DefaultValue = null, HelpText = "Only calculate throuput for work items that entered the done state on or after this date.")]
        public DateTime? Since { get; set; }

        public override async Task Execute()
        {
            var workItemClient = WorkItemClientFactory.Create(ProjectCollectionUrl, PatToken);
            var workItemReferences = await workItemClient.QueryWorkItemsAsync(ProjectName, Query);

            var calculator = new WorkItemDoneDateAggregator(workItemClient, DoneState);
            var workItemDoneDates = await calculator.AggregateAsync(workItemReferences);

            var weeklyThroughput =
                workItemDoneDates
                    .GroupBy(t => t.DoneDate.StartOfWeek(DayOfWeek.Monday))
                    .OrderByDescending(t => t.Key)
                    .Select(g => new {WeekBeginning = g.Key, Throughput = g.Count()});

            OutputRendererFactory.Create(OutputFormat).Render(weeklyThroughput);
        }

        public ThroughputCommand(IWorkItemClientFactory workItemClientFactory, IOutputRendererFactory outputRendererFactory)
            : base(workItemClientFactory, outputRendererFactory)
        {
        }
    }
}

Order the throughput data by newest to oldest.


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("Shovel ScriptCs Script Pack")]
[assembly: AssemblyDescription("A scriptcs script pack enabling the creation of scriptcs (.csx) build scripts.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Janco Wolmarans")]
[assembly: AssemblyProduct("Shovel")]
[assembly: AssemblyCopyright("Copyright ©  2013")]
[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("2d8b4853-42c8-4da0-93de-b0af1a2ca15c")]

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

[assembly: InternalsVisibleTo("Shovel.Tests")]

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("Shovel ScriptCs Script Pack")]
[assembly: AssemblyDescription("A scriptcs script pack enabling the creation of scriptcs (.csx) build scripts.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Janco Wolmarans")]
[assembly: AssemblyProduct("Shovel")]
[assembly: AssemblyCopyright("Copyright © 2013 Janco Wolmarans")]
[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("2d8b4853-42c8-4da0-93de-b0af1a2ca15c")]

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

[assembly: InternalsVisibleTo("Shovel.Tests")]

Add author to assembly copyright field

Add author to assembly copyright field


using Chalmers.ILL.Models;
using Examine;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Chalmers.ILL.Extensions;
using Chalmers.ILL.OrderItems;

namespace Chalmers.ILL.Providers
{
    public class ProviderService : IProviderService
    {
        IOrderItemSearcher _orderItemsSearcher;

        public ProviderService(IOrderItemSearcher orderItemsSearcher)
        {
            _orderItemsSearcher = orderItemsSearcher;
        }

        public IEnumerable<String> FetchAndCreateListOfUsedProviders()
        {
            return _orderItemsSearcher.AggregatedProviders();
        }

        public int GetSuggestedDeliveryTimeInHoursForProvider(string providerName)
        {
            int res = 168;

            if (!String.IsNullOrWhiteSpace(providerName) && providerName.ToLower().Contains("subito"))
            {
                res = 24;
            }

            return res;
        }
    }
}

using Chalmers.ILL.Models;
using Examine;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Chalmers.ILL.Extensions;
using Chalmers.ILL.OrderItems;

namespace Chalmers.ILL.Providers
{
    public class ProviderService : IProviderService
    {
        IOrderItemSearcher _orderItemsSearcher;

        public ProviderService(IOrderItemSearcher orderItemsSearcher)
        {
            _orderItemsSearcher = orderItemsSearcher;
        }

        public IEnumerable<String> FetchAndCreateListOfUsedProviders()
        {
            return _orderItemsSearcher.AggregatedProviders();
        }

        public int GetSuggestedDeliveryTimeInHoursForProvider(string providerName)
        {
            int res = 168;

            if (!String.IsNullOrWhiteSpace(providerName) && (providerName.ToLower().Contains("subito") || providerName.ToLower().Contains("reprints desk")))
            {
                res = 24;
            }

            return res;
        }
    }
}

Set the same delivery time for Reprints Desk as for Subito


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

using System;
using osu.Framework.Graphics.Textures;
using osuTK.Graphics.ES30;
using FFmpeg.AutoGen;
using osu.Framework.Graphics.Primitives;
using SixLabors.ImageSharp.PixelFormats;

namespace osu.Framework.Graphics.Video
{
    public unsafe class VideoTextureUpload : ITextureUpload
    {
        public AVFrame* Frame;

        private readonly FFmpegFuncs.AvFrameFreeDelegate freeFrame;

        public ReadOnlySpan<Rgba32> Data => ReadOnlySpan<Rgba32>.Empty;
        public int Level => 0;
        public RectangleI Bounds { get; set; }
        public PixelFormat Format => PixelFormat.Red;

        /// <summary>
        /// Sets the frame cotaining the data to be uploaded
        /// </summary>
        /// <param name="frame">The libav frame to upload.</param>
        /// <param name="free">A function to free the frame on disposal.</param>
        public VideoTextureUpload(AVFrame* frame, FFmpegFuncs.AvFrameFreeDelegate free)
        {
            Frame = frame;
            freeFrame = free;
        }

        #region IDisposable Support

        public void Dispose()
        {
            fixed (AVFrame** ptr = &Frame)
                freeFrame(ptr);
        }

        #endregion
    }
}

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

using System;
using osu.Framework.Graphics.Textures;
using osuTK.Graphics.ES30;
using FFmpeg.AutoGen;
using osu.Framework.Graphics.Primitives;
using SixLabors.ImageSharp.PixelFormats;

namespace osu.Framework.Graphics.Video
{
    public unsafe class VideoTextureUpload : ITextureUpload
    {
        public readonly AVFrame* Frame;

        private readonly FFmpegFuncs.AvFrameFreeDelegate freeFrameDelegate;

        public ReadOnlySpan<Rgba32> Data => ReadOnlySpan<Rgba32>.Empty;

        public int Level => 0;

        public RectangleI Bounds { get; set; }

        public PixelFormat Format => PixelFormat.Red;

        /// <summary>
        /// Sets the frame containing the data to be uploaded.
        /// </summary>
        /// <param name="frame">The frame to upload.</param>
        /// <param name="freeFrameDelegate">A function to free the frame on disposal.</param>
        public VideoTextureUpload(AVFrame* frame, FFmpegFuncs.AvFrameFreeDelegate freeFrameDelegate)
        {
            Frame = frame;
            this.freeFrameDelegate = freeFrameDelegate;
        }

        #region IDisposable Support

        public void Dispose()
        {
            fixed (AVFrame** ptr = &Frame)
                freeFrameDelegate(ptr);
        }

        #endregion
    }
}

Tidy up class xmldoc and naming

Tidy up class xmldoc and naming


using System;
using Sitecore.Data;

namespace AutoSitecore
{
  [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false)]
  public class ItemDataAttribute : Attribute
  {
    public static readonly ItemDataAttribute Null = new ItemDataAttribute();

    public ItemDataAttribute(string name=null, string id = null, string templateId= null)
    {
      this.Name = name;
      ID result;
      if (ID.TryParse(templateId, out result))
      {
        TemplateId = result;
      }
      else
      {
        TemplateId = ID.Null;
      }
      ID result2;

      if (ID.TryParse(id, out result2))
      {
        ItemId = result2;
      }
      else
      {
        ItemId = ID.Undefined;
      }

    }

    public string Name { get; }
    public ID TemplateId { get; }
    public ID ItemId { get; }
  }
}

using System;
using Sitecore.Data;

namespace AutoSitecore
{
  [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false)]
  public class ItemDataAttribute : Attribute
  {
    public static readonly ItemDataAttribute Null = new ItemDataAttribute();

    public ItemDataAttribute(string name=null, string itemId = null, string templateId= null)
    {
      Name = name;
      ItemId = ID.Parse(itemId, ID.Undefined);
      TemplateId = ID.Parse(templateId, ID.Undefined);
    }

    public string Name { get; }
    public ID TemplateId { get; }
    public ID ItemId { get; }
  }
}

Improve error messages for invalid Guids in ItemData

Invalid GUID did not say which field has error. Now paramater name is
specified.


namespace Parsley;

public static class ReadOnlySpanExtensions
{
    public static ReadOnlySpan<char> Peek(this ref ReadOnlySpan<char> input, int length)
        => length >= input.Length
            ? input.Slice(0)
            : input.Slice(0, length);

    public static void Advance(this ref ReadOnlySpan<char> input, ref Position position, int length)
    {
        int lineDelta = 0;
        int columnDelta = 0;

        var peek = input.Peek(length);

        foreach (var ch in peek)
        {
            if (ch == '\n')
            {
                lineDelta++;
                columnDelta = 0 - position.Column;
            }

            columnDelta++;
        }

        input = input.Slice(peek.Length);
        position = new Position(position.Line + lineDelta, position.Column + columnDelta);
    }

    public static ReadOnlySpan<char> TakeWhile(this ref ReadOnlySpan<char> input, Predicate<char> test)
    {
        int i = 0;

        while (i < input.Length && test(input[i]))
            i++;

        return input.Peek(i);
    }
}

namespace Parsley;

public static class ReadOnlySpanExtensions
{
    public static ReadOnlySpan<char> Peek(this ref ReadOnlySpan<char> input, int length)
        => length >= input.Length
            ? input.Slice(0)
            : input.Slice(0, length);

    public static void Advance(this ref ReadOnlySpan<char> input, ref Position position, int length)
    {
        var peek = input.Peek(length);

        input = input.Slice(peek.Length);

        int lineDelta = 0;
        int columnDelta = 0;

        foreach (var ch in peek)
        {
            if (ch == '\n')
            {
                lineDelta++;
                columnDelta = 0 - position.Column;
            }

            columnDelta++;
        }

        position = new Position(position.Line + lineDelta, position.Column + columnDelta);
    }

    public static ReadOnlySpan<char> TakeWhile(this ref ReadOnlySpan<char> input, Predicate<char> test)
    {
        int i = 0;

        while (i < input.Length && test(input[i]))
            i++;

        return input.Peek(i);
    }
}

Reorder lines within Advance to no longer interleve two distinct operations in play: advancing the input span by `length` items, and then analyzing the items advanced over to update the Position. This is a step towards extracting a method for each of the two distinct operations.


namespace Internal.ReadLine.Abstractions
{
    internal interface IConsole
    {
        int CursorLeft { get; }
        int CursorTop { get; }
        int BufferWidth { get; }
        int BufferHeight { get; }
        bool PasswordMode { get; set; }
        char PasswordChar { get; set; }
        void SetCursorPosition(int left, int top);
        void SetBufferSize(int width, int height);
        void Write(string value);
        void WriteLine(string value);
    }
}

namespace Internal.ReadLine.Abstractions
{
    internal interface IConsole
    {
        int CursorLeft { get; }
        int CursorTop { get; }
        int BufferWidth { get; }
        int BufferHeight { get; }
        void SetCursorPosition(int left, int top);
        void SetBufferSize(int width, int height);
        void Write(string value);
        void WriteLine(string value);
    }
}

Remove PasswordMode and PasswordChar from interface definition


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

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

//[assembly: AssemblyVersion("0.0.0.*")]
[assembly: AssemblyTitle ("NDesk.DBus")]
[assembly: AssemblyDescription ("D-Bus IPC protocol library and CLR binding")]
[assembly: AssemblyCopyright ("Copyright (C) Alp Toker")]
[assembly: AssemblyCompany ("NDesk")]

[assembly: InternalsVisibleTo ("dbus-monitor")]
[assembly: InternalsVisibleTo ("dbus-daemon")]

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

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

//[assembly: AssemblyVersion("0.0.0.*")]
[assembly: AssemblyTitle ("NDesk.DBus")]
[assembly: AssemblyDescription ("D-Bus IPC protocol library and CLR binding")]
[assembly: AssemblyCopyright ("Copyright (C) Alp Toker")]
[assembly: AssemblyCompany ("NDesk")]

[assembly: InternalsVisibleTo ("dbus-sharp-glib")]
[assembly: InternalsVisibleTo ("dbus-monitor")]
[assembly: InternalsVisibleTo ("dbus-daemon")]

Add dbus-sharp-glib to friend assemblies


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

namespace CompetitionPlatform.Models
{
    public class AuthenticateModel
    {
        public string FullName { get; set; }
        public string Password { get; set; }
    }
}

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

namespace CompetitionPlatform.Models
{
    public class AuthenticateModel
    {
        public string FullName { get; set; }
        public string Password { get; set; }
    }

    public class CompetitionPlatformUser
    {
        public string Email { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }

        public string GetFullName()
        {
            return FirstName + " " + LastName;
        }
    }
}

Add CompetitionPlatformUser to Identity models.


// IPAddressType.cs
// Script#/Libraries/Node/Core
// This source code is subject to terms and conditions of the Apache License, Version 2.0.
//

using System;
using System.Runtime.CompilerServices;

namespace NodeApi.Network {

    [ScriptImport]
    [ScriptIgnoreNamespace]
    [ScriptConstants(UseNames = true)]
    public enum HttpVerb {

        GET,

        PUT,

        POST,

        DELETE,

        HEAD,

        OPTIONS
    }
}

// IPAddressType.cs
// Script#/Libraries/Node/Core
// This source code is subject to terms and conditions of the Apache License, Version 2.0.
//

using System;
using System.Runtime.CompilerServices;

namespace NodeApi.Network {

    [ScriptImport]
    [ScriptIgnoreNamespace]
    [ScriptConstants(UseNames = true)]
    public enum HttpVerb {

        GET,

        PUT,

        POST,

        DELETE,

        HEAD,

        OPTIONS,

        PATCH
    }
}

Add PATCH to http verbs enumeration

Add PATCH to http verbs enumeration


using System;
using NUnit.Framework;

using DevTyr.Gullap;

namespace DevTyr.Gullap.Tests.With_Guard.For_NotNull
{
	[TestFixture]
	public class When_argument_is_null
	{
		[Test]
		public void Should_throw_argumentnullexception ()
		{
			Assert.Throws<ArgumentNullException> (() => Guard.NotNull (null, null));
		}

		[Test]
		public void Should_include_argument_name_in_exception_message ()
		{
			object what = null;
			Assert.Throws<ArgumentNullException> (() => Guard.NotNull (what, "what"), "what");
		}
    }
}

using System;
using NUnit.Framework;

using DevTyr.Gullap;

namespace DevTyr.Gullap.Tests.With_Guard.For_NotNull
{
	[TestFixture]
	public class When_argument_is_null
	{
		[Test]
		public void Should_throw_argumentnullexception ()
		{
			Assert.Throws<ArgumentNullException> (() => Guard.NotNull (null, null));
		}

		[Test]
		public void Should_include_argument_name_in_exception_message ()
		{
			object what = null;
			Assert.Throws<ArgumentNullException> (() => Guard.NotNull (what, "what"), "what");
		}

		[Test]
		public void Should_include_message_if_provided ()
		{
			object what = null;
			Assert.IsTrue (
				Assert.Throws<ArgumentNullException> (() => Guard.NotNull (what, "what", "the real deal"))
					.Message.Contains("the real deal")
			);
		}
    }
}

Add new test for NotNull with provided message.


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

namespace CSharp.Functional.Tests
{
    public class RangeTests
    {
        [Theory]
        [InlineData(0, 1)]
        public void RangeProvidesAnIEnumerable(int start, int end)
        {
            var result = F.Range(start, end);
            Assert.IsAssignableFrom<IEnumerable>(result);
        }

        [Theory]
        [InlineData(0, 1)]
        public void RangeProvidesAnIEnumerableOfIntegers(int start, int end)
        {
            var result = F.Range(start, end);
            Assert.IsAssignableFrom<IEnumerable<int>>(result);
        }

        [Theory]
        [InlineData(0, 1)]
        [InlineData(0, 0)]
        public void RangeBeginssAtStartValue(int start, int end)
        {
            var result = F.Range(start, end).First();
            Assert.Equal(start, result);
        }

        [Theory]
        [InlineData(0, 1)]
        [InlineData(0, 0)]
        public void RangeTerminatesAtEndValue(int start, int end)
        {
            var result = F.Range(start, end).Last();
            Assert.Equal(end, result);
        }
    }
}

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

namespace CSharp.Functional.Tests
{
    public class RangeTests
    {
        [Theory]
        [InlineData(0, 1)]
        public void RangeProvidesAnIEnumerable(int start, int end)
        {
            var result = F.Range(start, end);
            Assert.IsAssignableFrom<IEnumerable>(result);
        }

        [Theory]
        [InlineData(0, 1)]
        public void RangeProvidesAnIEnumerableOfIntegers(int start, int end)
        {
            var result = F.Range(start, end);
            Assert.IsAssignableFrom<IEnumerable<int>>(result);
        }

        [Theory]
        [InlineData(0, 1)]
        [InlineData(0, 0)]
        public void RangeBeginssAtStartValue(int start, int end)
        {
            var result = F.Range(start, end).First();
            Assert.Equal(start, result);
        }

        [Theory]
        [InlineData(0, 1)]
        [InlineData(0, 0)]
        public void RangeTerminatesAtEndValue(int start, int end)
        {
            var result = F.Range(start, end).Last();
            Assert.Equal(end, result);
        }

        [Theory]
        [InlineData(0, -3)]
        [InlineData(5, 2)]
        public void RangeReturnsEmptyEnumerableOnInvalidRanges(int start, int end)
        {
            var result = F.Range(start, end).ToList();
            Assert.Equal(0, result.Count);
        }
    }
}

Add test for invalid range

Add test for invalid range