using System.Collections.Generic;

namespace PublicApiGenerator
{
    internal static class CSharpOperatorKeyword
    {
        static readonly IDictionary<string, string> OperatorNameMap = new Dictionary<string, string>
        {
            { "op_Addition", "+" },
            { "op_UnaryPlus", "+" },
            { "op_Subtraction", "-" },
            { "op_UnaryNegation", "-" },
            { "op_Multiply", "*" },
            { "op_Division", "/" },
            { "op_Modulus", "%" },
            { "op_Increment", "++" },
            { "op_Decrement", "--" },
            { "op_OnesComplement", "~" },
            { "op_LogicalNot", "!" },
            { "op_BitwiseAnd", "&" },
            { "op_BitwiseOr", "|" },
            { "op_ExclusiveOr", "^" },
            { "op_LeftShift", "<<" },
            { "op_RightShift", ">>" },
            { "op_Equality", "==" },
            { "op_Inequality", "!=" },
            { "op_GreaterThan", ">" },
            { "op_GreaterThanOrEqual", ">=" },
            { "op_LessThan", "<" },
            { "op_LessThanOrEqual", "<=" }
        };

        public static string Get(string memberName)
        {
            return OperatorNameMap.TryGetValue(memberName, out string mappedMemberName) ? mappedMemberName : memberName;
        }
    }
}

using System.Collections.Generic;

namespace PublicApiGenerator
{
    internal static class CSharpOperatorKeyword
    {
        static readonly IDictionary<string, string> OperatorNameMap = new Dictionary<string, string>
        {
            { "op_False", "false" },
            { "op_True", "true" },
            { "op_Addition", "+" },
            { "op_UnaryPlus", "+" },
            { "op_Subtraction", "-" },
            { "op_UnaryNegation", "-" },
            { "op_Multiply", "*" },
            { "op_Division", "/" },
            { "op_Modulus", "%" },
            { "op_Increment", "++" },
            { "op_Decrement", "--" },
            { "op_OnesComplement", "~" },
            { "op_LogicalNot", "!" },
            { "op_BitwiseAnd", "&" },
            { "op_BitwiseOr", "|" },
            { "op_ExclusiveOr", "^" },
            { "op_LeftShift", "<<" },
            { "op_RightShift", ">>" },
            { "op_Equality", "==" },
            { "op_Inequality", "!=" },
            { "op_GreaterThan", ">" },
            { "op_GreaterThanOrEqual", ">=" },
            { "op_LessThan", "<" },
            { "op_LessThanOrEqual", "<=" }
        };

        public static string Get(string memberName)
        {
            return OperatorNameMap.TryGetValue(memberName, out string mappedMemberName) ? "operator " + mappedMemberName : memberName;
        }
    }
}

Fix output for overloaded operators

Fix output for overloaded operators


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

namespace IPOCS_Programmer.ObjectTypes
{
    public class PointsMotor_Pulse : PointsMotor
    {
        public override byte motorTypeId { get { return 1; } }
        public byte ThrowLeftOutput { get; set; }
        public byte ThrowRightOutput { get; set; }
        public byte positionPin { get; set; }
        public bool reverseStatus { get; set; }
        public bool lowToThrow { get; set; }

        public override List<byte> Serialize()
        {
            var vector = new List<byte>();
            vector.Add(motorTypeId);
            vector.Add(this.ThrowLeftOutput);
            vector.Add(this.ThrowRightOutput);
            vector.Add(positionPin);
            vector.Add((byte)(reverseStatus ? 1 : 0));
            vector.Add((byte)(lowToThrow ? 1 : 0));
            return vector;
        }
    }
}

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

namespace IPOCS_Programmer.ObjectTypes
{
    public class PointsMotor_Pulse : PointsMotor
    {
        public override byte motorTypeId { get { return 1; } }
        public byte ThrowLeftOutput { get; set; }
        public byte ThrowRightOutput { get; set; }
        public byte positionPin { get; set; }
        public bool reverseStatus { get; set; }
        public bool lowToThrow { get; set; }
        public byte timeToPulse { get; set; }

        public override List<byte> Serialize()
        {
            var vector = new List<byte>();
            vector.Add(motorTypeId);
            vector.Add(this.ThrowLeftOutput);
            vector.Add(this.ThrowRightOutput);
            vector.Add(positionPin);
            vector.Add((byte)(reverseStatus ? 1 : 0));
            vector.Add((byte)(lowToThrow ? 1 : 0));
            vector.Add(this.timeToPulse);
            return vector;
        }
    }
}

Make it possible to configure time to pulse

Resolves #9


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.Graphics;
using Repository.EditorServices.SyntaxHighlighting;

namespace Repository.Internal.EditorServices.SyntaxHighlighting
{
    internal class MonokaiColorTheme : IColorTheme
    {
        public Color BackgroundColor => Color.Black;

        public Color GetForegroundColor(SyntaxKind kind)
        {
            // TODO: Based off VSCode's Monokai theme
            switch (kind)
            {
                case SyntaxKind.Annotation: return Color.SkyBlue;
                case SyntaxKind.BooleanLiteral: return Color.Purple;
                case SyntaxKind.Comment: return Color.Gray;
                case SyntaxKind.ConstructorDeclaration: return Color.LightGreen;
                case SyntaxKind.Eof: return default(Color);
                case SyntaxKind.Identifier: return Color.White;
                case SyntaxKind.Keyword: return Color.HotPink;
                case SyntaxKind.MethodDeclaration: return Color.LightGreen;
                case SyntaxKind.MethodIdentifier: return Color.LightGreen;
                case SyntaxKind.NullLiteral: return Color.Purple;
                case SyntaxKind.NumericLiteral: return Color.Purple;
                case SyntaxKind.ParameterDeclaration: return Color.Orange;
                case SyntaxKind.Parenthesis: return Color.White;
                case SyntaxKind.StringLiteral: return Color.Beige;
                case SyntaxKind.TypeDeclaration: return Color.LightGreen;
                case SyntaxKind.TypeIdentifier: return Color.LightGreen;
                default: throw new NotSupportedException();
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.Graphics;
using Repository.EditorServices.SyntaxHighlighting;

namespace Repository.Internal.EditorServices.SyntaxHighlighting
{
    internal class MonokaiColorTheme : IColorTheme
    {
        public Color BackgroundColor => Color.Black;

        public Color GetForegroundColor(SyntaxKind kind)
        {
            // TODO: Based off VSCode's Monokai theme
            switch (kind)
            {
                case SyntaxKind.Annotation: return Color.SkyBlue;
                case SyntaxKind.BooleanLiteral: return Color.MediumPurple;
                case SyntaxKind.Comment: return Color.Gray;
                case SyntaxKind.ConstructorDeclaration: return Color.LightGreen;
                case SyntaxKind.Eof: return default(Color);
                case SyntaxKind.Identifier: return Color.White;
                case SyntaxKind.Keyword: return Color.HotPink;
                case SyntaxKind.MethodDeclaration: return Color.LightGreen;
                case SyntaxKind.MethodIdentifier: return Color.LightGreen;
                case SyntaxKind.NullLiteral: return Color.MediumPurple;
                case SyntaxKind.NumericLiteral: return Color.MediumPurple;
                case SyntaxKind.ParameterDeclaration: return Color.Orange;
                case SyntaxKind.Parenthesis: return Color.White;
                case SyntaxKind.StringLiteral: return Color.SandyBrown;
                case SyntaxKind.TypeDeclaration: return Color.LightGreen;
                case SyntaxKind.TypeIdentifier: return Color.SkyBlue;
                default: throw new NotSupportedException();
            }
        }
    }
}

Tweak the Monokai color theme

[SyntaxHighlighting] Tweak the Monokai color theme


using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Mapsui.Geometries;
using Mapsui.Layers;
using Mapsui.Providers;
using NUnit.Framework;

namespace Mapsui.Tests.Fetcher
{
    [TestFixture]
    public class FeatureFetcherTests
    {
        [Test]
        public void TestFeatureFetcherDelay()
        {
            // arrange
            var extent = new BoundingBox(0, 0, 10, 10);
            var layer = new Layer
            {
                DataSource = new MemoryProvider(GenerateRandomPoints(extent, 25)),
                FetchingPostponedInMilliseconds = 0
            };

            // act
            layer.RefreshData(extent, 1, true);
            var notifications = new List<bool>();

            layer.PropertyChanged += (sender, args) =>
            {
                if (args.PropertyName == nameof(Layer.Busy))
                {
                    notifications.Add(layer.Busy);
                }
            };

            // assert
            Task.Run(() =>
            {
                while (notifications.Count < 2)
                {
                    // just wait until we have two
                }
            }).GetAwaiter().GetResult();
            Assert.IsTrue(notifications[0]);
            Assert.IsFalse(notifications[1]);
        }

        private static IEnumerable<IGeometry> GenerateRandomPoints(BoundingBox envelope, int count)
        {
            var random = new Random();
            var result = new List<IGeometry>();

            for (var i = 0; i < count; i++)
            {
                result.Add(new Point(
                    random.NextDouble() * envelope.Width + envelope.Left,
                    random.NextDouble() * envelope.Height + envelope.Bottom));
            }

            return result;
        }
    }
}

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Mapsui.Geometries;
using Mapsui.Layers;
using Mapsui.Providers;
using NUnit.Framework;

namespace Mapsui.Tests.Fetcher
{
    [TestFixture]
    public class FeatureFetcherTests
    {
        [Test]
        public void TestFeatureFetcherDelay()
        {
            // arrange
            var extent = new BoundingBox(0, 0, 10, 10);
            var layer = new Layer
            {
                DataSource = new MemoryProvider(GenerateRandomPoints(extent, 25)),
                FetchingPostponedInMilliseconds = 0
            };

            var notifications = new List<bool>();
            layer.PropertyChanged += (sender, args) =>
            {
                if (args.PropertyName == nameof(Layer.Busy))
                {
                    notifications.Add(layer.Busy);
                }
            };

            // act
            layer.RefreshData(extent, 1, true);

            // assert
            Task.Run(() =>
            {
                while (notifications.Count < 2)
                {
                    // just wait until we have two
                }
            }).GetAwaiter().GetResult();
            Assert.IsTrue(notifications[0]);
            Assert.IsFalse(notifications[1]);
        }

        private static IEnumerable<IGeometry> GenerateRandomPoints(BoundingBox envelope, int count)
        {
            var random = new Random();
            var result = new List<IGeometry>();

            for (var i = 0; i < count; i++)
            {
                result.Add(new Point(
                    random.NextDouble() * envelope.Width + envelope.Left,
                    random.NextDouble() * envelope.Height + envelope.Bottom));
            }

            return result;
        }
    }
}

Fix a unit test for new Delayer logic (immediate if possible)


// Copyright (c) 2016 SIL International
// This software is licensed under the MIT license (http://opensource.org/licenses/MIT)
using System;

namespace LfMerge.LanguageForge.Model
{
	public class LfOptionListItem
	{
		public Guid? Guid { get; set; }
		public string Key { get; set; }
		public string Value { get; set; }
		public string Abbreviation { get; set; }
	}
}

// Copyright (c) 2016 SIL International
// This software is licensed under the MIT license (http://opensource.org/licenses/MIT)
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson;
using System;

namespace LfMerge.LanguageForge.Model
{
	public class LfOptionListItem
	{
		[BsonRepresentation(BsonType.String)]
		public Guid? Guid { get; set; }
		public string Key { get; set; }
		public string Value { get; set; }
		public string Abbreviation { get; set; }
	}
}

Fix binary GUIDs showing up in Mongo optionlists


using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterface;
using osu.Game.Tournament.IO;

namespace osu.Game.Tournament.Screens.Setup
{
    internal class TournamentSwitcher : ActionableInfo
    {
        private OsuDropdown<string> dropdown;

        private string startupTournament;

        [Resolved]
        private TournamentGameBase game { get; set; }

        [BackgroundDependencyLoader]
        private void load(TournamentStorage storage)
        {
            startupTournament = storage.CurrentTournament.Value;

            dropdown.Current = storage.CurrentTournament;
            dropdown.Items = storage.ListTournaments();
            dropdown.Current.BindValueChanged(v => Button.Enabled.Value = v.NewValue != startupTournament, true);

            Action = () => game.GracefullyExit();

            ButtonText = "Close osu!";
        }

        protected override Drawable CreateComponent()
        {
            var drawable = base.CreateComponent();

            FlowContainer.Insert(-1, dropdown = new OsuDropdown<string>
            {
                Width = 510
            });

            return drawable;
        }
    }
}

using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterface;
using osu.Game.Tournament.IO;

namespace osu.Game.Tournament.Screens.Setup
{
    internal class TournamentSwitcher : ActionableInfo
    {
        private OsuDropdown<string> dropdown;

        [Resolved]
        private TournamentGameBase game { get; set; }

        [BackgroundDependencyLoader]
        private void load(TournamentStorage storage)
        {
            string startupTournament = storage.CurrentTournament.Value;

            dropdown.Current = storage.CurrentTournament;
            dropdown.Items = storage.ListTournaments();
            dropdown.Current.BindValueChanged(v => Button.Enabled.Value = v.NewValue != startupTournament, true);

            Action = () => game.GracefullyExit();

            ButtonText = "Close osu!";
        }

        protected override Drawable CreateComponent()
        {
            var drawable = base.CreateComponent();

            FlowContainer.Insert(-1, dropdown = new OsuDropdown<string>
            {
                Width = 510
            });

            return drawable;
        }
    }
}

Change field to local variable

Change field to local variable


// 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.Framework.Graphics.Shapes;
using osuTK.Graphics;

namespace osu.Game.Overlays.OSD
{
    public class Toast : Container
    {
        private readonly Container content;
        protected override Container<Drawable> Content => content;

        public Toast()
        {
            Anchor = Anchor.Centre;
            Origin = Anchor.Centre;
            Width = 240;
            RelativeSizeAxes = Axes.Y;

            InternalChildren = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour = Color4.Black,
                    Alpha = 0.7f
                },
                content = new Container
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                    RelativeSizeAxes = Axes.Both,
                }
            };
        }
    }
}

// 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.Framework.Graphics.Shapes;
using osuTK.Graphics;

namespace osu.Game.Overlays.OSD
{
    public class Toast : Container
    {
        private readonly Container content;
        protected override Container<Drawable> Content => content;

