Delete ServiceCollectionExtensions.cs

Delete ServiceCollectionExtensions.cs

--- TIKSN.Framework.Full/DependencyInjection/ServiceCollectionExtensions.cs
+++ TIKSN.Framework.Full/DependencyInjection/ServiceCollectionExtensions.cs
@@ -1,27 +0,0 @@
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.DependencyInjection.Extensions;
-using TIKSN.FileSystem;
-using TIKSN.Network;
-using TIKSN.Security.Antimalware;
-using TIKSN.Settings;
-using TIKSN.Shell;
-using TIKSN.Speech;
-
-namespace TIKSN.DependencyInjection
-{
-    public static class ServiceCollectionExtensions
-    {
-        public static IServiceCollection AddFrameworkPlatform(this IServiceCollection services)
-        {
-            services.AddFrameworkCore();
-
-            services.TryAddSingleton<IConsoleService, ConsoleService>();
-            services.TryAddSingleton<IKnownFolders, KnownFolders>();
-            services.TryAddSingleton<INetworkConnectivityService, NetworkConnectivityService>();
-            services.TryAddSingleton<IShellCommandEngine, ShellCommandEngine>();
-            services.TryAddSingleton<ITextToSpeechService, TextToSpeechService>();
-
-            return services;
-        }
-    }
-}


adjusted tabs

adjusted tabs

--- WhenItsDone/Lib/WhenItsDone.Data/Repositories/AsyncGenericRepository.cs
+++ WhenItsDone/Lib/WhenItsDone.Data/Repositories/AsyncGenericRepository.cs
@@ -144,9 +144,9 @@
             }

             queryToExecute = queryToExecute
