using JetBrains.Annotations;
using JetBrains.ProjectModel;
using JetBrains.ReSharper.Plugins.Unity.UnityEditorIntegration;
using JetBrains.ReSharper.Plugins.Yaml.ProjectModel;

#nullable enable

namespace JetBrains.ReSharper.Plugins.Unity.Yaml.ProjectModel
{
    [ProjectFileTypeDefinition(Name)]
    public class MetaProjectFileType : YamlProjectFileType
    {
        public new const string Name = "Meta";

        [UsedImplicitly] public new static MetaProjectFileType? Instance { get; private set; }

        public MetaProjectFileType()
            : base(Name, "Unity Yaml", new[] { UnityFileExtensions.MetaFileExtensionWithDot })
        {
        }
    }
}

using JetBrains.Annotations;
using JetBrains.ProjectModel;
using JetBrains.ReSharper.Plugins.Unity.UnityEditorIntegration;
using JetBrains.ReSharper.Plugins.Yaml.ProjectModel;

#nullable enable

namespace JetBrains.ReSharper.Plugins.Unity.Yaml.ProjectModel
{
    [ProjectFileTypeDefinition(Name)]
    public class MetaProjectFileType : YamlProjectFileType
    {
        public new const string Name = "Meta";

        [UsedImplicitly] public new static MetaProjectFileType? Instance { get; private set; }

        public MetaProjectFileType()
            : base(Name, "Unity Meta File", new[] { UnityFileExtensions.MetaFileExtensionWithDot })
        {
        }
    }
}

Fix incorrect project file type description


@inject BTCPayServer.Security.ContentSecurityPolicies csp
@{
    Layout = null;
    csp.Add("script-src", "https://cdn.jsdelivr.net");
    csp.Add("worker-src", "blob:");
}
<!DOCTYPE html>

    <title>BTCPay Server Greenfield API</title>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="~/main/fonts/Roboto.css" rel="stylesheet" asp-append-version="true">
    <link href="~/main/fonts/Montserrat.css" rel="stylesheet" asp-append-version="true">

    @*Ignore this, this is for making the test ClickOnAllSideMenus happy*@

    <redoc spec-url="@Url.ActionLink("Swagger")"></redoc>

@inject BTCPayServer.Security.ContentSecurityPolicies csp
@{
    Layout = null;
    csp.Add("script-src", "https://cdn.jsdelivr.net");
    csp.Add("worker-src", "blob: self");
}
<!DOCTYPE html>

    <title>BTCPay Server Greenfield API</title>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="~/main/fonts/Roboto.css" rel="stylesheet" asp-append-version="true">
    <link href="~/main/fonts/Montserrat.css" rel="stylesheet" asp-append-version="true">

    @*Ignore this, this is for making the test ClickOnAllSideMenus happy*@

    <redoc spec-url="@Url.ActionLink("Swagger")"></redoc>

Make CSP more specific for docs

Make CSP more specific for docs


using BroadbandSpeedStats.Database.Schema;
using FluentMigrator;

namespace BroadbandSpeedTests.Database.Migrations.Migrations
{
    [Migration(20170228)]
    public class TodaysTestResultsView : Migration
    {
        public override void Up()
        {
            Execute.Sql($@"
CREATE VIEW [{Views.TodaysTestResults.Name}] WITH SCHEMABINDING AS
    SELECT TOP 100 PERCENT [{Views.TodaysTestResults.Columns.Id}],
                           [{Views.TodaysTestResults.Columns.Timestamp}],
                           [{Views.TodaysTestResults.Columns.PingTime}],
                           [{Views.TodaysTestResults.Columns.DownloadSpeed}],
                           [{Views.TodaysTestResults.Columns.UploadSpeed}]
    FROM [dbo].[{Views.TodaysTestResults.SourceTable}]
    WHERE WHERE DATEDIFF(d, {Views.TodaysTestResults.Columns.Timestamp}, GETUTCDATE()) = 0
    ORDER BY [{Views.TodaysTestResults.Columns.Timestamp}] DESC
GO");
        }

        public override void Down()
        {
            Execute.Sql($"DROP VIEW [{Views.TodaysTestResults.Name}]");
        }
    }
}

using BroadbandSpeedStats.Database.Schema;
using FluentMigrator;

namespace BroadbandSpeedTests.Database.Migrations.Migrations
{
    [Migration(20170228)]
    public class TodaysTestResultsView : Migration
    {
        public override void Up()
        {
            Execute.Sql($@"
CREATE VIEW [{Views.TodaysTestResults.Name}] WITH SCHEMABINDING AS
    SELECT TOP 100 PERCENT [{Views.TodaysTestResults.Columns.Id}],
                           [{Views.TodaysTestResults.Columns.Timestamp}],
                           [{Views.TodaysTestResults.Columns.PingTime}],
                           [{Views.TodaysTestResults.Columns.DownloadSpeed}],
                           [{Views.TodaysTestResults.Columns.UploadSpeed}]
    FROM [dbo].[{Views.TodaysTestResults.SourceTable}]
    WHERE DATEDIFF(d, {Views.TodaysTestResults.Columns.Timestamp}, GETUTCDATE()) = 0
    ORDER BY [{Views.TodaysTestResults.Columns.Timestamp}] DESC
GO");
        }

        public override void Down()
        {
            Execute.Sql($"DROP VIEW [{Views.TodaysTestResults.Name}]");
        }
    }
}

Fix a typo in a view

Fix a typo in a view


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

using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Overlays;
using osu.Game.Overlays.Settings;
using osu.Game.Rulesets.Edit.Checks.Components;

namespace osu.Game.Screens.Edit.Verify
{
    internal class VisibilitySection : EditorRoundedScreenSettingsSection
    {
        [Resolved]
        private VerifyScreen verify { get; set; }

        private readonly IssueType[] configurableIssueTypes =
        {
            IssueType.Warning,
            IssueType.Error,
            IssueType.Negligible
        };

        protected override string Header => "Visibility";

        [BackgroundDependencyLoader]
        private void load(OverlayColourProvider colours)
        {
            foreach (IssueType issueType in configurableIssueTypes)
            {
                var checkbox = new SettingsCheckbox
                {
                    Anchor = Anchor.CentreLeft,
                    Origin = Anchor.CentreLeft,
                    LabelText = issueType.ToString()
                };

                checkbox.Current.Default = !verify.HiddenIssueTypes.Contains(issueType);
                checkbox.Current.SetDefault();
                checkbox.Current.BindValueChanged(state =>
                {
                    if (!state.NewValue)
                        verify.HiddenIssueTypes.Add(issueType);
                    else
                        verify.HiddenIssueTypes.Remove(issueType);
                });

                Flow.Add(checkbox);
            }
        }
    }
}

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

using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Overlays;
using osu.Game.Overlays.Settings;
using osu.Game.Rulesets.Edit.Checks.Components;

namespace osu.Game.Screens.Edit.Verify
{
    internal class VisibilitySection : EditorRoundedScreenSettingsSection
    {
        [Resolved]
        private VerifyScreen verify { get; set; }

        private readonly IssueType[] configurableIssueTypes =
        {
            IssueType.Warning,
            IssueType.Error,
            IssueType.Negligible
        };

        protected override string Header => "Visibility";

        [BackgroundDependencyLoader]
        private void load(OverlayColourProvider colours)
        {
            var hiddenIssueTypes = verify.HiddenIssueTypes.GetBoundCopy();

            foreach (IssueType issueType in configurableIssueTypes)
            {
                var checkbox = new SettingsCheckbox
                {
                    Anchor = Anchor.CentreLeft,
                    Origin = Anchor.CentreLeft,
                    LabelText = issueType.ToString()
                };

                checkbox.Current.Default = !hiddenIssueTypes.Contains(issueType);
                checkbox.Current.SetDefault();
                checkbox.Current.BindValueChanged(state =>
                {
                    if (!state.NewValue)
                        hiddenIssueTypes.Add(issueType);
                    else
                        hiddenIssueTypes.Remove(issueType);
                });

                Flow.Add(checkbox);
            }
        }
    }
}

Use local bound copy for `HiddenIssueTypes`


namespace SoxSharp.Effects
{
  public interface IBaseEffect
  {
    string Name { get; }

    bool IsValid();

    string ToString();
  }
}

namespace SoxSharp.Effects
{
  public interface IBaseEffect
  {
    string Name { get; }

    string ToString();
  }
}

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

This reverts commit 819b807fb9e789bc2e47f8463735b2c745ca0361.


using StreamCompanionTypes.DataTypes;
using StreamCompanionTypes.Enums;
using StreamCompanionTypes.Interfaces;
using StreamCompanionTypes.Interfaces.Sources;

namespace PlaysReplacements
{
    public class PlaysReplacements : IPlugin, ITokensSource
    {
        private int Plays, Retrys;
        private Tokens.TokenSetter _tokenSetter;
        private string lastMapSearchString = "";

        public string Description { get; } = "";
        public string Name { get; } = nameof(PlaysReplacements);
        public string Author { get; } = "Piotrekol";
        public string Url { get; } = "";
        public string UpdateUrl { get; } = "";

        public PlaysReplacements()
        {
            _tokenSetter = Tokens.CreateTokenSetter(Name);
        }

        public void CreateTokens(MapSearchResult map)
        {
            if (map.Action == OsuStatus.Playing)
            {
                if (lastMapSearchString == map.MapSearchString)
                    Retrys++;
                else
                    Plays++;
                lastMapSearchString = map.MapSearchString;
            }

            _tokenSetter("plays", Plays);
            _tokenSetter("retrys", Retrys);
        }

    }
}

using StreamCompanionTypes.DataTypes;
using StreamCompanionTypes.Enums;
using StreamCompanionTypes.Interfaces;
using StreamCompanionTypes.Interfaces.Sources;

namespace PlaysReplacements
{
    public class PlaysReplacements : IPlugin, ITokensSource
    {
        private int Plays, Retrys;
        private Tokens.TokenSetter _tokenSetter;

        public string Description { get; } = "";
        public string Name { get; } = nameof(PlaysReplacements);
        public string Author { get; } = "Piotrekol";
        public string Url { get; } = "";
        public string UpdateUrl { get; } = "";

        public PlaysReplacements()
        {
            _tokenSetter = Tokens.CreateTokenSetter(Name);
            UpdateTokens();
        }

        public void CreateTokens(MapSearchResult map)
        {
            //ignore replays/spect
            if (map.Action != OsuStatus.Playing)
                return;

            switch (map.SearchArgs.EventType)
            {
                case OsuEventType.SceneChange:
                case OsuEventType.MapChange:
                    Plays++;
                    break;
                case OsuEventType.PlayChange:
                    Retrys++;
                    break;
            }

            UpdateTokens();
        }

