using System.Collections.Generic;
// Using directives for plugin use.
using MeidoCommon;
using System.ComponentModel.Composition;

[Export(typeof(IMeidoHook))]
public class MyClass : IMeidoHook
{
    readonly IIrcComm irc;

    public string Prefix { get; set; }

    public string Name
    {
        get { return "MyClass"; }
    }
    public string Version
    {
        get { return "0.10"; }
    }

    public Dictionary<string,string> Help
    {
        get
        {
            return new Dictionary<string, string>()
            {
                {"trigger", "trigger does x"}
            };
        }
    }

    [ImportingConstructor]
    public MyClass(IIrcComm ircComm)
    {
        irc = ircComm;
        irc.AddChannelMessageHandler(HandleChannelMessage);
    }

    public void HandleChannelMessage(IIrcMessage ircMessage)
    {
        // Do something
    }
}

using System.Collections.Generic;
// Using directives for plugin use.
using MeidoCommon;
using System.ComponentModel.Composition;

// IMeidoHook wants you to implement `Name`, `Version`, `Help` and the `Stop` method.
[Export(typeof(IMeidoHook))]
public class MyClass : IMeidoHook
{
    public string Name
    {
        get { return "MyClass"; }
    }
    public string Version
    {
        get { return "0.10"; }
    }

    public Dictionary<string,string> Help
    {
        get
        {
            return new Dictionary<string, string>()
            {
                {"example", "example [args] - does something."}
            };
        }
    }

    public void Stop()
    {}

    [ImportingConstructor]
    public MyClass(IIrcComm irc, IMeidoComm meido)
    {
        meido.RegisterTrigger("example", ExampleTrigger);
    }

    public void ExampleTrigger(IIrcMessage ircMessage)
    {
        // Do something, like:
        ircMessage.Reply("Example trigger triggered.");
    }
}

Update so it's once again in line with the interface and preferred paradigm (RegisterTrigger).


using System;
using SFA.DAS.CommitmentsV2.Types;

namespace SFA.DAS.CommitmentsV2.Messages.Events
{
    public class EntityStateChangedEvent
    {
        public Guid CorrelationId { get; set; }
        public UserAction StateChangeType { get; set; }
        public string EntityType { get; set; }
        public long EmployerAccountId { get; set; }
        public long ProviderId { get; set; }
        public long EntityId { get; set; }
        public string InitialState { get; set; }
        public string UpdatedState { get; set; }
        public string UpdatingUserId { get; set; }
        public string UpdatingUserName { get; set; }
        public Party UpdatingParty { get; set; }
        public DateTime UpdatedOn { get; set; }
    }

    public enum UserAction
    {
        ApproveCohort,
        SendCohort,
        AddDraftApprenticeship,
        ApprenticeshipCompleted,
        UpdateDraftApprenticeship,
        CreateCohort,
        CreateCohortWithOtherParty,
        DeleteDraftApprenticeship,
		DeleteCohort,
        ApproveTransferRequest,
        RejectTransferRequest,
        CompletionPayment
    }
}

using System;
using SFA.DAS.CommitmentsV2.Types;

namespace SFA.DAS.CommitmentsV2.Messages.Events
{
    public class EntityStateChangedEvent
    {
        public Guid CorrelationId { get; set; }
        public UserAction StateChangeType { get; set; }
        public string EntityType { get; set; }
        public long EmployerAccountId { get; set; }
        public long ProviderId { get; set; }
        public long EntityId { get; set; }
        public string InitialState { get; set; }
        public string UpdatedState { get; set; }
        public string UpdatingUserId { get; set; }
        public string UpdatingUserName { get; set; }
        public Party UpdatingParty { get; set; }
        public DateTime UpdatedOn { get; set; }
    }

    public enum UserAction
    {
        ApproveCohort,
        SendCohort,
        AddDraftApprenticeship,
        UpdateDraftApprenticeship,
        CreateCohort,
        CreateCohortWithOtherParty,
        DeleteDraftApprenticeship,
		DeleteCohort,
        ApproveTransferRequest,
        RejectTransferRequest,
        CompletionPayment
    }
}

Revert "CV-500 Added ApprenticeshipCompleted to UserAction"

This reverts commit 05dd9fbdca31201abe69cd5148508bbc5d129846.


using System;
using System.Net;

namespace BmpListener.Bgp
{
    public class IPAddrPrefix
    {
        public IPAddrPrefix(byte[] data, AddressFamily afi = AddressFamily.IP)
        {
            DecodeFromBytes(data, afi);
        }

        public byte Length { get; private set; }
        public IPAddress Prefix { get; private set; }

        public override string ToString()
        {
            return ($"{Prefix}/{Length}");
        }

        public int GetByteLength()
        {
            return 1 + (Length + 7) / 8;
        }

        public void DecodeFromBytes(byte[] data, AddressFamily afi)
        {
            Length = data[0];
            if (Length <= 0) return;
            var byteLength = (Length + 7) / 8;
            var ipBytes = afi == AddressFamily.IP
                ? new byte[4]
                : new byte[16];
            Buffer.BlockCopy(data, 1, ipBytes, 0, byteLength);
            Prefix = new IPAddress(ipBytes);
        }
    }
}

using System;
using System.Net;

namespace BmpListener.Bgp
{
    public class IPAddrPrefix
    {
        public IPAddrPrefix(ArraySegment<byte> data, AddressFamily afi = AddressFamily.IP)
        {
            Length = data.Array[data.Offset];
            var ipBytes = new byte[ByteLength - 1];
            Array.Copy(data.Array, data.Offset + 1, ipBytes, 0, ipBytes.Length);
            DecodeFromBytes(ipBytes, afi);
        }

        internal int ByteLength { get { return 1 + (Length + 7) / 8; } }
        public int Length { get; private set; }
        public IPAddress Prefix { get; private set; }

        public override string ToString()
        {
            return ($"{Prefix}/{Length}");
        }

        public void DecodeFromBytes(byte[] data, AddressFamily afi = AddressFamily.IP)
        {
            var ipBytes = afi == AddressFamily.IP
                ? new byte[4]
                : new byte[16];
            Array.Copy(data, 0, ipBytes, 0, data.Length);
            Prefix = new IPAddress(ipBytes);
        }
    }
}

Change ctor parameter from byte to ArraySegment<byte>


using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;

namespace Junctionizer.UI.Columns
{
    public partial class DependentOnFinalSizeColumn
    {
        public DependentOnFinalSizeColumn()
        {
            InitializeComponent();
        }

        public override BindingBase Binding
        {
            get => base.Binding;

            set {
                base.Binding = value;

                var path = ((Binding) Binding).Path.Path;
                var lastDotIndex = path.LastIndexOf('.');
                var pathToFolder = lastDotIndex < 0 ? string.Empty : path.Substring(0, lastDotIndex + 1);

                AddCellStyle(pathToFolder);
            }
        }

        private void AddCellStyle(string pathToFolder)
        {
            CellStyle = new Style(typeof(DataGridCell), (Style) Application.Current.FindResource("RightAlignCell"));
            var trigger = new DataTrigger {
                Binding = new Binding(pathToFolder + "HasFinalSize"),
                Value = "False"
            };

            trigger.Setters.Add(new Setter(FontStyleProperty, FontStyles.Italic));
            trigger.Setters.Add(new Setter(FontWeightProperty, FontWeights.SemiBold));

            CellStyle.Triggers.Add(trigger);
        }
    }
}

using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;

using Junctionizer.Model;

namespace Junctionizer.UI.Columns
{
    public partial class DependentOnFinalSizeColumn
    {
        public DependentOnFinalSizeColumn()
        {
            InitializeComponent();
        }

        public override BindingBase Binding
        {
            get => base.Binding;

            set {
                base.Binding = value;

                var path = ((Binding) Binding).Path.Path;
                var lastDotIndex = path.LastIndexOf('.');
                var pathToFolder = lastDotIndex < 0 ? string.Empty : path.Substring(0, lastDotIndex + 1);

                AddCellStyle(pathToFolder);
            }
        }

        private void AddCellStyle(string pathToFolder)
        {
            CellStyle = new Style(typeof(DataGridCell), (Style) Application.Current.FindResource("RightAlignCell"));
            var trigger = new DataTrigger {
                Binding = new Binding(pathToFolder + nameof(GameFolder.HasFinalSize)),
                Value = "False"
            };

            trigger.Setters.Add(new Setter(FontStyleProperty, FontStyles.Italic));
            trigger.Setters.Add(new Setter(FontWeightProperty, FontWeights.SemiBold));

            CellStyle.Triggers.Add(trigger);
        }
    }
}

Remove hard coded variable name.

Remove hard coded variable name.


// 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 System.Collections.Generic;
using osu.Framework.Graphics;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Allocation;
using osu.Game.Graphics;
using osu.Game.Overlays.Rankings;

namespace osu.Game.Tests.Visual.Online
{
    public class TestSceneRankingsScopeSelector : OsuTestScene
    {
        public override IReadOnlyList<Type> RequiredTypes => new[]
        {
            typeof(RankingsScopeSelector),
        };

        private readonly Box background;

        public TestSceneRankingsScopeSelector()
        {
            var scope = new Bindable<RankingsScope>();

            AddRange(new Drawable[]
            {
                background = new Box
                {
                    RelativeSizeAxes = Axes.Both
                },
                new RankingsScopeSelector
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                    Current = { BindTarget = scope }
                }
            });

            AddStep(@"Select country", () => scope.Value = RankingsScope.Country);
            AddStep(@"Select performance", () => scope.Value = RankingsScope.Performance);
            AddStep(@"Select score", () => scope.Value = RankingsScope.Score);
            AddStep(@"Select spotlights", () => scope.Value = RankingsScope.Spotlights);
        }

        [BackgroundDependencyLoader]
        private void load(OsuColour colours)
        {
            background.Colour = colours.GreySeafoam;
        }
    }
}

// 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 System.Collections.Generic;
using osu.Framework.Graphics;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Allocation;
using osu.Game.Graphics;
using osu.Game.Overlays.Rankings;