-                        .Where(x => !x.IsDeleted)
-                        .Skip(page * pageSize)
-                        .Take(pageSize);
+                .Where(x => !x.IsDeleted)
+                .Skip(page * pageSize)
+                .Take(pageSize);

             var runningTask = Task.Run(() =>
             {


bool -> int

bool -> int

--- csharp/Speculaas/Beoordeler.cs
+++ csharp/Speculaas/Beoordeler.cs
@@ -4,7 +4,7 @@
 {
     public class Beoordeler
     {
-        public static bool BeoordeelSpeculaas(HasseltseSpeculaas speculaas)
+        public static int BeoordeelSpeculaas(HasseltseSpeculaas speculaas)
         {
             throw new NotImplementedException();
         }


Continued work on ErrorDialog control. bugid: 342

--- cslacs/Csla/Wpf/ErrorDialog.cs
+++ cslacs/Csla/Wpf/ErrorDialog.cs
@@ -8,7 +8,7 @@
   /// Displays an error dialog for any exceptions
   /// that occur in a CslaDataProvider.
   /// </summary>
-  public class ErrorDialog : Control
+  public class ErrorDialog : Decorator
   {
     /// <summary>
     /// Creates a new instance of the control.
@@ -16,35 +16,13 @@
     public ErrorDialog()
     {
       this.DialogIcon = MessageBoxImage.Exclamation;
+      this.DataContextChanged += ErrorDialog_DataContextChanged;
     }

-    /// <summary>
-    /// Gets or sets the DataProvider
-    /// control to which the ErrorDialog control
-    /// is bound.
-    /// </summary>
-    public static readonly DependencyProperty SourceProperty = DependencyProperty.Register(
-      "Source",
-      typeof(object),
-      typeof(ErrorDialog),
-      new PropertyMetadata((o, e) => ((ErrorDialog)o).Source = e.NewValue));
-
-    private object _source;
-
-    /// <summary>
-    /// Gets or sets the DataProvider
-    /// control to which the ErrorDialog control
-    /// is bound.
-    /// </summary>
-    public object Source
+    void ErrorDialog_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
     {
-      get { return _source; }
-      set
-      {
-        DetachSource(_source);
-        _source = value;
-        AttachSource(_source);
-      }
+      DetachSource(e.OldValue);
+      AttachSource(e.NewValue);
     }

     /// <summary>


Improved performance by caching type schemas for structured parameters

--- src/unQuery/StructuredDynamicYielder.cs
+++ src/unQuery/StructuredDynamicYielder.cs
@@ -1,6 +1,7 @@
 using Microsoft.SqlServer.Server;
 using System;
 using System.Collections;
+using System.Collections.Concurrent;
 using System.Collections.Generic;
 using System.Linq;
 using System.Reflection;
@@ -8,12 +9,19 @@

 namespace unQuery
 {
+	internal class CachedType
+	{
+		internal SqlMetaData[] Schema;
+		internal PropertyInfo[] Properties;
+	}
+
 	/// <summary>
 	/// Datasource that yields SqlDataRecords for efficient streaming of table valued parameter data to SQL Server.
 	/// </summary>
 	internal class StructuredDynamicYielder : IEnumerable<SqlDataRecord>
 	{
 		private readonly IEnumerable<object> values;
+		private static readonly ConcurrentDictionary<Type, CachedType> typeCache = new ConcurrentDictionary<Type, CachedType>();

 		/// <summary>
 		/// Instantiates a StructedDynamicYielder that will efficiently stream the values to SQL Server.
@@ -34,67 +42,78 @@
 		public IEnumerator<SqlDataRecord> GetEnumerator()
 		{
 			SqlDataRecord sdr = null;
-			SqlMetaData[] schema = null;
-			PropertyInfo[] properties = null;
+			object[] recordValues = null;
+			CachedType cachedType = null;

 			foreach (object value in values)
 			{
 				// For the very first value, we'll first have to create the schema as an array of SqlMetaData
 				if (sdr == null)
 				{
-					// To ensure we get properties in the declaration order, we need to sort by the MetaDataToken
-					properties = value.GetType().GetProperties().OrderBy(x => x.MetadataToken).ToArray();
-					schema = new SqlMetaData[properties.Length];
-
-					// If no properties are found on the provided parameter object, then there's no schema & value to read
-					if (schema.Length == 0)
-						throw new ObjectHasNoPropertiesException("For an object to be used as a value for a Structured parameter, its properties need to match the SQL Server type. The provided object has no properties.");
+					var valueType = value.GetType();

-					// For each property, we'll add it as a SqlMetaData to the schema array. We'll let the ISqlType create
-					// the actual SqlMetaData value.
-					int index = 0;
-					foreach (PropertyInfo prop in properties)
+					// If type schema is not cached, we'll have to create it
+					if (!typeCache.TryGetValue(valueType, out cachedType))
 					{
-						try
+						// To ensure we get properties in the declaration order, we need to sort by the MetaDataToken
+						PropertyInfo[] properties = value.GetType().GetProperties().OrderBy(x => x.MetadataToken).ToArray();
+						SqlMetaData[] schema = new SqlMetaData[properties.Length];
+
+						// If no properties are found on the provided parameter object, then there's no schema & value to read
+						if (schema.Length == 0)
+							throw new ObjectHasNoPropertiesException("For an object to be used as a value for a Structured parameter, its properties need to match the SQL Server type. The provided object has no properties.");
+
+						// For each property, we'll add it as a SqlMetaData to the schema array. We'll let the ISqlType create
+						// the actual SqlMetaData value.
+						int index = 0;
+						foreach (PropertyInfo prop in properties)
 						{
-							schema[index++] = unQueryDB.ClrTypeHandlers[prop.PropertyType].CreateSqlMetaData(prop.Name);
+							try
+							{
+								schema[index++] = unQueryDB.ClrTypeHandlers[prop.PropertyType].CreateSqlMetaData(prop.Name);
+							}
+							catch (KeyNotFoundException)
+							{
+								throw new TypeNotSupportedException(prop.PropertyType);
+							}
 						}
-						catch (KeyNotFoundException)
-						{
-							throw new TypeNotSupportedException(prop.PropertyType);
-						}
+
+						// Cache the new schema
+						cachedType = new CachedType {
+							Properties = properties,
+							Schema = schema
+						};
+						typeCache.AddOrUpdate(valueType, cachedType, (k, v) => v);
+
+						// This is now the base SqlDataRecord that contains the schema without values. We'll be reusing this
+						// while constantly overwriting the values, for each record.
+						sdr = new SqlDataRecord(schema);
 					}
+					else
+						sdr = new SqlDataRecord(cachedType.Schema);

-					// This is now the base SqlDataRecord that contains the schema without values. We'll be reusing this
-					// while constantly overwriting the values, for each record.
-					sdr = new SqlDataRecord(schema);
+					// This is the array that'll be used to efficiently set all values on the data record at once
+					recordValues = new object[sdr.FieldCount];
 				}

 				// Populate values & yield
-				for (int i = 0; i < schema.Length; i++)
+				for (int i = 0; i < recordValues.Length; i++)
 				{
-					var col = schema[i];
-					var prop = properties[i];
+					var prop = cachedType.Properties[i];
 					var columnValue = prop.GetValue(value);
 					var columnValueSqlType = columnValue as ISqlType;

 					// If column value is an ISqlType, get the raw value rather than the ISqlType itself
 					if (columnValueSqlType != null)
-						columnValue = columnValueSqlType.GetRawValue();
+						recordValues[i] = columnValueSqlType.GetRawValue();
+					else
+						recordValues[i] = columnValue;

-					try
-					{
-						// If the value is null, we'll have to write a DBNull and if it's not, we'll let the TypeHandler set the value
-						if (columnValue == null)
-							sdr.SetDBNull(i);
-						else
-							unQueryDB.SqlDbTypeHandlers[col.SqlDbType].SetDataRecordValue(i, sdr, columnValue);
-					}
-					catch (KeyNotFoundException)
-					{
-						throw new TypeNotSupportedException(col.SqlDbType.ToString());
-					}
+					if (recordValues[i] == null)
+						recordValues[i] = DBNull.Value;
 				}
+
+				sdr.SetValues(recordValues);

 				// Once the values have been overwritten, we can now yield it before rewriting the values again
 				yield return sdr;


Fix a couple of bugs

Fix a couple of bugs

--- src/web/Views/Shared/_SelectFile.cshtml
+++ src/web/Views/Shared/_SelectFile.cshtml
@@ -58,12 +58,15 @@
             $(function () {
                 var selectFileName = '@fieldName';
                 var dzInstalled = false;
+                var initialized = false;
                 $(window).bind('selectfile.show', function (event, options) {
                     var callback = options.callback;
                     var eventName = options.eventName;
                     var meta = options.meta;
                     var singleSelect = @singleSelect;
-                    var value = options.value;
+                    var datatable = null;
+                    var cancelled = true;
+                    var triggerred = false;
                     var modal = $('#SelectFile_' + selectFileName);
                     $('body').append(modal);
                     var renderDate = function (data, type, full, meta) {
@@ -84,9 +87,6 @@
                         }
                         return data;
                     };
-                    var datatable = null;
-                    var cancelled = true;
-                    var triggerred = false;

                     function progressHandler(event) {
                         var $p = $('.js-uploader .progress-bar');
@@ -100,8 +100,7 @@
                     }

                     function setupDropZone() {
-                        if (!dzInstalled && Dropzone) {
-                            dzInstalled = true;
+                        if (Dropzone) {
                             function dz_issue_438(uploader) {
                                 var drag = (function (elm) {
                                     var dragCounter = 0;
@@ -128,9 +127,8 @@
                                 uploader.on('dragenter', drag.enter);
                                 uploader.on('dragleave', drag.leave);
                             }
-                            Dropzone.options.dropzone = {
-                            };
                             var filedropzone = new Dropzone('#SelectFile_' + selectFileName, {
+                                clickable: $('<i>')[0],
                                 dragenter: function () {},
                                 dragleave: function () {},
                                 init: function () { dz_issue_438(this); },
@@ -170,9 +168,11 @@

                     modal.modal('show')
                         .one('shown.bs.modal', function (e) {
-                            // display user's file list
                             $('[data-role="file-id"]', modal).val('');
                             $('[data-role="file-url"]', modal).val('');
+                            if (initialized){ return; }
+                            initialized = true;
+
                             setupDropZone();

                             $.getJSON('@Url.Action("Index", "WebFiles")', function (files) {
@@ -317,14 +317,14 @@
                             $('[data-role="file-id"]', modal).val(JSON.stringify(ids));
                             $('[data-role="file-url"]', modal).val(file && '/Download/' + file.Id + '/' + file.Name);
                             modal.modal('hide');
-                        } else if (data.message) {
+                        } else if (data && data.message) {
                             bootbox.alert(data.message);
                         }
                         $('.js-uploader').removeClass('uploading');
                     });
                     $(window).bind('error.upload', function (event, data) {
                         modal.modal('hide');
-                        if (data.message) {
+                        if (data && data.message) {
                             bootbox.alert(data.message);
                         }
                         $('.js-uploader').removeClass('uploading');


Add Game.OnUnloadContent event

Add Game.OnUnloadContent event

--- Raccoon/Core/Game.cs
+++ Raccoon/Core/Game.cs
@@ -20,6 +20,7 @@
                                        OnBegin = delegate { },
                                        OnBeforeUpdate = delegate { },
                                        OnLateUpdate = delegate { },
+                                       OnUnloadContent,
                                        OnWindowResize = delegate { },
                                        OnActivated,
                                        OnDeactivated,
@@ -907,6 +908,7 @@

         private void InternalUnloadContent() {
             Scene?.UnloadContent();
+            OnUnloadContent?.Invoke();
             Graphics.Texture.White.Dispose();
             Graphics.Texture.Black.Dispose();
         }


Change how feed item equality is determined

A particular feed's link property was the same for every item. The previous behaviour assumed that links were always different.

--- RdrLib/Model/Item.cs
+++ RdrLib/Model/Item.cs
@@ -49,14 +49,21 @@

 		private static bool EqualsInternal(Item thisOne, Item otherOne)
 		{
-            if (AreLinksTheSame(thisOne.Link, otherOne.Link))
+            if (AreLinksTheSame(thisOne.Link, otherOne.Link) == false)
+            {
+                // if the links are different, they are definitely different items
+
+                return false;
+            }
+
+            bool sameName = thisOne.Name.Equals(otherOne.Name, StringComparison.OrdinalIgnoreCase);
+
+            if (AreLinksTheSame(thisOne.Link, otherOne.Link) && sameName)
             {
                 return true;
             }
-
-            bool sameName = thisOne.Name.Equals(otherOne.Name, StringComparison.OrdinalIgnoreCase);
-
-            return sameName;
+
+            return false;
 		}

 		public static bool operator ==(Item lhs, Item rhs)


added unit to evaluation view

added unit to evaluation view

--- Battery-Commander.Web/Views/Evaluations/List.cshtml
+++ Battery-Commander.Web/Views/Evaluations/List.cshtml
@@ -52,6 +52,7 @@
                 @Html.DisplayNameFor(_ => _.Evaluations.FirstOrDefault().Ratee.Rank)
                 @Html.DisplayNameFor(_ => _.Evaluations.FirstOrDefault().Ratee.LastName)
                 @Html.DisplayNameFor(_ => _.Evaluations.FirstOrDefault().Ratee.FirstName)
+                @Html.DisplayNameFor(_ => _.Soldiers.FirstOrDefault().Unit)
                 @Html.DisplayNameFor(_ => _.Evaluations.FirstOrDefault().ThruDate)
                 @Html.DisplayNameFor(_ => _.Evaluations.FirstOrDefault().Status)
                 @Html.DisplayNameFor(_ => _.Evaluations.FirstOrDefault().Delinquency)


Use shortened rank

Use shortened rank

--- Battery-Commander.Web/Views/Evaluations/List.cshtml
+++ Battery-Commander.Web/Views/Evaluations/List.cshtml
@@ -47,7 +47,7 @@
         {

                 @Html.ActionLink("Details", "Details", new { evaluation.Id })
-                @Html.DisplayFor(_ => evaluation.Ratee.Rank)
+                @evaluation.Ratee.Rank.ShortName()
                 @Html.DisplayFor(_ => evaluation.Ratee.LastName)
                 @Html.DisplayFor(_ => evaluation.Ratee.FirstName)
                 @Html.DisplayFor(_ => evaluation.ThruDate)


Removing Should.Fluent from tests

Removing Should.Fluent from tests

--- CSMSL.Tests/Chemistry/ChemicalFormulaTestFixture.cs
+++ CSMSL.Tests/Chemistry/ChemicalFormulaTestFixture.cs
@@ -1,10 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.Collections.Generic;
 using NUnit.Framework;
-using Should.Fluent;
 using CSMSL.Chemistry;

 namespace CSMSL.Tests.Chemistry
@@ -12,13 +7,16 @@
     [TestFixture]
     [Category("Chemical Formula")]
     public class ChemicalFormulaTestFixture
-    {
-        private ChemicalFormula CAM = new ChemicalFormula("C2H3NO");
-        private ChemicalFormula EmptyFormula = new ChemicalFormula();
-        private ChemicalFormula NullChemicalFormula = null;
-        private Element NullElement = null;
-        private Isotope NullIsotope = null;
-        private IChemicalFormula NullIChemicalFormula = null;
+    {
+
+        private static readonly ChemicalFormula EmptyFormula = new ChemicalFormula();
+        private static readonly ChemicalFormula NullChemicalFormula = null;
+        private static readonly Element NullElement = null;
+        private static readonly Isotope NullIsotope = null;
+        private static readonly IChemicalFormula NullIChemicalFormula = null;
+// ReSharper disable NotAccessedField.Local
+        private object _ignore;
+// ReSharper restore NotAccessedField.Local

         [Test]
         public void AddElementToFormula()
@@ -30,7 +28,7 @@

             formulaA.Add(n, 1);

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -42,7 +40,7 @@

             formulaA.Add(formulaB);

-            formulaA.Should().Equal(formulaC);
+            Assert.AreEqual(formulaA, formulaC);
         }

         [Test]
@@ -53,7 +51,7 @@

             formulaA.Add(formulaA);

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -65,7 +63,7 @@

             formulaA.Add(formulaB);

-            formulaA.Should().Equal(formulaC);
+            Assert.AreEqual(formulaA, formulaC);
         }

         [Test]
@@ -78,9 +76,12 @@

             formulaA.Add(h1, 1);

-            formulaA.Should().Equal(formulaB);
-        }
-
+            Assert.AreEqual(formulaA, formulaB);
+        }
+
+        /// <summary>
+        /// This tests that the array for chemical formula properly expands
+        /// </summary>
         [Test]
         public void AddLargeIsotopeToFormula()
         {
@@ -91,7 +92,7 @@

             formulaA.Add(fe, 1);

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -103,20 +104,20 @@

             formulaA.Add(formulaB);

-            formulaA.Should().Equal(formulaC);
+            Assert.AreEqual(formulaA, formulaC);
         }

         [Test]
         public void AddNegativeIsotopeToFormula()
         {
             ChemicalFormula formulaA = new ChemicalFormula("C2H3NO");
-            ChemicalFormula formulaB = new ChemicalFormula("C2H1NO");
+            ChemicalFormula formulaB = new ChemicalFormula("C2HNO");

             Isotope h1 = Element.PeriodicTable["H"][1];

             formulaA.Add(h1, -2);

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -136,7 +137,7 @@

             formulaA.Add(NullElement, 1);

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -147,7 +148,7 @@

             formulaA.Add(NullIsotope, 1);

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -158,9 +159,8 @@

             formulaA.Add(NullChemicalFormula);

-            formulaA.Should().Equal(formulaB);
-        }
-
+            Assert.AreEqual(formulaA, formulaB);
+        }

         [Test]
         public void AddNullIChemicalFormulaToFormula()
@@ -170,7 +170,7 @@

             formulaA.Add(NullIChemicalFormula);

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -183,7 +183,7 @@

             formulaA.Add(n, 0);

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -194,8 +194,9 @@

             Isotope h1 = Element.PeriodicTable["H"][1];

-            formulaA.Add(h1, 0);
-            formulaA.Should().Equal(formulaB);
+            formulaA.Add(h1, 0);
+
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -205,14 +206,24 @@
             ChemicalFormula formulaB = new ChemicalFormula("C2H3NO");

             formulaA.Add("H", 0);
-            formulaA.Should().Equal(formulaB);
-        }
-
-        [Test]
-        public void BasicChemicalFormulaMass()
+
+            Assert.AreEqual(formulaA, formulaB);
+        }
+
+        [Test]
+        public void BasicChemicalFormulaMassMonoisotopic()
         {
             ChemicalFormula water = new ChemicalFormula("H2O");
-            water.Mass.Monoisotopic.Should().Equal(2 * Constants.HYDROGEN + Constants.OXYGEN);
+
+            Assert.AreEqual(2 * Constants.HYDROGEN + Constants.OXYGEN, water.Mass.Monoisotopic);
+        }
+
+        [Test]
+        public void BasicChemicalFormulaMassAverage()
+        {
+            ChemicalFormula water = new ChemicalFormula("H2O");
+
+            Assert.AreEqual(18.015286435051941, water.Mass.Average);
         }

         [Test]
@@ -221,7 +232,7 @@
             ChemicalFormula formulaA = new ChemicalFormula("C2H3NO");
             formulaA.Clear();

-            formulaA.Should().Equal(EmptyFormula);
+            Assert.AreEqual(formulaA, EmptyFormula);
         }

@@ -230,15 +241,15 @@
         {
             ChemicalFormula formulaA = new ChemicalFormula("");

-            formulaA.Should().Equal(EmptyFormula);
+            Assert.AreEqual(formulaA, EmptyFormula);
         }

         [Test]
         public void ConstructorEmptyStringEqualsEmptyFormula()
         {
             ChemicalFormula formulaA = new ChemicalFormula(string.Empty);
-
-            formulaA.Should().Equal(EmptyFormula);
+
+            Assert.AreEqual(formulaA, EmptyFormula);
         }

@@ -247,7 +258,7 @@
         {
             ChemicalFormula formulaA = new ChemicalFormula();

-            formulaA.Should().Equal(EmptyFormula);
+            Assert.AreEqual(formulaA, EmptyFormula);
         }

         [Test]
@@ -256,7 +267,7 @@
             ChemicalFormula formulaA = new ChemicalFormula("C2H3NO");
             ChemicalFormula formulaB = new ChemicalFormula(formulaA);

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -264,7 +275,7 @@
         {
             ChemicalFormula formulaA = new ChemicalFormula(NullChemicalFormula);

-            formulaA.Should().Equal(EmptyFormula);
+            Assert.AreEqual(formulaA, EmptyFormula);
         }

         [Test]
@@ -273,69 +284,49 @@
             ChemicalFormula formulaA = new ChemicalFormula("C2H3NO");
             ChemicalFormula formulaB = new ChemicalFormula(formulaA);

-            formulaA.Should().Not.Be.SameAs(formulaB);
-        }
-
-        [Test]
-        public void ContainsIsotope()
-        {
-            CAM.Contains(Element.PeriodicTable["C"].PrincipalIsotope).Should().Be.True();
-            CAM.Contains(Element.PeriodicTable["Fe"].PrincipalIsotope).Should().Be.False();
-            CAM.Contains(Element.PeriodicTable["O"]).Should().Be.True();
-            CAM.Contains(NullIsotope).Should().Be.False();
-            CAM.Contains(NullElement).Should().Be.False();
-            CAM.Contains("N").Should().Be.True();
-            CAM.Contains("H", 1).Should().Be.True();
-            CAM.Contains("N", 15).Should().Be.False();
-        }
-
-        [Test]
-        public void CountIsotope()
-        {
-            CAM.Count(Element.PeriodicTable["C"].PrincipalIsotope).Should().Equal(2);
-            CAM.Count(Element.PeriodicTable["Fe"].PrincipalIsotope).Should().Equal(0);
-            CAM.Count(Element.PeriodicTable["O"]).Should().Equal(1);
-            CAM.Count(NullElement).Should().Equal(0);
-            CAM.Count(NullIsotope).Should().Equal(0);
-            CAM.Count("N").Should().Equal(1);
-            CAM.Count("H", 1).Should().Equal(3);
-            CAM.Count("N", 15).Should().Equal(0);
+            Assert.AreNotSame(formulaA, formulaB);
+        }
+
+        [Test]
+        public void EmptyFormulaMassIsNotNull()
+        {
+            Assert.IsNotNull(EmptyFormula.Mass);
         }

         [Test]
         public void EmptyFormulaMonoisotopicMassIsZero()
         {
-            EmptyFormula.Mass.Monoisotopic.Should().Equal(0.0);
+            Assert.AreEqual(0.0, EmptyFormula.Mass.Monoisotopic);
         }

         [Test]
         public void EmptyFormulaAverageMassIsZero()
         {
-            EmptyFormula.Mass.Average.Should().Equal(0.0);
+            Assert.AreEqual(0.0, EmptyFormula.Mass.Average);
         }

         [Test]
         public void EmptyFormulaStringIsBlank()
         {
-            EmptyFormula.Formula.Should().Be.Empty();
+            Assert.IsEmpty(EmptyFormula.Formula);
         }

         [Test]
         public void EmptyFormulaAtomCountIsZero()
         {
-            EmptyFormula.AtomCount.Should().Equal(0);
+            Assert.AreEqual(0, EmptyFormula.AtomCount);
         }

         [Test]
         public void EmptyFormulaElementCountIsZero()
         {
-            EmptyFormula.ElementCount.Should().Equal(0);
+            Assert.AreEqual(0, EmptyFormula.ElementCount);
         }

         [Test]
         public void EmptyFormulaIsotopeCountIsZero()
         {
-            EmptyFormula.IsotopeCount.Should().Equal(0);
+            Assert.AreEqual(0, EmptyFormula.IsotopeCount);
         }

         [Test]
@@ -343,7 +334,7 @@
         {
             ChemicalFormula formulaA = new ChemicalFormula("C2H3NO");

-            formulaA.Should().Not.Equal(NullChemicalFormula);
+            Assert.AreNotEqual(NullChemicalFormula, formulaA);
         }

         [Test]
@@ -352,7 +343,7 @@
             ChemicalFormula formulaA = new ChemicalFormula("C2H3NO");
             ChemicalFormula formulaB = new ChemicalFormula("NC1OH3");

-            formulaA.Should().Not.Equal(formulaB);
+            Assert.AreNotEqual(formulaA, formulaB);
         }

         [Test]
@@ -360,8 +351,8 @@
         {
             ChemicalFormula formulaA = new ChemicalFormula("C2H3NO");
             ChemicalFormula formulaB = new ChemicalFormula("CC{13}H3NO");
-
-            formulaB.Should().Not.Equal(formulaA);
+
+            Assert.AreNotEqual(formulaA, formulaB);
         }

         [Test]
@@ -369,7 +360,7 @@
         {
             ChemicalFormula formulaA = new ChemicalFormula("C2H3NO");

-            formulaA.Should().Equal(formulaA);
+            Assert.AreEqual(formulaA, formulaA);
         }

         [Test]
@@ -378,7 +369,7 @@
             ChemicalFormula formulaA = new ChemicalFormula("C2H3NO");
             ChemicalFormula formulaB = new ChemicalFormula("NC2OH3");

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -387,7 +378,15 @@
             ChemicalFormula formulaA = new ChemicalFormula("C2H3NO");
             ChemicalFormula formulaB = new ChemicalFormula("H3C2NO");

-            formulaA.GetHashCode().Should().Equal(formulaB.GetHashCode());
+            Assert.AreEqual(formulaA.GetHashCode(), formulaB.GetHashCode());
+        }
+
+        [Test]
+        public void HashCodeImmutableEquality()
+        {
+            ChemicalFormula formulaA = new ChemicalFormula("C2H3NO");
+
+            Assert.AreEqual(formulaA.GetHashCode(), formulaA.GetHashCode());
         }

         [Test]
@@ -395,15 +394,15 @@
         {
             ChemicalFormula formulaA = new ChemicalFormula("H3NC2O");

-            formulaA.ToString().Should().Equal("C2H3NO");
+            Assert.AreEqual("C2H3NO", formulaA.Formula);
         }

         [Test]
         public void HillNotationNoCarbon()
         {
             ChemicalFormula formulaA = new ChemicalFormula("HBr");
-
-            formulaA.ToString().Should().Equal("BrH");
+
+            Assert.AreEqual("BrH", formulaA.Formula);
         }

         [Test]
@@ -411,39 +410,39 @@
         {
             ChemicalFormula formulaA = new ChemicalFormula("Ca5O14Al6");

-            formulaA.ToString().Should().Equal("Al6Ca5O14");
+            Assert.AreEqual("Al6Ca5O14", formulaA.Formula);
         }

         [Test]
         public void HillNotationNoHydrogen()
         {
             ChemicalFormula formulaA = new ChemicalFormula("NC2O");
-
-            formulaA.ToString().Should().Equal("C2NO");
+
+            Assert.AreEqual("C2NO", formulaA.Formula);
         }

         [Test]
         public void HillNotationWithHeavyIsotope()
         {
             ChemicalFormula formulaA = new ChemicalFormula("H3NC2C{13}2O");
-
-            formulaA.ToString().Should().Equal("C2C{13}2H3NO");
+
+            Assert.AreEqual("C2C{13}2H3NO", formulaA.Formula);
         }

         [Test]
         public void HillNotationWithNegativeCount()
         {
             ChemicalFormula formulaA = new ChemicalFormula("H3NC-2O");
-
-            formulaA.ToString().Should().Equal("C-2H3NO");
+
+            Assert.AreEqual("C-2H3NO", formulaA.Formula);
         }

         [Test]
         public void HillNotationWithHeavyIsotopeNegativeCount()
         {
             ChemicalFormula formulaA = new ChemicalFormula("H3NC2C{13}-2O");
-
-            formulaA.ToString().Should().Equal("C2C{13}-2H3NO");
+
+            Assert.AreEqual("C2C{13}-2H3NO", formulaA.Formula);
         }

         [Test]
@@ -455,7 +454,7 @@

             ChemicalFormula formulaD = formulaA + formulaB;

-            formulaD.Should().Equal(formulaC);
+            Assert.AreEqual(formulaC, formulaD);
         }

@@ -467,7 +466,7 @@

             ChemicalFormula formulaC = formulaA + NullChemicalFormula;

-            formulaB.Should().Equal(formulaC);
+            Assert.AreEqual(formulaC, formulaB);
         }

         [Test]
@@ -478,18 +477,15 @@

             ChemicalFormula formulaC = NullChemicalFormula + formulaA;

-            formulaB.Should().Equal(formulaC);
+            Assert.AreEqual(formulaC, formulaB);
         }

         [Test]
         public void ImplicitAddNullFormulaLeftRight()
         {
-            ChemicalFormula formulaA = new ChemicalFormula("C2H3NO");
-            ChemicalFormula formulaB = new ChemicalFormula("C2H3NO");
-
-            ChemicalFormula formulaC = NullChemicalFormula + NullChemicalFormula;
-
-            formulaC.Should().Equal(NullChemicalFormula);
+            ChemicalFormula formulaA = NullChemicalFormula + NullChemicalFormula;
+
+            Assert.AreEqual(formulaA, NullChemicalFormula);
         }

         [Test]
@@ -498,7 +494,7 @@
             ChemicalFormula formulaA = new ChemicalFormula("C2H3NO");
             ChemicalFormula formulaB = "C2H3NO";

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -509,7 +505,7 @@

             ChemicalFormula formulaC = formulaA * 2;

-            formulaB.Should().Equal(formulaC);
+            Assert.AreEqual(formulaC, formulaB);
         }

         [Test]
@@ -520,7 +516,7 @@

             ChemicalFormula formulaC = 2 * formulaA;

-            formulaB.Should().Equal(formulaC);
+            Assert.AreEqual(formulaC, formulaB);
         }

         [Test]
@@ -532,30 +528,27 @@

             ChemicalFormula formulaD = formulaA - formulaB;

-            formulaD.Should().Equal(formulaC);
+            Assert.AreEqual(formulaC, formulaD);
         }

         [Test]
-        [ExpectedException(typeof(KeyNotFoundException))]
         public void InvalidChemicalElement()
         {
-            Element element = Element.PeriodicTable["Faa"];
+            Assert.Throws<KeyNotFoundException>(() => { _ignore = Element.PeriodicTable["Faa"]; });
         }

         [Test]
-        [ExpectedException(typeof(KeyNotFoundException))]
         public void InvalidElementIsotope()
         {
-            Element element = Element.PeriodicTable["C"];
-            Isotope isotope = element[100];
+            Assert.Throws<KeyNotFoundException>(() => { _ignore = Element.PeriodicTable["C"][100]; });
         }

         [Test]
         public void NullFormulaDoesNotEqualFormula()
         {
-            ChemicalFormula formulaA = new ChemicalFormula("C2H3NO");
-
-            NullChemicalFormula.Should().Not.Equal(formulaA);
+            ChemicalFormula formulaA = new ChemicalFormula("C2H3NO");
+
+            Assert.AreNotEqual(formulaA, NullChemicalFormula);
         }

         [Test]
@@ -563,22 +556,21 @@
         {
             ChemicalFormula formulaA = new ChemicalFormula("C2H3NO");

-            formulaA.AtomCount.Should().Equal(7);
+            Assert.AreEqual(7, formulaA.AtomCount);
         }

         [Test]
         public void NumberOfAtomsOfEmptyFormula()
         {
-            EmptyFormula.AtomCount.Should().Equal(0);
-        }
-
-
+            Assert.AreEqual(0, EmptyFormula.AtomCount);
+        }
+
         [Test]
         public void NumberOfAtomsOfNegativeFormula()
         {
             ChemicalFormula formulaA = new ChemicalFormula("C-2H-3N-1O-1");

-            formulaA.AtomCount.Should().Equal(-7);
+            Assert.AreEqual(-7, formulaA.AtomCount);
         }

         [Test]
@@ -587,7 +579,7 @@
             ChemicalFormula formulaA = new ChemicalFormula("CCHHHNO");
             ChemicalFormula formulaB = new ChemicalFormula("C2H3NO");

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -596,7 +588,7 @@
             ChemicalFormula formulaA = new ChemicalFormula("C2 H3 N O");
             ChemicalFormula formulaB = new ChemicalFormula("C2H3NO");

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -605,7 +597,7 @@
             ChemicalFormula formulaA = new ChemicalFormula("C2H3NO  ");
             ChemicalFormula formulaB = new ChemicalFormula("C2H3NO");

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -614,7 +606,7 @@
             ChemicalFormula formulaA = new ChemicalFormula("    C2H3NO");
             ChemicalFormula formulaB = new ChemicalFormula("C2H3NO");

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -623,7 +615,7 @@
             ChemicalFormula formulaA = new ChemicalFormula("  C2 H3 N O  ");
             ChemicalFormula formulaB = new ChemicalFormula("C2H3NO");

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -632,7 +624,7 @@
             ChemicalFormula formulaA = new ChemicalFormula("OCHHCHN");
             ChemicalFormula formulaB = new ChemicalFormula("C2H3NO");

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -641,7 +633,7 @@
             ChemicalFormula formulaA = new ChemicalFormula("CH3NOC");
             ChemicalFormula formulaB = new ChemicalFormula("C2H3NO");

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -650,7 +642,7 @@
             ChemicalFormula formulaA = new ChemicalFormula("C2H3NOC-2");
             ChemicalFormula formulaB = new ChemicalFormula("H3NO");

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -661,7 +653,7 @@

             formulaA.Remove(Element.PeriodicTable["H"]);

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -672,7 +664,7 @@

             formulaA.Remove("H");

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -683,7 +675,7 @@

             formulaA.Remove(Element.PeriodicTable["C"]);

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -694,7 +686,7 @@

             formulaA.Remove(EmptyFormula);

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -706,7 +698,7 @@

             formulaA.Remove(formulaB);

-            formulaA.Should().Equal(formulaC);
+            Assert.AreEqual(formulaA, formulaC);
         }

         [Test]
@@ -717,7 +709,7 @@

             formulaA.Remove(Element.PeriodicTable["H"][1]);

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -728,7 +720,7 @@

             formulaA.Remove(Element.PeriodicTable["H"][1], 2);

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -739,7 +731,7 @@

             formulaA.Remove("N", 1);

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -750,7 +742,7 @@

             formulaA.Remove(Element.PeriodicTable["H"][1], -2);

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -762,8 +754,9 @@

             formulaA.Remove(formulaB);

-            formulaA.Should().Equal(formulaC);
-        }
+            Assert.AreEqual(formulaA, formulaC);
+        }
+
         [Test]
         public void RemoveNullElementFromFromula()
         {
@@ -772,7 +765,7 @@

             formulaA.Remove(NullElement);

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -783,7 +776,7 @@

             formulaA.Remove(NullChemicalFormula);

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }
         [Test]
         public void RemoveNullIsotopeFromFromula()
@@ -793,7 +786,7 @@

             formulaA.Remove(NullIsotope);

-            formulaA.Should().Equal(formulaB);
+            Assert.AreEqual(formulaA, formulaB);
         }

         [Test]
@@ -804,35 +797,37 @@

             formulaA.Remove(Element.PeriodicTable["H"][1], 0);

-            formulaA.Should().Equal(formulaB);
-        }
+            Assert.AreEqual(formulaA, formulaB);
+        }
+
         [Test]
         public void TotalNeutrons()
         {
             ChemicalFormula formulaA = new ChemicalFormula("C2H3NO");

-            formulaA.GetNeutronCount().Should().Equal(19);
+            Assert.AreEqual(19, formulaA.GetNeutronCount());
         }

         [Test]
         public void TotalProtons()
         {
             ChemicalFormula formulaA = new ChemicalFormula("C2H3NO");
-
-            formulaA.GetProtonCount().Should().Equal(22);
-        }
+
+            Assert.AreEqual(22, formulaA.GetProtonCount());
+        }
+
         [Test]
         public void UniqueElements()
         {
             ChemicalFormula formulaA = new ChemicalFormula("C2H3NO");

-            formulaA.ElementCount.Should().Equal(4);
+            Assert.AreEqual(4, formulaA.ElementCount);
         }

         [Test]
         public void UniqueElementsOfEmptyFormula()
         {
-            EmptyFormula.ElementCount.Should().Equal(0);
+            Assert.AreEqual(0, EmptyFormula.ElementCount);
         }

         [Test]
@@ -840,7 +835,7 @@
         {
             ChemicalFormula formulaA = new ChemicalFormula("CC{13}H3NO");

-            formulaA.ElementCount.Should().Equal(4);
+            Assert.AreEqual(4, formulaA.ElementCount);
         }

         [Test]
@@ -848,21 +843,21 @@
         {
             ChemicalFormula formulaA = new ChemicalFormula("C2H3NO");

-            formulaA.IsotopeCount.Should().Equal(4);
+            Assert.AreEqual(4, formulaA.IsotopeCount);
         }

         [Test]
         public void UniqueIsotopesOfEmptyFormula()
         {
-            EmptyFormula.IsotopeCount.Should().Equal(0);
+            Assert.AreEqual(0, EmptyFormula.IsotopeCount);
         }

         [Test]
         public void UniqueIsotopesWithHeavyIsotope()
         {
             ChemicalFormula formulaA = new ChemicalFormula("CC{13}H3NO");
-
-            formulaA.IsotopeCount.Should().Equal(5);
+
+            Assert.AreEqual(5, formulaA.IsotopeCount);
         }

     }


