using System;

namespace Cake.Yarn
{
    /// <summary>
    /// Yarn Runner command interface
    /// </summary>
    public interface IYarnRunnerCommands
    {
        /// <summary>
        /// execute 'yarn install' with options
        /// </summary>
        /// <param name="configure">options when running 'yarn install'</param>
        IYarnRunnerCommands Install(Action<YarnInstallSettings> configure = null);

        /// <summary>
        /// execute 'yarn add' with options
        /// </summary>
        /// <param name="configure">options when running 'yarn add'</param>
        IYarnRunnerCommands Add(Action<YarnAddSettings> configure = null);

        /// <summary>
        /// execute 'yarn run' with arguments
        /// </summary>
        /// <param name="scriptName">name of the </param>
        /// <param name="configure">options when running 'yarn run'</param>
        IYarnRunnerCommands RunScript(string scriptName, Action<YarnRunSettings> configure = null);

        /// <summary>
        /// execute 'yarn pack' with options
        /// </summary>
        /// <param name="packSettings">options when running 'yarn pack'</param>
        IYarnRunnerCommands Pack(Action<YarnPackSettings> packSettings = null);
    }
}

using System;

namespace Cake.Yarn
{
    /// <summary>
    /// Yarn Runner command interface
    /// </summary>
    public interface IYarnRunnerCommands
    {
        /// <summary>
        /// execute 'yarn install' with options
        /// </summary>
        /// <param name="configure">options when running 'yarn install'</param>
        IYarnRunnerCommands Install(Action<YarnInstallSettings> configure = null);

        /// <summary>
        /// execute 'yarn add' with options
        /// </summary>
        /// <param name="configure">options when running 'yarn add'</param>
        IYarnRunnerCommands Add(Action<YarnAddSettings> configure = null);

        /// <summary>
        /// execute 'yarn run' with arguments
        /// </summary>
        /// <param name="scriptName">name of the </param>
        /// <param name="configure">options when running 'yarn run'</param>
        IYarnRunnerCommands RunScript(string scriptName, Action<YarnRunSettings> configure = null);

        /// <summary>
        /// execute 'yarn pack' with options
        /// </summary>
        /// <param name="packSettings">options when running 'yarn pack'</param>
        IYarnRunnerCommands Pack(Action<YarnPackSettings> packSettings = null);

        /// <summary>
        /// execute 'yarn version' with options
        /// </summary>
        /// <param name="versionSettings">options when running 'yarn version'</param>
        IYarnRunnerCommands Version(Action<YarnVersionSettings> versionSettings = null);
    }
}

Add fix for missing method on interface

Add fix for missing method on interface


using System;
using System.IO;
using System.Threading.Tasks;

namespace Ylp.GitDb.Core
{
    public interface ILogger
    {
        Task Log(string message);
    }

    public class Logger : ILogger
    {
        public readonly string FileName;

        public Logger(string fileName)
        {
            FileName = fileName;
        }

        public Task Log(string message)
        {
            File.AppendAllText(FileName, $"{DateTime.Now.ToString("HH:mm:ss")}: {message}\n");
            return Task.CompletedTask;
        }
    }
}

using System;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;

namespace Ylp.GitDb.Core
{
    public interface ILogger
    {
        Task Log(string message);
    }

    public class Logger : ILogger
    {
        public readonly string FileName;
        static readonly object LockObj = new object();

        public Logger(string fileName)
        {
            FileName = fileName;
        }

        public Task Log(string message)
        {
            lock(LockObj)
                File.AppendAllText(FileName, $"{DateTime.Now.ToString("HH:mm:ss")}: {message}\n");

            return Task.CompletedTask;
        }
    }
}

Bugfix: Make sure logging doesn't cause cross-thread access to the log-file


//------------------------------------------------------------------------------
// This code was generated by a tool.
//
//   Tool : Bond Compiler 0.4.1.0
//   File : ExceptionDetails_types.cs
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// <auto-generated />
//------------------------------------------------------------------------------

// suppress "Missing XML comment for publicly visible type or member"
#pragma warning disable 1591

#region ReSharper warnings
// ReSharper disable PartialTypeWithSinglePart
// ReSharper disable RedundantNameQualifier
// ReSharper disable InconsistentNaming
// ReSharper disable CheckNamespace
// ReSharper disable UnusedParameter.Local
// ReSharper disable RedundantUsingDirective
#endregion

namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External
{
    using System.Collections.Concurrent;
    using System.Collections.Generic;

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.4.1.0")]
    internal partial class ExceptionDetails
    {

        public int id { get; set; }

        public int outerId { get; set; }

        public string typeName { get; set; }

        public string message { get; set; }

        public bool hasFullStack { get; set; }

        public string stack { get; set; }

        public IList<StackFrame> parsedStack { get; set; }

        public ExceptionDetails()
            : this("AI.ExceptionDetails", "ExceptionDetails")
        { }

        protected ExceptionDetails(string fullName, string name)
        {
            typeName = "";
            message = "";
            hasFullStack = true;
            stack = "";
            parsedStack = new List<StackFrame>();
        }
    }
} // AI

//------------------------------------------------------------------------------
// This code was generated by a tool.
//
//   Tool : Bond Compiler 0.4.1.0
//   File : ExceptionDetails_types.cs
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// <auto-generated />
//------------------------------------------------------------------------------

// suppress "Missing XML comment for publicly visible type or member"
#pragma warning disable 1591

#region ReSharper warnings
// ReSharper disable PartialTypeWithSinglePart
// ReSharper disable RedundantNameQualifier
// ReSharper disable InconsistentNaming
// ReSharper disable CheckNamespace
// ReSharper disable UnusedParameter.Local
// ReSharper disable RedundantUsingDirective
#endregion

namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External
{
    using System.Collections.Concurrent;
    using System.Collections.Generic;

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.4.1.0")]
    internal partial class ExceptionDetails
    {

        public int id { get; set; }

        public int outerId { get; set; }

        public string typeName { get; set; }

        public string message { get; set; }

        public bool hasFullStack { get; set; }

        public string stack { get; set; }

        public IList<StackFrame> parsedStack { get; set; }

        public ExceptionDetails()
            : this("AI.ExceptionDetails", "ExceptionDetails")
        {}

        protected ExceptionDetails(string fullName, string name)
        {
            typeName = "";
            message = "";
            hasFullStack = true;
            stack = "";
            parsedStack = new List<StackFrame>();
        }
    }
} // AI

Revert the whitespace change of the auto generated file


using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace Qowaiv.UnitTests.TestTools
{
	public static class DebuggerDisplayAssert
	{
		public static void HasAttribute(Type type)
		{
			Assert.IsNotNull(type, "The supplied type should not be null.");

			var act = (DebuggerDisplayAttribute)type.GetCustomAttributes(typeof(DebuggerDisplayAttribute), false).FirstOrDefault();
			Assert.IsNotNull(act, "The type '{0}' has no DebuggerDisplay attribute.", type);

			Assert.AreEqual("{DebuggerDisplay}", act.Value, "DebuggerDisplay attribute value is not '{DebuggerDisplay}'.");
		}

		public static void HasResult(string expected, object value)
		{
			Assert.IsNotNull(value, "The supplied value should not be null.");

			var type = value.GetType();

			var prop = type.GetProperty("DebuggerDisplay", BindingFlags.Instance | BindingFlags.NonPublic);

			Assert.IsNotNull(prop, "The type '{0}' does not contain a non-public property DebuggerDisplay.", type);

			var actual = prop.GetValue(value);

			Assert.AreEqual(expected, actual);
		}
	}
}

using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace Qowaiv.UnitTests.TestTools
{
	public static class DebuggerDisplayAssert
	{
		public static void HasAttribute(Type type)
		{
			Assert.IsNotNull(type, "The supplied type should not be null.");

			var act = (DebuggerDisplayAttribute)type.GetCustomAttributes(typeof(DebuggerDisplayAttribute), false).FirstOrDefault();
			Assert.IsNotNull(act, "The type '{0}' has no DebuggerDisplay attribute.", type);

			Assert.AreEqual("{DebuggerDisplay}", act.Value, "DebuggerDisplay attribute value is not '{DebuggerDisplay}'.");
		}

		public static void HasResult(object expected, object value)
		{
			Assert.IsNotNull(value, "The supplied value should not be null.");

			var type = value.GetType();

			var prop = type.GetProperty("DebuggerDisplay", BindingFlags.Instance | BindingFlags.NonPublic);

			Assert.IsNotNull(prop, "The type '{0}' does not contain a non-public property DebuggerDisplay.", type);

			var actual = prop.GetValue(value);

			Assert.AreEqual(expected, actual);
		}
	}
}

Support all objects for debugger display.


// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

namespace StyleCop.Analyzers.Test.CSharp8.LayoutRules
{
    using System.Threading;
    using System.Threading.Tasks;
    using Microsoft.CodeAnalysis.Testing;
    using StyleCop.Analyzers.Test.CSharp7.LayoutRules;
    using Xunit;
    using static StyleCop.Analyzers.Test.Verifiers.StyleCopCodeFixVerifier<
    StyleCop.Analyzers.LayoutRules.SA1514ElementDocumentationHeaderMustBePrecededByBlankLine,
    StyleCop.Analyzers.LayoutRules.SA1514CodeFixProvider>;

    public class SA1514CSharp8UnitTests : SA1514CSharp7UnitTests
    {
        /// <summary>
        /// Verifies that method-like declarations with invalid documentation will produce the expected diagnostics.
        /// </summary>
        /// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns>
        [Fact]
        public async Task TestValidPropertyDeclarationAsync()
        {
            var testCode = @"namespace TestNamespace
{
    public class TestClass
    {
        /// <summary>
        /// Gets or sets the value.
        /// </summary>
        public string SomeString { get; set; } = null!;

        /// <summary>
        /// Gets or sets the value.
        /// </summary>
        public string AnotherString { get; set; } = null!;
    }
}
";

            await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
        }
    }
}

// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