        public Toast()
        {
            Anchor = Anchor.Centre;
            Origin = Anchor.Centre;
            Width = 240;

            // A toast's height is decided (and transformed) by the containing OnScreenDisplay.
            RelativeSizeAxes = Axes.Y;

            InternalChildren = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour = Color4.Black,
                    Alpha = 0.7f
                },
                content = new Container
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                    RelativeSizeAxes = Axes.Both,
                }
            };
        }
    }
}

Add note about toast height

Add note about toast height


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

namespace PPWCode.Vernacular.Wcf.I.Config
{
    public static class WcfConstants
    {
        /// <summary>
        ///     Duplicates Castle.Facilities.WcfIntegration.WcfConstants.ExtensionScopeKey because it is internal defined.
        /// </summary>
        public const string ExtensionScopeKey = "scope";
    }
}

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

namespace PPWCode.Vernacular.Wcf.I.Config
{
    public static class WcfConstants
    {
        /// <summary>
        ///     Duplicates the <see cref="ExtensionScopeKey" /> property on
        ///     <see cref="Castle.Facilities.WcfIntegration.WcfConstants" /> because it is internal defined.
        /// </summary>
        public const string ExtensionScopeKey = "scope";
    }
}

Use references in the documentation (this also removes the spelling warning).


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

using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.Sprites;

namespace osu.Game.Tournament.Screens.Ladder.Components
{
    public class DrawableTournamentGrouping : CompositeDrawable
    {
        public DrawableTournamentGrouping(TournamentGrouping grouping, bool losers = false)
        {
            AutoSizeAxes = Axes.Both;
            InternalChild = new FillFlowContainer
            {
                Direction = FillDirection.Vertical,
                AutoSizeAxes = Axes.Both,
                Children = new Drawable[]
                {
                    new OsuSpriteText
                    {
                        Text = grouping.Description.Value.ToUpper(),
                        Origin = Anchor.TopCentre,
                        Anchor = Anchor.TopCentre
                    },
                    new OsuSpriteText
                    {
                        Text = ((losers ? "Losers " : "") + grouping.Name).ToUpper(),
                        Font = "Exo2.0-Bold",
                        Origin = Anchor.TopCentre,
                        Anchor = Anchor.TopCentre
                    },
                }
            };
        }
    }
}

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

using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using OpenTK.Graphics;

namespace osu.Game.Tournament.Screens.Ladder.Components
{
    public class DrawableTournamentGrouping : CompositeDrawable
    {
        public DrawableTournamentGrouping(TournamentGrouping grouping, bool losers = false)
        {
            AutoSizeAxes = Axes.Both;
            InternalChild = new FillFlowContainer
            {
                Direction = FillDirection.Vertical,
                AutoSizeAxes = Axes.Both,
                Children = new Drawable[]
                {
                    new OsuSpriteText
                    {
                        Text = grouping.Description.Value.ToUpper(),
                        Colour = Color4.Black,
                        Origin = Anchor.TopCentre,
                        Anchor = Anchor.TopCentre
                    },
                    new OsuSpriteText
                    {
                        Text = ((losers ? "Losers " : "") + grouping.Name).ToUpper(),
                        Font = "Exo2.0-Bold",
                        Colour = Color4.Black,
                        Origin = Anchor.TopCentre,
                        Anchor = Anchor.TopCentre
                    },
                }
            };
        }
    }
}

Change grouping title colours to match white background


    @if (!User.Identity.IsAuthenticated)
    {
        string returnUrl = ViewData.ContainsKey(Constants.ReturnUrlViewDataKey) ? (string)ViewData[Constants.ReturnUrlViewDataKey] : Request.RawUrl;

            Register / Sign in

    }
    else
    {
        @(User.Identity.Name)
        <text>/</text>

            Sign out

    }

Fix link to account page while in admin area


using Stylet;
using SyncTrayzor.Localization;
using SyncTrayzor.SyncThing;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace SyncTrayzor.Utils
{
    public static class SafeSyncthingExtensions
    {
        public static async Task StartWithErrorDialogAsync(this ISyncThingManager syncThingManager, IWindowManager windowManager)
        {
            try
            {
                await syncThingManager.StartAsync();
            }
            catch (Win32Exception e)
            {
                if (e.ErrorCode != -2147467259)
                    throw;

                // Possibly "This program is blocked by group policy. For more information, contact your system administrator" caused
                // by e.g. CryptoLocker?
                windowManager.ShowMessageBox(
                    Localizer.Translate("Dialog_SyncthingBlockedByGroupPolicy_Message", e.Message, syncThingManager.ExecutablePath),
                    Localizer.Translate("Dialog_SyncthingBlockedByGroupPolicy_Title"),
                    MessageBoxButton.OK, icon: MessageBoxImage.Error);
            }
            catch (SyncThingDidNotStartCorrectlyException)
            {
                // Haven't translated yet - still debugging
                windowManager.ShowMessageBox(
                    "Syncthing didn't start correctly",
                    "Syncthing started running, but we were enable to connect to it. Please report this as a bug",
                    MessageBoxButton.OK, icon: MessageBoxImage.Error);
            }
        }
    }
}

using Stylet;
using SyncTrayzor.Localization;
using SyncTrayzor.SyncThing;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace SyncTrayzor.Utils
{
    public static class SafeSyncthingExtensions
    {
        public static async Task StartWithErrorDialogAsync(this ISyncThingManager syncThingManager, IWindowManager windowManager)
        {
            try
            {
                await syncThingManager.StartAsync();
            }
            catch (Win32Exception e)
            {
                if (e.ErrorCode != -2147467259)
                    throw;

                // Possibly "This program is blocked by group policy. For more information, contact your system administrator" caused
                // by e.g. CryptoLocker?
                windowManager.ShowMessageBox(
                    Localizer.Translate("Dialog_SyncthingBlockedByGroupPolicy_Message", e.Message, syncThingManager.ExecutablePath),
                    Localizer.Translate("Dialog_SyncthingBlockedByGroupPolicy_Title"),
                    MessageBoxButton.OK, icon: MessageBoxImage.Error);
            }
            catch (SyncThingDidNotStartCorrectlyException)
            {
                // Haven't translated yet - still debugging
                windowManager.ShowMessageBox(
                    "Syncthing started running, but we were enable to connect to it. Please report this as a bug",
                    "Syncthing didn't start correctly",
                    MessageBoxButton.OK, icon: MessageBoxImage.Error);
            }
        }
    }
}

Fix order of title/message in dialog

Fix order of title/message in dialog


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SlimDX.Direct3D11;

using VVVV.PluginInterfaces.V1;

using FeralTic.DX11;
using FeralTic.DX11.Resources;

namespace VVVV.DX11
{

    [Obsolete("This does access IPluginIO, which fails in case of multi core access, this will be removed in next release, use RenderTaskDelegate instead")]
    public delegate void RenderDelegate<T>(IPluginIO pin, DX11RenderContext context, T settings);

    public delegate void RenderTaskDelegate<T>(IPluginIO pin, DX11RenderContext context, T settings);

    public class DX11BaseLayer<T> : IDX11Resource
    {
        public RenderDelegate<T> Render;

        public bool PostUpdate
        {
            get { return true; }
        }

        public void Dispose()
        {

        }
    }