        private void UpdateTokens()
        {
            _tokenSetter("plays", Plays);
            _tokenSetter("retrys", Retrys);
        }
    }
}

Misc: Refactor plays/retries counting using osu events


// 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.Pooling;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osuTK;

namespace osu.Game.Rulesets.Catch.UI
{
    public class CatcherTrailSprite : PoolableDrawable
    {
        public Texture Texture
        {
            set => sprite.Texture = value;
        }

        private readonly Sprite sprite;

        public CatcherTrailSprite()
        {
            InternalChild = sprite = new Sprite
            {
                RelativeSizeAxes = Axes.Both
            };

            Size = new Vector2(CatcherArea.CATCHER_SIZE);

            // Sets the origin roughly to the centre of the catcher's plate to allow for correct scaling.
            OriginPosition = new Vector2(0.5f, 0.06f) * CatcherArea.CATCHER_SIZE;
        }
    }
}

// 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.Pooling;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osuTK;

namespace osu.Game.Rulesets.Catch.UI
{
    public class CatcherTrailSprite : PoolableDrawable
    {
        public Texture Texture
        {
            set => sprite.Texture = value;
        }

        private readonly Sprite sprite;

        public CatcherTrailSprite()
        {
            InternalChild = sprite = new Sprite
            {
                RelativeSizeAxes = Axes.Both
            };

            Size = new Vector2(CatcherArea.CATCHER_SIZE);

            // Sets the origin roughly to the centre of the catcher's plate to allow for correct scaling.
            OriginPosition = new Vector2(0.5f, 0.06f) * CatcherArea.CATCHER_SIZE;
        }

        protected override void FreeAfterUse()
        {
            ClearTransforms();
            base.FreeAfterUse();
        }
    }
}

Clear all transforms of catcher trail sprite before returned to pool


using System;
using FluentAssertions;
using Microsoft.Practices.Unity;
using Unity.Interception.Serilog.Tests.Support;
using Xunit;

namespace Unity.Interception.Serilog.Tests
{
    public class NullTests
    {
        [Fact]
        public void NullMembersShouldThrow()
        {
            var container = new UnityContainer();
            Action[] actions = {
                () => container.RegisterLoggedType<IDummy, Dummy>((InjectionMember[])null),
                () => container.RegisterLoggedType<IDummy, Dummy>("", (InjectionMember[])null),
                () => container.RegisterLoggedType<IDummy, Dummy>(new ContainerControlledLifetimeManager(), null),
                () => container.RegisterLoggedType<IDummy, Dummy>("", new ContainerControlledLifetimeManager(), null)
            };
            foreach (var action in actions)
            {
                action.ShouldThrow<ArgumentNullException>().WithMessage("Value cannot be null.\nParameter name: first");
            }
        }

        [Fact]
        public void NullContainerShouldThrow()
        {
            Action[] actions = {
                () => UnityContainerExtensions.RegisterLoggedType<IDummy, Dummy>(null),
                () => UnityContainerExtensions.RegisterLoggedType<IDummy, Dummy>(null, ""),
                () => UnityContainerExtensions.RegisterLoggedType<IDummy, Dummy>(null, new ContainerControlledLifetimeManager()),
                () => UnityContainerExtensions.RegisterLoggedType<IDummy, Dummy>(null, "", new ContainerControlledLifetimeManager())
            };
            foreach (var action in actions)
            {
                action.ShouldThrow<ArgumentNullException>().WithMessage("Value cannot be null.\nParameter name: container");
            }
        }
    }
}

using System;
using FluentAssertions;
using Microsoft.Practices.Unity;
using Unity.Interception.Serilog.Tests.Support;
using Xunit;

namespace Unity.Interception.Serilog.Tests
{
    public class NullTests
    {
        [Fact]
        public void NullMembersShouldThrow()
        {
            var container = new UnityContainer();
            Action[] actions = {
                () => container.RegisterLoggedType<IDummy, Dummy>((InjectionMember[])null),
                () => container.RegisterLoggedType<IDummy, Dummy>("", (InjectionMember[])null),
                () => container.RegisterLoggedType<IDummy, Dummy>(new ContainerControlledLifetimeManager(), null),
                () => container.RegisterLoggedType<IDummy, Dummy>("", new ContainerControlledLifetimeManager(), null)
            };
            foreach (var action in actions)
            {
                action.ShouldThrow<ArgumentNullException>();
            }
        }

        [Fact]
        public void NullContainerShouldThrow()
        {
            Action[] actions = {
                () => UnityContainerExtensions.RegisterLoggedType<IDummy, Dummy>(null),
                () => UnityContainerExtensions.RegisterLoggedType<IDummy, Dummy>(null, ""),
                () => UnityContainerExtensions.RegisterLoggedType<IDummy, Dummy>(null, new ContainerControlledLifetimeManager()),
                () => UnityContainerExtensions.RegisterLoggedType<IDummy, Dummy>(null, "", new ContainerControlledLifetimeManager())
            };
            foreach (var action in actions)
            {
                action.ShouldThrow<ArgumentNullException>();
            }
        }
    }
}

Remove test on argument null exception message


namespace SIM.Client.Commands
{
  using CommandLine;
  using JetBrains.Annotations;
  using SIM.Core.Commands;

  public class InstallCommandFacade : InstallCommand
  {
    [UsedImplicitly]
    public InstallCommandFacade()
    {
    }

    [Option('n', "name", Required = true)]
    public override string Name { get; set; }

    [Option('s', "sqlPrefix", HelpText = "Logical names prefix of SQL databases, by default equals to instance name")]
    public override string SqlPrefix { get; set; }

    [Option('p', "product")]
    public override string Product { get; set; }

    [Option('v', "version")]
    public override string Version { get; set; }

    [Option('r', "revision")]
    public override string Revision { get; set; }

    [Option('a', "attach", HelpText = "Attach SQL databases, or just update ConnectionStrings.config", DefaultValue = AttachDatabasesDefault)]
    public override bool? AttachDatabases { get; set; }
  }
}

namespace SIM.Client.Commands
{
  using CommandLine;
  using JetBrains.Annotations;
  using SIM.Core.Commands;

  public class InstallCommandFacade : InstallCommand
  {
    [UsedImplicitly]
    public InstallCommandFacade()
    {
    }

    [Option('n', "name", Required = true)]
    public override string Name { get; set; }

    [Option('s', "sqlPrefix", HelpText = "Logical names prefix of SQL databases, by default equals to instance name")]
    public override string SqlPrefix { get; set; }

    [Option('p', "product")]
    public override string Product { get; set; }

    [Option('v', "version")]
    public override string Version { get; set; }

    [Option('r', "revision")]
    public override string Revision { get; set; }

    [Option('a', "attach", HelpText = "Attach SQL databases, or just update ConnectionStrings.config", DefaultValue = AttachDatabasesDefault)]
    public override bool? AttachDatabases { get; set; }

    [Option('u', "skipUnnecessaryFiles", HelpText = "Skip unnecessary files to speed up installation", DefaultValue = AttachDatabasesDefault)]
    public override bool? SkipUnnecessaryFiles { get; set; }
  }
}

Add option to install command

Add option to install command


using System;

namespace Marten.Services
{
    public class ConcurrentUpdateException : Exception
    {
        public ConcurrentUpdateException(Exception innerException) : base("Write collission detected while commiting the transaction.", innerException)
        {
        }
    }
}

using System;

namespace Marten.Services
{
    public class ConcurrentUpdateException : Exception
    {
        public ConcurrentUpdateException(Exception innerException) : base("Write collision detected while commiting the transaction.", innerException)
        {
        }
    }
}

Fix spelling mistake, 'collission' => 'collision'


using Microsoft.Extensions.DependencyInjection;
using System;

namespace THNETII.DependencyInjection.Nesting
{
    public static class NestedServicesServiceCollectionExtensions
    {
        public static IServiceCollection AddNestedServices(
            this IServiceCollection rootServices,
            string key,
            Action<INestedServiceCollection> configureServices)
        {
            throw new NotImplementedException();
            return rootServices;
        }
    }
}

using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;

namespace THNETII.DependencyInjection.Nesting
{
    public static class NestedServicesServiceCollectionExtensions
    {
        public static IServiceCollection AddNestedServices(
            this IServiceCollection rootServices,
            string key,
            Action<INestedServiceCollection> configureServices)
        {
            return AddNestedServices<string>(
                rootServices,
                key,
                StringComparer.OrdinalIgnoreCase,
                configureServices
                );
        }

        public static IServiceCollection AddNestedServices<T>(
            this IServiceCollection rootServices,
            string key,
            Action<INestedServiceCollection> configureServices)
            => AddNestedServices<T>(rootServices, key,
                StringComparer.OrdinalIgnoreCase,
                configureServices);

        public static IServiceCollection AddNestedServices<T>(
            this IServiceCollection rootServices,
            string key, IEqualityComparer<string> keyComparer,
            Action<INestedServiceCollection> configureServices)
        {
            throw new NotImplementedException();
            return rootServices;
        }
    }
}

Add Nesting ServiceCollection Extension method overloads


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

namespace Ext.NET
{
    class IntegerExtension
    {
        public static void Times(this int n, Action<int> action)
        {
            for (int i = 0; i < n; ++i)
            {
                action(i);
            }
        }
    }
}

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

namespace Ext.NET
{
    class IntegerExtension
    {
        public static void Times(this int n, Action<int> action)
        {
            for (int i = 0; i < n; ++i)
            {
                action(i);
            }
        }

        public static IEnumerable<int> To(this int n, int to)
        {
            if (n == to)
            {
                yield return n;
            }
            else if (to > n)
            {
                for (int i = n; i < to; ++i)
                    yield return i;
            }
            else
            {
                for (int i = n; i > to; --i)
                    yield return i;
            }
        }
    }
}

Add Int.To(Int) Method, which allow to generate a sequence between two numbers.


@model Portal.CMS.Entities.Entities.Copy.Copy
@using Portal.CMS.Web.Areas.Admin.Helpers;
@{
    Layout = "";

    var isAdmin = UserHelper.IsAdmin;
}

    @if (isAdmin) {
@Model.CopyName
 }