namespace osu.Game.Tests.Visual.Online
{
    public class TestSceneRankingsScopeSelector : OsuTestScene
    {
        public override IReadOnlyList<Type> RequiredTypes => new[]
        {
            typeof(RankingsScopeSelector),
        };

        private readonly Box background;

        public TestSceneRankingsScopeSelector()
        {
            var scope = new Bindable<RankingsScope>();

            AddRange(new Drawable[]
            {
                background = new Box
                {
                    RelativeSizeAxes = Axes.Both
                },
                new RankingsScopeSelector
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                    Current = scope
                }
            });

            AddStep(@"Select country", () => scope.Value = RankingsScope.Country);
            AddStep(@"Select performance", () => scope.Value = RankingsScope.Performance);
            AddStep(@"Select score", () => scope.Value = RankingsScope.Score);
            AddStep(@"Select spotlights", () => scope.Value = RankingsScope.Spotlights);
        }

        [BackgroundDependencyLoader]
        private void load(OsuColour colours)
        {
            background.Colour = colours.GreySeafoam;
        }
    }
}

Use assignment instead of binding

Use assignment instead of binding


using System.Web.Mvc;

namespace OdeToFood.Controllers
{
    public class CuisineController : Controller
    {
        //
        // GET: /Cuisine/

        // Including parameter named "name" causes MVC framework to try to
        // find a parameter named "name" in ANY of the web request (routing
        // data, query string or posted form data).
        public ActionResult Search(string name = "french")
        {
            // HtmlEncode prevents cross-site scripting attack. (Razor will
            // prevent this but a call to Content() assumes you know what
            // you are doing. You have been warned!
            var encodedName = Server.HtmlEncode(name);
            return RedirectToRoute("Default", new {controller = "Home", action = "About"});

        }
    }
}

using System.Net;
using System.Web.Mvc;

namespace OdeToFood.Controllers
{
    public class CuisineController : Controller
    {
        //
        // GET: /Cuisine/

        // Including parameter named "name" causes MVC framework to try to
        // find a parameter named "name" in ANY of the web request (routing
        // data, query string or posted form data).
        public ActionResult Search(string name = "french")
        {
            // Server.MapPath() converts from virtual path to actual path on
            // the **server** filesystem. The symbol ~ identifies the
            // application root (OdeToFood).
            var encodedName = Server.HtmlEncode(name);
            return File(Server.MapPath("~/Content/Site.css"), "text/css");
        }
    }
}

Return File() result (file on the server).


using System;
using System.Collections.Generic;
using Assent.Reporters.DiffPrograms;

namespace Assent.Reporters
{
    public class DiffReporter : IReporter
    {
#if NET45
        internal static readonly bool IsWindows = Environment.OSVersion.Platform == PlatformID.Win32NT;
#else
        internal static readonly bool IsWindows = System.Runtime.InteropServices.RuntimeInformation
            .IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows);
#endif

        static DiffReporter()
        {
            DefaultDiffPrograms = IsWindows
                ? new IDiffProgram[]
                {
                    new BeyondCompareDiffProgram(),
                    new KDiff3DiffProgram(),
                    new XdiffDiffProgram()
                }
                : new IDiffProgram[]
                {
                    new VsCodeDiffProgram(),
                };

        }

        public static readonly IReadOnlyList<IDiffProgram> DefaultDiffPrograms;

        private readonly IReadOnlyList<IDiffProgram> _diffPrograms;

        public DiffReporter() : this(DefaultDiffPrograms)
        {
        }

        public DiffReporter(IReadOnlyList<IDiffProgram> diffPrograms)
        {
            _diffPrograms = diffPrograms;
        }

        public void Report(string receivedFile, string approvedFile)
        {
            foreach (var program in _diffPrograms)
                if (program.Launch(receivedFile, approvedFile))
                    return;

            throw new Exception("Could not find a diff program to use");
        }
    }
}

using System;
using System.Collections.Generic;
using Assent.Reporters.DiffPrograms;

namespace Assent.Reporters
{
    public class DiffReporter : IReporter
    {
#if NET45
        internal static readonly bool IsWindows = Environment.OSVersion.Platform == PlatformID.Win32NT;
#else
        internal static readonly bool IsWindows = System.Runtime.InteropServices.RuntimeInformation
            .IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows);
#endif

        static DiffReporter()
        {
            DefaultDiffPrograms = IsWindows
                ? new IDiffProgram[]
                {
                    new BeyondCompareDiffProgram(),
                    new KDiff3DiffProgram(),
                    new XdiffDiffProgram(),
                    new P4MergeDiffProgram(),
                    new VsCodeDiffProgram()
                }
                : new IDiffProgram[]
                {
                    new VsCodeDiffProgram()
                };

        }

        public static readonly IReadOnlyList<IDiffProgram> DefaultDiffPrograms;

        private readonly IReadOnlyList<IDiffProgram> _diffPrograms;

        public DiffReporter() : this(DefaultDiffPrograms)
        {
        }

        public DiffReporter(IReadOnlyList<IDiffProgram> diffPrograms)
        {
            _diffPrograms = diffPrograms;
        }

        public void Report(string receivedFile, string approvedFile)
        {
            foreach (var program in _diffPrograms)
                if (program.Launch(receivedFile, approvedFile))
                    return;

            throw new Exception("Could not find a diff program to use");
        }
    }
}

Add more reporters by default

Add more reporters by default


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

using OpenLiveWriter.CoreServices;
using OpenLiveWriter.CoreServices.ResourceDownloading;
using Squirrel;
using System;
using System.Collections;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
using System.Threading;
using System.Xml;

namespace OpenLiveWriter.PostEditor.Updates
{
    public class UpdateManager
    {
        public static DateTime Expires = DateTime.MaxValue;

        public static void CheckforUpdates(bool forceCheck = false)
        {
            var checkNow = forceCheck || UpdateSettings.AutoUpdate;
            var downloadUrl = UpdateSettings.CheckForBetaUpdates ?
                UpdateSettings.BetaUpdateDownloadUrl : UpdateSettings.UpdateDownloadUrl;

            // Schedule Open Live Writer 10 seconds after the launch
            var delayUpdate = new DelayUpdateHelper(UpdateOpenLiveWriter(downloadUrl, checkNow), UPDATELAUNCHDELAY);
            delayUpdate.StartBackgroundUpdate("Background OpenLiveWriter application update");
        }

        private static ThreadStart UpdateOpenLiveWriter(string downloadUrl, bool checkNow)
        {
            return async () =>
            {
                if (checkNow)
                {
                    try
                    {
                        using (var manager = new Squirrel.UpdateManager(downloadUrl))
                        {
                            await manager.UpdateApp();
                        }
                    }
                    catch (Exception ex)
                    {
                        Trace.WriteLine("Unexpected error while updating Open Live Writer. " + ex);
                    }
                }
            };
        }

        private const int UPDATELAUNCHDELAY = 10000;
    }
}

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

using OpenLiveWriter.CoreServices;
using OpenLiveWriter.CoreServices.ResourceDownloading;
using Squirrel;
using System;
using System.Collections;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
using System.Threading;
using System.Xml;

namespace OpenLiveWriter.PostEditor.Updates
{
    public class UpdateManager
    {
        public static DateTime Expires = DateTime.MaxValue;

        public static void CheckforUpdates(bool forceCheck = false)
        {
#if !DesktopUWP
            // Update using Squirrel if not a Desktop UWP package
            var checkNow = forceCheck || UpdateSettings.AutoUpdate;
            var downloadUrl = UpdateSettings.CheckForBetaUpdates ?
                UpdateSettings.BetaUpdateDownloadUrl : UpdateSettings.UpdateDownloadUrl;

            // Schedule Open Live Writer 10 seconds after the launch
            var delayUpdate = new DelayUpdateHelper(UpdateOpenLiveWriter(downloadUrl, checkNow), UPDATELAUNCHDELAY);
            delayUpdate.StartBackgroundUpdate("Background OpenLiveWriter application update");
#endif
        }

        private static ThreadStart UpdateOpenLiveWriter(string downloadUrl, bool checkNow)
        {
            return async () =>
            {
                if (checkNow)
                {
                    try
                    {
                        using (var manager = new Squirrel.UpdateManager(downloadUrl))
                        {
                            await manager.UpdateApp();
                        }
                    }
                    catch (Exception ex)
                    {
                        Trace.WriteLine("Unexpected error while updating Open Live Writer. " + ex);
                    }
                }
            };
        }

        private const int UPDATELAUNCHDELAY = 10000;
    }
}

Put Squirrel updater behind conditional compilation flag


#if !NETSTANDARD1_3 && !NETSTANDARD1_6

using System.Runtime.InteropServices;
using System.Threading;

namespace NUnit.Framework.Internal
{
    [TestFixture]
    public class ThreadUtilityTests
    {
        [Platform("Win")]
        [Timeout(1000)]
        [TestCase(false, TestName = "Abort")]
        [TestCase(true, TestName = "Kill")]
        public void AbortOrKillThreadWithMessagePump(bool kill)
        {
            using (var isThreadAboutToWait = new ManualResetEvent(false))
            {
                var nativeId = 0;
                var thread = new Thread(() =>
                {
                    nativeId = ThreadUtility.GetCurrentThreadNativeId();
                    isThreadAboutToWait.Set();
                    while (true)
                        WaitMessage();
                });
                thread.Start();

                isThreadAboutToWait.WaitOne();
                Thread.Sleep(1);

                if (kill)
                    ThreadUtility.Kill(thread, nativeId);
                else
                    ThreadUtility.Abort(thread, nativeId);

                thread.Join();
            }

        }

        [DllImport("user32.dll")]
        private static extern bool WaitMessage();
    }
}

#endif

#if !NETSTANDARD1_3 && !NETSTANDARD1_6

using System.Runtime.InteropServices;
using System.Threading;