    /// <summary>
    /// DX11 Layer provide simple interface to tell which pin they need
    /// </summary>
    public class DX11Layer : DX11BaseLayer<DX11RenderSettings>
    {
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SlimDX.Direct3D11;

using VVVV.PluginInterfaces.V1;

using FeralTic.DX11;
using FeralTic.DX11.Resources;

namespace VVVV.DX11
{

    [Obsolete("This does access IPluginIO, which fails in case of multi core access, this will be removed in next release, use RenderTaskDelegate instead")]
    public delegate void RenderDelegate<T>(IPluginIO pin, DX11RenderContext context, T settings);

    public delegate void RenderTaskDelegate<T>(IPluginIO pin, DX11RenderContext context, T settings);

    public class DX11BaseLayer<T> : IDX11Resource
    {
        public RenderDelegate<T> Render;

        public bool PostUpdate
        {
            get { return true; }
        }

        public void Dispose()
        {

        }
    }

    /// <summary>
    /// DX11 Layer provide simple interface to tell which pin they need
    /// </summary>
    public class DX11Layer : DX11BaseLayer<DX11RenderSettings>
    {
    }

    public class DX11Shader: IDX11Resource
    {
        public DX11ShaderInstance Shader
        {
            get;
            private set;
        }

        public DX11Shader(DX11ShaderInstance instance)
        {
            this.Shader = instance;
        }

        public void Dispose()
        {
            //Owned, do nothing
        }
    }

    public class DX11Layout : IDX11Resource
    {
        public InputLayout Layout
        {
            get;
            private set;
        }

        public DX11Layout(InputLayout layout)
        {
            this.Layout = layout;
        }

        public void Dispose()
        {
            if (this.Layout != null)
            {
                this.Layout.Dispose();
                this.Layout = null;
            }

        }
    }
}

[Core] Add DX11Layout and DX11Shader as dx resources


using AVFoundation;
using Plugin.MediaManager.Abstractions;
using UIKit;

namespace Plugin.MediaManager.iOS
{
    public class VideoSurface : UIView, IVideoSurface
    {

		public override void LayoutSubviews()
		{
			foreach (var layer in Layer.Sublayers)
			{
				var avPlayerLayer = layer as AVPlayerLayer;
				if (avPlayerLayer != null)
					avPlayerLayer.Frame = Bounds;
			}
			base.LayoutSubviews();
		}

    }
}

using System;
using AVFoundation;
using CoreGraphics;
using Foundation;
using Plugin.MediaManager.Abstractions;
using UIKit;

namespace Plugin.MediaManager.iOS
{
    public class VideoSurface : UIView, IVideoSurface
    {

		public override void LayoutSubviews()
		{
			base.LayoutSubviews();
			if (Layer.Sublayers == null || Layer.Sublayers.Length == 0)
				return;
			foreach (var layer in Layer.Sublayers)
			{
				var avPlayerLayer = layer as AVPlayerLayer;
				if (avPlayerLayer != null)
					avPlayerLayer.Frame = Bounds;
			}
		}
    }
}

Add sanity checking for AVPlayerLayer

Add sanity checking for AVPlayerLayer


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

namespace Tera.Game.Messages
{
    public class LoginServerMessage : ParsedMessage
    {
        public EntityId Id { get; private set; }
        public uint PlayerId { get; private set; }
        public string Name { get; private set; }
        public string GuildName { get; private set; }
        public PlayerClass Class { get { return RaceGenderClass.Class; } }
        public RaceGenderClass RaceGenderClass { get; private set; }

        internal LoginServerMessage(TeraMessageReader reader)
            : base(reader)
        {
            reader.Skip(10);
            RaceGenderClass = new RaceGenderClass(reader.ReadInt32());
            Id = reader.ReadEntityId();
            reader.Skip(4);
            PlayerId = reader.ReadUInt32();
            reader.Skip(260);
            Name = reader.ReadTeraString();
        }
    }
}

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

namespace Tera.Game.Messages
{
    public class LoginServerMessage : ParsedMessage
    {
        public EntityId Id { get; private set; }
        public uint PlayerId { get; private set; }
        public string Name { get; private set; }
        public string GuildName { get; private set; }
        public PlayerClass Class { get { return RaceGenderClass.Class; } }
        public RaceGenderClass RaceGenderClass { get; private set; }

        internal LoginServerMessage(TeraMessageReader reader)
            : base(reader)
        {
            reader.Skip(10);
            RaceGenderClass = new RaceGenderClass(reader.ReadInt32());
            Id = reader.ReadEntityId();
            reader.Skip(4);
            PlayerId = reader.ReadUInt32();

            //reader.Skip(260);
            //This network message doesn't have a fixed size between different region

            reader.Skip(220);

            var nameFirstBit = false;
            while (true)
            {
                var b = reader.ReadByte();
                if (b == 0x80)
                {
                    nameFirstBit = true;
                    continue;
                }
                if (b == 0x3F && nameFirstBit)
                {
                    break;
                }
                nameFirstBit = false;
            }

            reader.Skip(9);
            Name = reader.ReadTeraString();
        }
    }
}

Fix user name detection for some regions

https://github.com/neowutran/ShinraMeter/issues/33


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

using System;
using osu.Framework.Graphics.Containers;
using osu.Framework.Input;
using osu.Framework.Input.Bindings;
using osu.Game.Input.Bindings;

namespace osu.Game.Overlays.Volume
{
    public class VolumeControlReceptor : Container, IScrollBindingHandler<GlobalAction>, IHandleGlobalKeyboardInput
    {
        public Func<GlobalAction, bool> ActionRequested;
        public Func<GlobalAction, float, bool, bool> ScrollActionRequested;

        public bool OnPressed(GlobalAction action)
        {
            // if nothing else handles selection actions in the game, it's safe to let volume be adjusted.
            switch (action)
            {
                case GlobalAction.SelectPrevious:
                    action = GlobalAction.IncreaseVolume;
                    break;

                case GlobalAction.SelectNext:
                    action = GlobalAction.DecreaseVolume;
                    break;
            }

            return ActionRequested?.Invoke(action) ?? false;
        }

        public bool OnScroll(GlobalAction action, float amount, bool isPrecise) =>
            ScrollActionRequested?.Invoke(action, amount, isPrecise) ?? false;

        public void OnReleased(GlobalAction action)
        {
        }
    }
}

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

using System;
using osu.Framework.Graphics.Containers;
using osu.Framework.Input;
using osu.Framework.Input.Bindings;
using osu.Game.Input.Bindings;

namespace osu.Game.Overlays.Volume
{
    public class VolumeControlReceptor : Container, IScrollBindingHandler<GlobalAction>, IHandleGlobalKeyboardInput
    {
        public Func<GlobalAction, bool> ActionRequested;
        public Func<GlobalAction, float, bool, bool> ScrollActionRequested;

        public bool OnPressed(GlobalAction action) =>
            ActionRequested?.Invoke(action) ?? false;

        public bool OnScroll(GlobalAction action, float amount, bool isPrecise) =>
            ScrollActionRequested?.Invoke(action, amount, isPrecise) ?? false;

        public void OnReleased(GlobalAction action)
        {
        }
    }
}

Disable adjusting volume via "select next" and "select previous" as fallbacks


using System.DoubleNumerics;

namespace SolidworksAddinFramework.Geometry
{
    public static class Matrix4x4Extensions
    {
        public static Matrix4x4 CreateFromAxisAngleOrigin(PointDirection3 p, double angle)
        {
            return
                Matrix4x4.CreateTranslation(-p.Point)
                *Matrix4x4.CreateFromAxisAngle(p.Direction.Unit(), angle)
                *Matrix4x4.CreateTranslation(p.Point);
        }
        public static Matrix4x4 CreateFromEdgeAngleOrigin(Edge3 p, double angle)
        {
            return CreateFromAxisAngleOrigin(new PointDirection3(p.A,p.Delta),angle);
        }
    }
}

using System.DoubleNumerics;
using System.Text;

namespace SolidworksAddinFramework.Geometry
{
    public static class Matrix4x4Extensions
    {
        public static Matrix4x4 CreateFromAxisAngleOrigin(PointDirection3 p, double angle)
        {
            return
                Matrix4x4.CreateTranslation(-p.Point)
                *Matrix4x4.CreateFromAxisAngle(p.Direction.Unit(), angle)
                *Matrix4x4.CreateTranslation(p.Point);
        }
        public static Matrix4x4 CreateFromEdgeAngleOrigin(Edge3 p, double angle)
        {
            return CreateFromAxisAngleOrigin(new PointDirection3(p.A,p.Delta),angle);
        }

        public static Matrix4x4 ExtractRotationPart(this Matrix4x4 m)
        {
            Vector3 dScale;
            Quaternion dRotation;
            Vector3 dTranslation;
            Matrix4x4.Decompose(m, out dScale, out dRotation, out dTranslation);
            return Matrix4x4.CreateFromQuaternion(dRotation);

        }

    }
}

Add method to extract rotation part of matrix


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

namespace Giles.Core.Configuration
{
    public class Filter
    {
        public Filter() { }

        public Filter(string convertToFilter)
        {
            foreach (var entry in FilterLookUp.Where(entry => convertToFilter.Contains(entry.Key)))
            {
                Type = entry.Value;
                Name = convertToFilter.Replace(entry.Key, string.Empty);

                break;
            }
        }

        public string Name { get; set; }
        public FilterType Type { get; set; }

        public static readonly IDictionary<string, FilterType> FilterLookUp = new Dictionary<string, FilterType>
                                                                           {
                                                                               {"-i", FilterType.Inclusive},
                                                                               {"-e", FilterType.Exclusive}
                                                                           };
    }

    public enum FilterType
    {
        Inclusive,
        Exclusive
    }

}

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

namespace Giles.Core.Configuration
{
    public class Filter
    {
        public Filter() { }

        public Filter(string convertToFilter)
        {
            foreach (var entry in FilterLookUp.Where(entry => convertToFilter.Contains(entry.Key)))
            {
                Type = entry.Value;
                Name = convertToFilter.Replace(entry.Key, string.Empty);

                break;
            }

            if (!string.IsNullOrWhiteSpace(Name)) return;

            Name = convertToFilter;
            Type = FilterType.Inclusive;
        }

        public string Name { get; set; }
        public FilterType Type { get; set; }

        public static readonly IDictionary<string, FilterType> FilterLookUp = new Dictionary<string, FilterType>
                                                                           {
                                                                               {"-i", FilterType.Inclusive},
                                                                               {"-e", FilterType.Exclusive}
                                                                           };
    }