        @Html.Raw(Model.CopyBody)

Copy Updates Other Copy elements of the Same Type on the Same Page When Saving


#tool "nuget:?package=xunit.runner.console"

var target = Argument("target", "Default");
var outputDir = "./bin";

Task("Default")
  .IsDependentOn("Xunit")
  .Does(() =>
{
});

Task("Xunit")
  .IsDependentOn("Build")
  .Does(()=>
  {
    DotNetCoreTest("./src/FibonacciHeap.Tests/FibonacciHeap.Tests.csproj");
  });

Task("Build")
  .IsDependentOn("NugetRestore")
  .Does(()=>
  {
    DotNetCoreMSBuild("FibonacciHeap.sln");
  });

Task("NugetRestore")
  .IsDependentOn("Clean")
  .Does(()=>
  {
    DotNetCoreRestore();
  });

Task("NugetPack")
  .IsDependentOn("Build")
  .Does(()=>
  {
    var settings = new DotNetCorePackSettings
    {
      Configuration = "Release",
      OutputDirectory = "../../nupkgs"
    };

    DotNetCorePack("src/FibonacciHeap", settings);
  });

Task("Clean")
  .Does(()=>
  {
    CleanDirectories("**/bin/**");
    CleanDirectories("**/obj/**");
    CleanDirectories("nupkgs");
  });

RunTarget(target);

#tool "nuget:?package=xunit.runner.console"

var target = Argument("target", "Default");
var outputDir = "./bin";

Task("Default")
  .IsDependentOn("Xunit")
  .Does(() =>
{
});

Task("Xunit")
  .IsDependentOn("Build")
  .Does(()=>
  {
    DotNetCoreTest("./src/FibonacciHeap.Tests/FibonacciHeap.Tests.csproj");
  });

Task("Build")
  .IsDependentOn("NugetRestore")
  .Does(()=>
  {
    DotNetCoreMSBuild("FibonacciHeap.sln");
  });

Task("NugetRestore")
  .IsDependentOn("Clean")
  .Does(()=>
  {
    DotNetCoreRestore();
  });

Task("NugetPack")
  .IsDependentOn("Clean")
  .Does(()=>
  {
    var settings = new DotNetCorePackSettings
    {
      Configuration = "Release",
      OutputDirectory = "nupkgs"
    };

    DotNetCorePack("src/FibonacciHeap", settings);
  });

Task("Clean")
  .Does(()=>
  {
    CleanDirectories("**/bin/**");
    CleanDirectories("**/obj/**");
    CleanDirectories("nupkgs");
  });

RunTarget(target);

Fix output path for nuget package.

Fix output path for nuget package.


using Serilog.Configuration;
using Serilog.Core;
using Serilog.Events;
using Serilog.Sinks.Graylog.Helpers;
using Serilog.Sinks.Graylog.Transport;

namespace Serilog.Sinks.Graylog
{
    public static class LoggerConfigurationGrayLogExtensions
    {
        public static LoggerConfiguration Graylog(this LoggerSinkConfiguration loggerSinkConfiguration,
            GraylogSinkOptions options)
        {
            var sink = (ILogEventSink) new GraylogSink(options);
            return loggerSinkConfiguration.Sink(sink, options.MinimumLogEventLevel);
        }

        public static LoggerConfiguration Graylog(this LoggerSinkConfiguration loggerSinkConfiguration,
            string hostnameOrAddress,
            int port,
            TransportType transportType,
            LogEventLevel minimumLogEventLevel = LevelAlias.Minimum,
            MessageIdGeneratortype messageIdGeneratorType = GraylogSinkOptions.DefaultMessageGeneratorType,
            int shortMessageMaxLength = 500,
            int stackTraceDepth = 10,
            string facility = GraylogSinkOptions.DefaultFacility
            )
        {
            var options = new GraylogSinkOptions
            {
                HostnameOrAdress = hostnameOrAddress,
                Port = port,
                TransportType = transportType,
                MinimumLogEventLevel = minimumLogEventLevel,
                MessageGeneratorType = messageIdGeneratorType,
                ShortMessageMaxLength = shortMessageMaxLength,
                StackTraceDepth = stackTraceDepth,
                Facility = facility
            };

            return loggerSinkConfiguration.Graylog(options);
        }
    }
}

using Serilog.Configuration;
using Serilog.Core;
using Serilog.Events;
using Serilog.Sinks.Graylog.Helpers;
using Serilog.Sinks.Graylog.Transport;

namespace Serilog.Sinks.Graylog
{
    public static class LoggerConfigurationGrayLogExtensions
    {
        public static LoggerConfiguration Graylog(this LoggerSinkConfiguration loggerSinkConfiguration,
            GraylogSinkOptions options)
        {
            var sink = (ILogEventSink) new GraylogSink(options);
            return loggerSinkConfiguration.Sink(sink, options.MinimumLogEventLevel);
        }

        public static LoggerConfiguration Graylog(this LoggerSinkConfiguration loggerSinkConfiguration,
            string hostnameOrAddress,
            int port,
            TransportType transportType,
            LogEventLevel minimumLogEventLevel = LevelAlias.Minimum,
            MessageIdGeneratortype messageIdGeneratorType = GraylogSinkOptions.DefaultMessageGeneratorType,
            int shortMessageMaxLength = GraylogSinkOptions.DefaultShortMessageMaxLength,
            int stackTraceDepth = GraylogSinkOptions.DefaultStackTraceDepth,
            string facility = GraylogSinkOptions.DefaultFacility
            )
        {
            var options = new GraylogSinkOptions
            {
                HostnameOrAdress = hostnameOrAddress,
                Port = port,
                TransportType = transportType,
                MinimumLogEventLevel = minimumLogEventLevel,
                MessageGeneratorType = messageIdGeneratorType,
                ShortMessageMaxLength = shortMessageMaxLength,
                StackTraceDepth = stackTraceDepth,
                Facility = facility
            };

            return loggerSinkConfiguration.Graylog(options);
        }
    }
}

Change extension method default parameters to use constants


using Veil.Parser;

namespace Veil.Compiler
{
    internal partial class VeilTemplateCompiler<T>
    {
        private void EmitWriteLiteral(SyntaxTreeNode.WriteLiteralNode node)
        {
            LoadWriterToStack();
            emitter.LoadConstant(node.LiteralContent);
            CallWriteFor(typeof(string));
        }
    }
}

using Veil.Parser;

namespace Veil.Compiler
{
    internal partial class VeilTemplateCompiler<T>
    {
        private void EmitWriteLiteral(SyntaxTreeNode.WriteLiteralNode node)
        {
            if (string.IsNullOrEmpty(node.LiteralContent)) return;

            LoadWriterToStack();
            emitter.LoadConstant(node.LiteralContent);
            CallWriteFor(typeof(string));
        }
    }
}

Optimize away empty string literals.

Optimize away empty string literals.


using ArduinoWindowsRemoteControl.Helpers;
using ArduinoWindowsRemoteControl.Interfaces;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ArduinoWindowsRemoteControl.UI
{
    public partial class EditCommandForm : Form
    {
        private List<int> _pressedButtons = new List<int>();

        public EditCommandForm()
        {
            InitializeComponent();
            cbRemoteCommand.Items.AddRange(EnumHelpers.GetAvailableEnumValues<RemoteCommand>().ToArray());
        }

        private void btCancel_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void tbCommand_KeyDown(object sender, KeyEventArgs e)
        {
            if (!_pressedButtons.Contains(e.KeyValue))
            {
                tbCommand.Text += WinAPIHelpers.GetKeyStringForVirtualCode((byte)e.KeyValue);
                _pressedButtons.Add(e.KeyValue);
            }
            e.Handled = true;
        }

        private void tbCommand_KeyUp(object sender, KeyEventArgs e)
        {
            _pressedButtons.Remove(e.KeyValue);
            e.Handled = true;
        }

        private void tbCommand_KeyPress(object sender, KeyPressEventArgs e)
        {
            e.Handled = true;
        }
    }
}

using ArduinoWindowsRemoteControl.Helpers;
using ArduinoWindowsRemoteControl.Interfaces;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ArduinoWindowsRemoteControl.UI
{
    public partial class EditCommandForm : Form
    {
        private List<int> _pressedButtons = new List<int>();
        private bool _isKeyStrokeEnabled = false;

        public EditCommandForm()
        {
            InitializeComponent();
            cbRemoteCommand.Items.AddRange(EnumHelpers.GetAvailableEnumValues<RemoteCommand>().ToArray());
        }

        private void btCancel_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void tbCommand_KeyDown(object sender, KeyEventArgs e)
        {
            if (!_pressedButtons.Contains(e.KeyValue))
            {
                //key command ended, start new one
                if (_pressedButtons.Count == 0)
                {
                    _isKeyStrokeEnabled = false;
                }

                if (_isKeyStrokeEnabled)
                {
                    tbCommand.Text += "-";
                }
                else
                {
                    if (tbCommand.Text.Length > 0)
                        tbCommand.Text += ",";
                }

                tbCommand.Text += WinAPIHelpers.GetKeyStringForVirtualCode((byte)e.KeyValue);
                tbCommand.SelectionStart = tbCommand.Text.Length;
                _pressedButtons.Add(e.KeyValue);
            }
            else
            {
                if (_pressedButtons.Last() == e.KeyValue)
                {
                    _isKeyStrokeEnabled = true;
                }
            }
            e.Handled = true;
        }

        private void tbCommand_KeyUp(object sender, KeyEventArgs e)
        {
            _pressedButtons.Remove(e.KeyValue);
            e.Handled = true;
        }

        private void tbCommand_KeyPress(object sender, KeyPressEventArgs e)
        {
            e.Handled = true;
        }
    }
}

Add ability to enter commands

Add ability to enter commands


using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Linq.Expressions;

namespace ExRam.Gremlinq
{
    public sealed class ValuesGremlinStep<TSource, TTarget> : NonTerminalGremlinStep
    {
        private readonly Expression<Func<TSource, TTarget>>[] _projections;

        public ValuesGremlinStep(Expression<Func<TSource, TTarget>>[] projections)
        {
            this._projections = projections;
        }

        public override IEnumerable<TerminalGremlinStep> Resolve(IGraphModel model)
        {
            yield return new TerminalGremlinStep(
                "values",
                this._projections
                    .Select(projection =>
                    {
                        if (projection.Body is MemberExpression memberExpression)
                            return model.GetIdentifier(memberExpression.Member.Name);

                        throw new NotSupportedException();
                    })
                    .ToImmutableList());
        }
    }
}

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Linq.Expressions;

namespace ExRam.Gremlinq
{
    public sealed class ValuesGremlinStep<TSource, TTarget> : NonTerminalGremlinStep
    {
        private readonly Expression<Func<TSource, TTarget>>[] _projections;