namespace StyleCop.Analyzers.Test.CSharp8.LayoutRules
{
    using System.Threading;
    using System.Threading.Tasks;
    using Microsoft.CodeAnalysis.Testing;
    using StyleCop.Analyzers.Test.CSharp7.LayoutRules;
    using Xunit;
    using static StyleCop.Analyzers.Test.Verifiers.StyleCopCodeFixVerifier<
        StyleCop.Analyzers.LayoutRules.SA1514ElementDocumentationHeaderMustBePrecededByBlankLine,
        StyleCop.Analyzers.LayoutRules.SA1514CodeFixProvider>;

    public class SA1514CSharp8UnitTests : SA1514CSharp7UnitTests
    {
        [Fact]
        [WorkItem(3067, "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3067")]
        public async Task TestValidPropertyDeclarationAsync()
        {
            var testCode = @"namespace TestNamespace
{
    public class TestClass
    {
        /// <summary>
        /// Gets or sets the value.
        /// </summary>
        public string SomeString { get; set; } = null!;

        /// <summary>
        /// Gets or sets the value.
        /// </summary>
        public string AnotherString { get; set; } = null!;
    }
}
";

            await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
        }
    }
}

Clean up test and reference original issue


using System;
using Marten.Testing.Harness;
using Xunit;

namespace DocumentDbTests.Bugs
{
    public class Bug_673_multiple_version_assertions: IntegrationContext
    {
        [Fact]
        public void replaces_the_max_version_assertion()
        {
            var streamId = Guid.NewGuid();

            using (var session = theStore.OpenSession())
            {
                session.Events.Append(streamId, new WhateverEvent(), new WhateverEvent());

                session.SaveChanges();
            }

            using (var session = theStore.OpenSession())
            {
                var state = session.Events.FetchStreamState(streamId);
                // ... do some stuff
                var expectedVersion = state.Version + 1;
                session.Events.Append(streamId, expectedVersion, new WhateverEvent());
                // ... do some more stuff
                expectedVersion += 1;
                session.Events.Append(streamId, expectedVersion, new WhateverEvent());
                session.SaveChanges();
            }
        }

        public Bug_673_multiple_version_assertions(DefaultStoreFixture fixture) : base(fixture)
        {
        }
    }

    public class WhateverEvent
    {
    }
}

using System;
using Marten.Events;
using Marten.Testing.Harness;
using Xunit;

namespace DocumentDbTests.Bugs
{
    public class Bug_673_multiple_version_assertions: IntegrationContext
    {
        [Fact]
        public void replaces_the_max_version_assertion()
        {
            var streamId = Guid.NewGuid();

            using (var session = theStore.OpenSession())
            {
                session.Events.Append(streamId, new WhateverEvent(), new WhateverEvent());

                session.SaveChanges();
            }

            using (var session = theStore.OpenSession())
            {
                var state = session.Events.FetchStreamState(streamId);
                // ... do some stuff
                var expectedVersion = state.Version + 1;
                session.Events.Append(streamId, expectedVersion, new WhateverEvent());
                // ... do some more stuff
                expectedVersion += 1;
                session.Events.Append(streamId, expectedVersion, new WhateverEvent());
                session.SaveChanges();
            }
        }

        [Fact]
        public void replaces_the_max_version_assertion_for_string_identity()
        {
            UseStreamIdentity(StreamIdentity.AsString);
            var streamId = Guid.NewGuid().ToString();

            using (var session = theStore.OpenSession())
            {
                session.Events.Append(streamId, new WhateverEvent(), new WhateverEvent());

                session.SaveChanges();
            }

            using (var session = theStore.OpenSession())
            {
                var state = session.Events.FetchStreamState(streamId);
                // ... do some stuff
                var expectedVersion = state.Version + 1;
                session.Events.Append(streamId, expectedVersion, new WhateverEvent());
                // ... do some more stuff
                expectedVersion += 1;
                session.Events.Append(streamId, expectedVersion, new WhateverEvent());
                session.SaveChanges();
            }
        }

        public Bug_673_multiple_version_assertions(DefaultStoreFixture fixture) : base(fixture)
        {
        }
    }

    public class WhateverEvent
    {
    }
}

Add failing test for append called several times for string identity


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

namespace NQuery.Authoring.CodeActions
{
    public abstract class CodeRefactoringProvider<T> : ICodeRefactoringProvider
        where T : SyntaxNode
    {
        public IEnumerable<ICodeAction> GetRefactorings(SemanticModel semanticModel, int position)
        {
            var syntaxTree = semanticModel.Compilation.SyntaxTree;
            var syntaxToken = syntaxTree.Root.FindToken(position);
            var synaxNodes = syntaxToken.Parent.AncestorsAndSelf().OfType<T>();
            return synaxNodes.SelectMany(n => GetRefactorings(semanticModel, position, n));
        }

        protected abstract IEnumerable<ICodeAction> GetRefactorings(SemanticModel semanticModel, int position, T node);
    }
}

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

namespace NQuery.Authoring.CodeActions
{
    public abstract class CodeRefactoringProvider<T> : ICodeRefactoringProvider
        where T : SyntaxNode
    {
        public IEnumerable<ICodeAction> GetRefactorings(SemanticModel semanticModel, int position)
        {
            var syntaxTree = semanticModel.Compilation.SyntaxTree;
            return from t in syntaxTree.Root.FindStartTokens(position)
                   from n in t.Parent.AncestorsAndSelf().OfType<T>()
                   from r in GetRefactorings(semanticModel, position, n)
                   select r;
        }

        protected abstract IEnumerable<ICodeAction> GetRefactorings(SemanticModel semanticModel, int position, T node);
    }
}

Fix refactoring provider to correctly handle positions near EOF


using System;
using Newtonsoft.Json;

namespace Archetype.Models
{
    public class ArchetypePreValueProperty
    {
        [JsonProperty("alias")]
        public string Alias { get; set; }

        [JsonProperty("remove")]
        public bool Remove { get; set; }

        [JsonProperty("collapse")]
        public bool Collapse { get; set; }

        [JsonProperty("label")]
        public string Label { get; set; }

        [JsonProperty("helpText")]
        public string HelpText { get; set; }

        [JsonProperty("dataTypeGuid")]
        public Guid DataTypeGuid { get; set; }

        [JsonProperty("propertyEditorAlias")]
        public string PropertyEditorAlias { get; set; }

        [JsonProperty("value")]
        public string Value { get; set; }

        [JsonProperty("required")]
        public bool Required { get; set; }

        [JsonProperty("regEx")]
        public bool RegEx { get; set; }
    }
}

using System;
using Newtonsoft.Json;

namespace Archetype.Models
{
    public class ArchetypePreValueProperty
    {
        [JsonProperty("alias")]
        public string Alias { get; set; }

        [JsonProperty("remove")]
        public bool Remove { get; set; }

        [JsonProperty("collapse")]
        public bool Collapse { get; set; }

        [JsonProperty("label")]
        public string Label { get; set; }

        [JsonProperty("helpText")]
        public string HelpText { get; set; }

        [JsonProperty("dataTypeGuid")]
        public Guid DataTypeGuid { get; set; }

        [JsonProperty("propertyEditorAlias")]
        public string PropertyEditorAlias { get; set; }

        [JsonProperty("value")]
        public string Value { get; set; }

        [JsonProperty("required")]
        public bool Required { get; set; }

        [JsonProperty("regEx")]
        public string RegEx { get; set; }
    }
}

Fix deserialization of RegEx enabled properties

Fix type mismatch for RegEx (introduced in 6e50301 - my bad, sorry)


using System.Configuration;
using System.IO;
using System.Linq;
using System.Web.Helpers;
using System.Web.Mvc;
using Topppro.WebSite.Areas.Humanist.Models;

namespace Topppro.WebSite.Areas.Humanist.Controllers
{
    [Authorize]
    public class DashboardController : Controller
    {
        private readonly static string _dlcFolderPath =
            ConfigurationManager.AppSettings["RootDownloadsFolderPath"];

        public ActionResult Index()
        {
            var key = "RootDownloadsFolderPath";

            var cached = WebCache.Get(key);

            if (cached == null)
            {
                string dlc_path =
                    Server.MapPath(_dlcFolderPath);

                DirectoryInfo dlc_folder = new DirectoryInfo(dlc_path);

                if (!dlc_folder.Exists)
                    return null;

                cached = dlc_folder.GetFiles()
                                .Select(f => new DLCModel()
                                {
                                    Url = UrlHelper.GenerateContentUrl(Path.Combine(_dlcFolderPath, f.Name), HttpContext),
                                    Name = Path.GetFileNameWithoutExtension(f.Name),
                                    Color = "purple-stripe",
                                    Icon = ""
                                });

                WebCache.Set(key, cached);
            }

            return View(cached);
        }
    }
}

using System.IO;
using System.Linq;
using System.Web.Helpers;
using System.Web.Mvc;
using Topppro.WebSite.Areas.Humanist.Models;
using Topppro.WebSite.Settings;

namespace Topppro.WebSite.Areas.Humanist.Controllers
{
    [Authorize]
    public class DashboardController : Controller
    {
        public ActionResult Index()
        {
            var key = typeof(DownloadSettings).Name;

            var cached = WebCache.Get(key);

            if (cached == null)
            {
                string dlc_path =
                    Server.MapPath(ToppproSettings.Download.Root);

                DirectoryInfo dlc_folder = new DirectoryInfo(dlc_path);

                if (!dlc_folder.Exists)
                    return null;

                cached = dlc_folder.GetFiles()
                                .Select(f => new DLCModel()
                                {
                                    Url = UrlHelper.GenerateContentUrl(Path.Combine(ToppproSettings.Download.Root, f.Name), HttpContext),
                                    Name = Path.GetFileNameWithoutExtension(f.Name),
                                    Color = "purple-stripe",
                                    Icon = ""
                                });

                WebCache.Set(key, cached);
            }

            return View(cached);
        }
    }
}

Fix en dashboard. Uso de la clase de configuracion.


using System;
using Caliburn.Micro;
using NDC.Build.Core.Services;
using static System.String;

namespace NDC.Build.Core.ViewModels
{
    public class LoginViewModel : Screen
    {
        private readonly ICredentialsService credentials;
        private readonly IAuthenticationService authentication;
        private readonly IApplicationNavigationService navigation;