    public enum FilterType
    {
        Inclusive,
        Exclusive
    }

}

Create filter when -* is not included

Create filter when -* is not included


using System.ComponentModel;

namespace JoinRpg.Web.Models.Schedules
{
    public enum ScheduleConfigProblemsViewModel
    {
        //TODO поменять сообщение, когда сделаем настроечный экран
        [Description("Расписание не настроено для этого проекта, обратитесь в техподдержку")]
        FieldsNotSet,
        [Description("У полей, привязанных к расписанию, разная видимость. Измените настройки видимости полей (публичные/игрокам/мастерам) на одинаковые")]
        InconsistentVisibility,
        [Description("У вас нет доступа к расписанию данного проекта")]
        NoAccess,

        [Description("Не настроено ни одного помещения")]
        NoRooms,
        [Description("Не настроено ни одного тайм-слота")]
        NoTimeSlots,
    }
}

using System.ComponentModel;

namespace JoinRpg.Web.Models.Schedules
{
    public enum ScheduleConfigProblemsViewModel
    {
        [Description("Расписание не настроено для этого проекта. Вам необходимо добавить поля для помещения и расписания.")]
        FieldsNotSet,
        [Description("У полей, привязанных к расписанию, разная видимость. Измените настройки видимости полей (публичные/игрокам/мастерам) на одинаковые.")]
        InconsistentVisibility,
        [Description("У вас нет доступа к расписанию данного проекта")]
        NoAccess,

        [Description("Не настроено ни одного помещения")]
        NoRooms,
        [Description("Не настроено ни одного тайм-слота")]
        NoTimeSlots,
    }
}

Fix message on project schedule not configured


// 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.Net.Http;
using osu.Framework.IO.Network;
using osu.Game.Online.API.Requests.Responses;

namespace osu.Game.Online.API.Requests
{
    public class CommentDeleteRequest : APIRequest<CommentBundle>
    {
        private readonly long id;

        public CommentDeleteRequest(long id)
        {
            this.id = id;
        }

        protected override WebRequest CreateWebRequest()
        {
            var req = base.CreateWebRequest();
            req.Method = HttpMethod.Delete;
            return req;
        }

        protected override string Target => $@"comments/{id}";
    }
}

// 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.Net.Http;
using osu.Framework.IO.Network;
using osu.Game.Online.API.Requests.Responses;

namespace osu.Game.Online.API.Requests
{
    public class CommentDeleteRequest : APIRequest<CommentBundle>
    {
        public readonly long ID;

        public CommentDeleteRequest(long id)
        {
            this.ID = id;
        }

        protected override WebRequest CreateWebRequest()
        {
            var req = base.CreateWebRequest();
            req.Method = HttpMethod.Delete;
            return req;
        }

        protected override string Target => $@"comments/{ID}";
    }
}

Make comment ID public for test

Make comment ID public for test


using System;
using AutomaticTypeMapper;
using EOLib.Domain.Chat;
using EOLib.Domain.Login;
using EOLib.Net;

namespace EOLib.PacketHandlers.Chat
{
    [AutoMappedType]
    public class PrivateMessageHandler : PlayerChatByNameBase
    {
        private readonly IChatRepository _chatRepository;

        public override PacketAction Action => PacketAction.Tell;

        public PrivateMessageHandler(IPlayerInfoProvider playerInfoProvider,
                                     IChatRepository chatRepository)
            : base(playerInfoProvider)
        {
            _chatRepository = chatRepository;
        }

        protected override void PostChat(string name, string message)
        {
            var localData = new ChatData(name, message, ChatIcon.Note, ChatColor.PM);
            var pmData = new ChatData(name, message, ChatIcon.Note);

            var whichPMTab = _chatRepository.PMTarget1.Equals(name, StringComparison.InvariantCultureIgnoreCase)
                ? ChatTab.Private1
                : _chatRepository.PMTarget2.Equals(name, StringComparison.InvariantCultureIgnoreCase)
                    ? ChatTab.Private2
                    : ChatTab.Local;

            _chatRepository.AllChat[ChatTab.Local].Add(localData);
            if (whichPMTab != ChatTab.Local)
                _chatRepository.AllChat[whichPMTab].Add(pmData);
        }
    }
}

using System;
using AutomaticTypeMapper;
using EOLib.Domain.Chat;
using EOLib.Domain.Login;
using EOLib.Net;

namespace EOLib.PacketHandlers.Chat
{
    [AutoMappedType]
    public class PrivateMessageHandler : PlayerChatByNameBase
    {
        private readonly IChatRepository _chatRepository;

        public override PacketAction Action => PacketAction.Tell;

        public PrivateMessageHandler(IPlayerInfoProvider playerInfoProvider,
                                     IChatRepository chatRepository)
            : base(playerInfoProvider)
        {
            _chatRepository = chatRepository;
        }

        protected override void PostChat(string name, string message)
        {
            var localData = new ChatData(name, message, ChatIcon.Note, ChatColor.PM);
            var pmData = new ChatData(name, message, ChatIcon.Note);

            ChatTab whichPmTab;

            if (_chatRepository.PMTarget1 == null && _chatRepository.PMTarget2 == null)
                whichPmTab = ChatTab.Local;
            else
                whichPmTab = _chatRepository.PMTarget1.Equals(name, StringComparison.InvariantCultureIgnoreCase)
                    ? ChatTab.Private1
                    : _chatRepository.PMTarget2.Equals(name, StringComparison.InvariantCultureIgnoreCase)
                        ? ChatTab.Private2
                        : ChatTab.Local;

            _chatRepository.AllChat[ChatTab.Local].Add(localData);
            if (whichPmTab != ChatTab.Local)
                _chatRepository.AllChat[whichPmTab].Add(pmData);
        }
    }
}

Fix bug in PMs where incoming PM would cause a crash


using System;
using compiler.frontend;

namespace Program
{
    class Program
    {
        //TODO: adjust main to use the parser when it is complete
        static void Main(string[] args)
        {
//            using (Lexer l = new Lexer(@"../../testdata/big.txt"))
//            {
//                Token t;
//                do
//                {
//                    t = l.GetNextToken();
//                    Console.WriteLine(TokenHelper.PrintToken(t));
//
//                } while (t != Token.EOF);
//
//                // necessary when testing on windows with visual studio
//                //Console.WriteLine("Press 'enter' to exit ....");
//                //Console.ReadLine();
//            }

            using (Parser p = new Parser(@"../../testdata/test002.txt"))
            {
                p.Parse();
                p.FlowCfg.GenerateDOTOutput();

                using (System.IO.StreamWriter file = new System.IO.StreamWriter("graph.txt"))
                {
                    file.WriteLine( p.FlowCfg.DOTOutput);
                }

            }

        }
    }
}

using System;
using compiler.frontend;

namespace Program
{
    class Program
    {
        //TODO: adjust main to use the parser when it is complete
        static void Main(string[] args)
        {
//            using (Lexer l = new Lexer(@"../../testdata/big.txt"))
//            {
//                Token t;
//                do
//                {
//                    t = l.GetNextToken();
//                    Console.WriteLine(TokenHelper.PrintToken(t));
//
//                } while (t != Token.EOF);
//
//                // necessary when testing on windows with visual studio
//                //Console.WriteLine("Press 'enter' to exit ....");
//                //Console.ReadLine();
//            }

            using (Parser p = new Parser(@"../../testdata/test003.txt"))
            {
                p.Parse();
                p.FlowCfg.GenerateDOTOutput();

                using (System.IO.StreamWriter file = new System.IO.StreamWriter("graph.txt"))
                {
                    file.WriteLine( p.FlowCfg.DOTOutput);
                }

            }

        }
    }
}

Change main to use test003

Change main to use test003


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

using System.Collections.Generic;
using System.Linq;
using Vipr.Core;
using Vipr.Core.CodeModel;

namespace CSharpWriter
{
    public class CollectionGetByIdIndexer : Indexer
    {
        public Dictionary<Parameter, OdcmProperty> ParameterToPropertyMap { get; private set; }

        public CollectionGetByIdIndexer(OdcmEntityClass odcmClass)
        {
            var keyProperties = odcmClass.Key;

            ParameterToPropertyMap = keyProperties.ToDictionary(Parameter.FromProperty, p => p);

            Parameters = ParameterToPropertyMap.Keys;
            ReturnType = new Type(NamesService.GetFetcherInterfaceName(odcmClass));
            OdcmClass = odcmClass;

            IsSettable = false;
            IsGettable = true;
        }

        public OdcmClass OdcmClass { get; private set; }
    }
}

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

using System.Collections.Generic;
using System.Linq;
using Vipr.Core;
using Vipr.Core.CodeModel;

namespace CSharpWriter
{
    public class CollectionGetByIdIndexer : Indexer
    {
        public Dictionary<Parameter, OdcmProperty> ParameterToPropertyMap { get; private set; }

        public CollectionGetByIdIndexer(OdcmEntityClass odcmClass)
        {
            Parameters = global::CSharpWriter.Parameters.GetKeyParameters(odcmClass);
            ReturnType = new Type(NamesService.GetFetcherInterfaceName(odcmClass));
            OdcmClass = odcmClass;

            IsSettable = false;
            IsGettable = true;
        }

        public OdcmClass OdcmClass { get; private set; }
    }
}

Move GetByIdIndexer to centralized GetKeyParameters implementation


// 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 osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Effects;

namespace osu.Game.Graphics.UserInterface
{
    public class OsuContextMenu : OsuMenu
    {
        private const int fade_duration = 250;

        public OsuContextMenu()
            : base(Direction.Vertical)
        {
            MaskingContainer.CornerRadius = 5;
            MaskingContainer.EdgeEffect = new EdgeEffectParameters
            {
                Type = EdgeEffectType.Shadow,
                Colour = Color4.Black.Opacity(0.1f),
                Radius = 4,
            };

            ItemsContainer.Padding = new MarginPadding { Vertical = DrawableOsuMenuItem.MARGIN_VERTICAL };
        }

        [BackgroundDependencyLoader]
        private void load(OsuColour colours)
        {
            BackgroundColour = colours.ContextMenuGray;
        }

        protected override void AnimateOpen() => this.FadeIn(fade_duration, Easing.OutQuint);
        protected override void AnimateClose() => this.FadeOut(fade_duration, Easing.OutQuint);
    }
}

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

using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.UserInterface;

namespace osu.Game.Graphics.UserInterface
{
    public class OsuContextMenu : OsuMenu
    {
        private const int fade_duration = 250;

        public OsuContextMenu()
            : base(Direction.Vertical)
        {
            MaskingContainer.CornerRadius = 5;
            MaskingContainer.EdgeEffect = new EdgeEffectParameters
            {
                Type = EdgeEffectType.Shadow,
                Colour = Color4.Black.Opacity(0.1f),
                Radius = 4,
            };

            ItemsContainer.Padding = new MarginPadding { Vertical = DrawableOsuMenuItem.MARGIN_VERTICAL };
        }

        [BackgroundDependencyLoader]
        private void load(OsuColour colours)
        {
            BackgroundColour = colours.ContextMenuGray;
        }