namespace NUnit.Framework.Internal
{
    [TestFixture]
    public class ThreadUtilityTests
    {
        [Platform("Win")]
        [TestCase(false, TestName = "Abort")]
        [TestCase(true, TestName = "Kill")]
        public void AbortOrKillThreadWithMessagePump(bool kill)
        {
            using (var isThreadAboutToWait = new ManualResetEvent(false))
            {
                var nativeId = 0;
                var thread = new Thread(() =>
                {
                    nativeId = ThreadUtility.GetCurrentThreadNativeId();
                    isThreadAboutToWait.Set();
                    while (true)
                        WaitMessage();
                });
                thread.Start();

                isThreadAboutToWait.WaitOne();
                Thread.Sleep(1);

                if (kill)
                    ThreadUtility.Kill(thread, nativeId);
                else
                    ThreadUtility.Abort(thread, nativeId);

                Assert.That(thread.Join(1000), "Native message pump was not able to be interrupted to enable a managed thread abort.");
            }
        }

        [DllImport("user32.dll")]
        private static extern bool WaitMessage();
    }
}

#endif

Stop using [Timeout] so that there should be no thread abort on the test thread


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

using System;
using System.ComponentModel.Composition;
using Microsoft.CodeAnalysis.Editor.Host;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.VisualStudio.Language.Intellisense;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Utilities;

namespace Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.QuickInfo
{
    [ContentType(ContentTypeNames.RoslynContentType)]
    [Export(typeof(IAsyncQuickInfoSourceProvider))]
    [Name("RoslynQuickInfoProvider")]
    internal partial class QuickInfoSourceProvider : IAsyncQuickInfoSourceProvider
    {
        private readonly IThreadingContext _threadingContext;
        private readonly Lazy<IStreamingFindUsagesPresenter> _streamingPresenter;

        [ImportingConstructor]
        [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
        public QuickInfoSourceProvider(
            IThreadingContext threadingContext,
            Lazy<IStreamingFindUsagesPresenter> streamingPresenter)
        {
            _threadingContext = threadingContext;
            _streamingPresenter = streamingPresenter;
        }

        public IAsyncQuickInfoSource TryCreateQuickInfoSource(ITextBuffer textBuffer)
            => new QuickInfoSource(textBuffer, _threadingContext, _streamingPresenter);
    }
}

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

using System;
using System.ComponentModel.Composition;
using Microsoft.CodeAnalysis.Editor.Host;
using Microsoft.CodeAnalysis.Editor.Shared.Extensions;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.VisualStudio.Language.Intellisense;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Utilities;

namespace Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.QuickInfo
{
    [ContentType(ContentTypeNames.RoslynContentType)]
    [Export(typeof(IAsyncQuickInfoSourceProvider))]
    [Name("RoslynQuickInfoProvider")]
    internal partial class QuickInfoSourceProvider : IAsyncQuickInfoSourceProvider
    {
        private readonly IThreadingContext _threadingContext;
        private readonly Lazy<IStreamingFindUsagesPresenter> _streamingPresenter;

        [ImportingConstructor]
        [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
        public QuickInfoSourceProvider(
            IThreadingContext threadingContext,
            Lazy<IStreamingFindUsagesPresenter> streamingPresenter)
        {
            _threadingContext = threadingContext;
            _streamingPresenter = streamingPresenter;
        }

        public IAsyncQuickInfoSource TryCreateQuickInfoSource(ITextBuffer textBuffer)
        {
            if (textBuffer.IsInCloudEnvironmentClientContext())
            {
                return null;
            }

            return new QuickInfoSource(textBuffer, _threadingContext, _streamingPresenter);
        }
    }
}

Disable local hover in cloud env

Disable local hover in cloud env


using LogicalShift.Reason.Api;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace LogicalShift.Reason.Solvers
{
    /// <summary>
    /// A query result where the next result is retrieved by a function
    /// </summary>
    public class ChainedResult : IQueryResult
    {
        /// <summary>
        /// A query result that stores the results for this query
        /// </summary>
        private readonly IQueryResult _basicResult;

        /// <summary>
        /// A function that retrieves the next query result
        /// </summary>
        private readonly Func<Task<IQueryResult>> _nextResult;

        public ChainedResult(IQueryResult basicResult, Func<Task<IQueryResult>> nextResult)
        {
            if (basicResult == null) throw new ArgumentNullException("basicResult");
            if (nextResult == null) throw new ArgumentNullException("nextResult");

            _basicResult = basicResult;
            _nextResult = nextResult;
        }

        public bool Success
        {
            get { return _basicResult.Success; }
        }

        public IBindings Bindings
        {
            get { return _basicResult.Bindings; }
        }

        public Task<IQueryResult> Next()
        {
            return _nextResult();
        }
    }
}

using LogicalShift.Reason.Api;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace LogicalShift.Reason.Solvers
{
    /// <summary>
    /// A query result where the next result is retrieved by a function
    /// </summary>
    public class ChainedResult : IQueryResult
    {
        /// <summary>
        /// A query result that stores the results for this query
        /// </summary>
        private readonly IQueryResult _basicResult;

        /// <summary>
        /// A function that retrieves the next query result
        /// </summary>
        private readonly Func<Task<IQueryResult>> _nextResult;

        public ChainedResult(IQueryResult basicResult, Func<Task<IQueryResult>> nextResult)
        {
            if (basicResult == null) throw new ArgumentNullException("basicResult");
            if (nextResult == null) throw new ArgumentNullException("nextResult");

            _basicResult = basicResult;
            _nextResult = nextResult;
        }

        public bool Success
        {
            get { return _basicResult.Success; }
        }

        public IBindings Bindings
        {
            get { return _basicResult.Bindings; }
        }

        public async Task<IQueryResult> Next()
        {
            return new ChainedResult(await _nextResult(), _nextResult);
        }
    }
}

Fix chainedresult to actually chain the results if there are more than 2


using System;
using System.Reactive.Disposables;
using SolidWorks.Interop.sldworks;

namespace SolidworksAddinFramework
{
    public static class ModelViewManagerExtensions
    {
        public static IDisposable CreateSectionView(this IModelViewManager modelViewManager, Action<SectionViewData> config)
        {
            var data = modelViewManager.CreateSectionViewData();
            config(data);
            if (!modelViewManager.CreateSectionView(data))
            {
                throw new Exception("Error while creating section view.");
            }
            // TODO `modelViewManager.RemoveSectionView` always returns `false` and doesn't remove the section view
            // In 2011 this seems to have worked (see https://forum.solidworks.com/thread/47641)
            return Disposable.Create(() => modelViewManager.RemoveSectionView());
        }
    }
}

using System;
using System.Reactive.Disposables;
using SolidWorks.Interop.sldworks;

namespace SolidworksAddinFramework
{
    public static class ModelViewManagerExtensions
    {
        public static IDisposable CreateSectionView(this IModelViewManager modelViewManager, Action<SectionViewData> config)
        {
            var data = modelViewManager.CreateSectionViewData();
            config(data);
            if (!modelViewManager.CreateSectionView(data))
            {
                throw new Exception("Error while creating section view.");
            }
            // TODO `modelViewManager.RemoveSectionView` returns `false` and doesn't remove the section view
            // when `SectionViewData::GraphicsOnlySection` is `true`
            return Disposable.Create(() => modelViewManager.RemoveSectionView());
        }
    }
}

Update comment about when a section view can't be removed


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

using System;
using System.Runtime.InteropServices;

internal static partial class Interop
{
    internal static partial class Sys
    {
        internal enum LockType : short
        {
            F_UNLCK = 2,    // unlock
            F_WRLCK = 3     // exclusive or write lock
        }

        [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LockFileRegion", SetLastError=true)]
        internal static extern int LockFileRegion(SafeHandle fd, long offset, long length, LockType lockType);
    }
}

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

using System;
using System.Runtime.InteropServices;

internal static partial class Interop
{
    internal static partial class Sys
    {
        internal enum LockType : short
        {
            F_WRLCK = 1,    // exclusive or write lock
            F_UNLCK = 2     // unlock
        }

        [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LockFileRegion", SetLastError=true)]
        internal static extern int LockFileRegion(SafeHandle fd, long offset, long length, LockType lockType);
    }
}

Fix Typo in Unix Lock/Unlock PAL

Fix Typo in Unix Lock/Unlock PAL


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using wwwplatform.Extensions;
using wwwplatform.Models;

namespace wwwplatform.Controllers
{
    public class HomeController : BaseController
    {
        public ActionResult Index()
        {
            var page = SitePage.GetAvailablePages(db, User, UserManager, RoleManager, true, false, false).Where(p => p.HomePage == true).FirstOrDefault();
            if (page == null)
            {
                if (db.ActiveSitePages.Where(p => p.HomePage == true).Any())
                {
                    return new HttpUnauthorizedResult("Access Denied");
                }
                return RedirectToAction("Setup");
            }
            return View(page);
        }

        public ActionResult Setup()
        {
            return View();
        }

        public ActionResult Upgrade()
        {
            ApplicationDbContext.Upgrade();
            return RedirectToAction("Index");
        }