        public ValuesGremlinStep(Expression<Func<TSource, TTarget>>[] projections)
        {
            this._projections = projections;
        }

        public override IEnumerable<TerminalGremlinStep> Resolve(IGraphModel model)
        {
            var keys = this._projections
                .Select(projection =>
                {
                    if (projection.Body is MemberExpression memberExpression)
                        return model.GetIdentifier(memberExpression.Member.Name);

                    throw new NotSupportedException();
                })
                .ToArray();

            var numberOfIdSteps = keys
                .OfType<T>()
                .Count(x => x == T.Id);

            var propertyKeys = keys
                .OfType<string>()
                .Cast<object>()
                .ToArray();

            if (numberOfIdSteps > 1 || (numberOfIdSteps > 0 && propertyKeys.Length > 0))
                throw new NotSupportedException();

            if (numberOfIdSteps > 0)
                yield return new TerminalGremlinStep("id");
            else
            {
                yield return new TerminalGremlinStep(
                    "values",
                    propertyKeys
                        .ToImmutableList());
            }
        }
    }
}

Make one of two red tests green by implementing basic support for the Values-method with Id-Property.


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 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));
            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 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;
        }
    }
}

Make it configurable if high or low throws.

Resolves #7


using UnityEngine;
using UnityEngine.UI;

/// <summary>
/// Attach this to the status text game object
/// </summary>
public class StatusText : MonoBehaviour
{
    Text text;
    GlobalGame game;

    public GlobalGame Game
    {
        get
        { return game; }
        set
        {
            if (game != null)
            {
                game.WinnerChanged -= HandleGameStateChanged;
                game.TurnChanged -= HandleGameStateChanged;
            }

            game = value;

            game.WinnerChanged += HandleGameStateChanged;
            game.TurnChanged += HandleGameStateChanged;
        }
    }

    private void Start()
    {
        text = GetComponent<Text>();
        if (game != null)
        {
            HandleGameStateChanged(null, null);
        }
    }

    public void HandleGameStateChanged(object o, GameEventArgs e)
    {
        if (game.GameOver())
        {
            if (game.Winner != null)
            {
                text.text = game.Winner.Name + " wins!";
                return;
            }
            text.text = "Tie game";
            return;
        }
        text.text = game.ActivePlayer().Name + "'s turn";
    }
}

using UnityEngine;
using UnityEngine.UI;

/// <summary>
/// Attach this to the status text game object
/// </summary>
public class StatusText : MonoBehaviour
{
    Text text;
    GlobalGame game;

    public GlobalGame Game
    {
        get
        { return game; }
        set
        {
            if (game != null)
            {
                game.WinnerChanged -= HandleGameStateChanged;
                game.TurnChanged -= HandleGameStateChanged;
            }

            game = value;

            if (game != null)
            {
                game.WinnerChanged += HandleGameStateChanged;
                game.TurnChanged += HandleGameStateChanged;
            }
            UpdateState();
        }
    }

    void UpdateState()
    {
        HandleGameStateChanged(game, null);
    }

    private void Start()
    {
        text = GetComponent<Text>();
        UpdateState();
    }

    public void HandleGameStateChanged(object o, GameEventArgs e)
    {
        if (game == null)
        {
            text.text = "";
            return;
        }

        if (game.GameOver())
        {
            if (game.Winner != null)
            {
                text.text = game.Winner.Name + " wins!";
                return;
            }
            text.text = "Tie game";
            return;
        }

        text.text = game.ActivePlayer().Name + "'s turn";
    }
}

Fix status text not updating upon reset

Fix status text not updating upon reset


using UnityEngine;
using UnityEngine.UI;

/// <summary>
/// Attach this to the status text game object
/// </summary>
public class StatusText : MonoBehaviour
{
    Text text;
    GlobalGame game;

    public GlobalGame Game
    {
        get
        { return game; }
        set
        {
            if (game != null)
            {
                game.WinnerChanged -= HandleGameStateChanged;
                game.TurnChanged -= HandleGameStateChanged;
            }

            game = value;

            if (game != null)
            {
                game.WinnerChanged += HandleGameStateChanged;
                game.TurnChanged += HandleGameStateChanged;
            }
            UpdateState();
        }
    }

    void UpdateState()
    {
        HandleGameStateChanged(game, null);
    }

    private void Start()
    {
        text = GetComponent<Text>();
        UpdateState();
    }

    public void HandleGameStateChanged(object o, GameEventArgs e)
    {
        if (game == null)
        {
            text.text = "";
            return;
        }

        if (game.GameOver())
        {
            if (game.Winner != null)
            {
                text.text = game.Winner.Name + " wins!";
                return;
            }
            text.text = "Tie game";
            return;
        }

        text.text = game.ActivePlayer().Name + "'s turn";
    }
}

using UnityEngine;
using UnityEngine.UI;

/// <summary>
/// Attach this to the status text game object
/// </summary>
public class StatusText : MonoBehaviour
{
    GlobalGame game;

    public GlobalGame Game
    {
        get
        { return game; }
        set
        {
            if (game != null)
            {
                game.WinnerChanged -= HandleGameStateChanged;
                game.TurnChanged -= HandleGameStateChanged;
            }

            game = value;

            if (game != null)
            {
                game.WinnerChanged += HandleGameStateChanged;
                game.TurnChanged += HandleGameStateChanged;
            }
            UpdateState();
        }
    }

    void UpdateState()
    {
        HandleGameStateChanged(game, null);
    }

    private void Awake()
    {
        UpdateState();
    }

    public void HandleGameStateChanged(object o, GameEventArgs e)
    {
        Text text = GetComponent<Text>();
        if (game == null)
        {
            text.text = "";
            return;
        }

        if (game.GameOver())
        {
            if (game.Winner != null)
            {
                text.text = game.Winner.Name + " wins!";
                return;
            }
            text.text = "Tie game";
            return;
        }

        text.text = game.ActivePlayer().Name + "'s turn";
    }
}

Fix null error on status text initialization


using System;
using System.Linq;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
using CorvallisBus.Core.Models;
using HtmlAgilityPack;

namespace CorvallisBus.Core.WebClients
{
    public static class ServiceAlertsClient
    {
        static readonly Uri FEED_URL = new Uri("https://www.corvallisoregon.gov/news?field_microsite_tid=581");
        static readonly HttpClient httpClient = new HttpClient();
        public static async Task<List<ServiceAlert>> GetServiceAlerts()
        {
            var responseStream = await httpClient.GetStreamAsync(FEED_URL);
            var htmlDocument = new HtmlDocument();
            htmlDocument.Load(responseStream);

            var alerts = htmlDocument.DocumentNode.SelectNodes("//tbody/tr")
                .Select(row => ParseRow(row))
                .ToList();
            return alerts;
        }

        private static ServiceAlert ParseRow(HtmlNode row)
        {
            var anchor = row.Descendants("a").First();
            var relativeLink = anchor.Attributes["href"].Value;
            var link = new Uri(FEED_URL, relativeLink).ToString();
            var title = anchor.InnerText;

            var publishDate = row.Descendants("span")
                .First(node => node.HasClass("date-display-single"))
                .Attributes["content"]
                .Value;

            return new ServiceAlert(title, publishDate, link);
        }
    }
}

using System;
using System.Linq;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
using CorvallisBus.Core.Models;
using HtmlAgilityPack;

namespace CorvallisBus.Core.WebClients
{
    public static class ServiceAlertsClient
    {
        static readonly Uri FEED_URL = new Uri("https://www.corvallisoregon.gov/news?field_microsite_tid=581");
        static readonly HttpClient httpClient = new HttpClient();
        public static async Task<List<ServiceAlert>> GetServiceAlerts()
        {
            var responseStream = await httpClient.GetStreamAsync(FEED_URL);
            var htmlDocument = new HtmlDocument();
            htmlDocument.Load(responseStream);

            var alerts = htmlDocument.DocumentNode.SelectNodes("//tbody/tr")
                .Select(row => ParseRow(row))
                .ToList();

            alerts.Insert(0, new ServiceAlert(
                title: "App Update for Upcoming CTS Schedule",
                publishDate: "2019-09-09T00:00:00-07:00",
                link: "https://rikkigibson.github.io/corvallisbus"));

            return alerts;
        }

        private static ServiceAlert ParseRow(HtmlNode row)
        {
            var anchor = row.Descendants("a").First();
            var relativeLink = anchor.Attributes["href"].Value;
            var link = new Uri(FEED_URL, relativeLink).ToString();
            var title = anchor.InnerText;

            var publishDate = row.Descendants("span")
                .First(node => node.HasClass("date-display-single"))
                .Attributes["content"]
                .Value;

            return new ServiceAlert(title, publishDate, link);
        }
    }
}

Add service alert for app update notice

Add service alert for app update notice


using System;
using DesktopWidgets.Properties;

namespace DesktopWidgets.Helpers
{
    public static class DoubleHelper
    {
        public static bool IsEqual(this double val1, double val2) =>
            double.IsNaN(val1) || double.IsNaN(val1) ||
            (Math.Abs(val1 - val2) > Settings.Default.DoubleComparisonTolerance);
    }
}

using System;
using DesktopWidgets.Properties;

namespace DesktopWidgets.Helpers
{
    public static class DoubleHelper
    {
        public static bool IsEqual(this double val1, double val2) =>
            double.IsNaN(val1) || double.IsNaN(val2) ||
            (Math.Abs(val1 - val2) > Settings.Default.DoubleComparisonTolerance);
    }
}

Fix NaN floating point comparison

Fix NaN floating point comparison


using System.Collections;
using System.Collections.Specialized;
using System.Text;

namespace TweetDuck.Core.Other.Analytics{
    sealed class AnalyticsReport : IEnumerable{
        private OrderedDictionary data = new OrderedDictionary(32);
        private int separators;

        public void Add(int ignored){ // adding separators to pretty print
            data.Add((++separators).ToString(), null);
        }

        public void Add(string key, string value){
            data.Add(key, value);
        }

        public AnalyticsReport FinalizeReport(){
            if (!data.IsReadOnly){
                data = data.AsReadOnly();
            }

            return this;
        }

        public IEnumerator GetEnumerator(){
            return data.GetEnumerator();
        }

        public NameValueCollection ToNameValueCollection(){
            NameValueCollection collection = new NameValueCollection();

            foreach(DictionaryEntry entry in data){
                if (entry.Value != null){
                    collection.Add((string)entry.Key, (string)entry.Value);
                }
            }

            return collection;
        }