        protected override void AnimateOpen() => this.FadeIn(fade_duration, Easing.OutQuint);
        protected override void AnimateClose() => this.FadeOut(fade_duration, Easing.OutQuint);

        protected override Menu CreateSubMenu() => new OsuContextMenu();
    }
}

Fix context menu sub-menu display

Fix context menu sub-menu display


using System.Collections.Generic;
using System.Web.Http;
using System.Web.Http.OData.Extensions;
using WebStack.QA.Test.OData.SxS2.ODataV3.Extensions;

namespace WebStack.QA.Test.OData.SxS2.ODataV3
{
    public static class ODataV3WebApiConfig
    {
        public static void Register(HttpConfiguration config)
        {
            config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;

            var odataRoute = config.Routes.MapODataServiceRoute(
                routeName: "SxSODataV3",
                routePrefix: "SxSOData",
                model: WebStack.QA.Test.OData.SxS2.ODataV3.Models.ModelBuilder.GetEdmModel())
                .SetODataVersionConstraint(true);

            var contraint = new ODataVersionRouteConstraint(new List<string>() { "OData-Version" });
            odataRoute.Constraints.Add("VersionContraintV1", contraint);
        }
    }
}

using System.Collections.Generic;
using System.Web.Http;
using System.Web.Http.OData.Extensions;
using WebStack.QA.Test.OData.SxS2.ODataV3.Extensions;

namespace WebStack.QA.Test.OData.SxS2.ODataV3
{
    public static class ODataV3WebApiConfig
    {
        public static void Register(HttpConfiguration config)
        {
            config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;

            var odataRoute = config.Routes.MapODataServiceRoute(
                routeName: "SxSODataV3",
                routePrefix: "SxSOData",
                model: WebStack.QA.Test.OData.SxS2.ODataV3.Models.ModelBuilder.GetEdmModel());

            var contraint = new ODataVersionRouteConstraint(new List<string>() { "OData-Version" });
            odataRoute.Constraints.Add("VersionContraintV1", contraint);
        }
    }
}

Fix e2e faild because api change

Fix e2e faild because api change


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

using BadgerJaus.Services.Core;
using BadgerJaus.Messages.PrimitiveDriver;
using BadgerJaus.Util;

using BadgerControlModule.Models;

namespace BadgerControlModule.Utils
{
    class RemotePrimitiveDriverService : RemoteDriverService
    {
        BadgerControlSubsystem badgerControlSubsystem;

        public RemotePrimitiveDriverService(BadgerControlSubsystem badgerControlSubsystem)
        {
            this.badgerControlSubsystem = badgerControlSubsystem;
        }

        public void SendDriveCommand(long xJoystickValue, long yJoystickValue, long zJoystickValue, Component parentComponent)
        {
            SetWrenchEffort setWrenchEffort = new SetWrenchEffort();
            setWrenchEffort.SetSource(badgerControlSubsystem.LocalAddress);
            setWrenchEffort.SetDestination(parentComponent.JausAddress);
            setWrenchEffort.SetPropulsiveLinearEffortX(yJoystickValue);
            Transport.SendMessage(setWrenchEffort);
        }
    }
}

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

using BadgerJaus.Services.Core;
using BadgerJaus.Messages.PrimitiveDriver;
using BadgerJaus.Util;

using BadgerControlModule.Models;

namespace BadgerControlModule.Utils
{
    class RemotePrimitiveDriverService : RemoteDriverService
    {
        BadgerControlSubsystem badgerControlSubsystem;

        public RemotePrimitiveDriverService(BadgerControlSubsystem badgerControlSubsystem)
        {
            this.badgerControlSubsystem = badgerControlSubsystem;
        }

        public void SendDriveCommand(long xJoystickValue, long yJoystickValue, long zJoystickValue, Component parentComponent)
        {
            SetWrenchEffort setWrenchEffort = new SetWrenchEffort();
            setWrenchEffort.SetSource(badgerControlSubsystem.LocalAddress);
            setWrenchEffort.SetDestination(parentComponent.JausAddress);
            // This is intentional, do not attempt to swap the X and Y values.
            setWrenchEffort.SetPropulsiveLinearEffortX(yJoystickValue);
            setWrenchEffort.SetPropulsiveLinearEffortY(xJoystickValue);
            setWrenchEffort.SetPropulsiveLinearEffortZ(zJoystickValue);
            Transport.SendMessage(setWrenchEffort);
        }
    }
}

Modify primitive driver to send x, y, and z linear effort values.


// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the Microsoft Reciprocal License (MS-RL). See LICENSE in the project root for license information.

namespace Tvl.VisualStudio.InheritanceMargin
{
    using System;
    using Microsoft.VisualStudio.Shell.Interop;

    // Stolen from Microsoft.RestrictedUsage.CSharp.Utilities in Microsoft.VisualStudio.CSharp.Services.Language.dll
    internal static class RoslynUtilities
    {
        private static bool? roslynInstalled;

        public static bool IsRoslynInstalled(IServiceProvider serviceProvider)
        {
            if (roslynInstalled.HasValue)
                return roslynInstalled.Value;

            roslynInstalled = false;
            if (serviceProvider == null)
                return false;

            IVsShell vsShell = serviceProvider.GetService(typeof(SVsShell)) as IVsShell;
            if (vsShell == null)
                return false;

            Guid guid = new Guid("6cf2e545-6109-4730-8883-cf43d7aec3e1");
            int isInstalled;
            if (vsShell.IsPackageInstalled(ref guid, out isInstalled) == 0 && isInstalled != 0)
                roslynInstalled = true;

            return roslynInstalled.Value;
        }
    }
}

// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the Microsoft Reciprocal License (MS-RL). See LICENSE in the project root for license information.

namespace Tvl.VisualStudio.InheritanceMargin
{
    using System;
    using Microsoft.VisualStudio.Shell.Interop;

    // Stolen from Microsoft.RestrictedUsage.CSharp.Utilities in Microsoft.VisualStudio.CSharp.Services.Language.dll
    internal static class RoslynUtilities
    {
        private static bool? _roslynInstalled;

        public static bool IsRoslynInstalled(IServiceProvider serviceProvider)
        {
            if (_roslynInstalled.HasValue)
                return _roslynInstalled.Value;

            _roslynInstalled = false;
            if (serviceProvider == null)
                return false;

            IVsShell vsShell = serviceProvider.GetService(typeof(SVsShell)) as IVsShell;
            if (vsShell == null)
                return false;

            Guid guid = new Guid("6cf2e545-6109-4730-8883-cf43d7aec3e1");
            int isInstalled;
            if (vsShell.IsPackageInstalled(ref guid, out isInstalled) == 0 && isInstalled != 0)
                _roslynInstalled = true;

            return _roslynInstalled.Value;
        }
    }
}

Fix all violations of SX1309S

Fix all violations of SX1309S


using UniRx;
using UniRx.Triggers;
using UnityEngine;
using UnityEngine.UI;

public class CanvasWidthScalePresenter : MonoBehaviour
{
    [SerializeField]
    CanvasEvents canvasEvents;
    [SerializeField]
    Slider canvasWidthScaleController;

    NotesEditorModel model;

    void Awake()
    {
        model = NotesEditorModel.Instance;
        model.OnLoadedMusicObservable.First().Subscribe(_ => Init());
    }

    void Init()
    {
        model.CanvasWidth = canvasEvents.MouseScrollWheelObservable
            .Where(_ => KeyInput.CtrlKey())
            .Merge(this.UpdateAsObservable().Where(_ => Input.GetKey(KeyCode.UpArrow)).Select(_ => 0.1f))
            .Merge(this.UpdateAsObservable().Where(_ => Input.GetKey(KeyCode.DownArrow)).Select(_ => -0.1f))
            .Select(delta => model.CanvasWidth.Value * (1 + delta))
            .Select(x => x / (model.Audio.clip.samples / 100f))
            .Select(x => Mathf.Clamp(x, 0.1f, 2f))
            .Merge(canvasWidthScaleController.OnValueChangedAsObservable()
                .DistinctUntilChanged())
            .Select(x => model.Audio.clip.samples / 100f * x)
            .ToReactiveProperty();
    }
}

using UniRx;
using UniRx.Triggers;
using UnityEngine;
using UnityEngine.UI;

public class CanvasWidthScalePresenter : MonoBehaviour
{
    [SerializeField]
    CanvasEvents canvasEvents;
    [SerializeField]
    Slider canvasWidthScaleController;

    NotesEditorModel model;

    void Awake()
    {
        model = NotesEditorModel.Instance;
        model.OnLoadedMusicObservable.First().Subscribe(_ => Init());
    }

    void Init()
    {
        model.CanvasWidth = canvasEvents.MouseScrollWheelObservable
            .Where(_ => KeyInput.CtrlKey())
            .Merge(this.UpdateAsObservable().Where(_ => Input.GetKey(KeyCode.UpArrow)).Select(_ => 0.05f))
            .Merge(this.UpdateAsObservable().Where(_ => Input.GetKey(KeyCode.DownArrow)).Select(_ => -0.05f))
            .Select(delta => model.CanvasWidth.Value * (1 + delta))
            .Select(x => x / (model.Audio.clip.samples / 100f))
            .Select(x => Mathf.Clamp(x, 0.1f, 2f))
            .Merge(canvasWidthScaleController.OnValueChangedAsObservable()
                .DistinctUntilChanged())
            .Select(x => model.Audio.clip.samples / 100f * x)
            .ToReactiveProperty();
    }
}

Fix the speed of the canvas width scaling by left/right arrow keys


using System.Collections;
using Engine;
using Engine.Data;
using Engine.Networking;
using Engine.Utility;
using UnityEngine;

namespace Engine.Game.Controllers {

    [RequireComponent(typeof(ThirdPersonController))]
    public class ThirdPersonPushBodies : BaseEngineBehavior {
        public float pushPower = 0.5f;
        public LayerMask pushLayers = -1;
        private BaseThirdPersonController controller;

        private void Start() {
            controller = GetComponent<BaseThirdPersonController>();
        }

        private void OnControllerColliderHit(ControllerColliderHit hit) {
            Rigidbody body = hit.collider.attachedRigidbody;

            // no rigidbody
            if (body == null || body.isKinematic)
                return;

            // Ignore pushing those rigidbodies
            int bodyLayerMask = 1 << body.gameObject.layer;
            if ((bodyLayerMask & pushLayers.value) == 0)
                return;

            // We dont want to push objects below us
            if (hit.moveDirection.y < -0.3)
                return;

            // Calculate push direction from move direction, we only push objects to the sides
            // never up and down
            Vector3 pushDir = new Vector3(hit.moveDirection.x, 0, hit.moveDirection.z);

            // push with move speed but never more than walkspeed
            body.velocity = pushDir * pushPower * Mathf.Min(controller.GetSpeed(), controller.walkSpeed);
        }
    }
}

using System.Collections;
using Engine;
using Engine.Data;
using Engine.Networking;
using Engine.Utility;
using UnityEngine;

namespace Engine.Game.Controllers {
#if NETWORK_PHOTON
    [RequireComponent(typeof(ThirdPersonController))]
    public class ThirdPersonPushBodies : BaseEngineBehavior {
        public float pushPower = 0.5f;
        public LayerMask pushLayers = -1;
        private BaseThirdPersonController controller;