        public ActionResult Uninstall()
        {
            if (Request.IsLocal)
            {
                var config = new Migrations.Configuration();
                config.Uninstall(db);
            }
            return RedirectToAction("Index");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using wwwplatform.Extensions;
using wwwplatform.Models;

namespace wwwplatform.Controllers
{
    public class HomeController : BaseController
    {
        public ActionResult Index()
        {
            var page = SitePage.GetAvailablePages(db, User, UserManager, RoleManager, true, false, false).Where(p => p.HomePage == true).FirstOrDefault();
            if (page == null)
            {
                if (db.ActiveSitePages.Where(p => p.HomePage == true).Any())
                {
                    return new HttpUnauthorizedResult("Access Denied");
                }
                return RedirectToAction("Setup");
            }

            if (!string.IsNullOrEmpty(page.RedirectUrl))
            {
                return Redirect(page.RedirectUrl);
            }

            ViewBag.Layout = page.Layout;
            return View(page);
        }

        public ActionResult Setup()
        {
            return View();
        }

        public ActionResult Upgrade()
        {
            ApplicationDbContext.Upgrade();
            return RedirectToAction("Index");
        }

        public ActionResult Uninstall()
        {
            if (Request.IsLocal)
            {
                var config = new Migrations.Configuration();
                config.Uninstall(db);
            }
            return RedirectToAction("Index");
        }
    }
}

Allow redirectUrl and custom layout on home page


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

namespace CarFuel.Controllers
{
    public class CarsController : Controller
    {
        //private static List<Car> cars = new List<Car>();
        private ICarDb db;
        private CarService carService;

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

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

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

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

            try
            {
                carService.AddCar(item, userId);
            }
            catch (OverQuotaException ex)
            {
                TempData["error"] = ex.Message;
            }

            return RedirectToAction("Index");
        }

        public ActionResult Details(Guid Id)
        {
            var userId = new Guid(User.Identity.GetUserId());
            var c = carService.GetCarsByMember(userId).SingleOrDefault(x => x.Id == Id);

            return View(c);
        }
    }
}

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

namespace CarFuel.Controllers
{
    public class CarsController : Controller
    {
        //private static List<Car> cars = new List<Car>();
        private ICarDb db;
        private CarService carService;

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

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

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

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

            try
            {
                carService.AddCar(item, userId);
            }
            catch (OverQuotaException ex)
            {
                TempData["error"] = ex.Message;
            }

            return RedirectToAction("Index");
        }

        public ActionResult Details(Guid? Id)
        {
            if (Id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadGateway);
            }
            var userId = new Guid(User.Identity.GetUserId());
            var c = carService.GetCarsByMember(userId).SingleOrDefault(x => x.Id == Id);

            return View(c);
        }
    }
}

Handle null id for Cars/Details action

Handle null id for Cars/Details action

if users don't supply id value in the URL, instead of displaying YSOD, we ar now return BadRequest.


using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Box.V2.Models;
using System.Threading.Tasks;

namespace Box.V2.Test.Integration
{
    [TestClass]
    public class BoxUsersManagerTestIntegration : BoxResourceManagerTestIntegration
    {

        [TestMethod]
        public async Task UsersInformation_LiveSession_ValidResponse()
        {
            BoxUser user = await _client.UsersManager.GetCurrentUserInformationAsync();

            Assert.AreEqual("215917383", user.Id);
            Assert.AreEqual("Box Windows", user.Name);
            Assert.AreEqual("boxwinintegration@gmail.com", user.Login, true);

        }
    }
}

using System;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Box.V2.Models;
using System.Threading.Tasks;

namespace Box.V2.Test.Integration
{
    [TestClass]
    public class BoxUsersManagerTestIntegration : BoxResourceManagerTestIntegration
    {

        [TestMethod]
        public async Task UsersInformation_LiveSession_ValidResponse()
        {
            BoxUser user = await _client.UsersManager.GetCurrentUserInformationAsync();

            Assert.AreEqual("215917383", user.Id);
            Assert.AreEqual("Box Windows", user.Name);
            Assert.AreEqual("boxwinintegration@gmail.com", user.Login, true);
        }

        [TestMethod]
        public async Task EnterpriseUsersInformation_LiveSession_ValidResponse()
        {
            BoxCollection<BoxUser> users = await _client.UsersManager.GetEnterpriseUsersAsync("jhoerr");

            Assert.AreEqual(users.TotalCount, 1);
            Assert.AreEqual(users.Entries.First().Name, "John Hoerr");
            Assert.AreEqual(users.Entries.First().Login, "jhoerr@iu.edu");
        }
    }
}

Add integration test for same.

Add integration test for same.


// 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.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Edit;
using osu.Game.Screens.Edit.Compose.Components.Timeline;
using osu.Game.Skinning;

namespace osu.Game.Screens.Edit.Compose
{
    public class ComposeScreen : EditorScreenWithTimeline
    {
        private HitObjectComposer composer;

        protected override Drawable CreateMainContent()
        {
            var ruleset = Beatmap.Value.BeatmapInfo.Ruleset?.CreateInstance();
            composer = ruleset?.CreateHitObjectComposer();

            if (ruleset == null || composer == null)
                return new ScreenWhiteBox.UnderConstructionMessage(ruleset == null ? "This beatmap" : $"{ruleset.Description}'s composer");

            var beatmapSkinProvider = new BeatmapSkinProvidingContainer(Beatmap.Value.Skin);

            // the beatmapSkinProvider is used as the fallback source here to allow the ruleset-specific skin implementation
            // full access to all skin sources.
            var rulesetSkinProvider = new SkinProvidingContainer(ruleset.CreateLegacySkinProvider(beatmapSkinProvider));

            // load the skinning hierarchy first.
            // this is intentionally done in two stages to ensure things are in a loaded state before exposing the ruleset to skin sources.
            return beatmapSkinProvider.WithChild(rulesetSkinProvider.WithChild(composer));
        }

        protected override Drawable CreateTimelineContent() => new TimelineHitObjectDisplay(composer.EditorBeatmap);
    }
}

// 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.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Edit;
using osu.Game.Screens.Edit.Compose.Components.Timeline;
using osu.Game.Skinning;

namespace osu.Game.Screens.Edit.Compose
{
    public class ComposeScreen : EditorScreenWithTimeline
    {
        private HitObjectComposer composer;

        protected override Drawable CreateMainContent()
        {
            var ruleset = Beatmap.Value.BeatmapInfo.Ruleset?.CreateInstance();
            composer = ruleset?.CreateHitObjectComposer();

            if (ruleset == null || composer == null)
                return new ScreenWhiteBox.UnderConstructionMessage(ruleset == null ? "This beatmap" : $"{ruleset.Description}'s composer");

            var beatmapSkinProvider = new BeatmapSkinProvidingContainer(Beatmap.Value.Skin);

            // the beatmapSkinProvider is used as the fallback source here to allow the ruleset-specific skin implementation
            // full access to all skin sources.
            var rulesetSkinProvider = new SkinProvidingContainer(ruleset.CreateLegacySkinProvider(beatmapSkinProvider));

            // load the skinning hierarchy first.
            // this is intentionally done in two stages to ensure things are in a loaded state before exposing the ruleset to skin sources.
            return beatmapSkinProvider.WithChild(rulesetSkinProvider.WithChild(composer));
        }

        protected override Drawable CreateTimelineContent() => composer == null ? base.CreateTimelineContent() : new TimelineHitObjectDisplay(composer.EditorBeatmap);
    }
}

Fix editor crashing when loading a beatmap for an unsupported ruleset


using System;

namespace Stylet.Samples.MasterDetail
{
    public class EmployeeModel
    {
        public string Name { get; set; }
    }
}

using System;

namespace Stylet.Samples.MasterDetail
{
    public class EmployeeModel : PropertyChangedBase
    {
        private string _name;
        public string Name
        {
            get { return this._name; }
            set { this.SetAndNotify(ref this._name, value); }
        }
    }
}

Make Master/Detail sample not rely on WPF magic

Fixes #33


using Alensia.Core.UI;
using UniRx;
using UnityEditor;
using UnityEngine;

namespace Alensia.Demo.Controller
{
    public class MainMenu : Box
    {
        protected readonly CompositeDisposable Observers;

        public MainMenu(IUIManager manager) : base(
            new BoxLayout(BoxLayout.BoxOrientation.Vertical), manager)
        {
            Observers = new CompositeDisposable();
        }

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

            Text = "Main Menu";

            var btnQuit = new Button(Manager)
            {
                Text = "Quit to Desktop",
                Padding = new RectOffset(30, 30, 10, 10),
                Color = UnityEngine.Color.red
            };

            var btnDismiss = new Button(Manager)
            {
                Text = "Return to Game",
                Padding = new RectOffset(30, 30, 10, 10)
            };

            Add(btnQuit);
            Add(btnDismiss);

            this.Pack();
            this.CenterOnScreen();

            btnQuit.Clicked
                .Subscribe(_ => OnQuit())
                .AddTo(Observers);

            btnDismiss.Clicked
                .Subscribe(_ => OnDismiss())
                .AddTo(Observers);
        }

        protected virtual void OnQuit()
        {
            Dispose();

            if (EditorApplication.isPlaying)
            {
                EditorApplication.isPlaying = false;
            }
            else
            {
                Application.Quit();
            }
        }

        protected virtual void OnDismiss() => Dispose();

        private void Dispose()
        {
            Manager.Remove(this);

            Observers.Dispose();
        }
    }
}

using Alensia.Core.UI;
using UniRx;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif

namespace Alensia.Demo.Controller
{
    public class MainMenu : Box
    {
        protected readonly CompositeDisposable Observers;

        public MainMenu(IUIManager manager) : base(
            new BoxLayout(BoxLayout.BoxOrientation.Vertical), manager)
        {
            Observers = new CompositeDisposable();
        }

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

            Text = "Main Menu";

            var btnQuit = new Button(Manager)
            {
                Text = "Quit to Desktop",
                Padding = new RectOffset(30, 30, 10, 10),
                Color = UnityEngine.Color.red
            };

            var btnDismiss = new Button(Manager)
            {
                Text = "Return to Game",
                Padding = new RectOffset(30, 30, 10, 10)
            };

            Add(btnQuit);
            Add(btnDismiss);

            this.Pack();
            this.CenterOnScreen();

            btnQuit.Clicked
                .Subscribe(_ => OnQuit())
                .AddTo(Observers);

            btnDismiss.Clicked
                .Subscribe(_ => OnDismiss())
                .AddTo(Observers);
        }

        protected virtual void OnQuit()
        {
            Dispose();

#if UNITY_EDITOR
            EditorApplication.isPlaying = false;
#else
            Application.Quit();
#endif
        }

        protected virtual void OnDismiss() => Dispose();