        public override string ToString(){
            StringBuilder build = new StringBuilder();

            foreach(DictionaryEntry entry in data){
                if (entry.Value == null){
                    build.AppendLine();
                }
                else{
                    build.AppendLine(entry.Key+": "+entry.Value);
                }
            }

            return build.ToString();
        }
    }
}

using System.Collections;
using System.Collections.Specialized;
using System.Text;

namespace TweetDuck.Core.Other.Analytics{
    sealed class AnalyticsReport : IEnumerable{
        private OrderedDictionary data = new OrderedDictionary(32);
        private int separators;

        public void Add(int ignored){ // adding separators to pretty print
            data.Add((++separators).ToString(), null);
        }

        public void Add(string key, string value){
            data.Add(key, value);
        }

        public AnalyticsReport FinalizeReport(){
            if (!data.IsReadOnly){
                data = data.AsReadOnly();
            }

            return this;
        }

        public IEnumerator GetEnumerator(){
            return data.GetEnumerator();
        }

        public NameValueCollection ToNameValueCollection(){
            NameValueCollection collection = new NameValueCollection();

            foreach(DictionaryEntry entry in data){
                if (entry.Value != null){
                    collection.Add(((string)entry.Key).ToLower().Replace(' ', '_'), (string)entry.Value);
                }
            }

            return collection;
        }

        public override string ToString(){
            StringBuilder build = new StringBuilder();

            foreach(DictionaryEntry entry in data){
                if (entry.Value == null){
                    build.AppendLine();
                }
                else{
                    build.AppendLine(entry.Key+": "+entry.Value);
                }
            }

            return build.ToString();
        }
    }
}

Tweak key format in analytics request

Tweak key format in analytics request


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

namespace osu.Game.Online
{
    public class ProductionEndpointConfiguration : EndpointConfiguration
    {
        public ProductionEndpointConfiguration()
        {
            WebsiteRootUrl = APIEndpointUrl = @"https://osu.ppy.sh";
            APIClientSecret = @"FGc9GAtyHzeQDshWP5Ah7dega8hJACAJpQtw6OXk";
            APIClientID = "5";
            SpectatorEndpointUrl = "https://spectator2.ppy.sh/spectator";
            MultiplayerEndpointUrl = "https://spectator2.ppy.sh/multiplayer";
        }
    }
}

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

namespace osu.Game.Online
{
    public class ProductionEndpointConfiguration : EndpointConfiguration
    {
        public ProductionEndpointConfiguration()
        {
            WebsiteRootUrl = APIEndpointUrl = @"https://osu.ppy.sh";
            APIClientSecret = @"FGc9GAtyHzeQDshWP5Ah7dega8hJACAJpQtw6OXk";
            APIClientID = "5";
            SpectatorEndpointUrl = "https://spectator.ppy.sh/spectator";
            MultiplayerEndpointUrl = "https://spectator.ppy.sh/multiplayer";
        }
    }
}

Update spectator/multiplayer endpoint in line with new deployment


@using JoinRpg.Web.Models
@model CharacterDetailsViewModel

    @Html.Partial("CharacterNavigation", Model.Navigation)
    @* TODO: Жесточайше причесать эту страницу*@

Игрок

@Html.DisplayFor(model => model, "IPlayerCharacter")

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

@Html.DisplayFor(model => model.Description)

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

@Html.DisplayFor(model => model.ParentGroups)

Поля персонажа

        @Html.Partial("_EditFieldsPartial", Model.Fields)

    @Html.Partial("_PlotForCharacterPartial", Model.Plot)

@using JoinRpg.Web.Models
@model CharacterDetailsViewModel

    @Html.Partial("CharacterNavigation", Model.Navigation)
    @* TODO: Жесточайше причесать эту страницу*@

Игрок

@Html.DisplayFor(model => model, "IPlayerCharacter")

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

@Html.DisplayFor(model => model.Description)

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

@Html.DisplayFor(model => model.ParentGroups)

@if (Model.Fields.CharacterFields.Any())
{

Поля персонажа

        @Html.Partial("_EditFieldsPartial", Model.Fields)

}
    @Html.Partial("_PlotForCharacterPartial", Model.Plot)

Hide character fields header if no fields


using static System.Console;
using CIV.Ccs;

namespace CIV
{
    class Program
    {
        static void Main(string[] args)
        {
  			var text = System.IO.File.ReadAllText(args[0]);

			var processes = CcsFacade.ParseAll(text);
            var trace = CcsFacade.RandomTrace(processes["Prison"], 450);
            foreach (var action in trace)
            {
                WriteLine(action);
            }
        }
    }
}

using static System.Console;
using CIV.Ccs;
using CIV.Interfaces;

namespace CIV
{
    class Program
    {
        static void Main(string[] args)
        {
  			var text = System.IO.File.ReadAllText(args[0]);

			var processes = CcsFacade.ParseAll(text);
            var trace = CcsFacade.RandomTrace(processes["Prison"], 450);
            foreach (var action in trace)
            {
                WriteLine(action);
            }
        }
    }
}

Add CIV.Interfaces reference in Main

Add CIV.Interfaces reference in Main


using System.Web.Http;
using Autofac;
using Autofac.Integration.WebApi;

namespace ReSharperTnT
{
    public class Bootstrapper
    {
        static Bootstrapper()
        {
            Init();
        }

        public static void Init()
        {
            var bootstrapper = new Bootstrapper();
            var container = bootstrapper.CreateContainer();
            var autofacWebApiDependencyResolver = new AutofacWebApiDependencyResolver(container);
            GlobalConfiguration.Configuration.DependencyResolver = autofacWebApiDependencyResolver;
        }

        private readonly IContainer _container;

        public Bootstrapper()
        {
            var builder = new ContainerBuilder();

            builder.RegisterAssemblyTypes(typeof (Bootstrapper).Assembly)
                .AsImplementedInterfaces();

            builder.RegisterAssemblyTypes(typeof (Bootstrapper).Assembly)
                .Where(c=>c.Name.EndsWith("Controller"))
                .AsSelf();

            _container = builder.Build();
        }

        public IContainer CreateContainer()
        {
            return _container;
        }

        public T Get<T>()
        {
            return _container.Resolve<T>();
        }
    }
}

using System.Reflection;
using System.Web.Http;
using Autofac;
using Autofac.Integration.WebApi;

namespace ReSharperTnT
{
    public class Bootstrapper
    {
        public static void Init()
        {
            var bootstrapper = new Bootstrapper();
            var container = bootstrapper.CreateContainer();
            var autofacWebApiDependencyResolver = new AutofacWebApiDependencyResolver(container);
            GlobalConfiguration.Configuration.DependencyResolver = autofacWebApiDependencyResolver;
        }

        private readonly IContainer _container;

        public Bootstrapper()
        {
            var builder = new ContainerBuilder();

            builder.RegisterApiControllers(Assembly.GetExecutingAssembly());

            builder.RegisterAssemblyTypes(typeof (Bootstrapper).Assembly)
                .AsImplementedInterfaces();

            _container = builder.Build();
        }

        public IContainer CreateContainer()
        {
            return _container;
        }

        public T Get<T>()
        {
            return _container.Resolve<T>();
        }
    }
}

Revert "Revert "registration of api controllers fixed""

This reverts commit 5d659b38601b2620054b286c941a5d53f1da20ae.


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

namespace RecurringDates
{
    public static class Extensions
    {
        public static SetUnionRule Or(this IRule first, params IRule[] otherRules)
        {
            return new SetUnionRule {Rules = new[] {first}.Concat(otherRules)};
        }

        public static SetIntersectionRule And(this IRule first, params IRule[] otherRules)
        {
            return new SetIntersectionRule { Rules = new[] { first }.Concat(otherRules) };
        }

        public static SetDifferenceRule Except(this IRule includeRule, IRule excludeRule)
        {
            return new SetDifferenceRule { IncludeRule = includeRule , ExcludeRule = excludeRule };
        }

        public static NotRule Not(this IRule rule)
        {
            return new NotRule { ReferencedRule = rule };
        }

        public static NthInMonthRule NthInMonth(this IRule rule, int nthOccurrence)
        {
            return new NthInMonthRule {Nth = nthOccurrence, ReferencedRule = rule};
        }

        public static MonthsFilterRule InMonths(this IRule rule, params Month[] months)
        {
            return new MonthsFilterRule { Months = months, ReferencedRule = rule };
        }
    }
}

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

namespace RecurringDates
{
    public static class Extensions
    {
        public static SetUnionRule Or(this IRule first, params IRule[] otherRules)
        {
            return new SetUnionRule {Rules = new[] {first}.Concat(otherRules)};
        }

        public static SetIntersectionRule And(this IRule first, params IRule[] otherRules)
        {
            return new SetIntersectionRule { Rules = new[] { first }.Concat(otherRules) };
        }

        public static SetDifferenceRule Except(this IRule includeRule, IRule excludeRule)
        {
            return new SetDifferenceRule { IncludeRule = includeRule , ExcludeRule = excludeRule };
        }

        public static NotRule Not(this IRule rule)
        {
            return new NotRule { ReferencedRule = rule };
        }

        public static NthInMonthRule NthInMonth(this IRule rule, int nthOccurrence)
        {
            return new NthInMonthRule {Nth = nthOccurrence, ReferencedRule = rule};
        }

        public static MonthsFilterRule InMonths(this IRule rule, params Month[] months)
        {
            return new MonthsFilterRule { Months = months, ReferencedRule = rule };
        }

        public static DayOfWeekRule EveryWeek(this DayOfWeek dow)
        {
            return new DayOfWeekRule(dow);
        }
    }
}

Add new fluent syntax: DayOfWeek.Monday.EveryWeek()


using Arkivverket.Arkade.Core;
using Arkivverket.Arkade.Core.Noark5;
using Arkivverket.Arkade.Identify;
using Arkivverket.Arkade.Logging;
using Arkivverket.Arkade.Tests;
using Arkivverket.Arkade.Tests.Noark5;
using Autofac;

namespace Arkivverket.Arkade.Util
{
    public class ArkadeAutofacModule : Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            builder.RegisterType<TarCompressionUtility>().As<ICompressionUtility>();
            builder.RegisterType<TestSessionFactory>().AsSelf();
            builder.RegisterType<ArchiveIdentifier>().As<IArchiveIdentifier>();
            builder.RegisterType<Noark5TestEngine>().AsSelf().SingleInstance();
            builder.RegisterType<ArchiveContentReader>().As<IArchiveContentReader>();
            builder.RegisterType<TestProvider>().As<ITestProvider>();
            builder.RegisterType<StatusEventHandler>().As<IStatusEventHandler>().SingleInstance();
            builder.RegisterType<Noark5TestProvider>().AsSelf();
        }
    }
}