        public LoginViewModel(ICredentialsService credentials, IAuthenticationService authentication, IApplicationNavigationService navigation)
        {
            this.credentials = credentials;
            this.authentication = authentication;
            this.navigation = navigation;
        }

        protected override async void OnInitialize()
        {
            var stored = await credentials.GetCredentialsAsync();

            if (stored == Credentials.None)
                return;

            Account = stored.Account;
            Token = stored.Token;
        }

        public string Account { get; set; }

        public string Token { get; set; }

        public string Message { get; private set; }

        public bool CanLogin => !IsNullOrEmpty(Account) && !IsNullOrEmpty(Token);

        public async void Login()
        {
            var entered = new Credentials(Account, Token);
            var authenticated = await authentication.AuthenticateCredentialsAsync(entered);

            if (!authenticated)
            {
                Message = "Account / Token is incorrect";
            }
            else
            {
                await credentials.StoreAsync(entered);

                navigation.ToProjects();
            }
        }
    }
}

using System;
using Caliburn.Micro;
using NDC.Build.Core.Services;
using PropertyChanged;
using static System.String;

namespace NDC.Build.Core.ViewModels
{
    public class LoginViewModel : Screen
    {
        private readonly ICredentialsService credentials;
        private readonly IAuthenticationService authentication;
        private readonly IApplicationNavigationService navigation;

        public LoginViewModel(ICredentialsService credentials, IAuthenticationService authentication, IApplicationNavigationService navigation)
        {
            this.credentials = credentials;
            this.authentication = authentication;
            this.navigation = navigation;
        }

        protected override async void OnInitialize()
        {
            var stored = await credentials.GetCredentialsAsync();

            if (stored == Credentials.None)
                return;

            Account = stored.Account;
            Token = stored.Token;
        }

        public string Account { get; set; }

        public string Token { get; set; }

        public string Message { get; private set; }

        [DependsOn(nameof(Account), nameof(Token))]
        public bool CanLogin => !IsNullOrEmpty(Account) && !IsNullOrEmpty(Token);

        public async void Login()
        {
            var entered = new Credentials(Account, Token);
            var authenticated = await authentication.AuthenticateCredentialsAsync(entered);

            if (!authenticated)
            {
                Message = "Account / Token is incorrect";
            }
            else
            {
                await credentials.StoreAsync(entered);

                navigation.ToProjects();
            }
        }
    }
}

Fix login view model inpc

Fix login view model inpc


#load "00_constants.csx"

using DotvvmAcademy.Validation.Dothtml.Unit;
using DotvvmAcademy.Validation.Unit;

public DothtmlUnit Unit { get; set; } = new DothtmlUnit();

Unit.GetDirective("/@viewModel")
    .RequireTypeArgument(ViewModelName);

var repeater = Unit.GetControl("/html/body/dot:Repeater");
{
    repeater.GetProperty("@DataSource")
        .RequireBinding(ItemsProperty);

    repeater.GetControl("p/dot:Literal")
        .GetProperty("@Text")
        .RequireBinding("_this");
}

#load "00_constants.csx"

using DotvvmAcademy.Validation.Dothtml.Unit;
using DotvvmAcademy.Validation.Unit;

public DothtmlUnit Unit { get; set; } = new DothtmlUnit();

Unit.GetDirective("/@viewModel")
    .RequireTypeArgument(ViewModelName);

var repeater = Unit.GetControl("/html/body/dot:Repeater");
{
    repeater.GetProperty("@DataSource")
        .RequireBinding(ItemsProperty)
        .GetControl("p/dot:Literal")
            .GetProperty("@Text")
            .RequireBinding("_this");
}

Fix bug in the repeater step validation

Fix bug in the repeater step validation


using System;

namespace EasyButtons
{
    /// <summary>
    /// Attribute to create a button in the inspector for calling the method it is attached to.
    /// The method must have no arguments.
    /// </summary>
    /// <example>
    /// [<see cref="ButtonAttribute"/>]
    /// void MyMethod()
    /// {
    ///     Debug.Log("Clicked!");
    /// }
    /// </example>
    [AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)]
    public sealed class ButtonAttribute : Attribute { }
}

using System;

namespace EasyButtons
{
    /// <summary>
    /// Attribute to create a button in the inspector for calling the method it is attached to.
    /// The method must be public and have no arguments.
    /// </summary>
    /// <example>
    /// [<see cref="ButtonAttribute"/>]
    /// public void MyMethod()
    /// {
    ///     Debug.Log("Clicked!");
    /// }
    /// </example>
    [AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)]
    public sealed class ButtonAttribute : Attribute { }
}

Update attribute summary and example

Update attribute summary and example


#region using

using System.ComponentModel.Composition;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Utilities;

#endregion

namespace GitDiffMargin
{
    [Export(typeof (IWpfTextViewMarginProvider))]
    [Name(EditorDiffMargin.MarginNameConst)]
    [Order(Before = PredefinedMarginNames.LineNumber)]
    [MarginContainer(PredefinedMarginNames.LeftSelection)]
    [ContentType("text")]
    [TextViewRole(PredefinedTextViewRoles.Editable)]
    internal sealed class EditorDiffMarginFactory : DiffMarginFactoryBase
    {
        public override IWpfTextViewMargin CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin)
        {
            var marginCore = TryGetMarginCore(textViewHost);
            if (marginCore == null)
                return null;

            return new EditorDiffMargin(textViewHost.TextView, marginCore);
        }
    }
}

#region using

using System.ComponentModel.Composition;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Utilities;

#endregion

namespace GitDiffMargin
{
    [Export(typeof (IWpfTextViewMarginProvider))]
    [Name(EditorDiffMargin.MarginNameConst)]
    [Order(After = PredefinedMarginNames.Spacer, Before = PredefinedMarginNames.Outlining)]
    [MarginContainer(PredefinedMarginNames.LeftSelection)]
    [ContentType("text")]
    [TextViewRole(PredefinedTextViewRoles.Editable)]
    internal sealed class EditorDiffMarginFactory : DiffMarginFactoryBase
    {
        public override IWpfTextViewMargin CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin)
        {
            var marginCore = TryGetMarginCore(textViewHost);
            if (marginCore == null)
                return null;

            return new EditorDiffMargin(textViewHost.TextView, marginCore);
        }
    }
}

Move diff bar to the right of the line numbers (like in the GitSCC extension)


using System;
using System.Runtime.InteropServices;

namespace LibGPhoto2
{
	public class Context : Object
	{
		[DllImport ("libgphoto2.so")]
		internal static extern IntPtr gp_context_new ();

		public Context ()
		{
			this.handle = new HandleRef (this, gp_context_new ());
		}

		[DllImport ("libgphoto2.so")]
		internal static extern void gp_context_unref   (HandleRef context);

		protected override void Cleanup ()
		{
			System.Console.WriteLine ("cleanup context");
			gp_context_unref(handle);
		}
	}
}

using System;
using System.Runtime.InteropServices;

namespace LibGPhoto2
{
	public class Context : Object
	{
		[DllImport ("libgphoto2.so")]
		internal static extern IntPtr gp_context_new ();

		public Context ()
		{
			this.handle = new HandleRef (this, gp_context_new ());
		}

		[DllImport ("libgphoto2.so")]
		internal static extern void gp_context_unref   (HandleRef context);

		protected override void Cleanup ()
		{
			gp_context_unref(handle);
		}
	}
}

Remove random context cleanup console output

git-svn-id: 40dd595c6684d839db675001a64203a1457e7319@8996 67ed7778-7388-44ab-90cf-0a291f65f57c


namespace Stripe
{
    using Newtonsoft.Json;

    public class AccountBusinessProfileOptions : INestedOptions
    {
        [JsonProperty("mcc")]
        public string Mcc { get; set; }

        [JsonProperty("name")]
        public string Name { get; set; }

        [JsonProperty("primary_color")]
        public string PrimaryColor { get; set; }

        [JsonProperty("product_description")]
        public string ProductDescription { get; set; }

        [JsonProperty("support_email")]
        public string SupportEmail { get; set; }

        [JsonProperty("support_phone")]
        public string SupportPhone { get; set; }

        [JsonProperty("support_url")]
        public string SupportUrl { get; set; }

        [JsonProperty("url")]
        public string Url { get; set; }
    }
}

namespace Stripe
{
    using System;
    using Newtonsoft.Json;

    public class AccountBusinessProfileOptions : INestedOptions
    {
        /// <summary>
        /// The merchant category code for the account. MCCs are used to classify businesses based
        /// on the goods or services they provide.
        /// </summary>
        [JsonProperty("mcc")]
        public string Mcc { get; set; }

        /// <summary>
        /// The customer-facing business name.
        /// </summary>
        [JsonProperty("name")]
        public string Name { get; set; }

        [Obsolete("Use AccountSettingsBrandingOptions.PrimaryColor instead.")]
        [JsonProperty("primary_color")]
        public string PrimaryColor { get; set; }

        /// <summary>
        /// Internal-only description of the product sold by, or service provided by, the business.
        /// Used by Stripe for risk and underwriting purposes.
        /// </summary>
        [JsonProperty("product_description")]
        public string ProductDescription { get; set; }

        /// <summary>
        /// A publicly available mailing address for sending support issues to.
        /// </summary>
        [JsonProperty("support_address")]
        public AddressOptions SupportAddress { get; set; }

        /// <summary>
        /// A publicly available email address for sending support issues to.
        /// </summary>
        [JsonProperty("support_email")]
        public string SupportEmail { get; set; }

        /// <summary>
        /// A publicly available phone number to call with support issues.
        /// </summary>
        [JsonProperty("support_phone")]
        public string SupportPhone { get; set; }

        /// <summary>
        /// A publicly available website for handling support issues.
        /// </summary>
        [JsonProperty("support_url")]
        public string SupportUrl { get; set; }

        /// <summary>
        /// The business’s publicly available website.
        /// </summary>
        [JsonProperty("url")]
        public string Url { get; set; }
    }
}

Add support for `SupportAddress` on `Account` create and update


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

using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;

namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
{
    public class ReferencesRequest
    {
        public static readonly
            RequestType<ReferencesParams, Location[], object, object> Type =
            RequestType<ReferencesParams, Location[], object, object>.Create("textDocument/references");
    }

    public class ReferencesParams : TextDocumentPosition
    {
        public ReferencesContext Context { get; set; }
    }

    public class ReferencesContext
    {
        public bool IncludeDeclaration { get; set; }
    }
}

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