        private void Dispose()
        {
            Manager.Remove(this);

            Observers.Dispose();
        }
    }
}

Use preprocessor check for editor mode to fix build failure


using System.Threading.Tasks;
using System.Web.Mvc;
using DancingGoat.Models;
using System.Collections.Generic;

namespace DancingGoat.Controllers
{
    public class AboutController : ControllerBase
    {
        public async Task<ActionResult> Index()
        {
            var response = await client.GetItemAsync<AboutUs>("about_us");

            var viewModel = new AboutUsViewModel
            {
                FactViewModels = new List<FactAboutUsViewModel>()
            };

            int i = 0;

            foreach (var fact in response.Item?.Facts)
            {
                var factViewModel = new FactAboutUsViewModel
                {
                    Fact = (FactAboutUs)fact
                };

                if (i++ % 2 == 0)
                {
                    factViewModel.Odd = true;
                }

                viewModel.FactViewModels.Add(factViewModel);
            }

            return View(viewModel);
        }
    }
}

using System.Threading.Tasks;
using System.Web.Mvc;
using DancingGoat.Models;
using System.Collections.Generic;
using KenticoCloud.Delivery;

namespace DancingGoat.Controllers
{
    public class AboutController : ControllerBase
    {
        public async Task<ActionResult> Index()
        {
            var response = await client.GetItemAsync<AboutUs>("about_us");

            var viewModel = new AboutUsViewModel
            {
                FactViewModels = MapFactsAboutUs(response)
            };

            return View(viewModel);
        }

        private IList<FactAboutUsViewModel> MapFactsAboutUs(DeliveryItemResponse<AboutUs> response)
        {
            var facts = new List<FactAboutUsViewModel>();

            if (response.Item == null)
            {
                return facts;
            }

            int i = 0;

            foreach (var fact in response.Item.Facts)
            {
                var factViewModel = new FactAboutUsViewModel
                {
                    Fact = (FactAboutUs)fact
                };

                if (i++ % 2 == 0)
                {
                    factViewModel.Odd = true;
                }

                facts.Add(factViewModel);
            }

            return facts;
        }
    }
}

Handle case where no facts are published.

In cases where facts were not published, this controller was throwing an error in the mapping of facts to the view model.


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

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SiteWarmer.Core")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SiteWarmer.Core")]
[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("f28abe61-e729-4553-b910-8604c9046a97")]

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

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

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SiteWarmer.Core")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SiteWarmer.Core")]
[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("f28abe61-e729-4553-b910-8604c9046a97")]

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

Set Version Numer for 3.0.3.1

Set Version Numer for 3.0.3.1


/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * Copyright (c) 2015, MPL Ali Taheri Moghaddar ali.taheri.m@gmail.com
 */

namespace Pablo.Graphics
{
    /// <summary>
    /// Determines the pattern of a line.
    /// </summary>
    public enum StrokeType
    {
        /// <summary>
        /// This produces a solid continuous line.
        /// </summary>
        Solid,

        /// <summary>
        /// This produces a dashed line.
        /// </summary>
        Dashed,

        /// <summary>
        /// This produces a dash-dotted line.
        /// </summary>
        DashDot,
    }
}

/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * Copyright (c) 2015, MPL Ali Taheri Moghaddar ali.taheri.m@gmail.com
 */

namespace Pablo.Graphics
{
    /// <summary>
    /// Determines the pattern of a line.
    /// </summary>
    public enum StrokeType
    {
        /// <summary>
        /// This produces a solid continuous line.
        /// </summary>
        Solid,

        /// <summary>
        /// This produces a dashed line.
        /// </summary>
        Dashed,

        /// <summary>
        /// This produces a zigzag line.
        /// </summary>
        Zigzag,
    }
}

Make way for future improvements

Make way for future improvements


using Microsoft.Extensions.Logging;
using Newtonsoft.Json;

namespace ExRam.Gremlinq.Providers.WebSocket
{
    public readonly struct QueryLoggingOptions
    {
        public static readonly QueryLoggingOptions Default = new QueryLoggingOptions(LogLevel.Trace, QueryLoggingVerbosity.QueryOnly, Formatting.None);

        public QueryLoggingOptions(LogLevel logLevel, QueryLoggingVerbosity verbosity, Formatting formatting)
        {
            LogLevel = logLevel;
            Verbosity = verbosity;
            Formatting = formatting;
        }

        public QueryLoggingOptions SetLogLevel(LogLevel logLevel)
        {
            return new QueryLoggingOptions(logLevel, Verbosity, Formatting);
        }

        public QueryLoggingOptions SetQueryLoggingVerbosity(QueryLoggingVerbosity verbosity)
        {
            return new QueryLoggingOptions(LogLevel, verbosity, Formatting);
        }

        public QueryLoggingOptions SetFormatting(Formatting formatting)
        {
            return new QueryLoggingOptions(LogLevel, Verbosity, formatting);
        }

        public LogLevel LogLevel { get; }
        public Formatting Formatting { get; }
        public QueryLoggingVerbosity Verbosity { get; }
    }
}

using Microsoft.Extensions.Logging;
using Newtonsoft.Json;

namespace ExRam.Gremlinq.Providers.WebSocket
{
    public readonly struct QueryLoggingOptions
    {
        public static readonly QueryLoggingOptions Default = new QueryLoggingOptions(LogLevel.Debug, QueryLoggingVerbosity.QueryOnly, Formatting.None);

        public QueryLoggingOptions(LogLevel logLevel, QueryLoggingVerbosity verbosity, Formatting formatting)
        {
            LogLevel = logLevel;
            Verbosity = verbosity;
            Formatting = formatting;
        }

        public QueryLoggingOptions SetLogLevel(LogLevel logLevel)
        {
            return new QueryLoggingOptions(logLevel, Verbosity, Formatting);
        }

        public QueryLoggingOptions SetQueryLoggingVerbosity(QueryLoggingVerbosity verbosity)
        {
            return new QueryLoggingOptions(LogLevel, verbosity, Formatting);
        }

        public QueryLoggingOptions SetFormatting(Formatting formatting)
        {
            return new QueryLoggingOptions(LogLevel, Verbosity, formatting);
        }

        public LogLevel LogLevel { get; }
        public Formatting Formatting { get; }
        public QueryLoggingVerbosity Verbosity { get; }
    }
}

Set Default-LogLevel to Debug since Trace isn't really logged onto the console.


using System;
using System.Linq;
using System.Web.Http;
using Peregrine.Data;

namespace Peregrine.Web.Controllers
{
	[RoutePrefix("api/tournaments")]
	public class TournamentsController : ApiController
	{
		[Route]
		public IHttpActionResult Get()
		{
			using(var dataContext = new DataContext())
			{
				var tournamentKeys = dataContext
					.Tournaments
					.Select(tournament => tournament.Key)
					.ToArray();

				return Ok(new
					{
						keys = tournamentKeys,
					});
			}
		}

		[Route]
		public IHttpActionResult Post()
		{
			using(var dataContext = new DataContext())
			{
				var tournament = dataContext
					.Tournaments
					.Add(new Tournament
					{
						Key = Guid.NewGuid(),
					});

				dataContext.SaveChanges();

				return CreatedAtRoute(
					"tournament-get",
					new { tournamentKey = tournament.Key },
					new
					{
						key = tournament.Key
					});
			}
		}
	}
}

using System;
using System.Linq;
using System.Web.Http;
using Peregrine.Data;

namespace Peregrine.Web.Controllers
{
	[RoutePrefix("api/tournaments")]
	public class TournamentsController : ApiController
	{
		[Route]
		public IHttpActionResult Get()
		{
			using(var dataContext = new DataContext())
			{
				var tournamentKeys = dataContext
					.Tournaments
					.Select(tournament => tournament.Key)
					.ToArray();

				return Ok(new
					{
						keys = tournamentKeys,
					});
			}
		}

		[Route]
		public IHttpActionResult Post()
		{
			using(var dataContext = new DataContext())
			{
				var tournament = dataContext
					.Tournaments
					.Add(new Tournament
					{
						Key = Guid.NewGuid(),
					});

				dataContext.SaveChanges();

				return CreatedAtRoute(
					"tournament-get",
					new { tournamentKey = tournament.Key },
					new
					{
						tournament = new
						{
							key = tournament.Key,
						}
					});
			}
		}
	}
}

Fix tournament POST not wrapping return value in an object.


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

using Microsoft.MixedReality.Toolkit.Utilities;

namespace Microsoft.MixedReality.Toolkit.Input
{
    public static class HandJointUtils
    {
        /// <summary>
        /// Try to find the first matching hand controller and return the pose of the requested joint for that hand.
        /// </summary>
        public static bool TryGetJointPose(TrackedHandJoint joint, Handedness handedness, out MixedRealityPose pose)
        {
            IMixedRealityHand hand = FindHand(handedness);
            if (hand != null)
            {
                return hand.TryGetJoint(joint, out pose);
            }

            pose = MixedRealityPose.ZeroIdentity;
            return false;
        }

        /// <summary>
        /// Find the first detected hand controller with matching handedness.
        /// </summary>
        public static IMixedRealityHand FindHand(Handedness handedness)
        {
            foreach (var detectedController in MixedRealityToolkit.InputSystem.DetectedControllers)
            {
                var hand = detectedController as IMixedRealityHand;
                if (hand != null)
                {
                    if (detectedController.ControllerHandedness == handedness)
                    {
                        return hand;
                    }
                }
            }
            return null;
        }
    }
}

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

using Microsoft.MixedReality.Toolkit.Utilities;

namespace Microsoft.MixedReality.Toolkit.Input
{
    public static class HandJointUtils
    {
        /// <summary>
        /// Tries to get the the pose of the requested joint for the first controller with the specified handedness.
        /// </summary>
        /// <param name="joint">The requested joint</param>
        /// <param name="handedness">The specific hand of interest. This should be either Handedness.Left or Handedness.Right</param>
        /// <param name="pose">The output pose data</param>
        public static bool TryGetJointPose(TrackedHandJoint joint, Handedness handedness, out MixedRealityPose pose)
        {
            IMixedRealityHand hand = FindHand(handedness);
            if (hand != null)
            {
                return hand.TryGetJoint(joint, out pose);
            }

            pose = MixedRealityPose.ZeroIdentity;
            return false;
        }