Task 12 attempt3

Task 12 attempt3

--- addressbook-web-tests/addressbook-web-tests/appmanager/ContactHelper.cs
+++ addressbook-web-tests/addressbook-web-tests/appmanager/ContactHelper.cs
@@ -47,9 +47,9 @@
             ClickFullInformationButton(index);

             IWebElement element = driver.FindElement(By.Id("content"));
-            string s = Regex.Replace(element.Text, "[ ()\\-\\r\\n]", "");
-
-            return Regex.Replace(s, "(H+:)|(M+:)|(W+:)", "");
+            return Regex.Replace(element.Text, "[ ()\\-\\r\\n]", "");
+
+           // return Regex.Replace(s, "(H+:)|(M+:)|(W+:)", "");

         }
         public string GetContactInformationFromTableReverse(int index)
@@ -74,9 +74,17 @@
             string address = driver.FindElement(By.Name("address")).GetAttribute("value");

             string homePhone = driver.FindElement(By.Name("home")).GetAttribute("value");
+            if (!string.IsNullOrEmpty(homePhone))  homePhone = "H: " + homePhone;
             string mobilePhone = driver.FindElement(By.Name("mobile")).GetAttribute("value");
+            if (!string.IsNullOrEmpty(mobilePhone))  mobilePhone = "M: " + mobilePhone;
             string workPhone = driver.FindElement(By.Name("work")).GetAttribute("value");