using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;

namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
{
    public class ReferencesRequest
    {
        public static readonly
            RequestType<ReferencesParams, Location[], object, TextDocumentRegistrationOptions> Type =
            RequestType<ReferencesParams, Location[], object, TextDocumentRegistrationOptions>.Create("textDocument/references");
    }

    public class ReferencesParams : TextDocumentPosition
    {
        public ReferencesContext Context { get; set; }
    }

    public class ReferencesContext
    {
        public bool IncludeDeclaration { get; set; }
    }
}

Add registration options for reference request


// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ChannelState.cs" company="Dan Barua">
//   (C) Dan Barua and contributors. Licensed under the Mozilla Public License.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace NEventSocket.FreeSwitch
{
    /// <summary>
    /// Represents the state of a Channel
    /// </summary>
    public enum ChannelState
    {
#pragma warning disable 1591
        New,

        Init,

        Routing,

        SoftExecute,

        Execute,

        ExchangeMedia,

        Park,

        ConsumeMedia,

        Hibernate,

        Reset,

        Hangup,

        Done,

        Destroy,

        Reporting
#pragma warning restore 1591
    }
}

// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ChannelState.cs" company="Dan Barua">
//   (C) Dan Barua and contributors. Licensed under the Mozilla Public License.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace NEventSocket.FreeSwitch
{
    /// <summary>
    /// Represents the state of a Channel
    /// </summary>
    public enum ChannelState
    {
#pragma warning disable 1591
        New,

        Init,

        Routing,

        SoftExecute,

        Execute,

        ExchangeMedia,

        Park,

        ConsumeMedia,

        Hibernate,

        Reset,

        Hangup,

        Done,

        Destroy,

        Reporting,

        None
#pragma warning restore 1591
    }
}

Add channel state None (CS_NONE)

Add channel state None (CS_NONE)


using BatteryCommander.Web.Controllers;
using BatteryCommander.Web.Services;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Threading.Tasks;

namespace BatteryCommander.Web.Models
{
    public class NavigationViewComponent : ViewComponent
    {
        private readonly Database db;

        public Soldier Soldier { get; private set; }

        public Boolean ShowNavigation => !String.Equals(nameof(HomeController.PrivacyAct), RouteData.Values["action"]);

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

        public async Task<IViewComponentResult> InvokeAsync()
        {
            Soldier = await UserService.FindAsync(db, UserClaimsPrincipal);

            return View(this);
        }
    }
}

using BatteryCommander.Web.Controllers;
using BatteryCommander.Web.Services;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Threading.Tasks;

namespace BatteryCommander.Web.Models
{
    public class NavigationViewComponent : ViewComponent
    {
        private readonly Database db;

        public Soldier Soldier { get; private set; }

        public Boolean ShowNavigation => Soldier != null && !String.Equals(nameof(HomeController.PrivacyAct), RouteData.Values["action"]);

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

        public async Task<IViewComponentResult> InvokeAsync()
        {
            Soldier = await UserService.FindAsync(db, UserClaimsPrincipal);

            return View(this);
        }
    }
}

Fix for no soldier foudn on nav component


@model IdentityServer3.Core.ViewModels.AuthorizeResponseViewModel
@{
    ViewBag.PageID = "authorize-response";
    ViewBag.Title = "Login Successful";
    ViewBag.HideSigninLink = "true";
}

Login successful

<form id="mainForm" method="post" action="@Model.ResponseFormUri">

Please wait...

    @Html.Raw(Model.ResponseFormFields)

It appears you do not have javascript enabled. Please click the continue button to complete your login.

        <button type="submit" class="button" autofocus="autofocus">Continue</button>

</form>

@section scripts
{

}

@model IdentityServer3.Core.ViewModels.AuthorizeResponseViewModel
@{
    ViewBag.PageID = "authorize-response";
    ViewBag.Title = "Login Successful";
    ViewBag.HideSigninLink = "true";
}

Login successful

<form id="mainForm" method="post" action="@Model.ResponseFormUri">

Please wait...

    @Html.Raw(Model.ResponseFormFields)

Please click the continue button to complete your login.

        <button type="submit" class="button" autofocus="autofocus">Continue</button>

</form>

@section scripts
{

}

Copy change on the logged in page

Copy change on the logged in page


using System;
using System.Net;
using System.Text;
using YaR.MailRuCloud.Api.Base.Requests.Repo;

namespace YaR.MailRuCloud.Api.Base.Requests.WebM1
{
    class MoveRequest : BaseRequestJson<WebV2.CopyRequest.Result>
    {
        private readonly string _sourceFullPath;
        private readonly string _destinationPath;

        public MoveRequest(IWebProxy proxy, IAuth auth, string sourceFullPath, string destinationPath) : base(proxy, auth)
        {
            _sourceFullPath = sourceFullPath;
            _destinationPath = destinationPath;
        }

        protected override string RelationalUri => $"/api/m1/file/move?access_token={Auth.AccessToken}";

        protected override byte[] CreateHttpContent()
        {
            var data = Encoding.UTF8.GetBytes($"home={Uri.EscapeDataString(_sourceFullPath)}&email={Auth.Login}&conflict=rename&folder={Uri.EscapeDataString(_destinationPath)}");
            return data;
        }
    }
}

using System;
using System.Net;
using System.Text;
using YaR.MailRuCloud.Api.Base.Requests.Repo;

namespace YaR.MailRuCloud.Api.Base.Requests.WebM1
{
    class MoveRequest : BaseRequestJson<WebV2.CopyRequest.Result>
    {
        private readonly string _sourceFullPath;
        private readonly string _destinationPath;

        public MoveRequest(IWebProxy proxy, IAuth auth, string sourceFullPath, string destinationPath) : base(proxy, auth)
        {
            _sourceFullPath = sourceFullPath;
            _destinationPath = destinationPath;
        }

        protected override string RelationalUri => $"/api/m1/file/move?access_token={Auth.AccessToken}";

        protected override byte[] CreateHttpContent()
        {
            var data = $"home={Uri.EscapeDataString(_sourceFullPath)}&email={Auth.Login}&conflict=rename&folder={Uri.EscapeDataString(_destinationPath)}";
            return Encoding.UTF8.GetBytes(data);
        }
    }
}

Move request changed for uniformity

WebM1: Move request changed for uniformity


@using Mollie.WebApplicationCoreExample.Framework.Extensions
@model CreatePaymentModel

@{
    ViewData["Title"] = "Create payment";
}

Create new payment

    <form method="post">

                    <input class="form-control" asp-for="Amount" />

                    <select class="form-control" asp-for="Currency" asp-items="@Html.GetStaticStringSelectList(typeof(Currency))"></select>

                    <textarea class="form-control" asp-for="Description" rows="4"></textarea>

                <input type="submit" name="Save" value="Save" class="btn btn-primary" />

    </form>

@using Mollie.WebApplicationCoreExample.Framework.Extensions
@model CreatePaymentModel

@{
    ViewData["Title"] = "Create payment";
}

Create new payment

    <form method="post">

                    <input class="form-control" asp-for="Amount" autocomplete="off" />

                    <select class="form-control" asp-for="Currency" asp-items="@Html.GetStaticStringSelectList(typeof(Currency))"></select>

                    <textarea class="form-control" asp-for="Description" rows="4"></textarea>

                <input type="submit" name="Save" value="Save" class="btn btn-primary" />

    </form>

Disable autocomplete for payment amount

Disable autocomplete for payment amount


namespace Fixie.Console
{
    public class Options
    {
        public Options(
            string configuration,
            bool noBuild,
            string framework,
            string report)
        {
            Configuration = configuration ?? "Debug";
            NoBuild = noBuild;
            Framework = framework;
            Report = report;
        }

        public string Configuration { get; }
        public bool NoBuild { get; }
        public bool ShouldBuild => !NoBuild;
        public string Framework { get; }
        public string Report { get; }
    }
}

namespace Fixie.Console
{
    public class Options
    {
        public Options(
            string? configuration,
            bool noBuild,
            string? framework,
            string? report)
        {
            Configuration = configuration ?? "Debug";
            NoBuild = noBuild;
            Framework = framework;
            Report = report;
        }

        public string Configuration { get; }
        public bool NoBuild { get; }
        public bool ShouldBuild => !NoBuild;
        public string? Framework { get; }
        public string? Report { get; }
    }
}

Declare the nullability of parsed command line arguments.


// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CanvasMock.cs" company="Helix Toolkit">
//   Copyright (c) 2014 Helix Toolkit contributors
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

using System;
using SharpDX;
using SharpDX.Direct3D11;

namespace HelixToolkit.Wpf.SharpDX.Tests.Controls
{
    class CanvasMock : IRenderHost
    {
        public CanvasMock()
        {
            Device = EffectsManager.Device;
            RenderTechnique = Techniques.RenderPhong;
        }

        public Device Device { get; private set; }
        Color4 IRenderHost.ClearColor { get; }
        Device IRenderHost.Device { get; }
        public Color4 ClearColor { get; private set; }
        public bool IsShadowMapEnabled { get; private set; }
        public bool IsMSAAEnabled { get; private set; }
        public IRenderer Renderable { get; private set; }
        public void SetDefaultRenderTargets()
        {
            throw new NotImplementedException();
        }

        public void SetDefaultColorTargets(DepthStencilView dsv)
        {
            throw new NotImplementedException();
        }

        public RenderTechnique RenderTechnique { get; private set; }
        public double ActualHeight { get; private set; }
        public double ActualWidth { get; private set; }
    }
}

// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CanvasMock.cs" company="Helix Toolkit">
//   Copyright (c) 2014 Helix Toolkit contributors
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

using System;
using SharpDX;
using SharpDX.Direct3D11;

namespace HelixToolkit.Wpf.SharpDX.Tests.Controls
{
    class CanvasMock : IRenderHost
    {
        public CanvasMock()
        {
            Device = EffectsManager.Device;
            RenderTechnique = Techniques.RenderPhong;
        }