using Arkivverket.Arkade.Core;
using Arkivverket.Arkade.Core.Addml;
using Arkivverket.Arkade.Core.Noark5;
using Arkivverket.Arkade.Identify;
using Arkivverket.Arkade.Logging;
using Arkivverket.Arkade.Tests;
using Arkivverket.Arkade.Tests.Noark5;
using Autofac;

namespace Arkivverket.Arkade.Util
{
    public class ArkadeAutofacModule : Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            builder.RegisterType<AddmlDatasetTestEngine>().AsSelf();
            builder.RegisterType<AddmlProcessRunner>().AsSelf();
            builder.RegisterType<ArchiveContentReader>().As<IArchiveContentReader>();
            builder.RegisterType<ArchiveIdentifier>().As<IArchiveIdentifier>();
            builder.RegisterType<FlatFileReaderFactory>().AsSelf();
            builder.RegisterType<Noark5TestEngine>().AsSelf().SingleInstance();
            builder.RegisterType<Noark5TestProvider>().AsSelf();
            builder.RegisterType<StatusEventHandler>().As<IStatusEventHandler>().SingleInstance();
            builder.RegisterType<TarCompressionUtility>().As<ICompressionUtility>();
            builder.RegisterType<TestEngineFactory>().AsSelf();
            builder.RegisterType<TestProvider>().As<ITestProvider>();
            builder.RegisterType<TestSessionFactory>().AsSelf();
        }
    }
}

Add missing dependencies to autofac module


//
// Copyright 2019 Google LLC
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.
//

using NUnit.Framework;
using System.Diagnostics;

namespace Google.Solutions.IapDesktop.Application.Test
{
    public abstract class FixtureBase
    {
        [SetUp]
        public void SetUpTracing()
        {
            TraceSources.IapDesktop.Listeners.Add(new ConsoleTraceListener());
            TraceSources.IapDesktop.Switch.Level = SourceLevels.Verbose;
        }
    }
}

//
// Copyright 2019 Google LLC
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.
//

using NUnit.Framework;
using System.Diagnostics;

namespace Google.Solutions.IapDesktop.Application.Test
{
    public abstract class FixtureBase
    {
        private static TraceSource[] Traces = new[]
        {
            Google.Solutions.Compute.TraceSources.Compute,
            Google.Solutions.IapDesktop.Application.TraceSources.IapDesktop
        };

        [SetUp]
        public void SetUpTracing()
        {
            var listener = new ConsoleTraceListener();

            foreach (var trace in Traces)
            {
                trace.Listeners.Add(listener);
                trace.Switch.Level = System.Diagnostics.SourceLevels.Verbose;
            }
        }
    }
}

Enable tracing for IAP code

Enable tracing for IAP code

Change-Id: I34c2c3c3c5110b9b894a59a81910f02667aefe52


using Blogifier.Core.Common;
using Blogifier.Core.Data.Domain;
using Blogifier.Core.Data.Interfaces;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Blogifier.Core.Services.Social
{
    public class SocialService : ISocialService
    {
        IUnitOfWork _db;

        public SocialService(IUnitOfWork db)
        {
            _db = db;
        }

        public Task<Dictionary<string, string>> GetSocialButtons(Profile profile)
        {
            var buttons = ApplicationSettings.SocialButtons;

            if(profile != null)
            {
                // override with profile customizations
                var dbFields = _db.CustomFields.Find(f => f.CustomType == CustomType.Profile && f.ParentId == profile.Id);
                if (dbFields != null && dbFields.Count() > 0)
                {
                    foreach (var field in dbFields)
                    {
                        if (buttons.ContainsKey(field.CustomKey))
                        {
                            buttons[field.CustomKey] = field.CustomValue;
                        }
                    }
                }
            }
            return Task.Run(()=> buttons);
        }
    }
}

using Blogifier.Core.Common;
using Blogifier.Core.Data.Domain;
using Blogifier.Core.Data.Interfaces;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Blogifier.Core.Services.Social
{
    public class SocialService : ISocialService
    {
        IUnitOfWork _db;

        public SocialService(IUnitOfWork db)
        {
            _db = db;
        }

        public Task<Dictionary<string, string>> GetSocialButtons(Profile profile)
        {
            var buttons = new Dictionary<string, string>();
            foreach (var item in ApplicationSettings.SocialButtons)
            {
                buttons.Add(item.Key, item.Value);
            }

            if(profile != null)
            {
                // override with profile customizations
                var dbFields = _db.CustomFields.Find(f => f.CustomType == CustomType.Profile && f.ParentId == profile.Id);
                if (dbFields != null && dbFields.Count() > 0)
                {
                    foreach (var field in dbFields)
                    {
                        if (buttons.ContainsKey(field.CustomKey))
                        {
                            buttons[field.CustomKey] = field.CustomValue;
                        }
                    }
                }
            }
            return Task.Run(()=> buttons);
        }
    }
}

Fix social buttons not copying setting valus


// SampSharp
// Copyright 2022 Tim Potze
//
// 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 SampSharp.Entities.SAMP;

/// <summary>Represents a system for handling dialog functionality</summary>
public class DialogSystem : ISystem
{
    [Event]
    // ReSharper disable once UnusedMember.Local
    private void OnPlayerDisconnect(VisibleDialog player, DisconnectReason _)
    {
        player.Handler(new DialogResult(DialogResponse.Disconnected, 0, null));
    }

    [Event]
    // ReSharper disable once UnusedMember.Local
    private void OnDialogResponse(VisibleDialog player, int dialogId, int response, int listItem, string inputText)
    {
        if (dialogId != DialogService.DialogId)
            return; // Prevent dialog hacks

        player.ResponseReceived = true;
        player.Handler(new DialogResult(response == 1
            ? DialogResponse.LeftButton
            : DialogResponse.RightButtonOrCancel, listItem, inputText));
    }
}

// SampSharp
// Copyright 2022 Tim Potze
//
// 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 SampSharp.Entities.SAMP;

/// <summary>Represents a system for handling dialog functionality</summary>
public class DialogSystem : ISystem
{
    [Event]
    // ReSharper disable once UnusedMember.Local
    private void OnPlayerDisconnect(VisibleDialog player, DisconnectReason _)
    {
        player.ResponseReceived = true;
        player.Handler(new DialogResult(DialogResponse.Disconnected, 0, null));
    }

    [Event]
    // ReSharper disable once UnusedMember.Local
    private void OnDialogResponse(VisibleDialog player, int dialogId, int response, int listItem, string inputText)
    {
        if (dialogId != DialogService.DialogId)
            return; // Prevent dialog hacks

        player.ResponseReceived = true;
        player.Handler(new DialogResult(response == 1
            ? DialogResponse.LeftButton
            : DialogResponse.RightButtonOrCancel, listItem, inputText));

        player.Destroy();
    }
}

[ecs] Fix issues related to open dialogs when a player disconnects


using System;
using MonoTouch.ObjCRuntime;

[assembly: LinkWith ("PSPDFKit.a", LinkTarget.ArmV7s | LinkTarget.ArmV7 | LinkTarget.Simulator, ForceLoad = true, IsCxx = true, Frameworks = "MediaPlayer CoreText QuartzCore MessageUI ImageIO CoreMedia CoreGraphics AVFoundation", LinkerFlags = "-lz -ObjC")]

using System;
using MonoTouch.ObjCRuntime;

[assembly: LinkWith ("PSPDFKit.a", LinkTarget.ArmV7s | LinkTarget.ArmV7 | LinkTarget.Simulator, ForceLoad = true, IsCxx = true, Frameworks = "MediaPlayer CoreText QuartzCore MessageUI ImageIO CoreMedia CoreGraphics AVFoundation", LinkerFlags = "-lz -ObjC -fobjc-arc")]

Add missing ARC runtime linker flag

Add missing ARC runtime linker flag


using System.Reflection;
using Funq;
using ServiceStack.Common.Web;
using ServiceStack.ServiceHost;
using ServiceStack.Text;
using ServiceStack.WebHost.Endpoints;
using SimpleEventMonitor.Core;

namespace SimpleEventMonitor.Web
{
    public class AppHostSimpleEventMonitor : AppHostBase
    {
        public AppHostSimpleEventMonitor(IEventDataStore dataStore)
            : base("SimpleEventMonitorServices", Assembly.GetExecutingAssembly())
        {
            Container.Register(dataStore);
        }

        public override void Configure(Container container)
        {
            JsConfig.IncludeNullValues = true;
            SetConfig(
                    new EndpointHostConfig
                    {
                        DebugMode = true,
                        DefaultContentType = ContentType.Json,
                        EnableFeatures = Feature.All
                    });
        }
    }
}

using System.Reflection;
using Funq;
using ServiceStack.Common.Web;
using ServiceStack.ServiceHost;
using ServiceStack.Text;
using ServiceStack.WebHost.Endpoints;
using SimpleEventMonitor.Core;

namespace SimpleEventMonitor.Web
{
    public class AppHostSimpleEventMonitor : AppHostBase
    {
        public AppHostSimpleEventMonitor(IEventDataStore dataStore)
            : base("SimpleEventMonitorServices", Assembly.GetExecutingAssembly())
        {
            Container.Register(dataStore);
        }

        public override void Configure(Container container)
        {
#if DEBUG
            bool debug = true;
            var enableFeatures = Feature.All;
#else
            bool debug = false;
            var enableFeatures = Feature.All.Remove(Feature.Metadata);
#endif

            JsConfig.IncludeNullValues = true;
            SetConfig(
                    new EndpointHostConfig
                    {
                        DebugMode = debug,
                        DefaultContentType = ContentType.Json,
                        EnableFeatures = enableFeatures
                    });
        }
    }
}

Debug mode only enabled for Debug Build configuration


using System;
using System.Drawing.Imaging;
using System.IO;
using OpenQA.Selenium;

namespace Selenium.WebDriver.Equip
{
    public class TestCapture
    {
        private IWebDriver _browser = null;
        private string fileName;
        public TestCapture(IWebDriver iWebDriver, string type = "Failed")
        {
            fileName = string.Format(@"{0}\{1}.{2}", Directory.GetCurrentDirectory(), DateTime.Now.Ticks, type);
            _browser = iWebDriver;
        }

        public void CaptureWebPage()
        {
            WebDriverLogsLogs();
            PageSource();
            ScreenShot();
        }

        public void PageSource()
        {
            string htmlFile = string.Format(@"{0}.html", fileName);
            using (var sw = new StreamWriter(htmlFile, false))
                sw.Write(_browser.PageSource);
        }