-            string fullData = firstName + lastName + address + homePhone + mobilePhone + workPhone;
+            if (!string.IsNullOrEmpty(workPhone)) workPhone = "W: " + workPhone;
+
+            string email = driver.FindElement(By.Name("email")).GetAttribute("value");
+            string email2 = driver.FindElement(By.Name("email2")).GetAttribute("value");
+            string email3 = driver.FindElement(By.Name("email3")).GetAttribute("value");
+
+            string fullData = firstName + lastName + address + homePhone + mobilePhone + workPhone+ email+ email2+ email3;
             return Regex.Replace(fullData, "[ \\r\\n]", "");
         }


-add optional parameter to TsPacketFactory to permit data length to be passed with source buffer to trim any junk from end

--- Cinegy.TsDecoder/TransportStream/TsPacketFactory.cs
+++ Cinegy.TsDecoder/TransportStream/TsPacketFactory.cs
@@ -47,10 +47,12 @@
         /// <param name="retainPayload">Optional parameter to trigger any resulting TS payload to be copied into the returned structure</param>
         /// <param name="preserveSourceData">Optional parameter to trigger complete copy of source data for TS packet to be held in array for quick access</param>
         /// <returns>Complete TS packets from this data and any prior partial data rolled over.</returns>
-        public TsPacket[] GetTsPacketsFromData(byte[] data, bool retainPayload = true, bool preserveSourceData = false)
+        public TsPacket[] GetTsPacketsFromData(byte[] data, int dataSize = 0, bool retainPayload = true, bool preserveSourceData = false)
         {
             try
             {
+                if(dataSize == 0) { dataSize = data.Length; }
+
                 if (_residualData != null)
                 {
                     var tempArray = new byte[data.Length];
@@ -60,14 +62,14 @@
                     Buffer.BlockCopy(tempArray,0,data,_residualData.Length,tempArray.Length);
                 }

-                var maxPackets = (data.Length) / TsPacketFixedSize;
+                var maxPackets = (dataSize) / TsPacketFixedSize;
                 var tsPackets = new TsPacket[maxPackets];

                 var packetCounter = 0;

                 var start = FindSync(data, 0, TsPacketFixedSize);

-                while (start >= 0 && ((data.Length - start) >= TsPacketFixedSize))
+                while (start >= 0 && ((dataSize - start) >= TsPacketFixedSize))
                 {
                     var tsPacket = new TsPacket
                     {
@@ -147,7 +149,7 @@

                         if (tsPacket.ContainsPayload && tsPacket.PayloadUnitStartIndicator)
                         {
-                            if (payloadOffs > (data.Length - 2) || data[payloadOffs] != 0 || data[payloadOffs + 1] != 0 || data[payloadOffs + 2] != 1)
+                            if (payloadOffs > (dataSize - 2) || data[payloadOffs] != 0 || data[payloadOffs + 1] != 0 || data[payloadOffs + 2] != 1)
                             {
 #if DEBUG
                                 //    Debug.WriteLine("PES syntax error: no PES startcode found, or payload offset exceeds boundary of data");
@@ -214,17 +216,17 @@

                     start += TsPacketFixedSize;

-                    if (start >= data.Length)
+                    if (start >= dataSize)
                         break;
                     if (data[start] != SyncByte)
                         break;  // but this is strange!
                 }

-                if ((start + TsPacketFixedSize) != data.Length)
+                if ((start + TsPacketFixedSize) != dataSize)
                 {
                     //we have 'residual' data to carry over to next call
-                    _residualData = new byte[data.Length - start];
-                    Buffer.BlockCopy(data,start,_residualData,0,data.Length-start);
+                    _residualData = new byte[dataSize - start];
+                    Buffer.BlockCopy(data,start,_residualData,0, dataSize - start);
                 }

                 return tsPackets;


Fixes #469

Fixes #469

--- source/FFImageLoading.Transformations.Droid/BlurredTransformation.cs
+++ source/FFImageLoading.Transformations.Droid/BlurredTransformation.cs
@@ -13,6 +13,7 @@
 		public BlurredTransformation()
 		{
 			Radius = 20d;
+			_context = Android.App.Application.Context;
 		}

 		public BlurredTransformation(double radius)


ShareProgress only enabled if settings are right

--- Client/Systems/ShareProgress/ShareProgressSystem.cs
+++ Client/Systems/ShareProgress/ShareProgressSystem.cs
@@ -22,6 +22,19 @@
         public override string SystemName { get; } = nameof(ShareProgressSystem);

         private ShareProgressEvents ShareProgressEvents { get; } = new ShareProgressEvents();
+
+        protected override void NetworkEventHandler(ClientState data)
+        {
+            if (data <= ClientState.Disconnected)
+            {
+                Enabled = false;
+            }
+
+            if (data == ClientState.Running && SettingsSystem.ServerSettings.ShareProgress && (SettingsSystem.ServerSettings.GameMode == GameMode.Science || SettingsSystem.ServerSettings.GameMode == GameMode.Career) )
+            {
+                Enabled = true;
+            }
+        }

         public bool IncomingFundsProcessing;
         public bool IncomingScienceProcessing;


Added a nicer exception message for failing Assembly scanning.

--- Code/SimpleAuthentication.Core/ReflectionHelpers.cs
+++ Code/SimpleAuthentication.Core/ReflectionHelpers.cs
@@ -1,6 +1,9 @@
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
+using System.Reflection;
+using System.Text;

 namespace SimpleAuthentication.Core
 {
@@ -8,14 +11,42 @@
     {
         public static IList<Type> FindAllTypesOf<T>()
         {
-            var type = typeof (T);
+            try
+            {
+                var type = typeof (T);

-            return AppDomain.CurrentDomain
-                            .GetAssemblies()
-                            .ToList()
-                            .SelectMany(s => s.GetTypes())
-                            .Where(p => type.IsAssignableFrom(p) && p.IsClass && !p.IsAbstract && !p.IsInterface)
-                            .ToList();
+                return AppDomain.CurrentDomain
+                    .GetAssemblies()
+                    .ToList()
+                    .SelectMany(s => s.GetTypes())
+                    .Where(p => type.IsAssignableFrom(p) &&
+                                p.IsClass &&
+                                !p.IsAbstract &&
+                                !p.IsInterface)
+                    .ToList();
+            }
+            catch (ReflectionTypeLoadException exception)
+            {
+                var stringBuilder = new StringBuilder();
+                foreach (var loaderException in exception.LoaderExceptions)
+                {
+                    stringBuilder.AppendLine(loaderException.Message);
+                    var fileNotFoundException = loaderException as FileNotFoundException;
+                    if (fileNotFoundException != null)
+                    {
+                        if (!string.IsNullOrEmpty(fileNotFoundException.FusionLog))
+                        {
+                            stringBuilder.AppendLine("Fusion Log:");
+                            stringBuilder.AppendLine(fileNotFoundException.FusionLog);
+                        }
+                    }
+                    stringBuilder.AppendLine();
+                }
+
+                throw new Exception(
+                    "Failed to reflect on the current domain's Assemblies while searching for plugins. Error Message: " +
+                    stringBuilder);
+            }
         }
     }
 }


Reset run timelimit to default

Reset run timelimit to default

--- src/AcceptanceTests/When_Failed_Messages_Are_Successfully_Retried.cs
+++ src/AcceptanceTests/When_Failed_Messages_Are_Successfully_Retried.cs
@@ -58,7 +58,7 @@
             }))
             .WithEndpoint<FakeServiceControl>()
             .Done(c => c.MessageHandlerInvoked && c.AuditHandlerInvoked && c.NotificationHandlerInvoked)
-            .Run(TimeSpan.FromMinutes(3));
+            .Run();

         Assert.IsFalse(context.HasMessageBody, "Message body is not empty");
     }


Replaced default load balancing suspend mode from Suspend to Graceful.

--- ConDep.Dsl/SemanticModel/Sequence/RemoteSequence.cs
+++ ConDep.Dsl/SemanticModel/Sequence/RemoteSequence.cs
@@ -153,7 +153,7 @@
             var serversToBringOffline = servers.Skip(numberOfServers);
             foreach (var server in serversToBringOffline)
             {
-                loadBalancer.BringOffline(server.Name, server.LoadBalancerFarm, LoadBalancerSuspendMethod.Suspend, status);
+                loadBalancer.BringOffline(server.Name, server.LoadBalancerFarm, LoadBalancerSuspendMethod.Graceful, status);
             }
         }