        /// <summary>
        /// Find the first detected hand controller with matching handedness.
        /// </summary>
        /// <remarks>
        /// The given handeness should be either Handedness.Left or Handedness.Right.
        /// </remarks>
        public static IMixedRealityHand FindHand(Handedness handedness)
        {
            foreach (var detectedController in MixedRealityToolkit.InputSystem.DetectedControllers)
            {
                var hand = detectedController as IMixedRealityHand;
                if (hand != null)
                {
                    if (detectedController.ControllerHandedness == handedness)
                    {
                        return hand;
                    }
                }
            }
            return null;
        }
    }
}

Update the TryGetJointPose docs to accurately describe the set of inputs it can take.

These functions only work if you pass in the specific Handedness.Left or Handedness.Right. They should be documented as such.


using ExplicitlyImpl.AspNetCore.Mvc.FluentActions;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;

namespace HelloWorld
{
    public class Startup
    {
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc().AddFluentActions();
        }

        public void Configure(IApplicationBuilder app)
        {
            app.UseMvc();
            app.UseFluentActions(actions =>
            {
                actions.RouteGet("/").To(() => "Hello World!");
            });
        }
    }
}

using ExplicitlyImpl.AspNetCore.Mvc.FluentActions;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;

namespace HelloWorld
{
    public class Startup
    {
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc().AddFluentActions();
        }

        public void Configure(IApplicationBuilder app)
        {
            app.UseFluentActions(actions =>
            {
                actions.RouteGet("/").To(() => "Hello World!");
            });
            app.UseMvc();
        }
    }
}

Move call to UseFluentActions before UseMvc in hello world sample project


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - Vaskelista</title>
    @Styles.Render("~/Content/css")
    @Mvc.RazorTools.BundleManager.Styles.Render()
    @Styles.Render("~/Content/less")
    @Scripts.Render("~/bundles/modernizr")
    <link href='http://fonts.googleapis.com/css?family=Patrick+Hand+SC|Schoolbell' rel='stylesheet' type='text/css'>
    <link href='//fonts.googleapis.com/css?family=Roboto:400,100,700' rel='stylesheet' type='text/css' />
    <link rel="shortcut icon" href="../favicon.ico" />
</head>
<body>

    <main class="main container body-content">
        @RenderBody()
    </main>

        @Scripts.Render("~/bundles/jquery")
        @Scripts.Render("~/bundles/bootstrap")
        @RenderSection("scripts", required: false)
</body>
</html>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - Vaskelista</title>
    @Styles.Render("~/Content/css")
    @Mvc.RazorTools.BundleManager.Styles.Render()
    @Styles.Render("~/Content/less")
    @Scripts.Render("~/bundles/modernizr")
    <link href='//fonts.googleapis.com/css?family=Patrick+Hand+SC|Schoolbell' rel='stylesheet' type='text/css'>
    <link href='//fonts.googleapis.com/css?family=Roboto:400,100,700' rel='stylesheet' type='text/css' />
    <link rel="shortcut icon" href="../favicon.ico" />
</head>
<body>

    <main class="main container body-content">
        @RenderBody()
    </main>

        @Scripts.Render("~/bundles/jquery")
        @Scripts.Render("~/bundles/bootstrap")
        @RenderSection("scripts", required: false)
</body>
</html>

Load fonts over https if using https

Load fonts over https if using https


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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using osu.Framework.Graphics;
using osu.Framework.Testing;
using osu.Game.Overlays;
using osu.Game.Users;

namespace osu.Desktop.VisualTests.Tests
{
    internal class TestCaseUserProfile : TestCase
    {
        public override void Reset()
        {
            base.Reset();
            var userpage = new UserProfile(new User
            {
                Username = @"peppy",
                Id = 2,
                Country = new Country { FlagName = @"AU" },
                CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg"
            })
            {
                Anchor = Anchor.Centre,
                Origin = Anchor.Centre,
                Width = 800,
                Height = 500
            };
            Add(userpage);
            AddStep("Toggle", userpage.ToggleVisibility);
        }
    }
}

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using osu.Framework.Graphics;
using osu.Framework.Testing;
using osu.Game.Overlays;
using osu.Game.Users;

namespace osu.Desktop.VisualTests.Tests
{
    internal class TestCaseUserProfile : TestCase
    {
        public override string Description => "Tests user's profile page.";

        public override void Reset()
        {
            base.Reset();
            var userpage = new UserProfile(new User
            {
                Username = @"peppy",
                Id = 2,
                Country = new Country { FlagName = @"AU" },
                CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg"
            })
            {
                Anchor = Anchor.Centre,
                Origin = Anchor.Centre,
                Width = 800,
                Height = 500
            };
            Add(userpage);
            AddStep("Toggle", userpage.ToggleVisibility);
        }
    }
}

Add description in test case.

Add description in test case.


using System;
using System.Linq;
using System.Transactions;
using NMF.Expressions;
using NMF.Models.Evolution;
using NMF.Models.Repository;

namespace NMF.Models
{
    class NMFTransaction : IDisposable
    {
        private bool _committed;
        private readonly ExecutionEngine _engine = ExecutionEngine.Current;
        private readonly ModelChangeRecorder _recorder = new ModelChangeRecorder();
        private IModelRepository _repository;
        //private TransactionScope _scope;

        public NMFTransaction(IModelElement rootElement)
        {
            if (rootElement == null) throw new ArgumentNullException(nameof(rootElement));
            _repository = rootElement.Model.Repository;
            _recorder.Start(rootElement);
            //_scope = new TransactionScope();
            _engine.BeginTransaction();
        }
        public void Commit()
        {
            //if (_scope == null) throw new InvalidOperationException();
            _engine.CommitTransaction();
            _committed = true;
            //_scope.Complete();
        }
        public void Rollback()
        {
            var modelChanges = _recorder.GetModelChanges().TraverseFlat().Reverse();
            _recorder.Stop();

            foreach (var change in modelChanges)
                change.Invert(_repository);
            _engine.RollbackTransaction();
        }
        public void Dispose()
        {
            if (!_committed)
                Rollback();
            //if (_scope != null)
            //{
            //    _scope.Dispose();
            //    _scope = null;
            //}
        }

    }
}

using System;
using System.Linq;
using System.Transactions;
using NMF.Expressions;
using NMF.Models.Evolution;
using NMF.Models.Repository;

namespace NMF.Models
{
    class NMFTransaction : IDisposable
    {
        private bool _committed;
        private readonly ExecutionEngine _engine = ExecutionEngine.Current;
        private readonly ModelChangeRecorder _recorder = new ModelChangeRecorder();
        private IModelRepository _repository;
        //private TransactionScope _scope;

        public NMFTransaction(IModelElement rootElement)
        {
            if (rootElement == null) throw new ArgumentNullException(nameof(rootElement));
            _repository = rootElement.Model.Repository;
            _recorder.Start(rootElement);
            //_scope = new TransactionScope();
            _engine.BeginTransaction();
        }
        public void Commit()
        {
            //if (_scope == null) throw new InvalidOperationException();
            _engine.CommitTransaction();
            _committed = true;
            //_scope.Complete();
        }
        public void Rollback()
        {
            var modelChanges = _recorder.GetModelChanges().Changes;
            _recorder.Stop();
            modelChanges.Reverse();

            foreach (var change in modelChanges)
                change.Invert(_repository);
            _engine.RollbackTransaction();
        }
        public void Dispose()
        {
            if (!_committed)
                Rollback();
            //if (_scope != null)
            //{
            //    _scope.Dispose();
            //    _scope = null;
            //}
        }

    }
}

Rollback now uses the changes field of the change collection instead of traverse flat.


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

#nullable disable

using System.Diagnostics;
using System.Globalization;

namespace Microsoft.CodeAnalysis.LanguageServices
{
    internal static class ArityUtilities
    {
        private const string GenericTypeNameManglingString = "`";
        private static readonly string[] s_aritySuffixesOneToNine = { "`1", "`2", "`3", "`4", "`5", "`6", "`7", "`8", "`9" };

        public static string GetMetadataAritySuffix(int arity)
        {
            Debug.Assert(arity > 0);
            return (arity <= s_aritySuffixesOneToNine.Length)
                ? s_aritySuffixesOneToNine[arity - 1]
                : string.Concat(GenericTypeNameManglingString, arity.ToString(CultureInfo.InvariantCulture));
        }
    }
}

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

using System.Collections.Immutable;
using System.Diagnostics;
using System.Globalization;

namespace Microsoft.CodeAnalysis.LanguageServices
{
    internal static class ArityUtilities
    {
        private const string GenericTypeNameManglingString = "`";
        private static readonly ImmutableArray<string> s_aritySuffixesOneToNine = ImmutableArray.Create("`1", "`2", "`3", "`4", "`5", "`6", "`7", "`8", "`9");

        public static string GetMetadataAritySuffix(int arity)
        {
            Debug.Assert(arity > 0);
            return (arity <= s_aritySuffixesOneToNine.Length)
                ? s_aritySuffixesOneToNine[arity - 1]
                : string.Concat(GenericTypeNameManglingString, arity.ToString(CultureInfo.InvariantCulture));
        }
    }
}

Switch to ImmutableArray to prevent accidental mutation


using System;

namespace Cosmos.TestRunner.Core
{
    public static class DefaultEngineConfiguration
    {
        public static void Apply(Engine engine)
        {
            if (engine == null)
            {
                throw new ArgumentNullException("engine");
            }

            engine.AddKernel(typeof(Cosmos.Compiler.Tests.SimpleWriteLine.Kernel.Kernel).Assembly.Location);
            //engine.AddKernel(typeof(SimpleStructsAndArraysTest.Kernel).Assembly.Location);
            //engine.AddKernel(typeof(VGACompilerCrash.Kernel).Assembly.Location);

            // known bugs, therefor disabled for now:
        }
    }
}

using System;