        public void ScreenShot()
        {
            _browser.TakeScreenShot(fileName + ".jpeg", ScreenshotImageFormat.Jpeg);
        }

        public void WebDriverLogsLogs()
        {
            foreach (var log in _browser.Manage().Logs.AvailableLogTypes)
                using (var sw = new StreamWriter(string.Format(@"{0}.{1}.log", fileName, log), false))
                    foreach (var logentry in _browser.Manage().Logs.GetLog(log))
                        sw.WriteLine(logentry);
        }
    }
}

using OpenQA.Selenium;
using System;
using System.IO;
using System.Reflection;

namespace Selenium.WebDriver.Equip
{
    public class TestCapture
    {
        private IWebDriver _browser = null;
        private string fileName;
        public TestCapture(IWebDriver iWebDriver, string type = "Failed")
        {
            fileName = $@"{Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)}\{DateTime.Now.Ticks}.{type}";
            _browser = iWebDriver;
        }

        public void CaptureWebPage()
        {
            WebDriverLogsLogs();
            PageSource();
            ScreenShot();
        }

        public void PageSource()
        {
            string htmlFile = $"{fileName}.html";
            using (var sw = new StreamWriter(htmlFile, false))
                sw.Write(_browser.PageSource);
        }

        public void ScreenShot()
        {
            _browser.TakeScreenShot(fileName + ".jpeg", ScreenshotImageFormat.Jpeg);
        }

        public void WebDriverLogsLogs()
        {
            foreach (var log in _browser.Manage().Logs.AvailableLogTypes)
                using (var sw = new StreamWriter($"{fileName}.{log}.log", false))
                    foreach (var logentry in _browser.Manage().Logs.GetLog(log))
                        sw.WriteLine(logentry);
        }
    }
}

Fix screen capture durring test failure

Fix screen capture durring test failure


namespace JsonDiffPatchDotNet
{
	public sealed class Options
	{
		public Options()
		{
			ArrayDiff = ArrayDiffMode.Efficient;
			TextDiff = TextDiffMode.Efficient;
			MinEfficientTextDiffLength = 50;
		}

		public ArrayDiffMode ArrayDiff
		{ get; set; }

		public TextDiffMode TextDiff
		{ get; set; }

		public long MinEfficientTextDiffLength
		{ get; set; }
	}
}

namespace JsonDiffPatchDotNet
{
	public sealed class Options
	{
		public Options()
		{
			ArrayDiff = ArrayDiffMode.Simple;
			TextDiff = TextDiffMode.Efficient;
			MinEfficientTextDiffLength = 50;
		}

		public ArrayDiffMode ArrayDiff { get; set; }

		public TextDiffMode TextDiff { get; set; }

		public long MinEfficientTextDiffLength { get; set; }
	}
}

Switch simple array diff to default until Efficient array diffing is implemented


using System.Drawing;
using System.Windows.Forms;

namespace TweetDuck.Video.Controls{
    sealed class SeekBar : ProgressBar{
        private readonly SolidBrush brush;

        public SeekBar(){
            brush = new SolidBrush(Color.White);

            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
        }

        protected override void OnPaint(PaintEventArgs e){
            if (brush.Color != ForeColor){
                brush.Color = ForeColor;
            }

            Rectangle rect = e.ClipRectangle;
            rect.Width = (int)(rect.Width*((double)Value/Maximum));
            e.Graphics.FillRectangle(brush, rect);
        }

        protected override void Dispose(bool disposing){
            base.Dispose(disposing);

            if (disposing){
                brush.Dispose();
            }
        }
    }
}

using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;

namespace TweetDuck.Video.Controls{
    sealed class SeekBar : ProgressBar{
        private readonly SolidBrush brushFore;
        private readonly SolidBrush brushHover;
        private readonly SolidBrush brushOverlap;

        public SeekBar(){
            brushFore = new SolidBrush(Color.White);
            brushHover = new SolidBrush(Color.White);
            brushOverlap = new SolidBrush(Color.White);

            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
        }

        protected override void OnPaint(PaintEventArgs e){
            if (brushFore.Color != ForeColor){
                brushFore.Color = ForeColor;
                brushHover.Color = Color.FromArgb(128, ForeColor);
                brushOverlap.Color = Color.FromArgb(80+ForeColor.R*11/16, 80+ForeColor.G*11/16, 80+ForeColor.B*11/16);
            }

            Rectangle rect = e.ClipRectangle;
            Point cursor = PointToClient(Cursor.Position);
            int width = rect.Width;
            int progress = (int)(width*((double)Value/Maximum));

            rect.Width = progress;
            e.Graphics.FillRectangle(brushFore, rect);

            if (cursor.X >= 0 && cursor.Y >= 0 && cursor.X <= width && cursor.Y <= rect.Height){
                if (progress >= cursor.X){
                    rect.Width = cursor.X;
                    e.Graphics.FillRectangle(brushOverlap, rect);
                }
                else{
                    rect.X = progress;
                    rect.Width = cursor.X-rect.X;
                    e.Graphics.FillRectangle(brushHover, rect);
                }
            }
        }

        protected override void Dispose(bool disposing){
            base.Dispose(disposing);

            if (disposing){
                brushFore.Dispose();
                brushHover.Dispose();
                brushOverlap.Dispose();
            }
        }
    }
}

Add a hover effect to video player seek bar


using System;
using System.Diagnostics;
using NUnit.Framework;
using Rhino.Mocks;

namespace NServiceKit.Logging.Tests.Support
{
    public class TestBase
    {
        private MockRepository mocks;

        protected virtual MockRepository Mocks
        {
            get { return mocks; }
        }

        [SetUp]
        protected virtual void SetUp()
        {
            mocks = new MockRepository();
        }

        [TearDown]
        protected virtual void TearDown()
        {
            mocks = null;
        }

        protected virtual void ReplayAll()
        {
            Mocks.ReplayAll();
        }

        protected virtual void VerifyAll()
        {
            try
            {
                Mocks.VerifyAll();
            }
            catch (InvalidOperationException ex)
            {
                Debug.Print("InvalidOperationException thrown: {0}", ex.Message);
            }
        }
    }
}

using System;
using System.Diagnostics;
using NUnit.Framework;
using Rhino.Mocks;

namespace NServiceKit.Logging.Tests.Support
{
    public class TestBase
    {
        private MockRepository mocks;

        protected virtual MockRepository Mocks
        {
            get { return mocks; }
        }

        [SetUp]
        protected virtual void SetUp()
        {
            mocks = new MockRepository();
        }

        [TearDown]
        protected virtual void TearDown()
        {
            mocks.BackToRecordAll();
            mocks = null;
        }

        protected virtual void ReplayAll()
        {
            Mocks.ReplayAll();
        }

        protected virtual void VerifyAll()
        {
            try
            {
                Mocks.VerifyAll();
            }
            catch (InvalidOperationException ex)
            {
                Debug.Print("InvalidOperationException thrown: {0}", ex.Message);
            }
        }
    }
}

Reset the mocks before disposing

Reset the mocks before disposing


using System.IO;
using BruTile.MbTiles;
using Mapsui.Layers;
using Mapsui.UI;
using SQLite;

namespace Mapsui.Samples.Common.Maps
{
    public class MbTilesSample : ISample
    {
        // This is a hack used for iOS/Android deployment
        public static string MbTilesLocation { get; set; } = @"." + Path.DirectorySeparatorChar + "MbTiles";

        public string Name => "1 MbTiles";
        public string Category => "Data";

        public void Setup(IMapControl mapControl)
        {
            mapControl.Map = CreateMap();
        }

        public static Map CreateMap()
        {
            var map = new Map();
            map.Layers.Add(CreateMbTilesLayer(Path.Combine(MbTilesLocation, "world.mbtiles"), "regular"));
            return map;
        }

        public static TileLayer CreateMbTilesLayer(string path, string name)
        {
            var mbTilesTileSource = new MbTilesTileSource(new SQLiteConnectionString(path, true));
            var mbTilesLayer = new TileLayer(mbTilesTileSource) { Name = name};
            return mbTilesLayer;
        }
    }
}

using System.IO;
using BruTile.MbTiles;
using Mapsui.Layers;
using Mapsui.UI;
using SQLite;

namespace Mapsui.Samples.Common.Maps
{
    public class MbTilesSample : ISample
    {
        // This is a hack used for iOS/Android deployment
        public static string MbTilesLocation { get; set; } = @"." + Path.DirectorySeparatorChar + "MbTiles";

        public string Name => "1 MbTiles";
        public string Category => "Data";

        public void Setup(IMapControl mapControl)
        {
            mapControl.Map = CreateMap();
        }

        public static Map CreateMap()
        {
            var map = new Map();
            map.Layers.Add(CreateMbTilesLayer(Path.GetFullPath(Path.Combine(MbTilesLocation, "world.mbtiles")), "regular"));
            return map;
        }

        public static TileLayer CreateMbTilesLayer(string path, string name)
        {
            var mbTilesTileSource = new MbTilesTileSource(new SQLiteConnectionString(path, true));
            var mbTilesLayer = new TileLayer(mbTilesTileSource) { Name = name};
            return mbTilesLayer;
        }
    }
}

Replace SQLite path for MBTiles files with full path, so that doesn't throw an exception on UWP


// Copyright 2019 Google LLC
//
// 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
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using System;

namespace Google.Cloud.Redis.V1Beta1.SmokeTests
{
    public class CloudRedisClientSmokeTest
    {
        public static int Main(string[] args)
        {
            var client = CloudRedisClient.Create();
            var locationName = new LocationName(args[0], "-");
            var instances = client.ListInstances(locationName);
            foreach (var instance in instances)
            {
                Console.WriteLine(instance.Name);
            }

            // Success
            Console.WriteLine("Smoke test passed OK");
            return 0;
        }
    }
}

// Copyright 2019 Google LLC
//
// 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
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using System;
using Google.Api.Gax.ResourceNames;

namespace Google.Cloud.Redis.V1Beta1.SmokeTests
{
    public class CloudRedisClientSmokeTest
    {
        public static int Main(string[] args)
        {
            var client = CloudRedisClient.Create();
            var locationName = new LocationName(args[0], "-");
            var instances = client.ListInstances(locationName);
            foreach (var instance in instances)
            {
                Console.WriteLine(instance.Name);
            }

            // Success
            Console.WriteLine("Smoke test passed OK");
            return 0;
        }
    }
}

Fix smoke test to use common LocationName


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common.Logging;
using GladNet;