@@ -168,7 +168,7 @@
                 {
                     Logger.Info(string.Format("Taking server [{0}] offline in load balancer.", server.Name));
                     loadBalancer.BringOffline(server.Name, server.LoadBalancerFarm,
-                                                LoadBalancerSuspendMethod.Suspend, status);
+                                                LoadBalancerSuspendMethod.Graceful, status);
                 }

                 ExecuteOnServer(server, status, options);


Configure EmailSender to use fake in Development

--- src/Clean.Architecture.Infrastructure/DefaultInfrastructureModule.cs
+++ src/Clean.Architecture.Infrastructure/DefaultInfrastructureModule.cs
@@ -91,18 +91,19 @@
         .AsClosedTypesOf(mediatrOpenType)
         .AsImplementedInterfaces();
     }
-
-    builder.RegisterType<EmailSender>().As<IEmailSender>()
-      .InstancePerLifetimeScope();
   }

   private void RegisterDevelopmentOnlyDependencies(ContainerBuilder builder)
   {
     // NOTE: Add any development only services here
+    builder.RegisterType<FakeEmailSender>().As<IEmailSender>()
+      .InstancePerLifetimeScope();
   }

   private void RegisterProductionOnlyDependencies(ContainerBuilder builder)
   {
     // NOTE: Add any production only services here
+    builder.RegisterType<SmtpEmailSender>().As<IEmailSender>()
+      .InstancePerLifetimeScope();
   }
 }


Replace new lines with explicit new line sequence "\r\n" in unit tests.