        private void Start() {
            controller = GetComponent<BaseThirdPersonController>();
        }

        private void OnControllerColliderHit(ControllerColliderHit hit) {
            Rigidbody body = hit.collider.attachedRigidbody;

            // no rigidbody
            if (body == null || body.isKinematic)
                return;

            // Ignore pushing those rigidbodies
            int bodyLayerMask = 1 << body.gameObject.layer;
            if ((bodyLayerMask & pushLayers.value) == 0)
                return;

            // We dont want to push objects below us
            if (hit.moveDirection.y < -0.3)
                return;

            // Calculate push direction from move direction, we only push objects to the sides
            // never up and down
            Vector3 pushDir = new Vector3(hit.moveDirection.x, 0, hit.moveDirection.z);

            // push with move speed but never more than walkspeed
            body.velocity = pushDir * pushPower * Mathf.Min(controller.GetSpeed(), controller.walkSpeed);
        }
    }
#endif
}

Update unity networking for NETWORK_PHOTON. Updates for iTunes 1.2 build update. Advertiser id to vendor id for game analytics and update textures/showing fireworks/camera sorting.


using OpenQA.Selenium;
using OpenQA.Selenium.Support.UI;
using System;
using TechTalk.SpecFlow;
using Xunit;

namespace Web.UI.Tests
{
    [Binding]
    public class WebBrowserWaitSteps : WebDriverStepsBase
    {
        [When("I wait for element with id (.*) to exist")]
        public void IWaitForElementWithIdToExist(string id)
        {
            var wait = new WebDriverWait(Driver, TimeSpan.FromMinutes(1));
            wait.Until<IWebElement>(x =>
            {
                return x.FindElement(By.Id(id));
            });
        }

        [Then(@"I expect that the element with id (.*) exists")]
        public void ThenIExpectThatTheElementWithIdExists(string id)
        {
            var element = Driver.FindElement(By.Id(id));

            Assert.NotNull(element);
        }
    }
}

using OpenQA.Selenium;
using OpenQA.Selenium.Support.UI;
using System;
using TechTalk.SpecFlow;
using Xunit;

namespace Web.UI.Tests
{
    [Binding]
    public class WebBrowserWaitSteps : WebDriverStepsBase
    {
        [When("I wait for element with id (.*) to exist")]
        public void IWaitForElementWithIdToExist(string id)
        {
            var wait = new WebDriverWait(Driver, TimeSpan.FromMinutes(1));
            wait.Until<IWebElement>(ExpectedConditions.ElementExists(By.Id(id)));
        }

        [Then(@"I expect that the element with id (.*) exists")]
        public void ThenIExpectThatTheElementWithIdExists(string id)
        {
            var element = Driver.FindElement(By.Id(id));

            Assert.NotNull(element);
        }
    }
}

Use ExpectedConditions for element exists check


using NBitcoin;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using WalletWasabi.Backend.Models;
using WalletWasabi.Interfaces;
using WalletWasabi.Logging;
using WalletWasabi.WebClients.BlockchainInfo;
using WalletWasabi.WebClients.Coinbase;
using WalletWasabi.WebClients.Gemini;
using WalletWasabi.WebClients.ItBit;
using WalletWasabi.WebClients.SmartBit;

namespace WalletWasabi.WebClients
{
	public class ExchangeRateProvider : IExchangeRateProvider
	{
		private readonly IExchangeRateProvider[] ExchangeRateProviders =
		{
			new SmartBitExchangeRateProvider(new SmartBitClient(Network.Main)),
			new BlockchainInfoExchangeRateProvider(),
			new CoinbaseExchangeRateProvider(),
			new GeminiExchangeRateProvider(),
			new ItBitExchangeRateProvider()
		};

		public async Task<List<ExchangeRate>> GetExchangeRateAsync()
		{
			List<ExchangeRate> exchangeRates = null;

			foreach (var provider in ExchangeRateProviders)
			{
				try
				{
					exchangeRates = await provider.GetExchangeRateAsync();
					break;
				}
				catch (Exception ex)
				{
					// Ignore it and try with the next one
					Logger.LogTrace(ex);
				}
			}
			return exchangeRates;
		}
	}
}

using NBitcoin;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using WalletWasabi.Backend.Models;
using WalletWasabi.Interfaces;
using WalletWasabi.Logging;
using WalletWasabi.WebClients.BlockchainInfo;
using WalletWasabi.WebClients.Coinbase;
using WalletWasabi.WebClients.Gemini;
using WalletWasabi.WebClients.ItBit;
using WalletWasabi.WebClients.SmartBit;

namespace WalletWasabi.WebClients
{
	public class ExchangeRateProvider : IExchangeRateProvider
	{
		private readonly IExchangeRateProvider[] ExchangeRateProviders =
		{
			new BlockchainInfoExchangeRateProvider(),
			new CoinstampExchangeRateProvider(),
			new CoinGeckoExchangeRateProvider(),
			new CoinbaseExchangeRateProvider(),
			new GeminiExchangeRateProvider(),
			new ItBitExchangeRateProvider()
			new SmartBitExchangeRateProvider(new SmartBitClient(Network.Main)),
		};

		public async Task<List<ExchangeRate>> GetExchangeRateAsync()
		{
			List<ExchangeRate> exchangeRates = null;

			foreach (var provider in ExchangeRateProviders)
			{
				try
				{
					exchangeRates = await provider.GetExchangeRateAsync();
					break;
				}
				catch (Exception ex)
				{
					// Ignore it and try with the next one
					Logger.LogTrace(ex);
				}
			}
			return exchangeRates;
		}
	}
}

Use new price providers and degare SmartBit


@{
    ViewBag.Title = "Contact";
}

@ViewBag.Title.

@ViewBag.Message

<address>
    One Microsoft Way

    Redmond, WA 98052-6399

    P:
    425.555.0100
</address>

<address>
    Support:   Support@example.com

    Marketing: Marketing@example.com
</address>

@{
    ViewBag.Title = "Contact";
}

@ViewBag.Title.

@ViewBag.Message

<address>
    One Microsoft Way

    Redmond, WA 98052-6399

    P:
    425.555.0100
</address>

<address>
    Support:   Support@wechangedthis.com

    Marketing: Marketing@example.com
</address>

Update Support's email address on contact page. Was breaking the world, so it had to be done.


using BatteryCommander.Web.Models;
using BatteryCommander.Web.Services;
using FluentEmail.Core;
using FluentEmail.Core.Models;
using FluentScheduler;
using System.Collections.Generic;
using System.IO;

namespace BatteryCommander.Web.Jobs
{
    public class PERSTATReportJob : IJob
    {
        private static IList<Address> Recipients => new List<Address>(new Address[]
        {
            Matt
            // new Address { Name = "2-116 FA BN TOC", EmailAddress = "ng.fl.flarng.list.ngfl-2-116-fa-bn-toc@mail.mil" }
        });

        internal static Address Matt => new Address { Name = "1LT Wagner", EmailAddress = "MattGWagner@gmail.com" };

        private readonly Database db;

        private readonly IFluentEmail emailSvc;

        public PERSTATReportJob(Database db, IFluentEmail emailSvc)
        {
            this.db = db;
            this.emailSvc = emailSvc;
        }

        public virtual void Execute()
        {
            foreach (var unit in UnitService.List(db).GetAwaiter().GetResult())
            {
                // HACK - Configure the recipients and units that this is going to be wired up for

                emailSvc
                    .To(Recipients)
                    .SetFrom(Matt.EmailAddress, Matt.Name)
                    .Subject($"{unit.Name} | RED 1 PERSTAT")
                    .UsingTemplateFromFile($"{Directory.GetCurrentDirectory()}/Views/Reports/Red1_Perstat.cshtml", unit)
                    .Send();
            }
        }
    }
}

using BatteryCommander.Web.Models;
using BatteryCommander.Web.Services;
using FluentEmail.Core;
using FluentEmail.Core.Models;
using FluentScheduler;
using System.Collections.Generic;
using System.IO;

namespace BatteryCommander.Web.Jobs
{
    public class PERSTATReportJob : IJob
    {
        private static IList<Address> Recipients => new List<Address>(new Address[]
        {
            FROM
            // new Address { Name = "2-116 FA BN TOC", EmailAddress = "ng.fl.flarng.list.ngfl-2-116-fa-bn-toc@mail.mil" }
        });

        internal static Address FROM => new Address { Name = "C-2-116 FA", EmailAddress = "C-2-116FA@redleg.app" };

        private readonly Database db;

        private readonly IFluentEmail emailSvc;

        public PERSTATReportJob(Database db, IFluentEmail emailSvc)
        {
            this.db = db;
            this.emailSvc = emailSvc;
        }

        public virtual void Execute()
        {
            foreach (var unit in UnitService.List(db).GetAwaiter().GetResult())
            {
                // HACK - Configure the recipients and units that this is going to be wired up for

                emailSvc
                    .To(Recipients)
                    .SetFrom(FROM.EmailAddress, FROM.Name)
                    .Subject($"{unit.Name} | RED 1 PERSTAT")
                    .UsingTemplateFromFile($"{Directory.GetCurrentDirectory()}/Views/Reports/Red1_Perstat.cshtml", unit)
                    .Send();
            }
        }
    }
}

Change from address on PERSTAT, OCD

Change from address on PERSTAT, OCD


using System;

namespace DiceApi.Core
{
    public class Die
    {
        /// <summary>
        /// Instance of Random that we'll instantiate with the die
        /// and use within the Roll() method.
        /// </summary>
        private readonly Random rng;

        /// <summary>
        /// Initializes a new instance of <see cref="Die" /> with a
        /// specified number of sides.
        /// </summary>
        /// <param name="sides">Number of sides on the die.</param>
        public Die(int sides)
        {
            if (sides < 1) {
                throw new ArgumentOutOfRangeException(nameof(sides));
            }

            this.Sides = sides;

            this.rng = new Random();
        }

        /// <summary>
        /// Gets the number of sides on the die.
        /// </summary>
        /// <returns></returns>
        public int Sides { get; }