namespace Booma.Proxy
{
	[SceneTypeCreate(GameSceneType.ServerSelectionScreen)]
	[SceneTypeCreate(GameSceneType.PreShipSelectionScene)]
	[SceneTypeCreate(GameSceneType.CharacterSelectionScreen)] //probably more than just the character screen.
	public sealed class NetworkClientConnectionOnInitInitializable : IGameInitializable
	{
		private IConnectionService ConnectionService { get; }

		private IGameConnectionEndpointDetails ConnectionDetails { get; }

		private ILog Logger { get; }

		/// <inheritdoc />
		public NetworkClientConnectionOnInitInitializable([NotNull] IConnectionService connectionService, [NotNull] IGameConnectionEndpointDetails connectionDetails, [NotNull] ILog logger)
		{
			ConnectionService = connectionService ?? throw new ArgumentNullException(nameof(connectionService));
			ConnectionDetails = connectionDetails ?? throw new ArgumentNullException(nameof(connectionDetails));
			Logger = logger ?? throw new ArgumentNullException(nameof(logger));
		}

		/// <inheritdoc />
		public Task OnGameInitialized()
		{
			if(Logger.IsInfoEnabled)
				Logger.Info($"Connectiong to: {ConnectionDetails.IpAddress}:{ConnectionDetails.Port}");

			//This initializable actually just
			//connects a IConnectionService with the provided game details.
			return ConnectionService.ConnectAsync(ConnectionDetails.IpAddress, ConnectionDetails.Port);
		}
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common.Logging;
using GladNet;

namespace Booma.Proxy
{
	[SceneTypeCreate(GameSceneType.PreBlockBurstingScene)]
	[SceneTypeCreate(GameSceneType.ServerSelectionScreen)]
	[SceneTypeCreate(GameSceneType.PreShipSelectionScene)]
	[SceneTypeCreate(GameSceneType.CharacterSelectionScreen)] //probably more than just the character screen.
	public sealed class NetworkClientConnectionOnInitInitializable : IGameInitializable
	{
		private IConnectionService ConnectionService { get; }

		private IGameConnectionEndpointDetails ConnectionDetails { get; }

		private ILog Logger { get; }

		/// <inheritdoc />
		public NetworkClientConnectionOnInitInitializable([NotNull] IConnectionService connectionService, [NotNull] IGameConnectionEndpointDetails connectionDetails, [NotNull] ILog logger)
		{
			ConnectionService = connectionService ?? throw new ArgumentNullException(nameof(connectionService));
			ConnectionDetails = connectionDetails ?? throw new ArgumentNullException(nameof(connectionDetails));
			Logger = logger ?? throw new ArgumentNullException(nameof(logger));
		}

		/// <inheritdoc />
		public Task OnGameInitialized()
		{
			if(Logger.IsInfoEnabled)
				Logger.Info($"Connectiong to: {ConnectionDetails.IpAddress}:{ConnectionDetails.Port}");

			//This initializable actually just
			//connects a IConnectionService with the provided game details.
			return ConnectionService.ConnectAsync(ConnectionDetails.IpAddress, ConnectionDetails.Port);
		}
	}
}

Enable auto-connection on pre-block bursting screen


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

[CustomEditor(typeof(MicrogameCollection))]
public class MicrogameCollectionEditor : Editor
{
	public override void OnInspectorGUI()
	{
		MicrogameCollection collection = (MicrogameCollection)target;
		if (GUILayout.Button("Update Microgames"))
		{
			collection.updateMicrogames();
		}
		DrawDefaultInspector();
	}

}

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

[CustomEditor(typeof(MicrogameCollection))]
public class MicrogameCollectionEditor : Editor
{
	public override void OnInspectorGUI()
	{
		MicrogameCollection collection = (MicrogameCollection)target;
		if (GUILayout.Button("Update Microgames"))
		{
			collection.updateMicrogames();
            EditorUtility.SetDirty(collection);
        }
		DrawDefaultInspector();
	}

}

Set MicrogameCollection dirty in editor update


@using Microsoft.Web.Mvc
@model CRP.Controllers.ViewModels.PaymentConfirmationViewModel

@{
    ViewBag.Title = "Confirmation";
}

Registration Confirmation

You have successfully registered for the following event:

        Item:
        @Model.Transaction.Item.Name

        Amount:
        @($"{Model.Transaction.Total:C}")

    @if (Model.Transaction.Credit)
    {

Payment is still due:

            <form action="@Model.PostUrl" method="post" autocomplete="off" style="margin-right: 3px">
                @foreach (var pair in Model.PaymentDictionary)
                {
                    <input type="hidden" name="@pair.Key" value="@pair.Value"/>
                }
                <input type="hidden" name="signature" value="@Model.Signature"/>
                @Html.SubmitButton("Submit", "Click here to be taken to our payment site")
            </form>

    }
    else if (Model.Transaction.Total > 0)
    {

            @Html.Raw(Model.Transaction.Item.CheckPaymentInstructions)

    }

@using Microsoft.Web.Mvc
@model CRP.Controllers.ViewModels.PaymentConfirmationViewModel

@{
    ViewBag.Title = "Confirmation";
}

Registration Confirmation

You have successfully registered for the following event:

        Item:
        @Model.Transaction.Item.Name

        Amount:
        @($"{Model.Transaction.Total:C}")

    @if (Model.Transaction.Credit)
    {

Payment is still due:

            <form action="@Model.PostUrl" method="post" autocomplete="off" style="margin-right: 3px">
                @foreach (var pair in Model.PaymentDictionary)
                {
                    <input type="hidden" name="@pair.Key" value="@pair.Value"/>
                }
                <input type="hidden" name="signature" value="@Model.Signature"/>
                <input type="submit" class="btn btn-primary" value="Click here to be taken to our payment site"/>
            </form>

    }
    else if (Model.Transaction.Total > 0)
    {

            @Html.Raw(Model.Transaction.Item.CheckPaymentInstructions)

    }

Add a link on Credit card registrations that have not paid


namespace Reaper.SharpBattleNet.Framework.DiabloIIRealmServer.Details
{
    using System;
    using System.Linq;
    using System.Text;
    using System.Collections;
    using System.Collections.Generic;
    using System.Threading;
    using System.Threading.Tasks;

    using Nini;
    using Nini.Config;
    using Nini.Ini;
    using Nini.Util;

    using NLog;

    using Reaper;
    using Reaper.SharpBattleNet;
    using Reaper.SharpBattleNet.Framework;
    using Reaper.SharpBattleNet.Framework.DiabloIIRealmServer;

    internal sealed class DiabloIIRealmServer : IDiabloIIRealmServer
    {
        private readonly IConfigSource _configuration = null;
        private readonly Logger _logger = LogManager.GetCurrentClassLogger();

        public DiabloIIRealmServer(IConfigSource configuration)
        {
            _configuration = configuration;

            return;
        }

        public async Task Start(string[] commandArguments)
        {
            return;
        }

        public async Task Stop()
        {
            return;
        }
    }
}

namespace Reaper.SharpBattleNet.Framework.DiabloIIRealmServer.Details
{
    using System;
    using System.Linq;
    using System.Text;
    using System.Collections;
    using System.Collections.Generic;
    using System.Threading;
    using System.Threading.Tasks;

    using Nini;
    using Nini.Config;
    using Nini.Ini;
    using Nini.Util;

    using NLog;

    using Reaper;
    using Reaper.SharpBattleNet;
    using Reaper.SharpBattleNet.Framework;
    using Reaper.SharpBattleNet.Framework.Networking;
    using Reaper.SharpBattleNet.Framework.DiabloIIRealmServer;

    internal sealed class DiabloIIRealmServer : IDiabloIIRealmServer
    {
        private readonly IConfigSource _configuration = null;
        private readonly INetworkManager _networkManager = null;

        private readonly Logger _logger = LogManager.GetCurrentClassLogger();

        public DiabloIIRealmServer(IConfigSource configuration, INetworkManager networkManager)
        {
            _configuration = configuration;
            _networkManager = networkManager;

            return;
        }

        public async Task Start(string[] commandArguments)
        {
            await _networkManager.StartNetworking();

            return;
        }

        public async Task Stop()
        {
            await _networkManager.StopNetworking();

            return;
        }
    }
}

Update D2RS to handle new networking infrastructure.


@model LETS.ViewModels.MemberNoticesViewModel

@string.Format("{0}'s {1}", @Model.Member.FirstLastName, T("notices"))

@if (Model.Notices.Count().Equals(0))
{

@T("This member doesn't have any active notices")

}
@foreach (var notice in Model.Notices)
{
    @Display(notice)
}
@{

@T("Archived notices")

@T("Expired notices will show up here until they are deleted or re-activated by publishing them.")

@T("Notices can also be archived if you don't want to delete them yet")

        @if (Model.ArchivedNotices.Any())
        {
            foreach (var archivedNotice in Model.ArchivedNotices)
            {
                @Display(archivedNotice)
            }
        }

}

@using LETS.Helpers;
@model LETS.ViewModels.MemberNoticesViewModel

@string.Format("{0}'s {1}", @Model.Member.FirstLastName, T("notices"))

@if (Model.Notices.Count().Equals(0))
{

@T("This member doesn't have any active notices")

}
@foreach (var notice in Model.Notices)
{
    var id = notice.ContentItem.Id;
    @Display(notice)
    @Html.ActionLink(T("Edit").ToString(), "Edit", "Notice", new { area = "LETS", id = id }, new { @class = "edit" }) @:|
    @Html.ActionLink(T("Delete").ToString(), "Delete", "Notice", new { area = "LETS", id = id }, new { @class = "edit", itemprop = "UnsafeUrl RemoveUrl" }) @:|
    @*var published = Helpers.IsPublished(notice.ContentPart.Id);
        if (published)
        {
            @Html.Link(T("Archive").Text, Url.Action("Unpublish", "Notice", new { area = "LETS", id = notice.Id }), new { @class = "edit", itemprop = "UnsafeUrl ArchiveUrl" })
        }
        else
        {
            @Html.ActionLink(T("Publish").ToString(), "Publish", "Notice", new { area = "LETS", id = notice.Id }, new { @class = "edit", itemprop = "UnsafeUrl" })
        }*@
}
@{

@T("Archived notices")

@T("Expired notices will show up here until they are deleted or re-activated by publishing them.")

@T("Notices can also be archived if you don't want to delete them yet")

        @if (Model.ArchivedNotices.Any())
        {
            foreach (var archivedNotice in Model.ArchivedNotices)
            {
                @Display(archivedNotice)
            }
        }

}

@Html.AntiForgeryTokenOrchard()

Add edit links to noitces admin

Add edit links to noitces admin