namespace Cosmos.TestRunner.Core
{
    public static class DefaultEngineConfiguration
    {
        public static void Apply(Engine engine)
        {
            if (engine == null)
            {
                throw new ArgumentNullException("engine");
            }

            engine.AddKernel(typeof(Cosmos.Compiler.Tests.SimpleWriteLine.Kernel.Kernel).Assembly.Location);
            engine.AddKernel(typeof(SimpleStructsAndArraysTest.Kernel).Assembly.Location);
            engine.AddKernel(typeof(VGACompilerCrash.Kernel).Assembly.Location);

            // known bugs, therefor disabled for now:
        }
    }
}

Enable all kernel tests again.

Enable all kernel tests again.


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

namespace System.Globalization
{
    public partial class TextInfo
    {
        //////////////////////////////////////////////////////////////////////////
        ////
        ////  TextInfo Constructors
        ////
        ////  Implements CultureInfo.TextInfo.
        ////
        //////////////////////////////////////////////////////////////////////////
        internal unsafe TextInfo(CultureData cultureData)
        {
            // TODO: Implement this fully.
        }

        private unsafe string ChangeCase(string s, bool toUpper)
        {
            Contract.Assert(s != null);
            // TODO: Implement this fully.

            StringBuilder sb = new StringBuilder(s.Length);

            for (int i = 0; i < s.Length; i++)
            {
                sb.Append(ChangeCaseAscii(s[i], toUpper));
            }

            return s.ToString();
        }

        private unsafe char ChangeCase(char c, bool toUpper)
        {
            // TODO: Implement this fully.
            return ChangeCaseAscii(c, toUpper);
        }

        // PAL Methods end here.

        internal static char ChangeCaseAscii(char c, bool toUpper = true)
        {
            if (toUpper && c >= 'a' && c <= 'z')
            {
                return (char)('A' + (c - 'a'));
            }
            else if (!toUpper && c >= 'A' && c <= 'Z')
            {
                return (char)('a' + (c - 'A'));
            }

            return c;
        }
    }
}

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

namespace System.Globalization
{
    public partial class TextInfo
    {
        //////////////////////////////////////////////////////////////////////////
        ////
        ////  TextInfo Constructors
        ////
        ////  Implements CultureInfo.TextInfo.
        ////
        //////////////////////////////////////////////////////////////////////////
        internal unsafe TextInfo(CultureData cultureData)
        {
            // TODO: Implement this fully.
        }

        private unsafe string ChangeCase(string s, bool toUpper)
        {
            Contract.Assert(s != null);
            // TODO: Implement this fully.

            StringBuilder sb = new StringBuilder(s.Length);

            for (int i = 0; i < s.Length; i++)
            {
                sb.Append(ChangeCaseAscii(s[i], toUpper));
            }

            return sb.ToString();
        }

        private unsafe char ChangeCase(char c, bool toUpper)
        {
            // TODO: Implement this fully.
            return ChangeCaseAscii(c, toUpper);
        }

        // PAL Methods end here.

        internal static char ChangeCaseAscii(char c, bool toUpper = true)
        {
            if (toUpper && c >= 'a' && c <= 'z')
            {
                return (char)('A' + (c - 'a'));
            }
            else if (!toUpper && c >= 'A' && c <= 'Z')
            {
                return (char)('a' + (c - 'A'));
            }

            return c;
        }
    }
}

Fix string.ToUpper/ToLower to use the computed result

Amazing the difference a single character can make :)


namespace Serilog.Tests.Support
{
    public abstract class DummyAbstractClass
    {
    }

    public class DummyConcreteClassWithDefaultConstructor
    {
        // ReSharper disable once UnusedParameter.Local
        public DummyConcreteClassWithDefaultConstructor(string param = "")
        {
        }
    }

    public class DummyConcreteClassWithoutDefaultConstructor
    {
        // ReSharper disable once UnusedParameter.Local
        public DummyConcreteClassWithoutDefaultConstructor(string param)
        {
        }
    }
}

namespace Serilog.Tests.Support
{
    public abstract class DummyAbstractClass
    {
    }

    public class DummyConcreteClassWithDefaultConstructor : DummyAbstractClass
    {
        // ReSharper disable once UnusedParameter.Local
        public DummyConcreteClassWithDefaultConstructor(string param = "")
        {
        }
    }

    public class DummyConcreteClassWithoutDefaultConstructor : DummyAbstractClass
    {
        // ReSharper disable once UnusedParameter.Local
        public DummyConcreteClassWithoutDefaultConstructor(string param)
        {
        }
    }
}

Fix wrong class hierarchy in Abstract class test cases


namespace CloudantDotNet.Models
{
    public class ToDoItem
    {
        public string id { get; set; }
        public string rev { get; set; }
        public string text { get; set; }

    }
    public class VREntryItem
    {
        public string id { get; set; }
        public string rev { get; set; }
        public string caseName { get; set; }
        public string mark { get; set; }
        public string comment { get; set; }
    }

}

namespace CloudantDotNet.Models
{
    public class ToDoItem
    {
        public string id { get; set; }
        public string rev { get; set; }
        public string text { get; set; }

    }
    public class VREntryItem
    {
        public string id { get; set; }
        public string rev { get; set; }
        public string caseName { get; set; }
        public int mark { get; set; }
        public string comment { get; set; }
    }

}

Change string to int for mark

Change string to int for mark


using System;
using StructureMap;

namespace Reactive.Config.StructureMap
{
    public static class ContainerExtensions
    {
        public static void ReactiveConfig(this ConfigurationExpression config, Action<IReactiveConfigRegistry> action)
        {
            config.For<IKeyPathProvider>().Use<NamespaceKeyPathProvider>();
            config.For<IConfigurationResultStore>().Singleton().Use<ConfigurationResultStore>();

            var configRegsitry = new ReactiveConfigRegsitry(config);

            action(configRegsitry);

            config.For<IConfigurationProvider>().Use<ConfigurationProvider>();
        }
    }
}

using System;
using StructureMap;

namespace Reactive.Config.StructureMap
{
    public static class ContainerExtensions
    {
        public static void ReactiveConfig(this ConfigurationExpression config, Action<IReactiveConfigRegistry> action)
        {
            config.Scan(s =>
            {
                s.AssemblyContainingType<IConfigured>();
                s.WithDefaultConventions();
            });

            config.For<IConfigurationResultStore>().Singleton().Use<ConfigurationResultStore>();
            config.For<IKeyPathProvider>().Use<NamespaceKeyPathProvider>();

            var configRegsitry = new ReactiveConfigRegsitry(config);

            action(configRegsitry);

            config.For<IConfigurationProvider>().Use<ConfigurationProvider>();
        }
    }
}

Fix StructureMap missing default convention for React.Config


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

using System.Collections.Immutable;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.NavigationBar;
using Microsoft.CodeAnalysis.Shared.Extensions;

namespace Microsoft.CodeAnalysis.Remote
{
    internal sealed class RemoteNavigationBarItemService : BrokeredServiceBase, IRemoteNavigationBarItemService
    {
        internal sealed class Factory : FactoryBase<IRemoteNavigationBarItemService>
        {
            protected override IRemoteNavigationBarItemService CreateService(in ServiceConstructionArguments arguments)
                => new RemoteNavigationBarItemService(arguments);
        }

        public RemoteNavigationBarItemService(in ServiceConstructionArguments arguments)
            : base(arguments)
        {
        }

        public ValueTask<ImmutableArray<SerializableNavigationBarItem>> GetItemsAsync(
            PinnedSolutionInfo solutionInfo, DocumentId documentId, bool supportsCodeGeneration, CancellationToken cancellationToken)
        {
            return RunServiceAsync(async cancellationToken =>
            {
                var solution = await GetSolutionAsync(solutionInfo, cancellationToken).ConfigureAwait(false);

                var document = solution.GetRequiredDocument(documentId);
                var navigationBarService = document.GetRequiredLanguageService<INavigationBarItemService>();
                var result = await navigationBarService.GetItemsAsync(document, supportsCodeGeneration, cancellationToken).ConfigureAwait(false);

                return SerializableNavigationBarItem.Dehydrate(result);
            }, cancellationToken);
        }
    }
}

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

using System.Collections.Immutable;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.NavigationBar;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.Remote
{
    internal sealed class RemoteNavigationBarItemService : BrokeredServiceBase, IRemoteNavigationBarItemService
    {
        internal sealed class Factory : FactoryBase<IRemoteNavigationBarItemService>
        {
            protected override IRemoteNavigationBarItemService CreateService(in ServiceConstructionArguments arguments)
                => new RemoteNavigationBarItemService(arguments);
        }

        public RemoteNavigationBarItemService(in ServiceConstructionArguments arguments)
            : base(arguments)
        {
        }

        public ValueTask<ImmutableArray<SerializableNavigationBarItem>> GetItemsAsync(
            PinnedSolutionInfo solutionInfo, DocumentId documentId, bool supportsCodeGeneration, CancellationToken cancellationToken)
        {
            return RunServiceAsync(async cancellationToken =>
            {
                var solution = await GetSolutionAsync(solutionInfo, cancellationToken).ConfigureAwait(false);

                var document = await solution.GetDocumentAsync(documentId, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false);
                Contract.ThrowIfNull(document);
                var navigationBarService = document.GetRequiredLanguageService<INavigationBarItemService>();
                var result = await navigationBarService.GetItemsAsync(document, supportsCodeGeneration, cancellationToken).ConfigureAwait(false);

                return SerializableNavigationBarItem.Dehydrate(result);
            }, cancellationToken);
        }
    }
}

Support computing navigation bar items for source generated files


using NUnit.Framework;
using FluentMigrator.Infrastructure;

namespace FluentMigrator.Tests.Unit
{
    using System.Collections.ObjectModel;
    using System.Linq;
    using FluentMigrator.Expressions;
    using Moq;

    [TestFixture]
    public class AutoReversingMigrationTests
    {
        private Mock<IMigrationContext> context;

        [SetUp]
        public void SetUp()
        {
            context = new Mock<IMigrationContext>();
            context.SetupAllProperties();
        }