        public Device Device { get; private set; }
        public Color4 ClearColor { get; private set; }
        public bool IsShadowMapEnabled { get; private set; }
        public bool IsMSAAEnabled { get; private set; }
        public IRenderer Renderable { get; private set; }
        public RenderTechnique RenderTechnique { get; private set; }
        public double ActualHeight { get; private set; }
        public double ActualWidth { get; private set; }

        public void SetDefaultRenderTargets()
        {
            throw new NotImplementedException();
        }

        public void SetDefaultColorTargets(DepthStencilView dsv)
        {
            throw new NotImplementedException();
        }
    }
}

Fix and re-enable the canvas mock.

Fix and re-enable the canvas mock.

This got busted when we updated SharpDX to 2.6.3.


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

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

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

            if (!settings.CefCommandLineArgs.ContainsKey("disable-gpu"))
            {
                settings.CefCommandLineArgs.Add("disable-gpu", "1");
            }

            if (!settings.CefCommandLineArgs.ContainsKey("disable-gpu-compositing"))
            {
                settings.CefCommandLineArgs.Add("disable-gpu-compositing", "1");
            }

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

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

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

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

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

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

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

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

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

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

Make sure GPU accel. in web view is disabled even if default cefsharp settings change


/*
 * ******************************************************************************
 *   Copyright 2014 Spectra Logic Corporation. All Rights Reserved.
 *   Licensed under the Apache License, Version 2.0 (the "License"). You may not use
 *   this file except in compliance with the License. A copy of the License is located at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 *   or in the "license" file accompanying this file.
 *   This file 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.Reflection;

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

/*
 * ******************************************************************************
 *   Copyright 2014 Spectra Logic Corporation. All Rights Reserved.
 *   Licensed under the Apache License, Version 2.0 (the "License"). You may not use
 *   this file except in compliance with the License. A copy of the License is located at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 *   or in the "license" file accompanying this file.
 *   This file 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.Reflection;

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

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

Update the version to 1.2.2

Update the version to 1.2.2


using System.IO;
using SoftwareThresher.Settings.Search;
using SoftwareThresher.Utilities;

namespace SoftwareThresher.Observations {
   public abstract class Observation {
      readonly Search search;

      protected Observation(Search search)
      {
         this.search = search;
      }

      public virtual bool Failed { get; set; }

      public abstract string Name { get; }

      public abstract string Location { get; }

      public abstract string SystemSpecificString { get; }

      // TODO - push more logic into this class?
      public virtual Date LastEdit => search.GetLastEditDate(this);

      public override string ToString() {
         return $"{Location}{Path.PathSeparator}{Name}";
      }
   }
}

using System.IO;
using SoftwareThresher.Settings.Search;
using SoftwareThresher.Utilities;

namespace SoftwareThresher.Observations {
   public abstract class Observation {
      readonly Search search;

      protected Observation(Search search)
      {
         this.search = search;
      }

      public virtual bool Failed { get; set; }

      public abstract string Name { get; }

      public abstract string Location { get; }

      public abstract string SystemSpecificString { get; }

      public virtual Date LastEdit => search.GetLastEditDate(this);

      public override string ToString() {
         return $"{Location}{Path.PathSeparator}{Name}";
      }
   }
}

Remove comment - no action needed

Remove comment - no action needed


// ReSharper disable UnusedMember.Local
namespace Gu.State.Benchmarks
{
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using BenchmarkDotNet.Reports;
    using BenchmarkDotNet.Running;

    public static class Program
    {
        public static void Main()
        {
            foreach (var summary in RunSingle<EqualByComplexType>())
            {
                CopyResult(summary);
            }
        }

        private static IEnumerable<Summary> RunAll() => new BenchmarkSwitcher(typeof(Program).Assembly).RunAll();

        private static IEnumerable<Summary> RunSingle<T>() => new[] { BenchmarkRunner.Run<T>() };

        private static void CopyResult(Summary summary)
        {
            var sourceFileName = Directory.EnumerateFiles(summary.ResultsDirectoryPath, $"*{summary.Title}-report-github.md")
                                          .Single();
            var destinationFileName = Path.ChangeExtension(FindCsFile(), ".md");
            Console.WriteLine($"Copy: {sourceFileName} -> {destinationFileName}");
            File.Copy(sourceFileName, destinationFileName, overwrite: true);

            string FindCsFile()
            {
                return Directory.EnumerateFiles(
                                    AppDomain.CurrentDomain.BaseDirectory.Split(new[] { "\\bin\\" }, StringSplitOptions.RemoveEmptyEntries).First(),
                                    $"{summary.Title.Split('.').Last()}.cs",
                                    SearchOption.AllDirectories)
                                .Single();
            }
        }
    }
}

// ReSharper disable UnusedMember.Local
namespace Gu.State.Benchmarks
{
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using BenchmarkDotNet.Reports;
    using BenchmarkDotNet.Running;

    public static class Program
    {
        public static void Main()
        {
            foreach (var summary in RunSingle<EqualByComplexType>())
            {
                CopyResult(summary);
            }
        }

        private static IEnumerable<Summary> RunAll() => new BenchmarkSwitcher(typeof(Program).Assembly).RunAll();

        private static IEnumerable<Summary> RunSingle<T>() => new[] { BenchmarkRunner.Run<T>() };

        private static void CopyResult(Summary summary)
        {
            var trimmedTitle = summary.Title.Split('.').Last().Split('-').First();
            Console.WriteLine(trimmedTitle);
            var sourceFileName = FindMdFile();
            var destinationFileName = Path.ChangeExtension(FindCsFile(), ".md");
            Console.WriteLine($"Copy: {sourceFileName} -> {destinationFileName}");
            File.Copy(sourceFileName, destinationFileName, overwrite: true);

            string FindMdFile()
            {
                return Directory.EnumerateFiles(summary.ResultsDirectoryPath, $"*{trimmedTitle}-report-github.md")
                                .Single();
            }

            string FindCsFile()
            {
                return Directory.EnumerateFiles(
                                    AppDomain.CurrentDomain.BaseDirectory.Split(new[] { "\\bin\\" }, StringSplitOptions.RemoveEmptyEntries).First(),
                                    $"{trimmedTitle}.cs",
                                    SearchOption.AllDirectories)
                                .Single();
            }
        }
    }
}

Fix copying of markdown result.

Fix copying of markdown result.

Would be nice if there were API for this.


using System;

namespace Blog.Data
{
    public class Post
    {
        public int Id { get; set; }

        public string Url { get; set; }

        public string Title { get; set; }

        public string Description { get; set; }

        public string ComputedDescription
        {
            get
            {
                if (!string.IsNullOrEmpty(this.Description))
                {
                    return this.Description;
                }

                var description = this.Content.Split(new string[] { "<!-- more -->", "<!--more-->" }, StringSplitOptions.RemoveEmptyEntries);

                if (description.Length > 0)
                {
                    return description[0];
                }

                return string.Empty;
            }
        }

        public string Content { get; set; }

        public DateTime? PublicationDate { get; set; }

        public int CategoryId { get; set; }

        public virtual Category Category { get; set; }
    }
}

using System;
using System.Linq.Expressions;

namespace Blog.Data
{
    public class Post
    {
        public int Id { get; set; }

        public string Url { get; set; }

        public string Title { get; set; }

        public string Description { get; set; }

        public string ComputedDescription
        {
            get
            {
                if (!string.IsNullOrEmpty(this.Description))
                {
                    return this.Description;
                }

                var description = this.Content.Split(new string[] { "<!-- more -->", "<!--more-->" }, StringSplitOptions.RemoveEmptyEntries);

                if (description.Length > 0)
                {
                    return description[0];
                }

                return string.Empty;
            }
        }

        public string Content { get; set; }

        public DateTime? PublicationDate { get; set; }

        public int CategoryId { get; set; }

        public virtual Category Category { get; set; }

        public static Expression<Func<Post, bool>> IsPublished = post => post.PublicationDate.HasValue && DateTime.Now > post.PublicationDate;
    }
}

Add expression indicating if a post is published


using log4net;
using RightpointLabs.ConferenceRoom.Services.Attributes;
using System.Net.Http;
using System.ServiceModel.Channels;
using System.Web;
using System.Web.Http;

namespace RightpointLabs.ConferenceRoom.Services.Controllers
{
    /// <summary>
    /// Operations dealing with client log messages
    /// </summary>
    [ErrorHandler]
    public abstract class BaseController : ApiController
    {
        protected BaseController(ILog log)
        {
            this.Log = log;
        }

        protected internal ILog Log { get; private set; }

        protected static string GetClientIp(HttpRequestMessage request = null)
        {
            // from https://trikks.wordpress.com/2013/06/27/getting-the-client-ip-via-asp-net-web-api/
            if (request.Properties.ContainsKey("MS_HttpContext"))
            {
                return ((HttpContextWrapper)request.Properties["MS_HttpContext"]).Request.UserHostAddress;
            }
            else if (request.Properties.ContainsKey(RemoteEndpointMessageProperty.Name))
            {
                RemoteEndpointMessageProperty prop = (RemoteEndpointMessageProperty)request.Properties[RemoteEndpointMessageProperty.Name];
                return prop.Address;
            }
            else if (HttpContext.Current != null)
            {
                return HttpContext.Current.Request.UserHostAddress;
            }
            else
            {
                return null;
            }
        }
    }
}

using log4net;
using RightpointLabs.ConferenceRoom.Services.Attributes;
using System.Net.Http;
using System.ServiceModel.Channels;
using System.Web;
using System.Web.Http;

namespace RightpointLabs.ConferenceRoom.Services.Controllers
{
    /// <summary>
    /// Operations dealing with client log messages
    /// </summary>
    [ErrorHandler]
    public abstract class BaseController : ApiController
    {
        protected BaseController(ILog log)
        {
            this.Log = log;
        }

        protected internal ILog Log { get; private set; }

        protected string GetClientIp(HttpRequestMessage request = null)
        {
            request = request ?? Request;

            // from https://trikks.wordpress.com/2013/06/27/getting-the-client-ip-via-asp-net-web-api/
            if (request.Properties.ContainsKey("MS_HttpContext"))
            {
                return ((HttpContextWrapper)request.Properties["MS_HttpContext"]).Request.UserHostAddress;
            }
            else if (request.Properties.ContainsKey(RemoteEndpointMessageProperty.Name))
            {
                RemoteEndpointMessageProperty prop = (RemoteEndpointMessageProperty)request.Properties[RemoteEndpointMessageProperty.Name];
                return prop.Address;
            }
            else if (HttpContext.Current != null)
            {
                return HttpContext.Current.Request.UserHostAddress;
            }
            else
            {
                return null;
            }
        }
    }
}

Fix process of requesting access to a room


using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System.ComponentModel;
using Telegram.Bot.Types.InputMessageContents;

namespace Telegram.Bot.Types.InlineQueryResults
{
    /// <summary>
    /// Represents a <see cref="Game"/>.
    /// </summary>
    /// <seealso cref="InlineQueryResultNew" />
    [JsonObject(MemberSerialization = MemberSerialization.OptIn,
                NamingStrategyType = typeof(SnakeCaseNamingStrategy))]
    public class InlineQueryResultGame : InlineQueryResult
    {
        /// <summary>
        /// Initializes a new inline query result
        /// </summary>
        public InlineQueryResultGame()
        {
            Type = InlineQueryResultType.Game;
        }

        /// <summary>
        /// Short name of the game.
        /// </summary>
        [JsonProperty(Required = Required.Always)]
        public string GameShortName { get; set; }

#pragma warning disable 1591
        [JsonIgnore]
        [EditorBrowsable(EditorBrowsableState.Never)]
        public new string Title { get; set; }

        [JsonIgnore]
        [EditorBrowsable(EditorBrowsableState.Never)]
        public new InputMessageContent InputMessageContent { get; set; }
#pragma warning restore 1591
    }
}

using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace Telegram.Bot.Types.InlineQueryResults
{
    /// <summary>
    /// Represents a <see cref="Game"/>.
    /// </summary>
    /// <seealso cref="InlineQueryResult" />
    [JsonObject(MemberSerialization = MemberSerialization.OptIn,
                NamingStrategyType = typeof(SnakeCaseNamingStrategy))]
    public class InlineQueryResultGame : InlineQueryResult
    {
        /// <summary>
        /// Initializes a new inline query result
        /// </summary>
        public InlineQueryResultGame()
        {
            Type = InlineQueryResultType.Game;
        }

        /// <summary>
        /// Short name of the game.
        /// </summary>
        [JsonProperty(Required = Required.Always)]
        public string GameShortName { get; set; }
    }
}

Fix game inline query result

Fix game inline query result


using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;

namespace ProjectTracker.AppServerCore
{
  public class Startup
  {
    public Startup(IConfiguration configuration)
    {
      Configuration = configuration;
    }

    public IConfiguration Configuration { get; }

    // This method gets called by the runtime. Use this method to add services to the container.
    public void ConfigureServices(IServiceCollection services)
    {
      services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
    }

    // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
    public void Configure(IApplicationBuilder app, IHostingEnvironment env)
    {
      if (env.IsDevelopment())
      {
        app.UseDeveloperExceptionPage();
      }
      else
      {
        app.UseHsts();
      }

      app.UseHttpsRedirection();
      app.UseMvc();

      Csla.Configuration.ConfigurationManager.AppSettings["DalManagerType"] =
        "ProjectTracker.DalMock.DalManager,ProjectTracker.DalMock";
    }
  }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Csla.Configuration;

namespace ProjectTracker.AppServerCore
{
  public class Startup
  {
    public Startup(IConfiguration configuration)
    {
      Configuration = configuration;
    }

    public IConfiguration Configuration { get; }

    // This method gets called by the runtime. Use this method to add services to the container.
    public void ConfigureServices(IServiceCollection services)
    {
      services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
      services.AddCsla();
    }

    // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
    public void Configure(IApplicationBuilder app, IHostingEnvironment env)
    {
      if (env.IsDevelopment())
      {
        app.UseDeveloperExceptionPage();
      }
      else
      {
        app.UseHsts();
      }

      app.UseHttpsRedirection();
      app.UseMvc();

      app.UseCsla();

      ConfigurationManager.AppSettings["DalManagerType"] =
        "ProjectTracker.DalMock.DalManager,ProjectTracker.DalMock";
    }
  }
}

Update to use CSLA configuration

Update to use CSLA configuration


using System;
using System.IO;

namespace UAOOI.SemanticData.AddressSpaceTestTool
{
  class Program
  {
    internal static void Main(string[] args)
    {
      FileInfo _fileToRead = GetFileToRead(args);
      ValidateFile(_fileToRead);
    }
    internal static void ValidateFile(FileInfo _fileToRead)
    {
      throw new NotImplementedException();
    }
    internal static FileInfo GetFileToRead(string[] args)
    {
      throw new NotImplementedException();
    }
  }
}

using System;
using System.IO;

namespace UAOOI.SemanticData.AddressSpaceTestTool
{
  class Program
  {
    internal static void Main(string[] args)
    {

      try
      {
        FileInfo _fileToRead = GetFileToRead(args);
        ValidateFile(_fileToRead);
      }
      catch (Exception ex)
      {
        Console.WriteLine(String.Format("Program stoped by the exception: {0}", ex.Message));
      }
      Console.Write("Press ENter to close this window.......");
      Console.Read();
    }
    internal static void ValidateFile(FileInfo _fileToRead)
    {
      throw new NotImplementedException();
    }
    internal static FileInfo GetFileToRead(string[] args)
    {
      throw new NotImplementedException();
    }
  }
}

Implement AddressSpaceComplianceTestTool - added top level exception handling.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DataAccessExamples.Core.Actions;
using DataAccessExamples.Core.ViewModels;

namespace DataAccessExamples.Core.Services.Employee
{
    public class LazyOrmEmployeeService : IEmployeeService
    {
        public void AddEmployee(AddEmployee action)
        {
            throw new NotImplementedException();
        }

        public EmployeeList ListRecentHires()
        {
            throw new NotImplementedException();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AutoMapper;
using DataAccessExamples.Core.Actions;
using DataAccessExamples.Core.Data;
using DataAccessExamples.Core.ViewModels;

namespace DataAccessExamples.Core.Services.Employee
{
    public class LazyOrmEmployeeService : IEmployeeService
    {
        private readonly EmployeesContext context;

        public LazyOrmEmployeeService(EmployeesContext context)
        {
            this.context = context;
        }

        public void AddEmployee(AddEmployee action)
        {
            var employee = Mapper.Map<Data.Employee>(action);
            employee.DepartmentEmployees.Add(new DepartmentEmployee
            {
                Employee = employee,
                DepartmentCode = action.DepartmentCode,
                FromDate = action.HireDate,
                ToDate = DateTime.MaxValue
            });
            context.Employees.Add(employee);
            context.SaveChanges();
        }

        public EmployeeList ListRecentHires()
        {
            return new EmployeeList
            {
                Employees = context.Employees
                    .Where(e => e.HireDate > DateTime.Now.AddDays(-7))
                    .OrderByDescending(e => e.HireDate)
            };
        }
    }
}

Add (intentionally) broken Lazy ORM Employee service


using System.Threading.Tasks;
using Version = Msg.Domain.Version;
using System;
using System.Net.Sockets;
using System.Net;

namespace Msg.Acceptance.Tests
{

	class GarbageSpewingClient
	{
		TcpClient client;

		public async Task<byte[]> ConnectAsync() {
			client = new TcpClient ();
			await client.ConnectAsync (IPAddress.Loopback, 1984);
			var stream = client.GetStream ();
			await stream.WriteAsync (new byte[] { 1, 9, 8, 4 }, 0, 4);
			var buffer = new byte[8];
			await stream.ReadAsync (buffer, 0, 8);
			return buffer;
		}

		public bool IsConnected()
		{
			return client != null && client.Connected;
		}
	}
}

using System.Threading.Tasks;
using Version = Msg.Domain.Version;
using System;
using System.Net.Sockets;
using System.Net;

namespace Msg.Acceptance.Tests.TestDoubles
{
	class GarbageSpewingClient
	{
		TcpClient client;

		public async Task<byte[]> ConnectAsync() {
			client = new TcpClient ();
			await client.ConnectAsync (IPAddress.Loopback, 1984);
			var stream = client.GetStream ();
			await stream.WriteAsync (new byte[] { 1, 9, 8, 4 }, 0, 4);
			var buffer = new byte[8];
			await stream.ReadAsync (buffer, 0, 8);
			return buffer;
		}

		public bool IsConnected()
		{
			return client != null && client.Connected;
		}
	}
}

Update garbage spewing client to use test doubles namespace.


using System;
using JabbR.Models;
using JabbR.Services;

namespace JabbR.Commands
{
    [Command("flag", "Flag_CommandInfo", "Iso 3366-2 Code", "user")]
    public class FlagCommand : UserCommand
    {
        public override void Execute(CommandContext context, CallerContext callerContext, ChatUser callingUser, string[] args)
        {
            if (args.Length == 0)
            {
                // Clear the flag.
                callingUser.Flag = null;
            }
            else
            {
                // Set the flag.
                string isoCode = String.Join(" ", args[0]).ToLowerInvariant();
                ChatService.ValidateIsoCode(isoCode);
                callingUser.Flag = isoCode;
            }

            context.NotificationService.ChangeFlag(callingUser);

            context.Repository.CommitChanges();
        }
    }
}

using System;
using JabbR.Models;
using JabbR.Services;

namespace JabbR.Commands
{
    [Command("flag", "Flag_CommandInfo", "Iso 3166-2 Code", "user")]
    public class FlagCommand : UserCommand
    {
        public override void Execute(CommandContext context, CallerContext callerContext, ChatUser callingUser, string[] args)
        {
            if (args.Length == 0)
            {
                // Clear the flag.
                callingUser.Flag = null;
            }
            else
            {
                // Set the flag.
                string isoCode = String.Join(" ", args[0]).ToLowerInvariant();
                ChatService.ValidateIsoCode(isoCode);
                callingUser.Flag = isoCode;
            }

            context.NotificationService.ChangeFlag(callingUser);

            context.Repository.CommitChanges();
        }
    }
}

Update to use correct ISO code

Update to use correct ISO code


namespace TraktApiSharp.Objects.Get.Users
{
    using Basic;
    using Newtonsoft.Json;

    public class TraktUserImages
    {
        [JsonProperty(PropertyName = "avatar")]
        public TraktImage Avatar { get; set; }
    }
}

namespace TraktApiSharp.Objects.Get.Users
{
    using Basic;
    using Newtonsoft.Json;

    /// A collection of images and image sets for a Trakt user.
    public class TraktUserImages
    {
        /// Gets or sets the avatar image.
        [JsonProperty(PropertyName = "avatar")]
        public TraktImage Avatar { get; set; }
    }
}

Add get best id method for user images.

Add get best id method for user images.


using Avalonia;
using Avalonia.Controls;
using Avalonia.Data;
using Avalonia.Markup.Xaml;
using ReactiveUI;
using System;

namespace WalletWasabi.Gui.Controls.WalletExplorer
{
	public class CoinListView : UserControl
	{
		public static readonly StyledProperty<bool> SelectAllNonPrivateVisibleProperty =
			AvaloniaProperty.Register<CoinListView, bool>(nameof(SelectAllNonPrivateVisible), defaultBindingMode: BindingMode.TwoWay);

		public bool SelectAllNonPrivateVisible
		{
			get => GetValue(SelectAllNonPrivateVisibleProperty);
			set => SetValue(SelectAllNonPrivateVisibleProperty, value);
		}

		public CoinListView()
		{
			InitializeComponent();

			SelectAllNonPrivateVisible = true;

			this.WhenAnyValue(x => x.DataContext)
				.Subscribe(dataContext =>
				{
					if (dataContext is CoinListViewModel viewmodel)
					{
						viewmodel.SelectAllNonPrivateVisible = SelectAllNonPrivateVisible;
					}
				});
		}

		private void InitializeComponent()
		{
			AvaloniaXamlLoader.Load(this);
		}
	}
}

using Avalonia;
using Avalonia.Controls;
using Avalonia.Data;
using Avalonia.Markup.Xaml;
using ReactiveUI;
using System;
using System.Reactive.Linq;

namespace WalletWasabi.Gui.Controls.WalletExplorer
{
	public class CoinListView : UserControl
	{
		public static readonly StyledProperty<bool> SelectAllNonPrivateVisibleProperty =
			AvaloniaProperty.Register<CoinListView, bool>(nameof(SelectAllNonPrivateVisible), defaultBindingMode: BindingMode.OneWayToSource);

		public bool SelectAllNonPrivateVisible
		{
			get => GetValue(SelectAllNonPrivateVisibleProperty);
			set => SetValue(SelectAllNonPrivateVisibleProperty, value);
		}

		public CoinListView()
		{
			InitializeComponent();

			SelectAllNonPrivateVisible = true;

			this.WhenAnyValue(x => x.DataContext)
				.Subscribe(dataContext =>
				{
					if (dataContext is CoinListViewModel viewmodel)
					{
						// Value is only propagated when DataContext is set at the beginning.
						viewmodel.SelectAllNonPrivateVisible = SelectAllNonPrivateVisible;
					}
				});
		}

		private void InitializeComponent()
		{
			AvaloniaXamlLoader.Load(this);
		}
	}
}

Add binding mode and comment.

Add binding mode and comment.


@using Site.App_Code
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
    Layout = "SW_Master.cshtml";
}

    @Html.Partial("LeftNavigation",@Model.Content)

            @Model.Content.GetTitleOrName()

            @Convert.ToDateTime(Model.Content.UpdateDate).ToString("D")

            @Html.Raw(Model.Content.GetPropertyValue<string>("bodyText"))

    @Html.Partial("ContentPanels",@Model.Content)

@using Site.App_Code
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
    Layout = "SW_Master.cshtml";
}

    @Html.Partial("LeftNavigation",@Model.Content)

        @*

            @Model.Content.GetTitleOrName()

            @Convert.ToDateTime(Model.Content.UpdateDate).ToString("D")

*@

            @Html.Raw(Model.Content.GetPropertyValue<string>("bodyText"))

    @Html.Partial("ContentPanels",@Model.Content)

Remove title and date from product item page


#if DNX451
using System;
using System.IO;

namespace BuildSpritesheet {
	class Program {
		static void Main(string[] args) {
			PrepareOutputDirectory();
			SpritePreparer.PrepareSprites();

			Console.WriteLine();
			Console.WriteLine("Done processing individual files");

			Console.WriteLine();
			SpritesheetBuilder.BuildSpritesheet();

			Console.WriteLine();
			Console.WriteLine("Done building spritesheet");

			Console.ReadKey();
		}

		private static void PrepareOutputDirectory() {
			Directory.CreateDirectory(Config.WwwRootSkillsPath);
			var outputDirectory = new DirectoryInfo(Config.WwwRootSkillsPath);
			outputDirectory.Empty();
		}
	}
}
#endif

#if DNX451
using System;
using System.IO;

namespace BuildSpritesheet {
	class Program {
		static void Main(string[] args) {
			PrepareOutputDirectory();
			SpritePreparer.PrepareSprites();

			Console.WriteLine();
			Console.WriteLine("Done processing individual files");

			Console.WriteLine();
			SpritesheetBuilder.BuildSpritesheet();

			Console.WriteLine();
			Console.WriteLine("Done building spritesheet. Press any key to exit.");

			Console.ReadKey();
		}

		private static void PrepareOutputDirectory() {
			Directory.CreateDirectory(Config.WwwRootSkillsPath);
			var outputDirectory = new DirectoryInfo(Config.WwwRootSkillsPath);
			outputDirectory.Empty();
		}
	}
}
#endif

Add "Press any key to exit."

Add "Press any key to exit."


using JetBrains.IDE.RunConfig;

namespace AlexPovar.ReSharperHelpers.Build
{
  public class RunConfigProjectWithSolutionBuild : RunConfigBase
  {
    public override void Execute(RunConfigContext context)
    {
      context.ExecutionProvider.Execute(null);
    }
  }
}

using System.Windows;
using JetBrains.DataFlow;
using JetBrains.IDE.RunConfig;
using JetBrains.ProjectModel;
using JetBrains.VsIntegration.IDE.RunConfig;

namespace AlexPovar.ReSharperHelpers.Build
{
  public class RunConfigProjectWithSolutionBuild : RunConfigBase
  {
    public override void Execute(RunConfigContext context)
    {
      context.ExecutionProvider.Execute(null);
    }

    public override IRunConfigEditorAutomation CreateEditor(Lifetime lifetime, IRunConfigCommonAutomation commonEditor, ISolution solution)
    {
      //Configure commot editor to hide build options. We support solution build only.
      commonEditor.IsWholeSolutionChecked.Value = true;
      commonEditor.WholeSolutionVisibility.Value = Visibility.Collapsed;
      commonEditor.IsSpecificProjectChecked.Value = false;

      var casted = commonEditor as RunConfigCommonAutomation;
      if (casted != null)
      {
        casted.ProjectRequiredVisibility.Value = Visibility.Collapsed;
      }

      return null;
    }
  }
}

Hide irrelevant options from build action configuration


using System;

namespace FbxSharp
{
    public class AnimStack : Collection
    {
        #region Public Attributes

        public readonly PropertyT<string>   Description     = new PropertyT<string>( "Description");
        public readonly PropertyT<FbxTime>  LocalStart      = new PropertyT<FbxTime>("LocalStart");
        public readonly PropertyT<FbxTime>  LocalStop       = new PropertyT<FbxTime>("LocalStop");
        public readonly PropertyT<FbxTime>  ReferenceStart  = new PropertyT<FbxTime>("ReferenceStart");
        public readonly PropertyT<FbxTime>  ReferenceStop   = new PropertyT<FbxTime>("ReferenceStop");

        #endregion

        #region Utility functions.

        public FbxTimeSpan GetLocalTimeSpan()
        {
            return new FbxTimeSpan(LocalStart.Get(), LocalStop.Get());
        }

        public void SetLocalTimeSpan(FbxTimeSpan pTimeSpan)
        {
            LocalStart.Set(pTimeSpan.GetStart());
            LocalStop.Set(pTimeSpan.GetStop());
        }

        public FbxTimeSpan GetReferenceTimeSpan()
        {
            throw new NotImplementedException();
        }

        public void SetReferenceTimeSpan(FbxTimeSpan pTimeSpan)
        {
            throw new NotImplementedException();
        }

        public bool BakeLayers(AnimEvaluator pEvaluator, FbxTime pStart, FbxTime pStop, FbxTime pPeriod)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}

using System;

namespace FbxSharp
{
    public class AnimStack : Collection
    {
        public AnimStack(String name="")
            : base(name)
        {
            Properties.Add(Description);
            Properties.Add(LocalStart);
            Properties.Add(LocalStop);
            Properties.Add(ReferenceStart);
            Properties.Add(ReferenceStop);
        }

        #region Public Attributes

        public readonly PropertyT<string>   Description     = new PropertyT<string>( "Description");
        public readonly PropertyT<FbxTime>  LocalStart      = new PropertyT<FbxTime>("LocalStart");
        public readonly PropertyT<FbxTime>  LocalStop       = new PropertyT<FbxTime>("LocalStop");
        public readonly PropertyT<FbxTime>  ReferenceStart  = new PropertyT<FbxTime>("ReferenceStart");
        public readonly PropertyT<FbxTime>  ReferenceStop   = new PropertyT<FbxTime>("ReferenceStop");

        #endregion

        #region Utility functions.

        public FbxTimeSpan GetLocalTimeSpan()
        {
            return new FbxTimeSpan(LocalStart.Get(), LocalStop.Get());
        }

        public void SetLocalTimeSpan(FbxTimeSpan pTimeSpan)
        {
            LocalStart.Set(pTimeSpan.GetStart());
            LocalStop.Set(pTimeSpan.GetStop());
        }

        public FbxTimeSpan GetReferenceTimeSpan()
        {
            throw new NotImplementedException();
        }

        public void SetReferenceTimeSpan(FbxTimeSpan pTimeSpan)
        {
            throw new NotImplementedException();
        }

        public bool BakeLayers(AnimEvaluator pEvaluator, FbxTime pStart, FbxTime pStop, FbxTime pPeriod)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}

Add the built-in properties to the Properties collection.


@using System.Text.Encodings.Web
@model IFS.Web.Core.Upload.UploadedFile
@{
    ViewBag.Title = $"Upload complete: {Model.Metadata.OriginalFileName}";
}

@ViewBag.Title

    The upload of your file has completed: @Model.Metadata.OriginalFileName.

@{
    string downloadLink = this.Url.RouteUrl("DownloadFile", new {id = Model.Id}, this.Context.Request.Scheme);
}

    Download link to share: <input type="text" value="@downloadLink" class="form-control" readonly="readonly"/>

    Test link: @downloadLink

    Upload another file

@section scripts {

}

Replace URL in address bar for easy copying


@using Aliencube.ReCaptcha.Wrapper.Mvc
@model Aliencube.ReCaptcha.Wrapper.WebApp.Models.HomeIndexViewModel
@{
    ViewBag.Title = "Index";
}

@ViewBag.Title

@using (Html.BeginForm(MVC.Home.ActionNames.Index, MVC.Home.Name, FormMethod.Post))
{

        @Html.LabelFor(m => m.Name)
        @Html.TextBoxFor(m => m.Name, new Dictionary<string, object>() {{"class", "form-control"}})

    @Html.ReCaptcha(new Dictionary<string, object>() { { "class", "form-group" }, { "data-sitekey", Model.SiteKey } })
    <input class="btn btn-default" type="submit" name="Submit" />
}

@if (IsPost)
{

Success: @Model.Success

            @if (@Model.ErrorCodes != null && @Model.ErrorCodes.Any())
            {

                    ErrorCodes:

                        @foreach (var errorCode in Model.ErrorCodes)
                        {

@errorCode

                        }

            }

ErorCodes: @Model.ErrorCodes

}

@section Scripts
{
    @Html.ReCaptchaApiJs(new Dictionary<string, object>() { { "src", Model.ApiUrl } })
}

@using Aliencube.ReCaptcha.Wrapper.Mvc
@model Aliencube.ReCaptcha.Wrapper.WebApp.Models.HomeIndexViewModel
@{
    ViewBag.Title = "Index";
}

@ViewBag.Title

@using (Html.BeginForm(MVC.Home.ActionNames.Index, MVC.Home.Name, FormMethod.Post))
{

        @Html.LabelFor(m => m.Name)
        @Html.TextBoxFor(m => m.Name, new Dictionary<string, object>() {{"class", "form-control"}})

    @Html.ReCaptcha(new Dictionary<string, object>() { { "class", "form-group" }, { "data-sitekey", Model.SiteKey } })
    <input class="btn btn-default" type="submit" name="Submit" />
}

@if (IsPost)
{

Success: @Model.Success

            @if (@Model.ErrorCodes != null && @Model.ErrorCodes.Any())
            {

                    ErrorCodes:

                        @foreach (var errorCode in Model.ErrorCodes)
                        {

@errorCode

                        }

            }

ErorCodes: @Model.ErrorCodes

}

@section Scripts
{
    @Html.ReCaptchaApiJs(Model.ApiUrl, JsRenderingOptions.Async | JsRenderingOptions.Defer)
}

Update reCaptcha API js rendering script


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

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Html2Markdown")]
[assembly: AssemblyDescription("A library for converting HTML to markdown syntax in C#")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Simon Baynes")]
[assembly: AssemblyProduct("Html2Markdown")]
[assembly: AssemblyCopyright("Copyright ©  2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("daf67b0f-5a0c-4789-ac19-799160a5e038")]

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

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

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Html2Markdown")]
[assembly: AssemblyDescription("A library for converting HTML to markdown syntax in C#")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Simon Baynes")]
[assembly: AssemblyProduct("Html2Markdown")]
[assembly: AssemblyCopyright("Copyright ©  2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("daf67b0f-5a0c-4789-ac19-799160a5e038")]

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

Increase move the version number to 2.1.3


using System.Numerics;

namespace DynamixelServo.Quadruped
{
    public static class Vector3Extensions
    {
        public static Vector3 Normal(this Vector3 vector)
        {
            float len = vector.Length();
            return new Vector3(vector.X / len, vector.Y / len, vector.Z / len);
        }

        public static bool Similar(this Vector3 a, Vector3 b, float marginOfError = float.Epsilon)
        {
            return Vector3.Distance(a, b) <= marginOfError;
        }
    }
}

using System.Numerics;

namespace DynamixelServo.Quadruped
{
    public static class Vector3Extensions
    {
        public static Vector3 Normal(this Vector3 vector)
        {
            return Vector3.Normalize(vector);
        }

        public static bool Similar(this Vector3 a, Vector3 b, float marginOfError = float.Epsilon)
        {
            return Vector3.Distance(a, b) <= marginOfError;
        }
    }
}

Update normalize extension method to use the built in hardware accelerated static method


// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System.Linq;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Organizing;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
using Microsoft.CodeAnalysis.Organizing;
using Microsoft.CodeAnalysis.Text;
using Xunit;

namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Organizing
{
    public abstract class AbstractOrganizerTests
    {
        protected void Check(string initial, string final)
        {
            CheckResult(initial, final);
            CheckResult(initial, final, Options.Script);
        }

        protected void Check(string initial, string final, bool specialCaseSystem)
        {
            CheckResult(initial, final, specialCaseSystem);
            CheckResult(initial, final, specialCaseSystem, Options.Script);
        }

        protected void CheckResult(string initial, string final, bool specialCaseSystem, CSharpParseOptions options = null)
        {
            using (var workspace = CSharpWorkspaceFactory.CreateWorkspaceFromFile(initial))
            {
                var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id);
                var newRoot = OrganizingService.OrganizeAsync(document).Result.GetSyntaxRootAsync().Result;
                Assert.Equal(final, newRoot.ToFullString());
            }
        }

        protected void CheckResult(string initial, string final, CSharpParseOptions options = null)
        {
            CheckResult(initial, final, false, options);
        }
    }
}

// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System.Linq;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Organizing;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
using Microsoft.CodeAnalysis.Organizing;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Test.Utilities;
using Xunit;

namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Organizing
{
    public abstract class AbstractOrganizerTests
    {
        protected void Check(string initial, string final)
        {
            CheckResult(initial, final);
            CheckResult(initial, final, Options.Script);
        }

        protected void Check(string initial, string final, bool specialCaseSystem)
        {
            CheckResult(initial, final, specialCaseSystem);
            CheckResult(initial, final, specialCaseSystem, Options.Script);
        }

        protected void CheckResult(string initial, string final, bool specialCaseSystem, CSharpParseOptions options = null)
        {
            using (var workspace = CSharpWorkspaceFactory.CreateWorkspaceFromFile(initial))
            {
                var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id);
                var newRoot = OrganizingService.OrganizeAsync(document).Result.GetSyntaxRootAsync().Result;
                Assert.Equal(final.NormalizeLineEndings(), newRoot.ToFullString());
            }
        }

        protected void CheckResult(string initial, string final, CSharpParseOptions options = null)
        {
            CheckResult(initial, final, false, options);
        }
    }
}

Test Fixup for a Line Normalization Issue.

This is a workaround for Issue #4109. It normalizes the line endings of the expected text so that the test will compare to the correct expected value even if the input line endings are '\n' isntead of '\r\n'.


using Microsoft.Build.Framework;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;

namespace Microsoft.DotNet.Build.Tasks
{
    public class UpdatePackageDependencyVersion : VisitProjectDependencies
    {
        [Required]
        public string PackageId { get; set; }

        [Required]
        public string OldVersion { get; set; }

        [Required]
        public string NewVersion { get; set; }

        public override bool VisitPackage(JProperty package, string projectJsonPath)
        {
            var dependencyIdentifier = package.Name;
            string dependencyVersion;
            if (package.Value is JObject)
            {
                dependencyVersion = package.Value["version"].Value<string>();
            }
            else if (package.Value is JValue)
            {
                dependencyVersion = package.Value.ToObject<string>();
            }
            else
            {
                throw new ArgumentException(string.Format(
                    "Unrecognized dependency element for {0} in {1}",
                    package.Name,
                    projectJsonPath));
            }

            if (dependencyIdentifier == PackageId && dependencyVersion == OldVersion)
            {
                Log.LogMessage(
                    "Changing {0} {1} to {2} in {3}",
                    dependencyIdentifier,
                    dependencyVersion,
                    NewVersion,
                    projectJsonPath);

                if (package.Value is JObject)
                {
                    package.Value["version"] = NewVersion;
                }
                else
                {
                    package.Value = NewVersion;
                }
                return true;
            }
            return false;
        }
    }
}

using Microsoft.Build.Framework;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;

namespace Microsoft.DotNet.Build.Tasks
{
    public class UpdatePackageDependencyVersion : VisitProjectDependencies
    {
        [Required]
        public string PackageId { get; set; }

        [Required]
        public string OldVersion { get; set; }

        [Required]
        public string NewVersion { get; set; }

        public override bool VisitPackage(JProperty package, string projectJsonPath)
        {
            var dependencyIdentifier = package.Name;
            string dependencyVersion;
            if (package.Value is JObject)
            {
                dependencyVersion = package.Value["version"]?.Value<string>();
            }
            else if (package.Value is JValue)
            {
                dependencyVersion = package.Value.ToObject<string>();
            }
            else
            {
                throw new ArgumentException(string.Format(
                    "Unrecognized dependency element for {0} in {1}",
                    package.Name,
                    projectJsonPath));
            }

            if (dependencyVersion == null)
            {
                return false;
            }

            if (dependencyIdentifier == PackageId && dependencyVersion == OldVersion)
            {
                Log.LogMessage(
                    "Changing {0} {1} to {2} in {3}",
                    dependencyIdentifier,
                    dependencyVersion,
                    NewVersion,
                    projectJsonPath);

                if (package.Value is JObject)
                {
                    package.Value["version"] = NewVersion;
                }
                else
                {
                    package.Value = NewVersion;
                }
                return true;
            }
            return false;
        }
    }
}

Remove requirement for dependency nodes to have a version.

In corefx this fixes references to 'test-runtime' and 'net46-test-runtime'.