--- src/Compilers/CSharp/Test/Syntax/LexicalAndXml/XmlDocCommentTests.cs
+++ src/Compilers/CSharp/Test/Syntax/LexicalAndXml/XmlDocCommentTests.cs
@@ -2894,9 +2894,10 @@
         [Trait("Feature", "Xml Documentation Comments")]
         public void TestXmlSummaryElement()
         {
-            var expected = @"/// <summary>
-/// This class provides extension methods.
-/// </summary>";
+            var expected =
+                "/// <summary>\r\n" +
+                "/// This class provides extension methods.\r\n" +
+                "/// </summary>";

             DocumentationCommentTriviaSyntax documentationComment = SyntaxFactory.DocumentationComment(
                 SyntaxFactory.XmlSummaryElement(
@@ -2913,9 +2914,10 @@
         [Trait("Feature", "Xml Documentation Comments")]
         public void TestXmlSeeElementAndXmlSeeAlsoElement()
         {
-            var expected = @"/// <summary>
-/// This class provides extension methods for the <see cref=""TypeName""/> class and the <seealso cref=""TypeName2""/> class.
-/// </summary>";
+            var expected =
+                "/// <summary>\r\n" +
+                "/// This class provides extension methods for the <see cref=\"TypeName\"/> class and the <seealso cref=\"TypeName2\"/> class.\r\n" +
+                "/// </summary>";

             DocumentationCommentTriviaSyntax documentationComment = SyntaxFactory.DocumentationComment(
                 SyntaxFactory.XmlSummaryElement(


Dep step fixes

Dep step fixes


Changing visibility of help button.

Changing visibility of help button.


Fix for over-aggressive change detection in display properties - was caused by change notification on buffer address difference, even though this seems to be something that happens all the time Ideally this option would come outside of the display properties


update spelling of full file use

update spelling of full file use


Update src/FluentMigrator.Runner/Processors/SqlServer/SqlServerProcessor.cs

Changed check for "GO" to ignore case.

--- src/FluentMigrator.Runner/Processors/SqlServer/SqlServerProcessor.cs
+++ src/FluentMigrator.Runner/Processors/SqlServer/SqlServerProcessor.cs
@@ -155,7 +155,7 @@
             if (Connection.State != ConnectionState.Open)
                 Connection.Open();

-            if (sql.Contains("GO"))
+            if (sql.IndexOf("GO", StringComparison.OrdinalIgnoreCase) >= 0)
             {
                 ExecuteBatchNonQuery(sql);


Groupが設定されている際にorderにセットするカラムの可否はカラムリストで行うように変更

グループ化されていないカラムをオーダーに設定する場合がありました
例えば、SUM(*) などの集計関数を使用した場合など、その集計結果のカラムでオーダーする
この時、集計結果カラムをグループ化してしまうと正しい集計ができなくなってしまいます

--- Sdx/Db/Sql/Select.cs
+++ Sdx/Db/Sql/Select.cs
@@ -379,9 +379,9 @@
       //Group Byに無いカラムは自動的にOrderから取り除かれます。
       //SELECT句はからは取り除きません。DBベンダーによっては取得できますし、意味がないわけではないので。
       if (groups.Count > 0)
-      {
-        orders = orders
-          .Where(orderCol => groups.Any(groupCol => orderCol.SameAs(groupCol)))
+      {
+        orders = orders
+          .Where(orderCol => columns.Any(col => orderCol.SameAs(col)))
           .ToList<Column>();
       }


Added additional filtering callback on project for pipeline file exclusion logic

--- Sharpmake/Project.cs
+++ Sharpmake/Project.cs
@@ -752,6 +752,8 @@
                 NatvisFiles.IntersectWith(SourceFilesFilters);
             }

+            AdditionalFiltering(SourceFiles, ref SourceFilesExclude);
+
             // Add source files
             ResolvedSourceFiles.AddRange(SourceFiles);

@@ -1011,6 +1013,11 @@
                 else
                     conf.ResolvedSourceFilesBuildExclude.AddRange(blobContent.ResolvedBlobSourceFiles);
             }
+        }
+
+        public virtual void AdditionalFiltering(Strings sourceFiles, ref Strings sourceFilesExclude)
+        {
+
         }

         public virtual bool ResolveFilterPath(string relativePath, out string filterPath)


Fixed WinApiFile so that it returns the correct number of bytes received

--- Controllers/HexLightController/WinAPI/WinApiFile.cs
+++ Controllers/HexLightController/WinAPI/WinApiFile.cs
@@ -181,7 +181,6 @@

         public uint Read(byte[] buffer, uint cbToRead, int timeout = DEFAULT_TIMEOUT)
         {
-            uint cbThatWereRead = 0;
             OVERLAPPED overlapped = new OVERLAPPED();

             if (!ReadFile(_hFile, buffer, cbToRead, IntPtr.Zero, ref overlapped))
@@ -205,12 +204,11 @@
                 }
             }

-            return cbThatWereRead;
+            return cbToRead;
         }

         public uint Write(byte[] buffer, uint cbToWrite, int timeout = DEFAULT_TIMEOUT)
         {
-            uint cbThatWereWritten = 0;
             OVERLAPPED overlapped = new OVERLAPPED();

             if (!WriteFile(_hFile, buffer, cbToWrite, IntPtr.Zero, ref overlapped))
@@ -232,7 +230,7 @@
                 }
             }

-            return cbThatWereWritten;
+            return cbToWrite;
         }

         public T ReadStructure<T>()


Remove interface lookup per instance

Remove interface lookup per instance

--- src/MongoFramework/Infrastructure/ShallowPropertyEqualityComparer.cs
+++ src/MongoFramework/Infrastructure/ShallowPropertyEqualityComparer.cs
@@ -8,15 +8,11 @@
 	public class ShallowPropertyEqualityComparer<TObject> : IEqualityComparer<TObject>
 	{
 		private PropertyInfo[] Properties { get; }
-		private bool ImplementsIEquatable { get; }
+		private static bool ImplementsIEquatable { get; } = typeof(TObject).GetInterfaces().Any(i => i == typeof(IEquatable<TObject>));

 		public ShallowPropertyEqualityComparer()
 		{
-			if (typeof(TObject).GetInterfaces().Any(i => i == typeof(IEquatable<TObject>)))
-			{
-				ImplementsIEquatable = true;
-			}
-			else
+			if (!ImplementsIEquatable)
 			{
 				Properties = typeof(TObject).GetProperties(BindingFlags.Public | BindingFlags.Instance);
 			}


Comments fix

Comments fix

--- Core/System/Diagnostics/Contracts/Contract.net35.cs
+++ Core/System/Diagnostics/Contracts/Contract.net35.cs
@@ -117,7 +117,7 @@
         /// <summary>
         /// Specifies a public contract such that the expression <paramref name="condition"/> will be true when the enclosing method or property returns normally.
         /// </summary>
-        /// <param name="condition">Boolean expression representing the contract.  May include <seealso cref="OldValue"/> and <seealso cref="Result"/>.</param>
+        /// <param name="condition">Boolean expression representing the contract.  May include <seealso cref="OldValue{T}"/> and <seealso cref="Result{T}"/>.</param>
         /// <remarks>
         /// This call must happen at the beginning of a method or property before any other code.
         /// This contract is exposed to clients so must only reference members at least as visible as the enclosing method.
@@ -134,7 +134,7 @@
         /// <summary>
         /// Specifies a public contract such that the expression <paramref name="condition"/> will be true when the enclosing method or property returns normally.
         /// </summary>
-        /// <param name="condition">Boolean expression representing the contract.  May include <seealso cref="OldValue"/> and <seealso cref="Result"/>.</param>
+        /// <param name="condition">Boolean expression representing the contract.  May include <seealso cref="OldValue{T}"/> and <seealso cref="Result{T}"/>.</param>
         /// <param name="userMessage">If it is not a constant string literal, then the contract may not be understood by tools.</param>
         /// <remarks>
         /// This call must happen at the beginning of a method or property before any other code.
@@ -154,7 +154,7 @@
         /// Specifies a contract such that if an exception of type <typeparamref name="TException"/> is thrown then the expression <paramref name="condition"/> will be true when the enclosing method or property terminates abnormally.
         /// </summary>
         /// <typeparam name="TException">Type of exception related to this postcondition.</typeparam>
-        /// <param name="condition">Boolean expression representing the contract.  May include <seealso cref="OldValue"/> and <seealso cref="Result"/>.</param>
+        /// <param name="condition">Boolean expression representing the contract.  May include <seealso cref="OldValue{T}"/> and <seealso cref="Result{T}"/>.</param>
         /// <remarks>
         /// This call must happen at the beginning of a method or property before any other code.
         /// This contract is exposed to clients so must only reference types and members at least as visible as the enclosing method.
@@ -162,7 +162,8 @@
         /// </remarks>
         [Conditional("CONTRACTS_FULL")]
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
-        public static void EnsuresOnThrow<TException>(bool condition) where TException : Exception
+        public static void EnsuresOnThrow<TException>(bool condition)
+            where TException : Exception
         {
             GC.KeepAlive(condition);
             AssertMustUseRewriter(ContractFailureKind.PostconditionOnException, "EnsuresOnThrow");
@@ -172,7 +173,7 @@
         /// Specifies a contract such that if an exception of type <typeparamref name="TException"/> is thrown then the expression <paramref name="condition"/> will be true when the enclosing method or property terminates abnormally.
         /// </summary>
         /// <typeparam name="TException">Type of exception related to this postcondition.</typeparam>
-        /// <param name="condition">Boolean expression representing the contract.  May include <seealso cref="OldValue"/> and <seealso cref="Result"/>.</param>
+        /// <param name="condition">Boolean expression representing the contract.  May include <seealso cref="OldValue{T}"/> and <seealso cref="Result{T}"/>.</param>
         /// <param name="userMessage">If it is not a constant string literal, then the contract may not be understood by tools.</param>
         /// <remarks>
         /// This call must happen at the beginning of a method or property before any other code.
@@ -181,7 +182,8 @@
         /// </remarks>
         [Conditional("CONTRACTS_FULL")]
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
-        public static void EnsuresOnThrow<TException>(bool condition, string userMessage) where TException : Exception
+        public static void EnsuresOnThrow<TException>(bool condition, string userMessage)
+            where TException : Exception
         {
             GC.KeepAlive(condition);
             GC.KeepAlive(userMessage);
@@ -424,7 +426,8 @@
         /// Use this form when you want to throw a particular exception.
         /// </remarks>
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
-        public static void Requires<TException>(bool condition) where TException : Exception
+        public static void Requires<TException>(bool condition)
+            where TException : Exception
         {
             GC.KeepAlive(condition);
             AssertMustUseRewriter(ContractFailureKind.Precondition, "Requires<TException>");
@@ -442,7 +445,8 @@
         /// Use this form when you want to throw a particular exception.
         /// </remarks>
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
-        public static void Requires<TException>(bool condition, string userMessage) where TException : Exception
+        public static void Requires<TException>(bool condition, string userMessage)
+            where TException : Exception
         {
             GC.KeepAlive(condition);
             GC.KeepAlive(userMessage);


Added prefix duplicates in an error message

--- src/NetEscapades.Configuration.Vault/VaultConfigurationExtensions.cs
+++ src/NetEscapades.Configuration.Vault/VaultConfigurationExtensions.cs
@@ -489,8 +489,10 @@
                 .Where(g => g.Count() > 1)
                 .Select(g => g.Key)
                 .ToList();
-            {
-                throw new ArgumentException($"{nameof(vaultSecretMappings)} prefixes must be unique", nameof(vaultSecretMappings));
+
+            if (duplicatePrefixes.Any())
+            {
+                throw new ArgumentException($"Prefixes '{string.Join(";", duplicatePrefixes)}' are duplicated", nameof(vaultSecretMappings));
             }

             if (manager == null)


Startup Error Log Bugfix #FIX: Removed internal legacy Font property lookups. This also fixes the startup error log "Unable to retrieve property 'Family' of type 'Font'".

--- Source/Core/Duality/Utility/ReflectionInfo.cs
+++ Source/Core/Duality/Utility/ReflectionInfo.cs
@@ -49,12 +49,6 @@
 		public static readonly PropertyInfo	Property_DrawTechnique_PreferredVertexFormat;

 		public static readonly PropertyInfo	Property_Resource_AssetInfo;
-
-		public static readonly PropertyInfo	Property_Font_Family;
-		public static readonly PropertyInfo	Property_Font_Size;
-		public static readonly PropertyInfo	Property_Font_Style;
-		public static readonly PropertyInfo	Property_Font_GlyphRenderMode;
-		public static readonly PropertyInfo	Property_Font_MonoSpace;

 		public static readonly PropertyInfo	Property_Pixmap_AnimCols;
 		public static readonly PropertyInfo	Property_Pixmap_AnimRows;
@@ -114,13 +108,6 @@
 			Type resource = typeof(Resource);
 			Property_Resource_AssetInfo		= GetProperty(resource, "AssetInfo");

-			Type font = typeof(Font);
-			Property_Font_Family			= GetProperty(font, "Family");
-			Property_Font_Size				= GetProperty(font, "Size");
-			Property_Font_Style				= GetProperty(font, "Style");
-			Property_Font_GlyphRenderMode	= GetProperty(font, "GlyphRenderMode");
-			Property_Font_MonoSpace			= GetProperty(font, "MonoSpace");
-
 			Type pixmap = typeof(Pixmap);
 			Property_Pixmap_AnimCols		= GetProperty(pixmap, "AnimCols");
 			Property_Pixmap_AnimRows		= GetProperty(pixmap, "AnimRows");


Fix incorrect title on edit page

Fix incorrect title on edit page

Fixes #7142

--- src/Orchard.Web/Modules/Orchard.Blogs/Views/Content-Blog.Edit.cshtml
+++ src/Orchard.Web/Modules/Orchard.Blogs/Views/Content-Blog.Edit.cshtml
@@ -1,7 +1,4 @@
 @using Orchard.Mvc.Html;
-@{
-    Layout.Title = T("New Blog");
-}

         @if (Model.Content != null) {
@@ -22,4 +19,4 @@

         }

-
+


Fixed PayPal bug

Fixed PayPal bug

--- Source/TeaCommerce.PaymentProviders/PayPal.cs
+++ Source/TeaCommerce.PaymentProviders/PayPal.cs
@@ -39,8 +39,7 @@
     protected string APIPostUrl { get { return !isSandbox ? "https://api-3t.paypal.com/nvp" : "https://api-3t.sandbox.paypal.com/nvp"; } }

     public override Dictionary<string, string> GenerateForm( Order order, string teaCommerceContinueUrl, string teaCommerceCancelUrl, string teaCommerceCallBackUrl, Dictionary<string, string> settings ) {
-      isSandbox = false;
-      bool.TryParse( settings[ "isSandbox" ], out isSandbox );
+      isSandbox = settings[ "isSandbox" ] == "1";
       List<string> settingsToExclude = new string[] { "USER", "PWD", "SIGNATURE", "isSandbox", "productNumberPropertyAlias", "productNamePropertyAlias", "shippingMethodFormatString", "paymentMethodFormatString" }.ToList();
       Dictionary<string, string> inputFields = settings.Where( i => !settingsToExclude.Contains( i.Key ) ).ToDictionary( i => i.Key, i => i.Value );

@@ -191,7 +190,7 @@
     }

     public override APIInfo RefundPayment( Order order, Dictionary<string, string> settings ) {
-      isSandbox = bool.Parse( settings[ "isSandbox" ] );
+      isSandbox = settings[ "isSandbox" ] == "1";

       string errorMessage = string.Empty;
       Dictionary<string, string> inputFields = PrepareAPIPostRequest( "RefundTransaction", settings );
@@ -227,7 +226,7 @@
     }

     protected APIInfo InternalGetStatus( string transactionId, Dictionary<string, string> settings ) {
-      isSandbox = bool.Parse( settings[ "isSandbox" ] );
+      isSandbox = settings[ "isSandbox" ] == "1";

       string errorMessage = string.Empty;
       Dictionary<string, string> inputFields = PrepareAPIPostRequest( "GetTransactionDetails", settings );


Synchrophasor: Updated baser setup utility version number.

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS07]$/openpdc/Synchrophasor/Current Version;C57514


Removed unused code

Removed unused code


parallelise the fetching of the account data and paye schemes

--- src/SFA.DAS.EAS.Support.Infrastructure/Services/AccountRepository.cs
+++ src/SFA.DAS.EAS.Support.Infrastructure/Services/AccountRepository.cs
@@ -121,18 +121,15 @@
         {
             var accountsWithDetails = new List<Core.Models.Account>();

-            foreach (var account in accounts)
-                try
-                {
-                    var accountViewModel = await _accountApiClient.GetAccount(account.AccountHashId);
-                    _logger.Info($"GetAdditionalFields for account ID {account.AccountHashId}");
-                    var accountWithDetails = await GetAdditionalFields(accountViewModel, AccountFieldsSelection.PayeSchemes);
-                    accountsWithDetails.Add(accountWithDetails);
-                }
-                catch (Exception e)
-                {
-                    _logger.Error(e, $"Exception while retrieving details for account ID {account.AccountHashId}");
-                }
+            var accountDetailTasks = accounts.Select(account => _accountApiClient.GetAccount(account.AccountHashId));
+            var accountDetails = await Task.WhenAll(accountDetailTasks);
+
+            foreach (var account  in accountDetails)
+            {
+                _logger.Info($"GetAdditionalFields for account ID {account.HashedAccountId}");
+                var accountWithDetails = await GetAdditionalFields(account, AccountFieldsSelection.PayeSchemes);
+                accountsWithDetails.Add(accountWithDetails);
+            }

             return accountsWithDetails;
         }
@@ -198,34 +195,20 @@

         private async Task<IEnumerable<PayeSchemeViewModel>> GetPayeSchemes(AccountDetailViewModel response)
         {
-            var payeTasks = new List<Task<PayeSchemeViewModel>>();
-            foreach (var payeScheme in response.PayeSchemes ?? new ResourceList(new List<ResourceViewModel>()))
-            {
-                async Task<PayeSchemeViewModel> GetPayeSchemeResource()
-                {
-                    var obscured = _payeSchemeObfuscator.ObscurePayeScheme(payeScheme.Id).Replace("/", "%252f");
-                    var paye = payeScheme.Id.Replace("/", "%252f");
-                    _logger.Debug(
-                        $"IAccountApiClient.GetResource<PayeSchemeViewModel>(\"{payeScheme.Href.Replace(paye, obscured)}\");");
-                    try
-                    {
-                        return await _accountApiClient.GetResource<PayeSchemeViewModel>(payeScheme.Href);
-                    }
-                    catch (Exception ex)
-                    {
-                        _logger.Error(ex, $"Exception occured in Account API type of {nameof(PayeSchemeViewModel)} at {payeScheme.Href} id {payeScheme.Id}");
-                        return new PayeSchemeViewModel();
-                    }
-                }
-
-                payeTasks.Add(GetPayeSchemeResource());
-            }
-            await Task.WhenAll(payeTasks);
-
+            var payeTasks = response.PayeSchemes.Select(payeScheme =>
+             {
+                 var obscured = _payeSchemeObfuscator.ObscurePayeScheme(payeScheme.Id).Replace("/", "%252f");
+                 var paye = payeScheme.Id.Replace("/", "%252f");
+                 _logger.Debug(
+                     $"IAccountApiClient.GetResource<PayeSchemeViewModel>(\"{payeScheme.Href.Replace(paye, obscured)}\");");
+                 return _accountApiClient.GetResource<PayeSchemeViewModel>(payeScheme.Href);
+             });
+
+            var payes = await Task.WhenAll(payeTasks);
+
             var result = new List<PayeSchemeViewModel>();
-            foreach (var payeTask in payeTasks)
-            {
-                var payeSchemeViewModel = payeTask.Result;
+            foreach (var payeSchemeViewModel in payes)
+            {
                 if (IsValidPayeScheme(payeSchemeViewModel))
                 {
                     var item = new PayeSchemeViewModel
@@ -308,7 +291,7 @@

         private async Task<IEnumerable<PayeSchemeModel>> MapToDomainPayeSchemeAsync(AccountDetailViewModel response)
         {
-            var mainPayeSchemes = await GetPayeSchemes(response);
+            var mainPayeSchemes = await GetPayeSchemes(response);

             return mainPayeSchemes?.Select(payeScheme => new PayeSchemeModel
             {


Improve hotkey stability

Improve hotkey stability

--- DesktopWidgets/ViewModelBase/WidgetViewModelBase.cs
+++ DesktopWidgets/ViewModelBase/WidgetViewModelBase.cs
@@ -189,7 +189,6 @@
             {
                 if (_settings.OpenMode == OpenMode.Keyboard || _settings.OpenMode == OpenMode.MouseAndKeyboard)
                 {
-                    HotkeyManager.Current.Remove("Show");
                     HotkeyManager.Current.AddOrReplace("Show", _settings.HotKey, _settings.HotKeyModifiers, OnHotKey);
                 }
             }
@@ -200,7 +199,8 @@

         private void OnHotKey(object sender, HotkeyEventArgs e)
         {
-            ShowIntro();
+            if(e.Name == "Show")
+                ShowIntro();
             e.Handled = true;
         }


Extended a debug method

Extended a debug method

--- Duplicati/Library/Main/Database/ExtensionMethods.cs
+++ Duplicati/Library/Main/Database/ExtensionMethods.cs
@@ -87,11 +87,12 @@
                 return self.ExecuteReader();
         }

-        public static void DumpSQL(this System.Data.IDbConnection self, string sql, params object[] parameters)
+        public static void DumpSQL(this System.Data.IDbConnection self, System.Data.IDbTransaction trans, string sql, params object[] parameters)
         {
             using (var c = self.CreateCommand())
             {
                 c.CommandText = sql;
+                c.Transaction = trans;
                 if (parameters != null)
                     foreach (var p in parameters)
                         c.AddParameter(p);


Remove Alert Contoller

Remove Alert Contoller

--- DynThings.WebPortal/Controllers/AlertsController.cs
+++ DynThings.WebPortal/Controllers/AlertsController.cs
@@ -1,154 +0,0 @@
-/////////////////////////////////////////////////////////////////
-// Created by : Caesar Moussalli                               //
-// TimeStamp  : 31-1-2016                                      //
-// Content    : Handel the Alerts Actions                      //
-// Notes      :                                                //
-//                                                             //
-/////////////////////////////////////////////////////////////////
-using System;
-using System.Collections.Generic;
-using System.Data;
-using System.Data.Entity;
-using System.Linq;
-using System.Net;
-using System.Web;
-using System.Web.Mvc;
-using DynThings.Data.Models;
-using PagedList;
-
-namespace DynThings.WebPortal.Controllers
-{
-    public class AlertsController : Controller
-    {
-        private DynThingsEntities db = new DynThingsEntities();
-
-        // GET: Alerts
-        public ActionResult Index()
-        {
-            var alerts = db.Alerts.Include(a => a.Endpoint);
-            return View(alerts.ToList());
-        }
-
-        // GET: Alerts/Details/5
-        public ActionResult Details(long? id)
-        {
-            if (id == null)
-            {
-                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
-            }
-            Alert alert = db.Alerts.Find(id);
-            if (alert == null)
-            {
-                return HttpNotFound();
-            }
-            return View(alert);
-        }
-
-        // GET: Alerts/Create
-        public ActionResult Create()
-        {
-            ViewBag.EndPointID = new SelectList(db.Endpoints, "ID", "PinCode");
-            return View();
-        }
-
-        // POST: Alerts/Create
-        // To protect from overposting attacks, please enable the specific properties you want to bind to, for
-        // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
-        [HttpPost]
-        [ValidateAntiForgeryToken]
-        public ActionResult Create([Bind(Include = "ID,Title,Text,EndPointID,TimeStamp")] Alert alert)
-        {
-            if (ModelState.IsValid)
-            {
-                db.Alerts.Add(alert);
-                db.SaveChanges();
-                return RedirectToAction("Index");
-            }
-
-            ViewBag.EndPointID = new SelectList(db.Endpoints, "ID", "PinCode", alert.EndPointID);
-            return View(alert);
-        }
-
-        // GET: Alerts/Edit/5
-        public ActionResult Edit(long? id)
-        {
-            if (id == null)
-            {
-                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
-            }
-            Alert alert = db.Alerts.Find(id);
-            if (alert == null)
-            {
-                return HttpNotFound();
-            }
-            ViewBag.EndPointID = new SelectList(db.Endpoints, "ID", "PinCode", alert.EndPointID);
-            return View(alert);
-        }
-
-        // POST: Alerts/Edit/5
-        // To protect from overposting attacks, please enable the specific properties you want to bind to, for
-        // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
-        [HttpPost]
-        [ValidateAntiForgeryToken]
-        public ActionResult Edit([Bind(Include = "ID,Title,Text,EndPointID,TimeStamp")] Alert alert)
-        {
-            if (ModelState.IsValid)
-            {
-                db.Entry(alert).State = EntityState.Modified;
-                db.SaveChanges();
-                return RedirectToAction("Index");
-            }
-            ViewBag.EndPointID = new SelectList(db.Endpoints, "ID", "PinCode", alert.EndPointID);
-            return View(alert);
-        }
-
-        // GET: Alerts/Delete/5
-        public ActionResult Delete(long? id)
-        {
-            if (id == null)
-            {
-                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
-            }
-            Alert alert = db.Alerts.Find(id);
-            if (alert == null)
-            {
-                return HttpNotFound();
-            }
-            return View(alert);
-        }
-
-        // POST: Alerts/Delete/5
-        [HttpPost, ActionName("Delete")]
-        [ValidateAntiForgeryToken]
-        public ActionResult DeleteConfirmed(long id)
-        {
-            Alert alert = db.Alerts.Find(id);
-            db.Alerts.Remove(alert);
-            db.SaveChanges();
-            return RedirectToAction("Index");
-        }
-
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing)
-            {
-                db.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-
-        [HttpGet]
-        public PartialViewResult GetListPV(string searchfor = null, int page = 1, int recordsperpage = 2)
-        {
-            PagedList.IPagedList alrts = db.Alerts
-                .Where(a => searchfor == null || a.Text.Contains(searchfor))
-                .OrderByDescending(e => e.TimeStamp).ToList()
-                .ToPagedList(page, recordsperpage);
-
-
-            return PartialView("_List", alrts);
-        }
-
-    }
-}


Format dates properly for the api

Format dates properly for the api

--- SurveyMonkey/Helpers/RequestSettingsHelper.cs
+++ SurveyMonkey/Helpers/RequestSettingsHelper.cs
@@ -22,7 +22,7 @@
                     }
                     else if (underlyingType == typeof(DateTime))
                     {
-                        output.Add(PropertyCasingHelper.CamelToSnake(property.Name), ((DateTime)property.GetValue(obj, null)).ToString("s"));
+                        output.Add(PropertyCasingHelper.CamelToSnake(property.Name), ((DateTime)property.GetValue(obj, null)).ToString("s") + "+00:00");
                     }
                     else
                     {


remove blank line

remove blank line

--- osu.Framework/Graphics/Containers/ScrollContainer.cs
+++ osu.Framework/Graphics/Containers/ScrollContainer.cs
@@ -262,7 +262,6 @@
             scrollOffset = clampedScrollOffset + (scrollOffset - clampedScrollOffset) / 2;

             offset(scrollOffset, false);
-
             return true;
         }


Adjust easing type to match in disposal clause

Co-Authored-By: Dan Balasescu <c9bd76907373126dff70d71f8b944159a669cbf1@smgi.me>

--- osu.Game/Graphics/UserInterface/ProcessingOverlay.cs
+++ osu.Game/Graphics/UserInterface/ProcessingOverlay.cs
@@ -81,7 +81,7 @@
             if (State.Value == Visibility.Visible)
             {
                 // ensure we don't leave the target in a bad state.
-                dimTarget?.FadeColour(Color4.White, transition_duration);
+                dimTarget?.FadeColour(Color4.White, transition_duration, Easing.OutQuint);
             }
         }
     }


Move size of simulation to master directory name

--- Simulator/Program.cs
+++ Simulator/Program.cs
@@ -55,13 +55,13 @@
             double meanNumberOfLoginsPerAttackerControlledIP = 1000d;

             DateTime now = DateTime.Now;
-            string dirName = BasePath + "Run_" + now.Month + "_" + now.Day + "_" + now.Hour + "_" + now.Minute;
+            string dirName = BasePath + "Run_" + totalLoginAttempts + "_" + now.Month + "_" + now.Day + "_" + now.Hour + "_" + now.Minute;
             Directory.CreateDirectory(dirName);
             config.OutputPath = dirName + @"\";

-            config.OutputDirectoryName = string.Format("{0}Size_{1}_Strategy_{2}_Remove_{3}_Proxies_{4}_Overlap_{5}",
+            config.OutputDirectoryName = string.Format("{0}_Strategy_{1}_Remove_{2}_Proxies_{3}_Overlap_{4}",
                 addToName == null ? "" : addToName + "_",
-                (int)Math.Log10(totalLoginAttempts),
+                //(int)Math.Log10(totalLoginAttempts),
                 config.AttackersStrategy == ExperimentalConfiguration.AttackStrategy.BreadthFirst
                     ? "BreadthFirst"
                     : config.AttackersStrategy == ExperimentalConfiguration.AttackStrategy.Weighted


Add base random file initializer

Add base random file initializer

--- Tabster/Utilities/SingleInstanceController.cs
+++ Tabster/Utilities/SingleInstanceController.cs
@@ -18,6 +18,12 @@
         private readonly string _uniqueFilePath;
         private Form _mainForm;

+        public SingleInstanceControllerBase()
+            : this(GetRandomFile())
+        {
+
+        }
+
         public SingleInstanceControllerBase(string fileName)
         {
             _uniqueFilePath = fileName;
@@ -25,6 +31,12 @@
             _fileSystemWatcher.Changed += _fileSystemWatcher_Changed;
             _fileSystemWatcher.SynchronizingObject = MainForm;
             _fileSystemWatcher.EnableRaisingEvents = true;
+        }
+
+        private static string GetRandomFile()
+        {
+            var guid = Guid.NewGuid();
+            return Path.Combine(Path.GetTempPath(), string.Format("{0}.tmp", guid));
         }

         protected Form MainForm


Allow fetching current auth'd user

Allow fetching current auth'd user

--- SmugSharp/SmugMug.cs
+++ SmugSharp/SmugMug.cs
@@ -6,6 +6,9 @@
 using System.Net.Http;
 using System.Text;
 using System.Threading.Tasks;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using SmugSharp.Models;
 using Windows.Security.Cryptography;
 using Windows.Security.Cryptography.Core;
 using Windows.Storage.Streams;
@@ -39,6 +42,9 @@
         /// </summary>
         public Authentication Authentication { get; private set; }

+
+        public User CurrentUser { get; set; }
+
         /// <summary>
         /// The ctor to use in testing or situations where you already have the auth token and secret.
         /// </summary>
@@ -64,6 +70,16 @@
         {
             ApiKey = apiKey;
             Authentication = new Authentication(ApiKey, apiSecret, callbackUrl);
+        }
+
+        public async Task<User> GetCurrentUser()
+        {
+            var authUserUrl = $"{BaseApiUrl}!authuser";
+            var response = await GetResponseWithHeaders(authUserUrl);
+
+            CurrentUser = User.FromResponse(response);
+
+            return CurrentUser;
         }

         /// <summary>


better user interface

better user interface

--- VisualMutatorGUI/VisualMutatorGUI.Designer.cs
+++ VisualMutatorGUI/VisualMutatorGUI.Designer.cs
@@ -43,16 +43,16 @@
             this.listBoxMutants.ItemHeight = 11;
             this.listBoxMutants.Location = new System.Drawing.Point(12, 41);
             this.listBoxMutants.Name = "listBoxMutants";
-            this.listBoxMutants.Size = new System.Drawing.Size(1012, 121);
-            this.listBoxMutants.TabIndex = 0;
+            this.listBoxMutants.Size = new System.Drawing.Size(1012, 114);
+            this.listBoxMutants.TabIndex = 2;
             //
             // buttonLoadXml
             //
             this.buttonLoadXml.Location = new System.Drawing.Point(12, 12);
             this.buttonLoadXml.Name = "buttonLoadXml";
             this.buttonLoadXml.Size = new System.Drawing.Size(122, 23);
-            this.buttonLoadXml.TabIndex = 1;
-            this.buttonLoadXml.Text = "Load Mutation Results";
+            this.buttonLoadXml.TabIndex = 0;
+            this.buttonLoadXml.Text = "&Load Mutation Results";
             this.buttonLoadXml.UseVisualStyleBackColor = true;
             this.buttonLoadXml.Click += new System.EventHandler(this.buttonLoadXml_Click);
             //
@@ -67,7 +67,7 @@
             this.richTextCode.Name = "richTextCode";
             this.richTextCode.ReadOnly = true;
             this.richTextCode.Size = new System.Drawing.Size(1012, 387);
-            this.richTextCode.TabIndex = 2;
+            this.richTextCode.TabIndex = 3;
             this.richTextCode.Text = "";
             this.richTextCode.WordWrap = false;
             //
@@ -77,7 +77,7 @@
             this.linkIcon.Location = new System.Drawing.Point(140, 17);
             this.linkIcon.Name = "linkIcon";
             this.linkIcon.Size = new System.Drawing.Size(77, 13);
-            this.linkIcon.TabIndex = 3;
+            this.linkIcon.TabIndex = 1;
             this.linkIcon.TabStop = true;
             this.linkIcon.Text = "Icon by Icons8";
             this.linkIcon.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkIcon_LinkClicked);


Add completed notification + correct progress indication + linting.


WindowsService was fixed

WindowsService was fixed

--- WindowsService.Core/Service/WindowsService.cs
+++ WindowsService.Core/Service/WindowsService.cs
@@ -37,9 +37,6 @@
 				Console.WriteLine(@"Press any key to stop service");
 				Console.ReadKey();
 				OnStop();
-
-				Console.WriteLine(@"Press any key to stop service2");
-				Console.ReadKey();
 			}
 			else
 			{


Provide message

Provide message

--- src/Workspaces/Core/Portable/Simplification/SimplificationOptions.cs
+++ src/Workspaces/Core/Portable/Simplification/SimplificationOptions.cs
@@ -15,7 +15,7 @@
         /// This option tells the simplification engine if the Qualified Name should be replaced by Alias
         /// if the user had initially not used the Alias
         /// </summary>
-        [Obsolete]
+        [Obsolete("This option is no longer used")]
         public static Option<bool> PreferAliasToQualification { get; } = new Option<bool>(nameof(SimplificationOptions), nameof(PreferAliasToQualification), true,
             storageLocations: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.PreferAliasToQualification"));

@@ -23,83 +23,83 @@
         /// This option influences the name reduction of members of a module in VB. If set to true, the
         /// name reducer will e.g. reduce Namespace.Module.Member to Namespace.Member.
         /// </summary>
-        [Obsolete]
+        [Obsolete("This option is no longer used")]
         public static Option<bool> PreferOmittingModuleNamesInQualification { get; } = new Option<bool>(nameof(SimplificationOptions), nameof(PreferOmittingModuleNamesInQualification), true,
             storageLocations: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.PreferOmittingModuleNamesInQualification"));

         /// <summary>
         /// This option says that if we should simplify the Generic Name which has the type argument inferred
         /// </summary>
-        [Obsolete]
+        [Obsolete("This option is no longer used")]
         public static Option<bool> PreferImplicitTypeInference { get; } = new Option<bool>(nameof(SimplificationOptions), nameof(PreferImplicitTypeInference), true,
             storageLocations: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.PreferImplicitTypeInference"));

         /// <summary>
         /// This option says if we should simplify the Explicit Type in Local Declarations
         /// </summary>
-        [Obsolete]
+        [Obsolete("This option is no longer used")]
         public static Option<bool> PreferImplicitTypeInLocalDeclaration { get; } = new Option<bool>(nameof(SimplificationOptions), nameof(PreferImplicitTypeInLocalDeclaration), true,
             storageLocations: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.PreferImplicitTypeInLocalDeclaration"));

         /// <summary>
         /// This option says if we should simplify to NonGeneric Name rather than GenericName
         /// </summary>
-        [Obsolete]
+        [Obsolete("This option is no longer used")]
         public static Option<bool> AllowSimplificationToGenericType { get; } = new Option<bool>(nameof(SimplificationOptions), nameof(AllowSimplificationToGenericType), false,
             storageLocations: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.AllowSimplificationToGenericType"));

         /// <summary>
         /// This option says if we should simplify from Derived types to Base types in Static Member Accesses
         /// </summary>
-        [Obsolete]
+        [Obsolete("This option is no longer used")]
         public static Option<bool> AllowSimplificationToBaseType { get; } = new Option<bool>(nameof(SimplificationOptions), nameof(AllowSimplificationToBaseType), true,
             storageLocations: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.AllowSimplificationToBaseType"));

         /// <summary>
         /// This option says if we should simplify away the <see langword="this"/> or <see langword="Me"/> in member access expressions.
         /// </summary>
-        [Obsolete]
+        [Obsolete("This option is no longer used")]
         public static PerLanguageOption<bool> QualifyMemberAccessWithThisOrMe { get; } = new PerLanguageOption<bool>(nameof(SimplificationOptions), nameof(QualifyMemberAccessWithThisOrMe), defaultValue: false,
             storageLocations: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.QualifyMemberAccessWithThisOrMe"));

         /// <summary>
         /// This option says if we should simplify away the <see langword="this"/>. or <see langword="Me"/>. in field access expressions.
         /// </summary>
-        [Obsolete]
+        [Obsolete("This option is no longer used")]
         public static PerLanguageOption<bool> QualifyFieldAccess { get; } = new PerLanguageOption<bool>(nameof(SimplificationOptions), nameof(QualifyFieldAccess), defaultValue: false,
             storageLocations: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.QualifyFieldAccess"));

         /// <summary>
         /// This option says if we should simplify away the <see langword="this"/>. or <see langword="Me"/>. in property access expressions.
         /// </summary>
-        [Obsolete]
+        [Obsolete("This option is no longer used")]
         public static PerLanguageOption<bool> QualifyPropertyAccess { get; } = new PerLanguageOption<bool>(nameof(SimplificationOptions), nameof(QualifyPropertyAccess), defaultValue: false,
             storageLocations: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.QualifyPropertyAccess"));

         /// <summary>
         /// This option says if we should simplify away the <see langword="this"/>. or <see langword="Me"/>. in method access expressions.
         /// </summary>
-        [Obsolete]
+        [Obsolete("This option is no longer used")]
         public static PerLanguageOption<bool> QualifyMethodAccess { get; } = new PerLanguageOption<bool>(nameof(SimplificationOptions), nameof(QualifyMethodAccess), defaultValue: false,
             storageLocations: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.QualifyMethodAccess"));

         /// <summary>
         /// This option says if we should simplify away the <see langword="this"/>. or <see langword="Me"/>. in event access expressions.
         /// </summary>
-        [Obsolete]
+        [Obsolete("This option is no longer used")]
         public static PerLanguageOption<bool> QualifyEventAccess { get; } = new PerLanguageOption<bool>(nameof(SimplificationOptions), nameof(QualifyEventAccess), defaultValue: false,
             storageLocations: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.QualifyEventAccess"));

         /// <summary>
         /// This option says if we should prefer keyword for Intrinsic Predefined Types in Declarations
         /// </summary>
-        [Obsolete]
+        [Obsolete("This option is no longer used")]
         public static PerLanguageOption<bool> PreferIntrinsicPredefinedTypeKeywordInDeclaration { get; } = new PerLanguageOption<bool>(nameof(SimplificationOptions), nameof(PreferIntrinsicPredefinedTypeKeywordInDeclaration), defaultValue: true);

         /// <summary>
         /// This option says if we should prefer keyword for Intrinsic Predefined Types in Member Access Expression
         /// </summary>
-        [Obsolete]
+        [Obsolete("This option is no longer used")]
         public static PerLanguageOption<bool> PreferIntrinsicPredefinedTypeKeywordInMemberAccess { get; } = new PerLanguageOption<bool>(nameof(SimplificationOptions), nameof(PreferIntrinsicPredefinedTypeKeywordInMemberAccess), defaultValue: true);

         /// <summary>


Forgot to add getAllOre overload

Forgot to add getAllOre overload

--- BARABAS.cs
+++ BARABAS.cs
@@ -1327,6 +1327,25 @@
 	for (int i = items.Count - 1; i >= 0; i--) {
 		var item = items[i];
 		if (!isIngot(item)) {
+			continue;
+		}
+		if (name != null && item.Content.SubtypeName != name) {
+			continue;
+		}
+		ItemHelper ih = new ItemHelper();
+		ih.Inventory = inv;
+		ih.Item = item;
+		ih.Index = i;
+		list.Add(ih);
+	}
+}
+
+// get all ingots of a certain type from a particular inventory
+void getAllOre(IMyInventory inv, string name, List < ItemHelper > list) {
+	var items = inv.GetItems();
+	for (int i = items.Count - 1; i >= 0; i--) {
+		var item = items[i];
+		if (!isOre(item)) {
 			continue;
 		}
 		if (name != null && item.Content.SubtypeName != name) {