        /// <summary>
        /// Rolls the die, returning its value.
        /// </summary>
        /// <returns>Result of die roll.</returns>
        public int Roll()
        {
            // Range for Next() is inclusive on the minimum, exclusive on the maximum
            return rng.Next(1, this.Sides + 1);
        }
    }
}

using System;

namespace DiceApi.Core
{
    public class Die
    {
        /// <summary>
        /// Initializes a new instance of <see cref="Die" /> with a
        /// specified number of sides.
        /// </summary>
        /// <param name="sides">Number of sides on the die.</param>
        public Die(int sides)
        {
            if (sides < 1) {
                throw new ArgumentOutOfRangeException(nameof(sides));
            }

            this.Sides = sides;

            this.RandomNumberGenerator = new Random();
        }

        /// <summary>
        /// Gets the number of sides on the die.
        /// </summary>
        /// <returns></returns>
        public int Sides { get; }

        /// <summary>
        /// Gets an instance of Random that we instantiate with the Die
        /// constructor. This is used by Roll() to create a random value
        /// for the die roll.
        /// </summary>
        private Random RandomNumberGenerator { get; }

        /// <summary>
        /// Rolls the die, returning its value.
        /// </summary>
        /// <returns>Result of die roll.</returns>
        public int Roll()
        {
            // Range for Next() is inclusive on the minimum, exclusive on the maximum
            return this.RandomNumberGenerator.Next(1, this.Sides + 1);
        }
    }
}

Use autogenerated prop for Random instance


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

using System.Collections.Generic;
using osu.Framework.Bindables;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.UserInterface;

namespace osu.Game.Screens.Edit
{
    internal class WaveformOpacityMenuItem : MenuItem
    {
        private readonly Bindable<float> waveformOpacity;

        private readonly Dictionary<float, ToggleMenuItem> menuItemLookup = new Dictionary<float, ToggleMenuItem>();

        public WaveformOpacityMenuItem(Bindable<float> waveformOpacity)
            : base("Waveform opacity")
        {
            Items = new[]
            {
                createMenuItem(0.25f),
                createMenuItem(0.5f),
                createMenuItem(0.75f),
                createMenuItem(1f),
            };

            this.waveformOpacity = waveformOpacity;
            waveformOpacity.BindValueChanged(opacity =>
            {
                foreach (var kvp in menuItemLookup)
                    kvp.Value.State.Value = kvp.Key == opacity.NewValue;
            }, true);
        }

        private ToggleMenuItem createMenuItem(float opacity)
        {
            var item = new ToggleMenuItem($"{opacity * 100}%", MenuItemType.Standard, _ => updateOpacity(opacity));
            menuItemLookup[opacity] = item;
            return item;
        }

        private void updateOpacity(float opacity) => waveformOpacity.Value = opacity;
    }
}

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

using System.Collections.Generic;
using osu.Framework.Bindables;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.UserInterface;

namespace osu.Game.Screens.Edit
{
    internal class WaveformOpacityMenuItem : MenuItem
    {
        private readonly Bindable<float> waveformOpacity;

        private readonly Dictionary<float, TernaryStateRadioMenuItem> menuItemLookup = new Dictionary<float, TernaryStateRadioMenuItem>();

        public WaveformOpacityMenuItem(Bindable<float> waveformOpacity)
            : base("Waveform opacity")
        {
            Items = new[]
            {
                createMenuItem(0.25f),
                createMenuItem(0.5f),
                createMenuItem(0.75f),
                createMenuItem(1f),
            };

            this.waveformOpacity = waveformOpacity;
            waveformOpacity.BindValueChanged(opacity =>
            {
                foreach (var kvp in menuItemLookup)
                    kvp.Value.State.Value = kvp.Key == opacity.NewValue ? TernaryState.True : TernaryState.False;
            }, true);
        }

        private TernaryStateRadioMenuItem createMenuItem(float opacity)
        {
            var item = new TernaryStateRadioMenuItem($"{opacity * 100}%", MenuItemType.Standard, _ => updateOpacity(opacity));
            menuItemLookup[opacity] = item;
            return item;
        }

        private void updateOpacity(float opacity) => waveformOpacity.Value = opacity;
    }
}

Fix checkmark being hidden after clicking current waveform opacity setting


using System;
namespace Xamarin.Forms.GoogleMaps.Internals
{
    internal class ProductInformation
    {
        public const string Author = "amay077";
        public const string Name = "Xamarin.Forms.GoogleMaps";
        public const string Copyright = "Copyright © amay077. 2016 - 2017";
        public const string Trademark = "";
        public const string Version = "2.2.1.3";
    }
}

using System;
namespace Xamarin.Forms.GoogleMaps.Internals
{
    internal class ProductInformation
    {
        public const string Author = "amay077";
        public const string Name = "Xamarin.Forms.GoogleMaps";
        public const string Copyright = "Copyright © amay077. 2016 - 2017";
        public const string Trademark = "";
        public const string Version = "2.2.1.4";
    }
}

Update file version to 2.2.1.4

Update file version to 2.2.1.4


using BatteryCommander.Web.Models;
using BatteryCommander.Web.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Linq;
using System.Threading.Tasks;

namespace BatteryCommander.Web.Controllers
{
    [Authorize, ApiExplorerSettings(IgnoreApi = true)]
    public class SSDController : Controller
    {
        private readonly Database db;

        public SSDController(Database db)
        {
            this.db = db;
        }

        public async Task<IActionResult> Index(SoldierSearchService.Query query)
        {
            // Ensure we're only displaying Soldiers we care about here

            if (!query.Ranks.Any()) query.OnlyEnlisted = true;

            return View("List", await SoldierSearchService.Filter(db, query));
        }

        [HttpPost]
        public async Task<IActionResult> Update(int soldierId, SSD ssd, decimal completion)
        {
            // Take the models and pull the updated data

            var soldier = await SoldiersController.Get(db, soldierId);

            soldier
                .SSDSnapshots
                .Add(new Soldier.SSDSnapshot
                {
                    SSD = ssd,
                    PerecentComplete = completion / 100 // Convert to decimal percentage
                });

            await db.SaveChangesAsync();

            return RedirectToAction(nameof(Index));
        }
    }
}

using BatteryCommander.Web.Models;
using BatteryCommander.Web.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Linq;
using System.Threading.Tasks;

namespace BatteryCommander.Web.Controllers
{
    [Authorize, ApiExplorerSettings(IgnoreApi = true)]
    public class SSDController : Controller
    {
        private readonly Database db;

        public SSDController(Database db)
        {
            this.db = db;
        }

        public async Task<IActionResult> Index(SoldierSearchService.Query query)
        {
            if (query?.Ranks?.Any() == true)
            {
                // Cool, we're searching for one or more specific ranks
            }
            else
            {
                query.OnlyEnlisted = true;
            }

            return View("List", await SoldierSearchService.Filter(db, query));
        }

        [HttpPost]
        public async Task<IActionResult> Update(int soldierId, SSD ssd, decimal completion)
        {
            // Take the models and pull the updated data

            var soldier = await SoldiersController.Get(db, soldierId);

            soldier
                .SSDSnapshots
                .Add(new Soldier.SSDSnapshot
                {
                    SSD = ssd,
                    PerecentComplete = completion / 100 // Convert to decimal percentage
                });

            await db.SaveChangesAsync();

            return RedirectToAction(nameof(Index));
        }
    }
}

Fix for search by rank

Fix for search by rank

Fixes #239 for real this time


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

namespace Verdeler
{
    public class Distributor<TDistributable> : IDistributor<TDistributable> where TDistributable : IDistributable
    {
        private readonly List<IEndpointRepository> _endpointRepositories
            = new List<IEndpointRepository>();

        private readonly Dictionary<Type, IEndpointDeliveryService> _endpointDeliveryServices
            = new Dictionary<Type, IEndpointDeliveryService>();

        public void RegisterEndpointRepository(IEndpointRepository endpointRepository)
        {
            if (!_endpointRepositories.Contains(endpointRepository))
            {
                _endpointRepositories.Add(endpointRepository);
            }
        }

        public void RegisterEndpointDeliveryService<TEndpoint>(IEndpointDeliveryService<TEndpoint> endpointDeliveryService)
        {
            _endpointDeliveryServices[typeof(TEndpoint)] = endpointDeliveryService;
        }

        public void Distribute(TDistributable distributable, string recipientName)
        {
            var endpoints = _endpointRepositories.SelectMany(r => r.GetEndpointsForRecipient(recipientName));

            foreach (var endpoint in endpoints)
            {
                var endpointDeliveryService = _endpointDeliveryServices[endpoint.GetType()];

                endpointDeliveryService.Deliver(distributable, endpoint);
            }
        }
    }
}

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

namespace Verdeler
{
    public class Distributor<TDistributable> : IDistributor<TDistributable> where TDistributable : IDistributable
    {
        private readonly List<IEndpointRepository> _endpointRepositories
            = new List<IEndpointRepository>();

        private readonly Dictionary<Type, IEndpointDeliveryService> _endpointDeliveryServices
            = new Dictionary<Type, IEndpointDeliveryService>();

        public void RegisterEndpointRepository(IEndpointRepository endpointRepository)
        {
            if (!_endpointRepositories.Contains(endpointRepository))
            {
                _endpointRepositories.Add(endpointRepository);
            }
        }

        public void RegisterEndpointDeliveryService<TEndpoint>(IEndpointDeliveryService<TEndpoint> endpointDeliveryService)
            where TEndpoint : IEndpoint
        {
            _endpointDeliveryServices[typeof(TEndpoint)] = endpointDeliveryService;
        }