        [Test]
        public void CreateTableUpAutoReversingMigrationGivesDeleteTableDown()
        {
            var autoReversibleMigration = new TestAutoReversingMigrationCreateTable();
            context.Object.Expressions = new Collection<IMigrationExpression>();
            autoReversibleMigration.GetDownExpressions(context.Object);

            Assert.True(context.Object.Expressions.Any(me => me is DeleteTableExpression && ((DeleteTableExpression)me).TableName == "Foo"));
        }

        [Test]
        public void DownMigrationsAreInReverseOrderOfUpMigrations()
        {
            var autoReversibleMigration = new TestAutoReversingMigrationCreateTable();
            context.Object.Expressions = new Collection<IMigrationExpression>();
            autoReversibleMigration.GetDownExpressions(context.Object);

            Assert.IsAssignableFrom(typeof(RenameTableExpression), context.Object.Expressions.ToList()[0]);
            Assert.IsAssignableFrom(typeof(DeleteTableExpression), context.Object.Expressions.ToList()[1]);
        }

    }

    internal class TestAutoReversingMigrationCreateTable : AutoReversingMigration
    {
        public override void Up()
        {
            Create.Table("Foo");
            Rename.Table("Foo").InSchema("FooSchema").To("Bar");
        }
    }
}

using NUnit.Framework;
using FluentMigrator.Infrastructure;

namespace FluentMigrator.Tests.Unit
{
    using System.Collections.ObjectModel;
    using System.Linq;
    using FluentMigrator.Expressions;
    using Moq;

    [TestFixture]
    public class AutoReversingMigrationTests
    {
        private Mock<IMigrationContext> context;

        [SetUp]
        public void SetUp()
        {
            context = new Mock<IMigrationContext>();
            context.SetupAllProperties();
        }

        [Test]
        public void CreateTableUpAutoReversingMigrationGivesDeleteTableDown()
        {
            var autoReversibleMigration = new TestAutoReversingMigration();
            context.Object.Expressions = new Collection<IMigrationExpression>();
            autoReversibleMigration.GetDownExpressions(context.Object);

            Assert.True(context.Object.Expressions.Any(me => me is DeleteTableExpression && ((DeleteTableExpression)me).TableName == "Foo"));
        }

        [Test]
        public void DownMigrationsAreInReverseOrderOfUpMigrations()
        {
            var autoReversibleMigration = new TestAutoReversingMigration();
            context.Object.Expressions = new Collection<IMigrationExpression>();
            autoReversibleMigration.GetDownExpressions(context.Object);

            Assert.IsAssignableFrom(typeof(RenameTableExpression), context.Object.Expressions.ToList()[0]);
            Assert.IsAssignableFrom(typeof(DeleteTableExpression), context.Object.Expressions.ToList()[1]);
        }

    }

    internal class TestAutoReversingMigration : AutoReversingMigration
    {
        public override void Up()
        {
            Create.Table("Foo");
            Rename.Table("Foo").InSchema("FooSchema").To("Bar");
        }
    }
}

Update class name to reflect additional test


using Autofac;
using BookSleeve;
using Compilify.Web.Services;

namespace Compilify.Web.Infrastructure.DependencyInjection
{
    public class RedisModule : Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            builder.Register(x => RedisConnectionGateway.Current)
                   .SingleInstance()
                   .AsSelf();

            builder.Register(x => x.Resolve<RedisConnectionGateway>().GetConnection())
                   .ExternallyOwned()
                   .AsSelf();

            builder.Register(x => x.Resolve<RedisConnection>().GetOpenSubscriberChannel())
                   .SingleInstance()
                   .AsSelf();
        }
    }
}

using Autofac;
using BookSleeve;
using Compilify.Web.Services;

namespace Compilify.Web.Infrastructure.DependencyInjection
{
    public class RedisModule : Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            builder.Register(x => RedisConnectionGateway.Current)
                   .SingleInstance()
                   .AsSelf();

            builder.Register(x => x.Resolve<RedisConnectionGateway>().GetConnection())
                   .ExternallyOwned()
                   .AsSelf();

            builder.Register(x => x.Resolve<RedisConnection>().GetOpenSubscriberChannel())
                   .ExternallyOwned()
                   .AsSelf();
        }
    }
}

Change RedisSubscriberConnection externally owned in Autofac registration


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

using System;

namespace Xunit
{
    [Flags]
    public enum TargetFrameworkMonikers
    {
        Net45 = 0x1,
        Net451 = 0x2,
        Net452 = 0x4,
        Net46 = 0x8,
        Net461 = 0x10,
        Net462 = 0x20,
        Net463 = 0x40,
        Netcore50 = 0x80,
        Netcore50aot = 0x100,
        Netcoreapp1_0 = 0x200,
        Netcoreapp1_1 = 0x400,
        NetFramework = 0x800,
        Netcoreapp = 0x1000,
        Uap = 0x2000,
        UapAot = 0x4000,
        NetcoreCoreRT = 0x8000
    }
}

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

using System;

namespace Xunit
{
    [Flags]
    public enum TargetFrameworkMonikers
    {
        Net45 = 0x1,
        Net451 = 0x2,
        Net452 = 0x4,
        Net46 = 0x8,
        Net461 = 0x10,
        Net462 = 0x20,
        Net463 = 0x40,
        Netcore50 = 0x80,
        Netcore50aot = 0x100,
        Netcoreapp1_0 = 0x200,
        Netcoreapp1_1 = 0x400,
        NetFramework = 0x800,
        Netcoreapp = 0x1000,
        Uap = UapAot | 0x2000,
        UapAot = 0x4000,
        NetcoreCoreRT = 0x8000
    }
}

Fix Uap TFM to include Aot

Fix Uap TFM to include Aot


// Copyright (c) Martin Costello, 2015. All rights reserved.
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.

namespace MartinCostello.AdventOfCode.Puzzles
{
    using Xunit;

    /// <summary>
    /// A class containing methods for helping to test puzzles. This class cannot be inherited.
    /// </summary>
    internal static class PuzzleTestHelpers
    {
        /// <summary>
        /// Solves the specified puzzle type.
        /// </summary>
        /// <typeparam name="T">The type of the puzzle to solve.</typeparam>
        /// <returns>
        /// The solved puzzle of the type specified by <typeparamref name="T"/>.
        /// </returns>
        internal static T SolvePuzzle<T>()
            where T : IPuzzle, new()
        {
            return SolvePuzzle<T>(new string[0]);
        }

        /// <summary>
        /// Solves the specified puzzle type with the specified arguments.
        /// </summary>
        /// <typeparam name="T">The type of the puzzle to solve.</typeparam>
        /// <param name="args">The arguments to pass to the puzzle.</param>
        /// <returns>
        /// The solved puzzle of the type specified by <typeparamref name="T"/>.
        /// </returns>
        internal static T SolvePuzzle<T>(string[] args)
            where T : IPuzzle, new()
        {
            // Arrange
            T puzzle = new T();

            // Act
            int result = puzzle.Solve(args);

            // Assert
            Assert.Equal(0, result);

            return puzzle;
        }
    }
}

// Copyright (c) Martin Costello, 2015. All rights reserved.
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.

namespace MartinCostello.AdventOfCode.Puzzles
{
    using Xunit;

    /// <summary>
    /// A class containing methods for helping to test puzzles. This class cannot be inherited.
    /// </summary>
    internal static class PuzzleTestHelpers
    {
        /// <summary>
        /// Solves the specified puzzle type.
        /// </summary>
        /// <typeparam name="T">The type of the puzzle to solve.</typeparam>
        /// <returns>
        /// The solved puzzle of the type specified by <typeparamref name="T"/>.
        /// </returns>
        internal static T SolvePuzzle<T>()
            where T : IPuzzle, new()
        {
            return SolvePuzzle<T>(new string[0]);
        }

        /// <summary>
        /// Solves the specified puzzle type with the specified arguments.
        /// </summary>
        /// <typeparam name="T">The type of the puzzle to solve.</typeparam>
        /// <param name="args">The arguments to pass to the puzzle.</param>
        /// <returns>
        /// The solved puzzle of the type specified by <typeparamref name="T"/>.
        /// </returns>
        internal static T SolvePuzzle<T>(params string[] args)
            where T : IPuzzle, new()
        {
            // Arrange
            T puzzle = new T();

            // Act
            int result = puzzle.Solve(args);

            // Assert
            Assert.Equal(0, result);

            return puzzle;
        }
    }
}

Support params usage as input for tests

Support params usage as input for tests

Change SolvePuzzle<T> to support using params for arguments.


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

public class AIController : MonoBehaviour
{
	public UnityEngine.AI.NavMeshAgent agent { get; private set; }             // the navmesh agent required for the path finding
	public Transform target;                                    // target to aim for
	public Transform head;

	private void Start()
	{
		// get the components on the object we need ( should not be null due to require component so no need to check )
		agent = GetComponentInChildren<UnityEngine.AI.NavMeshAgent>();
		agent.updateRotation = false;
		agent.updatePosition = true;
	}

	private void Update()
	{
		if (target != null)
		{
			agent.SetDestination(target.position);
		}

		head.LookAt(target);
	}

	public void SetTarget(Transform target)
	{
		this.target = target;
	}
}

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

public class AIController : MonoBehaviour
{
	public UnityEngine.AI.NavMeshAgent agent { get; private set; }             // the navmesh agent required for the path finding
	public Transform target;                                    // target to aim for
	public Transform head;

	private void Start()
	{
		// get the components on the object we need ( should not be null due to require component so no need to check )

		//testing
		agent = GetComponentInChildren<UnityEngine.AI.NavMeshAgent>();
		agent.updateRotation = false;
		agent.updatePosition = true;
	}

	private void Update()
	{
		if (target != null)
		{
			agent.SetDestination(target.position);
		}

		head.LookAt(target);
	}

	public void SetTarget(Transform target)
	{
		this.target = target;
	}
}

Test Commit for Slack Integration

Test Commit for Slack Integration