        public void Distribute(TDistributable distributable, string recipientName)
        {
            var endpoints = _endpointRepositories.SelectMany(r => r.GetEndpointsForRecipient(recipientName));

            foreach (var endpoint in endpoints)
            {
                var endpointDeliveryService = _endpointDeliveryServices[endpoint.GetType()];

                endpointDeliveryService.Deliver(distributable, endpoint);
            }
        }
    }
}

Add IEndpoint restriction to RegisterEndpointDeliveryService.


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

namespace WifiProfiles
{
    class Program
    {
        static void Main(string[] args)
        {
            var profiles = NetShWrapper.GetWifiProfiles();
            bool sawBadWifi = false;
            foreach (var a in profiles)
            {
                string warning = NetShWrapper.IsOpenAndAutoWifiProfile(a) ? "Warning: AUTO connect to OPEN WiFi" : String.Empty;
                Console.WriteLine(String.Format("{0,-20} {1,10} {2,10} {3,30} ", a.Name, a.ConnectionMode, a.Authentication, warning));
                if (!String.IsNullOrWhiteSpace(warning)) sawBadWifi = true;
            }
            if (sawBadWifi)
            {
                Console.WriteLine("\r\nDelete WiFi profiles that are OPEN *and* AUTO connect? [y/n]");
                if (args[0].ToUpperInvariant() == "/DELETEAUTOOPEN" || Console.ReadLine().Trim().ToUpperInvariant()[0] == 'Y')
                {
                    Console.WriteLine("in here");
                    foreach (var a in profiles.Where(a => NetShWrapper.IsOpenAndAutoWifiProfile(a)))
                    {
                        Console.WriteLine(NetShWrapper.DeleteWifiProfile(a));
                    }
                }
            }
            else
            {
                Console.WriteLine("\r\nNo WiFi profiles set to OPEN and AUTO connect were found. \r\nOption: Run with /deleteautoopen to auto delete.");
            }
            //Console.ReadKey();
        }
    }
}

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

namespace WifiProfiles
{
    class Program
    {
        static void Main(string[] args)
        {
            var profiles = NetShWrapper.GetWifiProfiles();
            bool sawBadWifi = false;
            foreach (var a in profiles)
            {
                string warning = NetShWrapper.IsOpenAndAutoWifiProfile(a) ? "Warning: AUTO connect to OPEN WiFi" : String.Empty;
                Console.WriteLine(String.Format("{0,-20} {1,10} {2,10} {3,30} ", a.Name, a.ConnectionMode, a.Authentication, warning));
                if (!String.IsNullOrWhiteSpace(warning)) sawBadWifi = true;
            }
            if (sawBadWifi)
            {
                Console.WriteLine("\r\nDelete WiFi profiles that are OPEN *and* AUTO connect? [y/n]");
                if (args.Length > 0 && args[0].ToUpperInvariant() == "/DELETEAUTOOPEN" ||
                    Console.ReadLine().Trim().ToUpperInvariant().StartsWith("Y"))
                {
                    Console.WriteLine("in here");
                    foreach (var a in profiles.Where(a => NetShWrapper.IsOpenAndAutoWifiProfile(a)))
                    {
                        Console.WriteLine(NetShWrapper.DeleteWifiProfile(a));
                    }
                }
            }
            else
            {
                Console.WriteLine("\r\nNo WiFi profiles set to OPEN and AUTO connect were found. \r\nOption: Run with /deleteautoopen to auto delete.");
            }
            //Console.ReadKey();
        }
    }
}

Fix crashes when no arguments or no input


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

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ElitePlayerJournal")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ElitePlayerJournal")]
[assembly: AssemblyCopyright("Copyright ©  2017")]
[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("195b246a-62a6-4399-944a-4ad55e722994")]

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

[assembly: InternalsVisibleTo("Netwonsoft.Json")]

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

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ElitePlayerJournal")]
[assembly: AssemblyDescription("A library for reading Elite Dangerous player journal files.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ElitePlayerJournal")]
[assembly: AssemblyCopyright("Copyright © Jamie Anderson 2017")]
[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("195b246a-62a6-4399-944a-4ad55e722994")]

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

Add copyright info in DLL properties.

Add copyright info in DLL properties.


using System.Web.Http;
using Bit.WebApi.ActionFilters;
using Bit.WebApi.Contracts;

namespace Bit.WebApi.Implementations
{
    public class GlobalHostAuthenticationFilterProvider : IWebApiConfigurationCustomizer
    {
        public virtual void CustomizeWebApiConfiguration(HttpConfiguration webApiConfiguration)
        {
            webApiConfiguration.Filters.Add(new HostAuthenticationFilter("Bearer"));
        }
    }

    public class GlobalDefaultExceptionHandlerActionFilterProvider<TExceptionHandlerFilterAttribute> : IWebApiConfigurationCustomizer
        where TExceptionHandlerFilterAttribute : ExceptionHandlerFilterAttribute, new()
    {
        public virtual void CustomizeWebApiConfiguration(HttpConfiguration webApiConfiguration)
        {
            webApiConfiguration.Filters.Add(new TExceptionHandlerFilterAttribute());
        }
    }

    public class GlobalDefaultLogOperationArgsActionFilterProvider<TOperationArgsArgs> : IWebApiConfigurationCustomizer
        where TOperationArgsArgs : LogOperationArgsFilterAttribute, new()
    {
        public virtual void CustomizeWebApiConfiguration(HttpConfiguration webApiConfiguration)
        {
            webApiConfiguration.Filters.Add(new TOperationArgsArgs());
        }
    }

    public class GlobalDefaultRequestModelStateValidatorActionFilterProvider : IWebApiConfigurationCustomizer
    {
        public virtual void CustomizeWebApiConfiguration(HttpConfiguration webApiConfiguration)
        {
            webApiConfiguration.Filters.Add(new RequestModelStateValidatorActionFilterAttribute());
        }
    }
}

using System.Web.Http;
using Bit.WebApi.ActionFilters;
using Bit.WebApi.Contracts;

namespace Bit.WebApi.Implementations
{
    public class GlobalHostAuthenticationFilterProvider : IWebApiConfigurationCustomizer
    {
        public virtual void CustomizeWebApiConfiguration(HttpConfiguration webApiConfiguration)
        {
            webApiConfiguration.Filters.Add(new HostAuthenticationFilter("Bearer"));
            webApiConfiguration.Filters.Add(new HostAuthenticationFilter("Basic"));
        }
    }

    public class GlobalDefaultExceptionHandlerActionFilterProvider<TExceptionHandlerFilterAttribute> : IWebApiConfigurationCustomizer
        where TExceptionHandlerFilterAttribute : ExceptionHandlerFilterAttribute, new()
    {
        public virtual void CustomizeWebApiConfiguration(HttpConfiguration webApiConfiguration)
        {
            webApiConfiguration.Filters.Add(new TExceptionHandlerFilterAttribute());
        }
    }

    public class GlobalDefaultLogOperationArgsActionFilterProvider<TOperationArgsArgs> : IWebApiConfigurationCustomizer
        where TOperationArgsArgs : LogOperationArgsFilterAttribute, new()
    {
        public virtual void CustomizeWebApiConfiguration(HttpConfiguration webApiConfiguration)
        {
            webApiConfiguration.Filters.Add(new TOperationArgsArgs());
        }
    }

    public class GlobalDefaultRequestModelStateValidatorActionFilterProvider : IWebApiConfigurationCustomizer
    {
        public virtual void CustomizeWebApiConfiguration(HttpConfiguration webApiConfiguration)
        {
            webApiConfiguration.Filters.Add(new RequestModelStateValidatorActionFilterAttribute());
        }
    }
}

Support for basic auth in web api & odata


using System;
using System.IO;

using ApprovalTests;
using ApprovalTests.Reporters;
using FluentAssertions;
using Xunit;

using Grobid.NET;
using org.apache.log4j;
using org.grobid.core;

namespace Grobid.Test
{
    [UseReporter(typeof(DiffReporter))]
    public class GrobidTest
    {
        static GrobidTest()
        {
            BasicConfigurator.configure();
            org.apache.log4j.Logger.getRootLogger().setLevel(Level.INFO);
        }

        [Fact]
        [Trait("Test", "EndToEnd")]
        public void ExtractTest()
        {
            var binPath = Environment.GetEnvironmentVariable("PDFTOXMLEXE");

            var factory = new GrobidFactory(
                "grobid.zip",
                binPath,
                Directory.GetCurrentDirectory());

            var grobid = factory.Create();
            var result = grobid.Extract(@"essence-linq.pdf");

            result.Should().NotBeEmpty();
            Approvals.Verify(result);
        }

        [Fact]
        public void Test()
        {
            var x = GrobidModels.NAMES_HEADER;
            x.name().Should().Be("NAMES_HEADER");
            x.toString().Should().Be("name/header");
        }
    }
}

using System;
using System.IO;

using ApprovalTests;
using ApprovalTests.Reporters;
using FluentAssertions;
using Xunit;

using Grobid.NET;
using org.apache.log4j;
using org.grobid.core;

namespace Grobid.Test
{
    [UseReporter(typeof(DiffReporter))]
    public class GrobidTest
    {
        static GrobidTest()
        {
            BasicConfigurator.configure();
            org.apache.log4j.Logger.getRootLogger().setLevel(Level.DEBUG);
        }

        [Fact]
        [Trait("Test", "EndToEnd")]
        public void ExtractTest()
        {
            var binPath = Environment.GetEnvironmentVariable("PDFTOXMLEXE");
            org.apache.log4j.Logger.getRootLogger().info("PDFTOXMLEXE=" + binPath);

            var factory = new GrobidFactory(
                "grobid.zip",
                binPath,
                Directory.GetCurrentDirectory());

            var grobid = factory.Create();
            var result = grobid.Extract(@"essence-linq.pdf");

            result.Should().NotBeEmpty();
            Approvals.Verify(result);
        }

        [Fact]
        public void Test()
        {
            var x = GrobidModels.NAMES_HEADER;
            x.name().Should().Be("NAMES_HEADER");
            x.toString().Should().Be("name/header");
        }
    }
}

Set log level to DEBUG

Set log level to DEBUG


using Microsoft.Win32;
using System.IO;

namespace StorybrewEditor.Util
{
    public static class OsuHelper
    {
        public static string GetOsuPath()
        {
            using (var registryKey = Registry.ClassesRoot.OpenSubKey("osu\\DefaultIcon"))
            {
                if (registryKey == null)
                    return string.Empty;

                var value = registryKey.GetValue(null).ToString();
                var startIndex = value.IndexOf("\"");
                var endIndex = value.LastIndexOf("\"");
                return value.Substring(startIndex + 1, endIndex - 1);
            }
        }

        public static string GetOsuFolder()
            => Path.GetDirectoryName(GetOsuPath());

        public static string GetOsuSongFolder()
        {
            var osuFolder = Path.GetDirectoryName(GetOsuPath());
            var songsFolder = Path.Combine(osuFolder, "Songs");
            return Directory.Exists(songsFolder) ? songsFolder : osuFolder;
        }
    }
}

using Microsoft.Win32;
using System;
using System.IO;

namespace StorybrewEditor.Util
{
    public static class OsuHelper
    {
        public static string GetOsuPath()
        {
            using (var registryKey = Registry.ClassesRoot.OpenSubKey("osu\\DefaultIcon"))
            {
                if (registryKey == null)
                    return string.Empty;

                var value = registryKey.GetValue(null).ToString();
                var startIndex = value.IndexOf("\"");
                var endIndex = value.LastIndexOf("\"");
                return value.Substring(startIndex + 1, endIndex - 1);
            }
        }

        public static string GetOsuFolder()
        {
            var osuPath = GetOsuPath();
            if (osuPath.Length == 0)
                return Path.GetPathRoot(Environment.SystemDirectory);

            return Path.GetDirectoryName(osuPath);
        }

        public static string GetOsuSongFolder()
        {
            var osuPath = GetOsuPath();
            if (osuPath.Length == 0)
                return Path.GetPathRoot(Environment.SystemDirectory);

            var osuFolder = Path.GetDirectoryName(osuPath);
            var songsFolder = Path.Combine(osuFolder, "Songs");
            return Directory.Exists(songsFolder) ? songsFolder : osuFolder;
        }
    }
}

Fix crash when creating a new project if osu!'s folder could not be found.